CN108984317B - Method and device for realizing IPC (inter-process communication) - Google Patents

Method and device for realizing IPC (inter-process communication) Download PDF

Info

Publication number
CN108984317B
CN108984317B CN201810646525.0A CN201810646525A CN108984317B CN 108984317 B CN108984317 B CN 108984317B CN 201810646525 A CN201810646525 A CN 201810646525A CN 108984317 B CN108984317 B CN 108984317B
Authority
CN
China
Prior art keywords
shared memory
ipc
message
ipc object
communication
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
CN201810646525.0A
Other languages
Chinese (zh)
Other versions
CN108984317A (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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201810646525.0A priority Critical patent/CN108984317B/en
Publication of CN108984317A publication Critical patent/CN108984317A/en
Application granted granted Critical
Publication of CN108984317B publication Critical patent/CN108984317B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/544Buffers; Shared memory; Pipes
    • 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)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method and a device for realizing inter-process communication IPC. The method comprises the following steps: registering an IPC object corresponding to the IPC object in a shared memory for interprocess communication; and sending the message to the IPC object corresponding to the communication target, and/or receiving the message sent by the communication target through the IPC object corresponding to the IPC object. The technical scheme has the advantages that all IPCs of the application program can be carried out in one shared memory, a shared memory does not need to be newly applied every time the IPCs are carried out as in the prior art, and the problems of low efficiency and easy increase of complexity of memory management can be solved; and multiple threads of a process can instantiate own IPC objects in the shared memory, so that communication is not interfered with each other and efficiency is improved.

Description

Method and device for realizing IPC (inter-process communication)
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for realizing inter-process communication IPC.
Background
IPC (Inter-Process Communication) is widely used in current application programs, and a simple example is that many programs have a Process corresponding to a main window and a Process corresponding to a tray in a task bar, and the interaction between the two is very frequent. The IPC implementation mode in the prior art is not high in efficiency, needs to occupy a large amount of memory, and needs to be improved.
Disclosure of Invention
In view of the above, the present invention has been made to provide a method and apparatus for implementing an inter-process communication IPC that overcomes or at least partially solves the above problems.
According to one aspect of the present invention, there is provided a method for implementing inter-process communication IPC, comprising:
registering an IPC object corresponding to the IPC object in a shared memory for interprocess communication;
and sending the message to the IPC object corresponding to the communication target, and/or receiving the message sent by the communication target through the IPC object corresponding to the IPC object.
Optionally, the registering an IPC object corresponding to itself in a shared memory for inter-process communication includes:
acquiring a unique identification of an IPC object corresponding to the IPC object;
and registering the IPC object corresponding to the unique identifier and the callback function preset by the IPC object according to the unique identifier and the IPC object.
Optionally, the obtaining the unique identifier of the IPC object corresponding to itself includes:
and acquiring the randomly distributed unique identifier or acquiring the reserved unique identifier according to the type of the process to which the self belongs.
Optionally, the registering an IPC object corresponding to itself in a shared memory for inter-process communication includes:
judging whether a shared memory for interprocess communication exists or not;
if so, the shared memory for interprocess communication is used, otherwise, the shared memory for interprocess communication is applied.
Optionally, the applying for the shared memory for inter-process communication includes:
managing the shared memory using a partner algorithm;
and setting a header area in the shared memory to store header information of the partner algorithm and common information of all IPC objects.
Optionally, the registering an IPC object corresponding to itself in a shared memory for inter-process communication includes:
and judging whether a reserved space corresponding to the IPC object exists in the shared memory, if so, writing the registration information of the IPC object into the reserved space, otherwise, newly allocating a space for the IPC object in the shared memory.
Optionally, the sending the message to the IPC object corresponding to the communication target includes:
judging whether an IPC object corresponding to a communication target is registered in the shared memory;
if yes, writing the message into a message queue of an IPC object corresponding to the communication target; otherwise, judging whether a reserved space corresponding to the IPC object corresponding to the communication target exists in the shared memory, if so, writing the message into a message queue corresponding to the reserved space, otherwise, applying for the reserved space for the IPC object corresponding to the communication target in the shared memory, and writing the message into the message queue corresponding to the reserved space.
Optionally, the method further comprises: setting a survival time for the transmitted message;
and if the sent message is not acquired by the communication target in the survival time, deleting the sent message from the corresponding message queue.
Optionally, the method further comprises:
acquiring the parameter type of the parameter to be transmitted;
selecting a matched data packaging template from preset data packaging templates according to the parameter type;
packaging the parameters to be transmitted into data objects of specified types according to the matched data packaging templates;
and sequencing the data objects of the specified type into binary data according to a preset method, and taking the binary data as a message to be sent.
Optionally, the preset method is implemented using a variable parameter template comprising nested templates.
Optionally, the selecting a matched data encapsulation template from preset data encapsulation templates according to the parameter type includes:
determining the parameter type of each parameter in the parameters to be transmitted by utilizing type extraction;
the step of packaging the parameters to be transmitted into the data objects of the specified types according to the matched data packaging templates comprises the following steps:
if the parameter type is a scalar type, directly packaging the value of the parameter; and if the parameter type is the structure body, establishing a reference to the parameter, and packaging the reference.
Optionally, the parameter types include one or more of:
basic type, custom class, smart pointer, vector, map.
According to another aspect of the present invention, there is provided an apparatus for implementing an inter-process communication IPC, including:
the preprocessing unit is suitable for registering an IPC object corresponding to the preprocessing unit in a shared memory for interprocess communication;
and the communication unit is suitable for sending the message to the IPC object corresponding to the communication target and/or receiving the message sent by the communication target through the IPC object corresponding to the communication unit.
Optionally, the preprocessing unit is adapted to obtain a unique identifier of the IPC object corresponding to the preprocessing unit; and registering the IPC object corresponding to the unique identifier and the callback function preset by the IPC object according to the unique identifier and the IPC object.
Optionally, the preprocessing unit is adapted to obtain a randomly allocated unique identifier or a reserved unique identifier according to a type of a process to which the preprocessing unit belongs.
Optionally, the preprocessing unit is adapted to determine whether a shared memory for inter-process communication already exists; if so, the shared memory for interprocess communication is used, otherwise, the shared memory for interprocess communication is applied.
Optionally, the preprocessing unit is adapted to manage the shared memory using a partner algorithm; and setting a header area in the shared memory to store header information of the partner algorithm and common information of all IPC objects.
Optionally, the preprocessing unit is adapted to determine whether a reserved space corresponding to the IPC object exists in the shared memory, if so, write the registration information of the IPC object into the reserved space, otherwise, newly allocate a space for the IPC object in the shared memory.
Optionally, the communication unit is adapted to determine whether an IPC object corresponding to a communication target is registered in the shared memory; if yes, writing the message into a message queue of an IPC object corresponding to the communication target; otherwise, judging whether a reserved space corresponding to the IPC object corresponding to the communication target exists in the shared memory, if so, writing the message into a message queue corresponding to the reserved space, otherwise, applying for the reserved space for the IPC object corresponding to the communication target in the shared memory, and writing the message into the message queue corresponding to the reserved space.
Optionally, the communication unit is adapted to set a survival time for the transmitted message; and if the sent message is not acquired by the communication target in the survival time, deleting the sent message from the corresponding message queue.
Optionally, the preprocessing unit is further adapted to obtain a parameter type of the parameter to be transmitted; selecting a matched data packaging template from preset data packaging templates according to the parameter type; packaging the parameters to be transmitted into data objects of specified types according to the matched data packaging templates; and sequencing the data objects of the specified type into binary data according to a preset method, and taking the binary data as a message to be sent.
Optionally, the preset method is implemented using a variable parameter template comprising nested templates.
Optionally, the preprocessing unit is adapted to determine the parameter type of each parameter in the parameters to be transmitted by using type extraction; if the parameter type is a scalar type, directly packaging the value of the parameter; and if the parameter type is the structure body, establishing a reference to the parameter, and packaging the reference.
Optionally, the parameter types include one or more of:
basic type, custom class, smart pointer, vector, map.
According to still another aspect of the present invention, there is provided an intelligent terminal including: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to perform a method as any one of the above.
According to a further aspect of the invention, there is provided a computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement a method as any one of the above.
As can be seen from the above description, in the technical solution of the present invention, by registering the IPC object corresponding to itself in the shared memory for inter-process communication, it is possible to send a message to the IPC object corresponding to the communication target and/or receive a message sent by the communication target through the IPC object corresponding to itself. The technical scheme has the advantages that all IPCs of the application program can be carried out in one shared memory, a shared memory does not need to be newly applied every time the IPCs are carried out as in the prior art, and the problems of low efficiency and easy increase of complexity of memory management can be solved; and multiple threads of a process can instantiate own IPC objects in the shared memory, so that communication is not interfered with each other and efficiency is improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flow diagram illustrating a method for implementing inter-process communication IPC according to one embodiment of the present invention;
FIG. 2 is a schematic structural diagram of an apparatus for implementing inter-process communication IPC according to an embodiment of the present invention;
FIG. 3 shows a schematic structural diagram of an intelligent terminal according to one embodiment of the invention;
fig. 4 shows a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
FIG. 1 is a flow chart showing a method for implementing IPC according to one embodiment of the present invention. As shown in fig. 1, the method includes:
in step S110, an IPC object corresponding to the IPC object is registered in a shared memory for inter-process communication.
In the embodiment of the invention, the technical means can also be adopted, specifically, an IPC class can be defined by definition, and the corresponding IPC object is instantiated during use. Thus, each thread of a process can instantiate multiple IPC objects, which is very flexible to use and removes the concept of IPC windows utilized in the prior art.
Step S120, sending the message to the IPC object corresponding to the communication object, and/or receiving the message sent by the communication object through the IPC object corresponding to the step S.
Therefore, the message can be transmitted in one step, and the loss of performance caused by the need of multi-stage forwarding in the prior art is avoided. Through debugging and testing, the delay can be reduced to one third of the prior art, and particularly can be reduced to about 0.3ms (in the prior art, the delay in a debugging state is about 1 ms).
It can be seen that, in the method shown in fig. 1, by registering the IPC object corresponding to itself in the shared memory for inter-process communication, it is possible to send a message to the IPC object corresponding to the communication target and/or receive a message sent by the communication target through the IPC object corresponding to itself. The technical scheme has the advantages that all IPCs of the application program can be carried out in one shared memory, a shared memory does not need to be newly applied every time the IPCs are carried out as in the prior art, and the problems of low efficiency and easy increase of complexity of memory management can be solved; and multiple threads of a process can instantiate own IPC objects in the shared memory, so that communication is not interfered with each other and efficiency is improved.
In an embodiment of the present invention, the registering, in the shared memory for inter-process communication, the IPC object corresponding to itself includes: acquiring a unique identification of an IPC object corresponding to the IPC object; and registering the IPC object corresponding to the unique identifier and the callback function preset by the IPC object according to the unique identifier and the IPC object.
For example, if the callback function of a thread is fun1 and the unique identifier is 101, the registration format may be reg (101, fun 1).
In an embodiment of the present invention, in the method, acquiring the unique identifier of the IPC object corresponding to the IPC object includes: and acquiring the randomly distributed unique identifier or acquiring the reserved unique identifier according to the type of the process to which the self belongs.
For example, 1-100 are reserved unique identifiers, 1 is reserved for the main process, 2 is reserved for the tray process, and so on. Other processes or threads may assign unique identifications starting at 101 when registering an IPC object.
In an embodiment of the present invention, the registering, in the shared memory for inter-process communication, the IPC object corresponding to itself includes: judging whether a shared memory for interprocess communication exists or not; if so, the shared memory for interprocess communication is used, otherwise, the shared memory for interprocess communication is applied.
In this embodiment, the first thread or process that needs IPC communication requests shared memory, and other subsequent threads or processes only need to use the shared memory. The shared memory need not be too large, and 1MB size is sufficient for most cases (since message passing is fast, the occupied memory is released quickly), even 256KB can be sufficient for normal cases. The specific implementation can adopt a mutex approach to control.
In an embodiment of the present invention, in the method, applying for a shared memory for interprocess communication includes: managing the shared memory by using a partner algorithm; a header area is set in the shared memory to store header information of the partner algorithm and common information of each IPC object.
The partner (pair) algorithm is a memory management algorithm, which is not introduced herein too much, and has the advantages of being capable of better solving the problem of external fragmentation, and the like, and although there are also problems of memory waste, and the like, because the memory release speed is considered to be very fast, the defects can be ignored, and the influence on the use is not very large, thus it is clear that the memory management algorithm is not randomly selected, and the advantages and the disadvantages are reasonably considered.
The partner algorithm needs to have a header information of itself, and each IPC object also needs to have some common information, for example, written in a header file of a code, and the information is uniformly stored in a header area, thereby avoiding the defect that the common property is not considered in the prior art and the excessive unnecessary memory space is occupied.
In an embodiment of the present invention, the registering, in the shared memory for inter-process communication, the IPC object corresponding to itself includes: and judging whether a reserved space corresponding to the IPC object exists in the shared memory, if so, writing the registration information of the IPC object into the reserved space, otherwise, newly allocating a space for the IPC object in the shared memory.
In the prior art, if a process of a communication target is not started, a corresponding process needs to be started to perform communication. The starting and exiting of the process are more complicated, and the problems often occur in the prior art: if a process does not normally exit, the other processes execute the starting operation, and finally the process cannot exit, is blocked and the like. In the embodiment of the invention, the problem of starting the process is not considered, and the message can be sent in real time or sent in advance, and can be acquired after the process is started.
This results in the fact that there may already be reserved messages when a thread or process instantiates its own IPC object, and the reserved space needs to be used when saving these reserved messages.
In an embodiment of the present invention, the sending a message to an IPC object corresponding to a communication target in the method includes: judging whether an IPC object corresponding to a communication target is registered in a shared memory; if yes, writing the message into the message queue of the IPC object corresponding to the communication target; otherwise, judging whether a reserved space corresponding to the IPC object corresponding to the communication target exists in the shared memory, if so, writing the message into a message queue corresponding to the reserved space, otherwise, applying for the reserved space for the IPC object corresponding to the communication target in the shared memory, and writing the message into the message queue corresponding to the reserved space.
In the specific implementation, two types of linked lists can be used, wherein one type of linked list stores the head of the IPC object, which is called a head linked list; another type of linked list holds a queue of messages, called a message linked list. It is apparent that if there are multiple IPC objects, there will be multiple corresponding message linked lists.
In an embodiment of the present invention, in the above method, the method further includes: setting a survival time for the transmitted message; and if the sent message is not acquired by the communication target in the survival time, deleting the sent message from the corresponding message queue.
Not only can the reservation message be set, but also a survival time can be set, thereby avoiding unreasonable occupation of the memory. The situation that the reservation message is needed is that the process is not started, for example, the survival time is set to 10s, the starting time of the process generally does not exceed 10s, and then the message is deleted after 10s to cope with the complex situation.
In an embodiment of the present invention, the method further includes: acquiring the parameter type of the parameter to be transmitted; selecting a matched data packaging template from preset data packaging templates according to the parameter type; packaging the parameters to be transmitted into data objects of specified types according to the matched data packaging templates; and sequencing the data objects of the specified type into binary data according to a preset method, and taking the binary data as a message to be sent.
Another difficulty of IPC is solved in this embodiment: the parameters passed are limited. In the prior art, a PostMessage mode and the like are adopted, so that only 9 basic types of parameters can be transmitted generally, the parameters need to be converted into character strings, multiple copies are executed, and the performance is very low. In the embodiment, a data packaging template is adopted, almost any type and any number of parameters can be packaged, and the performance is greatly improved because the data is binary data instead of character strings. For example, in one embodiment of the present invention, in the method, the parameter types include one or more of the following: basic type, custom class, smart pointer, vector, map.
Specifically, in one embodiment of the present invention, the preset method is implemented by using a variable parameter template including nested templates. Therefore, extremely complex nesting modes such as vector < map < int and vector < string > > can be realized, and data conversion can be accurately and reasonably realized only by presetting a method and formulating a rule.
In an embodiment of the present invention, in the method, selecting a matching data encapsulation template from preset data encapsulation templates according to the parameter type includes: determining the parameter type of each parameter in the parameters to be transmitted by utilizing type extraction; packaging the parameters to be transmitted into data objects of the specified type according to the matched data packaging template comprises the following steps: if the parameter type is a scalar type, directly packaging the value of the parameter; and if the parameter type is the structure body, establishing reference to the parameter, and packaging the reference.
In the embodiment, the performance is further improved, and particularly, the performance influence caused by copying is considered. For a structure, copying will greatly reduce performance, so specially designing it, building a reference, passing a reference instead of the parameter itself, reduces copying.
Fig. 2 is a schematic structural diagram of an apparatus for implementing inter-process communication IPC according to an embodiment of the present invention. As shown in fig. 2, an apparatus 200 for implementing inter-process communication IPC includes:
the preprocessing unit 210 is adapted to register an IPC object corresponding to itself in a shared memory for inter-process communication.
In the embodiment of the invention, the technical means can also be adopted, specifically, an IPC class can be defined by definition, and the corresponding IPC object is instantiated during use. Thus, each thread of a process can instantiate multiple IPC objects, which is very flexible to use and removes the concept of IPC windows utilized in the prior art.
The communication unit 220 is suitable for sending messages to the IPC object corresponding to the communication target and/or receiving the messages sent by the communication target through the IPC object corresponding to the communication target.
Therefore, the message can be transmitted in one step, and the loss of performance caused by the need of multi-stage forwarding in the prior art is avoided. Through debugging and testing, the delay can be reduced to one third of the prior art, and particularly can be reduced to about 0.3ms (in the prior art, the delay in a debugging state is about 1 ms).
It can be seen that the apparatus shown in fig. 2 can implement sending a message to an IPC object corresponding to a communication target and/or receiving a message sent by a communication target through the IPC object corresponding to itself by registering the IPC object corresponding to itself in the shared memory for inter-process communication. The technical scheme has the advantages that all IPCs of the application program can be carried out in one shared memory, a shared memory does not need to be newly applied every time the IPCs are carried out as in the prior art, and the problems of low efficiency and easy increase of complexity of memory management can be solved; and multiple threads of a process can instantiate own IPC objects in the shared memory, so that communication is not interfered with each other and efficiency is improved.
In an embodiment of the present invention, in the above apparatus, the preprocessing unit 210 is adapted to obtain a unique identifier of the IPC object corresponding to itself; and registering the IPC object corresponding to the unique identifier and the callback function preset by the IPC object according to the unique identifier and the IPC object.
For example, if the callback function of a thread is fun1 and the unique identifier is 101, the registration format may be reg (101, fun 1).
In an embodiment of the present invention, in the above apparatus, the preprocessing unit 210 is adapted to obtain a randomly allocated unique identifier or obtain a reserved unique identifier according to a type of a process to which the preprocessing unit belongs.
For example, 1-100 are reserved unique identifiers, 1 is reserved for the main process, 2 is reserved for the tray process, and so on. Other processes or threads may assign unique identifications starting at 101 when registering an IPC object.
In an embodiment of the present invention, in the above apparatus, the preprocessing unit 210 is adapted to determine whether a shared memory for inter-process communication already exists; if so, the shared memory for interprocess communication is used, otherwise, the shared memory for interprocess communication is applied.
In this embodiment, the first thread or process that needs IPC communication requests shared memory, and other subsequent threads or processes only need to use the shared memory. The shared memory need not be too large, and 1MB size is sufficient for most cases (since message passing is fast, the occupied memory is released quickly), even 256KB can be sufficient for normal cases. The specific implementation can adopt a mutex approach to control.
In an embodiment of the present invention, in the above apparatus, the preprocessing unit 210 is adapted to manage the shared memory using a partner algorithm; a header area is set in the shared memory to store header information of the partner algorithm and common information of each IPC object.
The partner (pair) algorithm is a memory management algorithm, which is not introduced herein too much, and has the advantages of being capable of better solving the problem of external fragmentation, and the like, and although there are also problems of memory waste, and the like, because the memory release speed is considered to be very fast, the defects can be ignored, and the influence on the use is not very large, thus it is clear that the memory management algorithm is not randomly selected, and the advantages and the disadvantages are reasonably considered.
The partner algorithm needs to have a header information of itself, and each IPC object also needs to have some common information, for example, written in a header file of a code, and the information is uniformly stored in a header area, thereby avoiding the defect that the common property is not considered in the prior art and the excessive unnecessary memory space is occupied.
In an embodiment of the present invention, in the above apparatus, the preprocessing unit 210 is adapted to determine whether a reserved space corresponding to the IPC object exists in the shared memory, if so, write the registration information of the IPC object into the reserved space, otherwise, newly allocate a space for the IPC object in the shared memory.
In the prior art, if a process of a communication target is not started, a corresponding process needs to be started to perform communication. The starting and exiting of the process are more complicated, and the problems often occur in the prior art: if a process does not normally exit, the other processes execute the starting operation, and finally the process cannot exit, is blocked and the like. In the embodiment of the invention, the problem of starting the process is not considered, and the message can be sent in real time or sent in advance, and can be acquired after the process is started.
This results in the fact that there may already be reserved messages when a thread or process instantiates its own IPC object, and the reserved space needs to be used when saving these reserved messages.
In an embodiment of the present invention, in the above apparatus, the communication unit 220 is adapted to determine whether an IPC object corresponding to a communication target is registered in the shared memory; if yes, writing the message into the message queue of the IPC object corresponding to the communication target; otherwise, judging whether a reserved space corresponding to the IPC object corresponding to the communication target exists in the shared memory, if so, writing the message into a message queue corresponding to the reserved space, otherwise, applying for the reserved space for the IPC object corresponding to the communication target in the shared memory, and writing the message into the message queue corresponding to the reserved space.
In the specific implementation, two types of linked lists can be used, wherein one type of linked list stores the head of the IPC object, which is called a head linked list; another type of linked list holds a queue of messages, called a message linked list. It is apparent that if there are multiple IPC objects, there will be multiple corresponding message linked lists.
In an embodiment of the present invention, in the above apparatus, the communication unit 220 is adapted to set a survival time for the transmitted message; and if the sent message is not acquired by the communication target in the survival time, deleting the sent message from the corresponding message queue.
Not only can the reservation message be set, but also a survival time can be set, thereby avoiding unreasonable occupation of the memory. The situation that the reservation message is needed is that the process is not started, for example, the survival time is set to 10s, the starting time of the process generally does not exceed 10s, and then the message is deleted after 10s to cope with the complex situation.
In an embodiment of the present invention, in the above apparatus, the preprocessing unit 210 is further adapted to obtain a parameter type of a parameter to be transmitted; selecting a matched data packaging template from preset data packaging templates according to the parameter type; packaging the parameters to be transmitted into data objects of specified types according to the matched data packaging templates; and sequencing the data objects of the specified type into binary data according to a preset method, and taking the binary data as a message to be sent.
Another difficulty of IPC is solved in this embodiment: the parameters passed are limited. In the prior art, a PostMessage mode and the like are adopted, so that only 9 basic types of parameters can be transmitted generally, the parameters need to be converted into character strings, multiple copies are executed, and the performance is very low. In the embodiment, a data packaging template is adopted, almost any type and any number of parameters can be packaged, and the performance is greatly improved because the data is binary data instead of character strings. For example, in one embodiment of the present invention, in the above apparatus, the parameter types include one or more of the following: basic type, custom class, smart pointer, vector, map.
Specifically, in one embodiment of the present invention, in the above apparatus, the preset method is implemented by using a variable parameter template including nested templates. Therefore, extremely complex nesting modes such as vector < map < int and vector < string > > can be realized, and data conversion can be accurately and reasonably realized only by presetting a method and formulating a rule.
In an embodiment of the present invention, in the above apparatus, the preprocessing unit 210 is adapted to determine a parameter type of each parameter in the parameters to be transmitted by using type extraction; if the parameter type is a scalar type, directly packaging the value of the parameter; and if the parameter type is the structure body, establishing reference to the parameter, and packaging the reference.
In the embodiment, the performance is further improved, and particularly, the performance influence caused by copying is considered. For a structure, copying will greatly reduce performance, so specially designing it, building a reference, passing a reference instead of the parameter itself, reduces copying.
In summary, the technical scheme of the present invention has the beneficial effects that all IPCs of an application program can be performed in one shared memory, and there is no need to newly apply for one shared memory every time an IPC is performed as in the prior art, so that the problems of low efficiency and increased complexity of memory management can be solved; and multiple threads of a process can instantiate own IPC objects in the shared memory, so that communication is not interfered with each other and efficiency is improved.
It should be noted that:
the algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose devices may be used with the teachings herein. The required structure for constructing such a device will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It will be appreciated by those skilled in the art that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in an implementation of an inter-process communication IPC according to an embodiment of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
For example, fig. 3 shows a schematic structural diagram of an intelligent terminal according to an embodiment of the present invention. The intelligent terminal comprises a processor 310 and a memory 320 arranged to store computer executable instructions (computer readable program code). The memory 320 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. The memory 320 has a storage space 330 storing computer readable program code 331 for performing any of the method steps described above. For example, the storage space 330 for storing the computer readable program code may comprise respective computer readable program codes 331 for respectively implementing various steps in the above method. The computer readable program code 331 may be read from or written to one or more computer program products. These computer program products comprise a program code carrier such as a hard disk, a Compact Disc (CD), a memory card or a floppy disk. Such a computer program product is typically a computer readable storage medium such as described in fig. 4. Fig. 4 shows a schematic structural diagram of a computer-readable storage medium according to an embodiment of the present invention. The computer readable storage medium 400 stores computer readable program code 331 for performing the steps of the method according to the present invention, which is readable by the processor 310 of the smart terminal 300 and when the computer readable program code 331 is executed by the smart terminal 300, causes the smart terminal 300 to perform the steps of the method described above, and in particular, the computer readable program code 331 stored by the computer readable storage medium may perform the method shown in any of the embodiments described above. The computer readable program code 331 may be compressed in a suitable form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The embodiment of the invention discloses A1, a method for realizing IPC (inter-process communication), which comprises the following steps:
registering an IPC object corresponding to the IPC object in a shared memory for interprocess communication;
and sending the message to the IPC object corresponding to the communication target, and/or receiving the message sent by the communication target through the IPC object corresponding to the IPC object.
A2, the method as in A1, wherein the registering the IPC object corresponding to itself in the shared memory for inter-process communication comprises:
acquiring a unique identification of an IPC object corresponding to the IPC object;
and registering the IPC object corresponding to the unique identifier and the callback function preset by the IPC object according to the unique identifier and the IPC object.
A3, the method as in A2, wherein the obtaining the unique identification of the IPC object corresponding to the IPC object comprises:
and acquiring the randomly distributed unique identifier or acquiring the reserved unique identifier according to the type of the process to which the self belongs.
A4, the method as in A1, wherein the registering the IPC object corresponding to itself in the shared memory for inter-process communication comprises:
judging whether a shared memory for interprocess communication exists or not;
if so, the shared memory for interprocess communication is used, otherwise, the shared memory for interprocess communication is applied.
A5, the method as in A4, wherein the applying for the shared memory for interprocess communication includes:
managing the shared memory using a partner algorithm;
and setting a header area in the shared memory to store header information of the partner algorithm and common information of all IPC objects.
A6, the method as in A5, wherein the registering the IPC object corresponding to itself in the shared memory for inter-process communication comprises:
and judging whether a reserved space corresponding to the IPC object exists in the shared memory, if so, writing the registration information of the IPC object into the reserved space, otherwise, newly allocating a space for the IPC object in the shared memory.
A7, the method as in A6, wherein the sending the message to the IPC object corresponding to the communication target comprises:
judging whether an IPC object corresponding to a communication target is registered in the shared memory;
if yes, writing the message into a message queue of an IPC object corresponding to the communication target; otherwise, judging whether a reserved space corresponding to the IPC object corresponding to the communication target exists in the shared memory, if so, writing the message into a message queue corresponding to the reserved space, otherwise, applying for the reserved space for the IPC object corresponding to the communication target in the shared memory, and writing the message into the message queue corresponding to the reserved space.
A8, the method of a7, wherein the method further comprises: setting a survival time for the transmitted message;
and if the sent message is not acquired by the communication target in the survival time, deleting the sent message from the corresponding message queue.
A9, the method of a1, wherein the method further comprises:
acquiring the parameter type of the parameter to be transmitted;
selecting a matched data packaging template from preset data packaging templates according to the parameter type;
packaging the parameters to be transmitted into data objects of specified types according to the matched data packaging templates;
and sequencing the data objects of the specified type into binary data according to a preset method, and taking the binary data as a message to be sent.
A10, the method of a9, wherein the preset method is implemented using variable parameter templates including nested templates.
A11, the method as in a9, wherein the selecting the matching data package template from the preset data package templates according to the parameter type includes:
determining the parameter type of each parameter in the parameters to be transmitted by utilizing type extraction;
the step of packaging the parameters to be transmitted into the data objects of the specified types according to the matched data packaging templates comprises the following steps:
if the parameter type is a scalar type, directly packaging the value of the parameter; and if the parameter type is the structure body, establishing a reference to the parameter, and packaging the reference.
A12, the method of A9, wherein the parameter types include one or more of:
basic type, custom class, smart pointer, vector, map.
The embodiment of the invention also discloses B13, an implementation device of IPC, comprising:
the preprocessing unit is suitable for registering an IPC object corresponding to the preprocessing unit in a shared memory for interprocess communication;
and the communication unit is suitable for sending the message to the IPC object corresponding to the communication target and/or receiving the message sent by the communication target through the IPC object corresponding to the communication unit.
B14, the device of B13, wherein,
the preprocessing unit is suitable for acquiring the unique identification of the IPC object corresponding to the preprocessing unit; and registering the IPC object corresponding to the unique identifier and the callback function preset by the IPC object according to the unique identifier and the IPC object.
B15, the device of B14, wherein,
the preprocessing unit is suitable for acquiring the randomly distributed unique identifier or acquiring the reserved unique identifier according to the type of the process to which the preprocessing unit belongs.
B16, the device of B13, wherein,
the preprocessing unit is suitable for judging whether a shared memory for interprocess communication exists or not; if so, the shared memory for interprocess communication is used, otherwise, the shared memory for interprocess communication is applied.
B17, the device of B16, wherein,
the preprocessing unit is suitable for managing the shared memory by using a partner algorithm; and setting a header area in the shared memory to store header information of the partner algorithm and common information of all IPC objects.
B18, the device of B17, wherein,
the preprocessing unit is suitable for judging whether a reserved space corresponding to the IPC object exists in the shared memory, if so, the registration information of the IPC object is written into the reserved space, otherwise, a space is newly allocated to the IPC object in the shared memory.
B19, the device of B18, wherein,
the communication unit is suitable for judging whether an IPC object corresponding to a communication target is registered in the shared memory; if yes, writing the message into a message queue of an IPC object corresponding to the communication target; otherwise, judging whether a reserved space corresponding to the IPC object corresponding to the communication target exists in the shared memory, if so, writing the message into a message queue corresponding to the reserved space, otherwise, applying for the reserved space for the IPC object corresponding to the communication target in the shared memory, and writing the message into the message queue corresponding to the reserved space.
B20, the device of B19, wherein,
the communication unit is suitable for setting survival time for the transmitted message; and if the sent message is not acquired by the communication target in the survival time, deleting the sent message from the corresponding message queue.
B21, the device of B13, wherein,
the preprocessing unit is also suitable for acquiring the parameter type of the parameter to be transmitted; selecting a matched data packaging template from preset data packaging templates according to the parameter type; packaging the parameters to be transmitted into data objects of specified types according to the matched data packaging templates; and sequencing the data objects of the specified type into binary data according to a preset method, and taking the binary data as a message to be sent.
B22, the device as in B21, wherein the preset method is realized by using a variable parameter template comprising nested templates.
B23, the device of B21, wherein,
the preprocessing unit is suitable for determining the parameter type of each parameter in the parameters to be transmitted by type extraction; if the parameter type is a scalar type, directly packaging the value of the parameter; and if the parameter type is the structure body, establishing a reference to the parameter, and packaging the reference.
B24, the apparatus as in B21, wherein the parameter types include one or more of:
basic type, custom class, smart pointer, vector, map.
The embodiment of the invention also discloses C25 and an intelligent terminal, wherein the intelligent terminal comprises: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the method of any one of a1-a 12.
Embodiments of the invention also disclose D26, a computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the method as described in any of a1-a 12.

Claims (24)

1. A method for realizing IPC (inter-process communication) comprises the following steps:
registering an IPC object corresponding to the IPC object in a shared memory for interprocess communication;
acquiring the parameter type of the parameter to be transmitted;
selecting a matched data packaging template from preset data packaging templates according to the parameter type;
packaging the parameters to be transmitted into data objects of specified types according to the matched data packaging templates;
the data objects of the specified type are serialized into binary data according to a preset method, and the binary data is used as a message to be sent;
and sending the message to the IPC object corresponding to the communication target, and/or receiving the message sent by the communication target through the IPC object corresponding to the IPC object.
2. The method of claim 1, wherein registering the IPC object corresponding to itself in the shared memory for inter-process communication comprises:
acquiring a unique identification of an IPC object corresponding to the IPC object;
and registering the IPC object corresponding to the unique identifier and the callback function preset by the IPC object according to the unique identifier and the IPC object.
3. The method of claim 2, wherein the obtaining the unique identification of the IPC object corresponding to itself comprises:
and acquiring the randomly distributed unique identifier or acquiring the reserved unique identifier according to the type of the process to which the self belongs.
4. The method of claim 1, wherein registering the IPC object corresponding to itself in the shared memory for inter-process communication comprises:
judging whether a shared memory for interprocess communication exists or not;
if so, the shared memory for interprocess communication is used, otherwise, the shared memory for interprocess communication is applied.
5. The method of claim 4, wherein the applying for shared memory for interprocess communication comprises:
managing the shared memory using a partner algorithm;
and setting a header area in the shared memory to store header information of the partner algorithm and common information of all IPC objects.
6. The method of claim 5, wherein registering the IPC object corresponding to itself in the shared memory for inter-process communication comprises:
and judging whether a reserved space corresponding to the IPC object exists in the shared memory, if so, writing the registration information of the IPC object into the reserved space, otherwise, newly allocating a space for the IPC object in the shared memory.
7. The method of claim 6, wherein the sending a message to an IPC object corresponding to a communication target comprises:
judging whether an IPC object corresponding to a communication target is registered in the shared memory;
if yes, writing the message into a message queue of an IPC object corresponding to the communication target; otherwise, judging whether a reserved space corresponding to the IPC object corresponding to the communication target exists in the shared memory, if so, writing the message into a message queue corresponding to the reserved space, otherwise, applying for the reserved space for the IPC object corresponding to the communication target in the shared memory, and writing the message into the message queue corresponding to the reserved space.
8. The method of claim 7, wherein the method further comprises: setting a survival time for the transmitted message;
and if the sent message is not acquired by the communication target in the survival time, deleting the sent message from the corresponding message queue.
9. The method of claim 1, wherein the preset method is implemented using a variable parameter template comprising nested templates.
10. The method of claim 1, wherein the selecting a matching data encapsulation template from preset data encapsulation templates according to the parameter type comprises:
determining the parameter type of each parameter in the parameters to be transmitted by utilizing type extraction;
the step of packaging the parameters to be transmitted into the data objects of the specified types according to the matched data packaging templates comprises the following steps:
if the parameter type is a scalar type, directly packaging the value of the parameter; and if the parameter type is the structure body, establishing a reference to the parameter, and packaging the reference.
11. The method of claim 1, wherein the parameter types include one or more of:
basic type, custom class, smart pointer, vector, map.
12. An implementation device for inter-process communication (IPC), comprising:
the preprocessing unit is suitable for registering an IPC object corresponding to the preprocessing unit in a shared memory for interprocess communication;
the preprocessing unit is also suitable for acquiring the parameter type of the parameter to be transmitted; selecting a matched data packaging template from preset data packaging templates according to the parameter type; packaging the parameters to be transmitted into data objects of specified types according to the matched data packaging templates; the data objects of the specified type are serialized into binary data according to a preset method, and the binary data is used as a message to be sent;
and the communication unit is suitable for sending the message to the IPC object corresponding to the communication target and/or receiving the message sent by the communication target through the IPC object corresponding to the communication unit.
13. The apparatus of claim 12, wherein,
the preprocessing unit is suitable for acquiring the unique identification of the IPC object corresponding to the preprocessing unit; and registering the IPC object corresponding to the unique identifier and the callback function preset by the IPC object according to the unique identifier and the IPC object.
14. The apparatus of claim 13, wherein,
the preprocessing unit is suitable for acquiring the randomly distributed unique identifier or acquiring the reserved unique identifier according to the type of the process to which the preprocessing unit belongs.
15. The apparatus of claim 12, wherein,
the preprocessing unit is suitable for judging whether a shared memory for interprocess communication exists or not; if so, the shared memory for interprocess communication is used, otherwise, the shared memory for interprocess communication is applied.
16. The apparatus of claim 15, wherein,
the preprocessing unit is suitable for managing the shared memory by using a partner algorithm; and setting a header area in the shared memory to store header information of the partner algorithm and common information of all IPC objects.
17. The apparatus of claim 16, wherein,
the preprocessing unit is suitable for judging whether a reserved space corresponding to the IPC object exists in the shared memory, if so, the registration information of the IPC object is written into the reserved space, otherwise, a space is newly allocated to the IPC object in the shared memory.
18. The apparatus of claim 17, wherein,
the communication unit is suitable for judging whether an IPC object corresponding to a communication target is registered in the shared memory; if yes, writing the message into a message queue of an IPC object corresponding to the communication target; otherwise, judging whether a reserved space corresponding to the IPC object corresponding to the communication target exists in the shared memory, if so, writing the message into a message queue corresponding to the reserved space, otherwise, applying for the reserved space for the IPC object corresponding to the communication target in the shared memory, and writing the message into the message queue corresponding to the reserved space.
19. The apparatus of claim 18, wherein,
the communication unit is suitable for setting survival time for the transmitted message; and if the sent message is not acquired by the communication target in the survival time, deleting the sent message from the corresponding message queue.
20. The apparatus of claim 12, wherein the preset method is implemented using a variable parameter template comprising nested templates.
21. The apparatus of claim 12, wherein,
the preprocessing unit is suitable for determining the parameter type of each parameter in the parameters to be transmitted by type extraction; if the parameter type is a scalar type, directly packaging the value of the parameter; and if the parameter type is the structure body, establishing a reference to the parameter, and packaging the reference.
22. The apparatus of claim 12, wherein the parameter types include one or more of:
basic type, custom class, smart pointer, vector, map.
23. An intelligent terminal, wherein, this intelligent terminal includes: a processor; and a memory arranged to store computer-executable instructions that, when executed, cause the processor to perform the method of any one of claims 1-11.
24. A computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the method of any of claims 1-11.
CN201810646525.0A 2018-06-21 2018-06-21 Method and device for realizing IPC (inter-process communication) Active CN108984317B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810646525.0A CN108984317B (en) 2018-06-21 2018-06-21 Method and device for realizing IPC (inter-process communication)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810646525.0A CN108984317B (en) 2018-06-21 2018-06-21 Method and device for realizing IPC (inter-process communication)

Publications (2)

Publication Number Publication Date
CN108984317A CN108984317A (en) 2018-12-11
CN108984317B true CN108984317B (en) 2021-07-13

Family

ID=64538061

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810646525.0A Active CN108984317B (en) 2018-06-21 2018-06-21 Method and device for realizing IPC (inter-process communication)

Country Status (1)

Country Link
CN (1) CN108984317B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112199205B (en) * 2019-07-08 2023-10-27 南京工程学院 Program communication method between heterogeneous platforms
CN112256460B (en) * 2020-11-24 2024-07-09 北京元心科技有限公司 Inter-process communication method, inter-process communication device, electronic equipment and computer readable storage medium
CN113760569B (en) * 2021-01-06 2024-04-05 北京沃东天骏信息技术有限公司 Multi-account management method and system
CN113867991B (en) * 2021-12-01 2022-02-25 北京翼辉信息技术有限公司 Method and device for processing events among threads based on signal slots and storage medium
CN114490141B (en) * 2022-04-14 2022-07-05 中国电子科技集团公司第二十八研究所 High-concurrency IPC data interaction method based on shared memory
CN115629827B (en) * 2022-12-22 2023-03-10 中国西安卫星测控中心 Linux server multi-application process scheduling method based on shared memory

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1472644A (en) * 2003-05-16 2004-02-04 北京北方格林电子技术有限责任公司 Interface design and task processing separating system
CN101262501A (en) * 2008-04-23 2008-09-10 杭州华三通信技术有限公司 An inter-core communication method in multi-core system and one multi-core system
CN102662774A (en) * 2012-03-13 2012-09-12 中冶南方工程技术有限公司 Inter-process structured document communication method
US9015376B2 (en) * 2012-04-29 2015-04-21 Texas Instruments Incorporated Method for infrastructure messaging
CN105786612A (en) * 2014-12-23 2016-07-20 杭州华为数字技术有限公司 Resource management method and apparatus
CN106338931A (en) * 2015-07-06 2017-01-18 天津九洲云物联科技有限公司 Central control information scheduling algorithm
CN106547631A (en) * 2016-09-26 2017-03-29 腾讯科技(深圳)有限公司 Striding course communication means and device based on Android platform

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1472644A (en) * 2003-05-16 2004-02-04 北京北方格林电子技术有限责任公司 Interface design and task processing separating system
CN101262501A (en) * 2008-04-23 2008-09-10 杭州华三通信技术有限公司 An inter-core communication method in multi-core system and one multi-core system
CN102662774A (en) * 2012-03-13 2012-09-12 中冶南方工程技术有限公司 Inter-process structured document communication method
US9015376B2 (en) * 2012-04-29 2015-04-21 Texas Instruments Incorporated Method for infrastructure messaging
CN105786612A (en) * 2014-12-23 2016-07-20 杭州华为数字技术有限公司 Resource management method and apparatus
CN106338931A (en) * 2015-07-06 2017-01-18 天津九洲云物联科技有限公司 Central control information scheduling algorithm
CN106547631A (en) * 2016-09-26 2017-03-29 腾讯科技(深圳)有限公司 Striding course communication means and device based on Android platform

Also Published As

Publication number Publication date
CN108984317A (en) 2018-12-11

Similar Documents

Publication Publication Date Title
CN108984317B (en) Method and device for realizing IPC (inter-process communication)
CN113641457B (en) Container creation method, device, apparatus, medium, and program product
CN108062252B (en) Information interaction method, object management method, device and system
CN111324427B (en) Task scheduling method and device based on DSP
CN110727608A (en) Log data storage method, electronic equipment and storage medium
WO2023000673A1 (en) Hardware accelerator device management method and apparatus, and electronic device and storage medium
CN108932123B (en) Parameter processing method and device
CN109634664A (en) A kind of method and device of CPU to hardware circuit transmitting order to lower levels descriptor
US9251107B2 (en) Immediate direct memory access descriptor-based write operation
WO2024119930A1 (en) Scheduling method and apparatus, and computer device and storage medium
CN112001837A (en) CDVS multi-process driving method and device, electronic equipment and storage medium
CN113535087A (en) Data processing method, server and storage system in data migration process
CN112052083B (en) Video memory scheduling method and device of cloud GPU, electronic equipment and storage medium
CN107193650B (en) Method and device for scheduling display card resources in distributed cluster
CN114217710B (en) Bullet frame control method, device, storage medium and system
CN108536644B (en) Device for pushing core into queue from device end
CN109522121A (en) A kind of memory application method, device, terminal and computer readable storage medium
EP3291084A1 (en) Java card application package used as a library package
CN114356516A (en) Resource scheduling method, related device, equipment and storage medium
CN114675954A (en) Task scheduling method and device
CN109165200B (en) Data synchronization method and device, computing equipment and computer storage medium
CN108647086B (en) Application switching method and device in android system
WO2024108907A1 (en) Data processing method and apparatus, ai chip, electronic device, and storage medium
CN117093345B (en) Task linked list execution method and device, terminal equipment and storage medium
CN108829502B (en) Method and device for realizing thread operation

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