CN115098283A - IPC message processing method, system, storage medium and equipment - Google Patents

IPC message processing method, system, storage medium and equipment Download PDF

Info

Publication number
CN115098283A
CN115098283A CN202210912744.5A CN202210912744A CN115098283A CN 115098283 A CN115098283 A CN 115098283A CN 202210912744 A CN202210912744 A CN 202210912744A CN 115098283 A CN115098283 A CN 115098283A
Authority
CN
China
Prior art keywords
ipc message
message
thread
linked list
ipc
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210912744.5A
Other languages
Chinese (zh)
Inventor
刘潇木
张璐
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210912744.5A priority Critical patent/CN115098283A/en
Publication of CN115098283A publication Critical patent/CN115098283A/en
Pending legal-status Critical Current

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/546Message passing systems or structures, e.g. queues
    • 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/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides an IPC message processing method, a system, a storage medium and equipment, wherein the method comprises the following steps: creating a first thread through a first process of an IPC message sending end, and sending the IPC message to a message linked list through the first thread; creating a second thread and a circular linked list through a second process of the IPC message receiving end, scanning the message linked list by the second thread, and sending the IPC message to the circular linked list in response to detecting that the IPC message exists in the message linked list; and distributing and processing the IPC message by the second thread based on the weight of the IPC message in the circular linked list. The invention makes up the deficiencies of the existing synchronous mode and asynchronous mode of IPC message processing, has the feedback of the IPC message synchronous processing mechanism and the non-blocking characteristic of the IPC message asynchronous processing mode, ensures that the sending and receiving processing of the IPC message are more efficient and stable, improves the service processing capability, improves the concurrency of the service to a certain extent, and improves the system processing efficiency.

Description

IPC message processing method, system, storage medium and equipment
Technical Field
The present invention relates to the field of information technologies, and in particular, to an IPC message processing method, system, storage medium, and device.
Background
Information sharing among processes is usually done in a variety of ways, one is through kernel access to the file system, the other is through shared information residing in the content, and the other is through process shared memory areas.
The processing modes of IPC (Inter-Process Communication) messages can be divided into synchronous and asynchronous modes. The synchronization means will block the function process until the message processing is complete and the result is returned, and the process will not continue to run. FIG. 1 is a schematic diagram of an IPC message asynchronous processing mode provided according to the prior art. As shown in fig. 1, the asynchronous mode does not block the function process, and after the message is sent, the process continues to run without concern for the message execution result.
Therefore, at present, both the synchronous mode and the asynchronous mode for IPC message processing are insufficient, resulting in low processing capability and processing efficiency.
Disclosure of Invention
In view of the above, an object of the present invention is to provide an IPC message processing method, system, storage medium and device, so as to solve the problem of low processing capability and processing efficiency caused by the deficiency of both synchronous and asynchronous methods for IPC message processing in the prior art.
Based on the above purpose, the invention provides an IPC message processing method, comprising the following steps:
creating a first thread through a first process of an IPC message sending end, and sending the IPC message to a message linked list through the first thread;
creating a second thread and a circular linked list through a second process of the IPC message receiving end, scanning the message linked list by the second thread, and sending the IPC message to the circular linked list in response to detecting that the IPC message exists in the message linked list;
and distributing and processing the IPC message by the second thread based on the weight of the IPC message in the circular linked list.
In some embodiments, the distributing, by the second thread, the IPC message based on the weight of the IPC message in the circular linked list comprises:
acquiring the IPC message in the circular linked list through a second thread, and allocating corresponding amount of resources to the IPC message according to the weight of the acquired IPC message;
and responding to the completion of the resource allocation, and handing the acquired IPC message to the service module for processing through the second thread.
In some embodiments, allocating a corresponding amount of resources to the IPC message according to the obtained weight value thereof includes:
and allocating corresponding amount of resources for the obtained IPC message according to the weight value of the example message in the obtained IPC message.
In some embodiments, the method further comprises:
and creating a third thread through the first process, and registering the timeout processing function and the callback function to the third thread.
In some embodiments, the method further comprises:
and responding to the fact that the circular linked list is full, and sending a first completion signal that the linked list is full to a third thread through an IPC message receiving end, so that the third thread triggers callback processing based on a callback function.
In some embodiments, the method further comprises:
and in response to the completion of the distribution processing of the IPC message through the second process, sending a second completion signal to the IPC message sending end to inform the IPC message sending end to perform callback processing through a third thread.
In some embodiments, the method further comprises:
and in response to the fact that the IPC message is not distributed and processed through the second process, sending an exception completion signal or a timeout signal to the IPC message sending end to inform the IPC message sending end to perform special callback processing through a third thread.
In another aspect of the present invention, an IPC message processing system is further provided, including:
the sending module is configured to create a first thread through a first process of an IPC message sending end and send the IPC message to a message linked list through the first thread;
the scanning module is configured to create a second thread and a circular linked list through a second process of the IPC message receiving end, scan the message linked list through the second thread, and send the IPC message to the circular linked list in response to detecting that the IPC message exists in the message linked list; and
and the processing module is configured to distribute and process the IPC message based on the weight value of the IPC message in the circular linked list through the second thread.
In still another aspect of the present invention, a computer-readable storage medium is further provided, which stores computer program instructions, which when executed by a processor, implement the above-mentioned method.
In yet another aspect of the present invention, a computer device is further provided, which includes a memory and a processor, the memory storing a computer program, and the computer program executing the method when executed by the processor.
The invention has at least the following beneficial technical effects:
the IPC message processing method of the invention creates a first thread through a first process of an IPC message sending end, sends the IPC message to a message linked list through the first thread, creating a second thread and a circular linked list through a second process of the IPC message receiving end, scanning the message linked list by the second thread, and when detecting that the IPC message exists in the message linked list, the IPC message is sent to the circular linked list, the second thread distributes the IPC message based on the weight of the IPC message in the circular linked list, thereby making up for the deficiencies of the existing synchronous mode and asynchronous mode of IPC message processing, having the feedback of the IPC message synchronous processing mechanism and the non-blocking characteristic of the IPC message asynchronous processing mode, the IPC message sending and receiving processing is more efficient and stable, the service processing capacity is improved, the service concurrency is improved to a certain extent, and the system processing efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a schematic diagram of an IPC message asynchronous processing mode provided according to the prior art;
FIG. 2 is a schematic diagram of an IPC message processing method according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an IPC message processing method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an IPC message processing system provided in accordance with an embodiment of the present invention;
FIG. 5 is a schematic diagram of a computer readable storage medium for implementing an IPC message processing method according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a hardware configuration of a computer device that executes an IPC message processing method according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two non-identical entities with the same name or different parameters, and it is understood that "first" and "second" are only used for convenience of expression and should not be construed as limiting the embodiments of the present invention. Furthermore, the terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements does not include all of the other steps or elements inherent in the list.
In view of the above, a first aspect of the embodiments of the present invention provides an embodiment of an IPC message processing method. FIG. 2 is a diagram showing an embodiment of an IPC message processing method provided by the present invention. As shown in fig. 2, the embodiment of the present invention includes the following steps:
step S10, creating a first thread through a first process of an IPC message sending end, and sending the IPC message to a message linked list through the first thread;
step S20, creating a second thread and a circular linked list through a second process of the IPC message receiving end, scanning the message linked list by the second thread, and sending the IPC message to the circular linked list in response to the IPC message detected to exist in the message linked list;
and step S30, distributing the IPC message based on the weight value of the IPC message in the circular linked list through the second thread.
IPC (Inter-Process Communication) refers to the interaction between data of two processes.
The IPC message processing method of the embodiment of the invention creates a first thread through a first process of an IPC message sending end, sends the IPC message to a message linked list through the first thread, creates a second thread and a circular linked list through a second process of an IPC message receiving end, scans the message linked list through the second thread, sends the IPC message to the circular linked list when detecting that the IPC message exists in the message linked list, and distributes and processes the IPC message through the second thread based on the weight value of the IPC message in the circular linked list, thereby taking the advantages of the existing IPC message processing synchronous mode and asynchronous mode, having the feedback of an IPC message synchronous processing mechanism and the non-blocking characteristic of the IPC message asynchronous processing mode, leading the sending and receiving processing of the IPC message to be more efficient and stable, improving the service processing capability, improving the service concurrency to a certain degree, thereby improving the processing efficiency of the system.
In some embodiments, the distributing, by the second thread, the IPC messages based on the weights of the IPC messages in the circular linked list comprises: acquiring the IPC message in the circular linked list through a second thread, and allocating corresponding amount of resources to the IPC message according to the weight of the acquired IPC message; and responding to the completion of the resource allocation, and handing the acquired IPC message to the service module for processing through the second thread.
In some embodiments, allocating a corresponding amount of resources to the IPC message according to the obtained weight value thereof includes: and allocating corresponding resources to the obtained IPC message according to the weight of the instance message in the obtained IPC message.
In some embodiments, the method further comprises: and creating a third thread through the first process, and registering the timeout processing function and the callback function to the third thread.
In some embodiments, the method further comprises: and responding to the fact that the circular linked list is full, and sending a first completion signal that the linked list is full to a third thread through an IPC message receiving end, so that the third thread triggers callback processing based on a callback function.
In some embodiments, the method further comprises: and in response to the completion of the distribution processing of the IPC message through the second process, sending a second completion signal to the IPC message sending end to inform the IPC message sending end to perform callback processing through a third thread.
In some embodiments, the method further comprises: and in response to the IPC message is not distributed and processed through the second process, sending an exception completion signal or a timeout signal to the IPC message sending end to inform the IPC message sending end to perform special callback processing through a third thread.
FIG. 3 is a schematic structural diagram of an IPC message processing method according to an embodiment of the present invention. As shown in FIG. 3, first the sending end of the IPC message (Process A) is divided into two threads: thread A1 (i.e., the first thread) is responsible for the sending of IPC message bodies, and thread A2 (i.e., the third thread) is responsible for callback and timeout handling of IPC messages. The receiving end of the IPC message (process B) has only one thread B1 (i.e. the second thread), but adds the polling task chain table and sets the weight. The reason for using one thread B1 is to simply and effectively ensure the continuity of message processing.
Firstly, the sending end of the IPC message mainly realizes the following processes:
(1) the process A creates a thread A1 and is responsible for sending an IPC message body, wherein the message body mainly comprises a main instance msg (instance message), timeout time and a callback function of the message;
(2) after the thread A1 finishes sending the IPC message, continuously waiting for sending the next message;
(3) the process A creates a thread A2, which mainly comprises the processing of a timeout function and the processing of a callback function;
(4) the timeout function and callback function are registered with thread a2 and are triggered by a signal.
Secondly, the receiving end of the IPC message mainly realizes the following processes:
(1) the process B creates a thread B1, which is responsible for receiving and distributing IPC messages;
(2) creating a circular linked list with weight values, wherein the weight values represent the priority of the messages, and the thread B1 processes the IPC messages in the polling circular linked list in sequence; specifically, the thread B1 will hang in the circular linked list after taking out the IPC message, and wait for distribution processing;
(3) during distribution processing, determining distributable resources according to the weight value, wherein the larger the weight value is, the more distributable resources are, but the execution sequence of the distributable resources in the linked list is not changed;
(4) when the circular linked list is full, the receiving end sends a linked list full completion signal to trigger callback processing, and resending or giving up sending can be tried;
(5) when the message is distributed and processed, corresponding resources are distributed to the message according to the weight of the example msg and are delivered to the service module for processing, and more resources can be distributed when the weight is larger; msg (message structure) is a main structure of an IPC message, and includes contents such as a transmitted ID and cache data.
(6) And after the message processing is finished or overtime, sending a corresponding signal to inform a sending end of carrying out corresponding processing.
The embodiment combines the advantages and disadvantages of the sending and processing of the synchronous and asynchronous IPC messages, organically combines the advantages of the synchronous and asynchronous IPC message processing, and increases the special linked list and weight distribution, so that the sending and receiving processing of the IPC messages are more efficient and stable.
The second aspect of the embodiment of the invention also provides an IPC message processing system. FIG. 4 is a schematic diagram of an embodiment of an IPC message processing system provided by the present invention. As shown in fig. 4, an IPC message processing system includes: the sending module 10 is configured to create a first thread through a first process of an IPC message sending end, and send the IPC message to a message linked list through the first thread; the scanning module 20 is configured to create a second thread and a circular linked list through a second process of the IPC message receiving end, scan the message linked list through the second thread, and send the IPC message to the circular linked list in response to detecting that the IPC message exists in the message linked list; and a processing module 30 configured to distribute the IPC message based on the weight of the IPC message in the circular linked list through the second thread.
In some embodiments, the processing module 30 is further configured to obtain the IPC message in the circular linked list through the second thread, and allocate a corresponding amount of resources to the obtained IPC message according to the weight of the IPC message; and responding to the completion of the resource allocation, and handing the acquired IPC message to the service module for processing through the second thread.
In some embodiments, the processing module 30 includes an allocating module configured to allocate a corresponding amount of resources to the obtained IPC message according to the weight of the instance message in the obtained IPC message.
In some embodiments, the system further includes a registration module configured to create a third thread by the first process and register the timeout handling function and the callback function with the third thread.
In some embodiments, the system further comprises a first callback module configured to send a first completion signal that the linked list is full to the third thread through the IPC message receiving end in response to the circular linked list being full, so that the third thread triggers callback processing based on the callback function.
In some embodiments, the system further includes a second callback module configured to send a second completion signal to the IPC message sending end in response to completion of the distribution processing of the IPC message by the second process, so as to notify the IPC message sending end of the callback processing by the third thread.
In some embodiments, the system further includes a third callback module configured to send an exception completion signal or a timeout signal to the IPC message sending end in response to the distribution processing of the IPC message not being completed by the second process, so as to notify the IPC message sending end of performing the special callback processing by the third thread.
The IPC message processing system of the embodiment of the invention creates a first thread through a first process of an IPC message sending end, sends the IPC message to a message linked list through the first thread, creates a second thread and a circular linked list through a second process of an IPC message receiving end, scans the message linked list through the second thread, sends the IPC message to the circular linked list when the IPC message exists in the message linked list, and distributes and processes the IPC message through the second thread based on the weight value of the IPC message in the circular linked list, thereby taking the advantages of the existing synchronous mode and asynchronous mode of the IPC message processing, having the feedback of an IPC message synchronous processing mechanism and the non-blocking characteristic of the IPC message asynchronous processing mode, leading the sending and receiving processing of the IPC message to be more efficient and stable, improving the service processing capability and improving the service concurrency to a certain extent, thereby improving the system processing efficiency.
In a third aspect of the embodiment of the present invention, a computer-readable storage medium is further provided, and fig. 5 is a schematic diagram of a computer-readable storage medium for implementing an IPC message processing method according to an embodiment of the present invention. As shown in fig. 5, the computer-readable storage medium 3 stores computer program instructions 31. The computer program instructions 31 when executed by a processor implement the steps of:
creating a first thread through a first process of an IPC message sending end, and sending the IPC message to a message linked list through the first thread;
creating a second thread and a circular linked list through a second process of the IPC message receiving end, scanning the message linked list by the second thread, and sending the IPC message to the circular linked list in response to detecting that the IPC message exists in the message linked list;
and distributing and processing the IPC message by the second thread based on the weight of the IPC message in the circular linked list.
In some embodiments, the distributing, by the second thread, the IPC message based on the weight of the IPC message in the circular linked list comprises:
acquiring IPC messages in the circular linked list through a second thread, and allocating corresponding resources to the IPC messages according to the weight of the IPC messages;
and responding to the completion of the resource allocation, and handing the acquired IPC message to the service module for processing through the second thread.
In some embodiments, allocating a corresponding amount of resources to the IPC message according to the obtained weight value thereof includes: and allocating corresponding amount of resources for the obtained IPC message according to the weight value of the example message in the obtained IPC message.
In some embodiments, the steps further comprise: and creating a third thread through the first process, and registering the timeout processing function and the callback function to the third thread.
In some embodiments, the steps further comprise: and responding to the fact that the circular linked list is full, and sending a first completion signal that the linked list is full to a third thread through an IPC message receiving end, so that the third thread triggers callback processing based on a callback function.
In some embodiments, the steps further comprise: and in response to the IPC message distribution processing completed through the second process, sending a second completion signal to the IPC message sending end to inform the IPC message sending end to perform callback processing through a third thread.
In some embodiments, the steps further comprise: and in response to the fact that the IPC message is not distributed and processed through the second process, sending an exception completion signal or a timeout signal to the IPC message sending end to inform the IPC message sending end to perform special callback processing through a third thread.
It should be understood that all the embodiments, features and advantages set forth above with respect to the IPC message processing method according to the present invention are equally applicable to the IPC message processing system and the storage medium according to the present invention without conflicting therewith.
In a fourth aspect of the embodiments of the present invention, there is further provided a computer device, including a memory 402 and a processor 401 as shown in fig. 6, where the memory 402 stores therein a computer program, and the computer program implements the method of any one of the above embodiments when executed by the processor 401.
Fig. 6 is a schematic diagram of a hardware structure of an embodiment of a computer device for executing an IPC message processing method according to the present invention. Taking the computer device shown in fig. 6 as an example, the computer device includes a processor 401 and a memory 402, and may further include: an input device 403 and an output device 404. The processor 401, the memory 402, the input device 403 and the output device 404 may be connected by a bus or other means, and fig. 6 illustrates an example of a connection by a bus. The input device 403 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the IPC message processing system. The output device 404 may include a display device such as a display screen.
The memory 402, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the IPC message processing method in the embodiments of the present application. The memory 402 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by use of the IPC message processing method, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 402 may optionally include memory located remotely from processor 401, which may be connected to local modules via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The processor 401 executes various functional applications of the server and data processing by running nonvolatile software programs, instructions and modules stored in the memory 402, that is, implements the IPC message processing method of the above-described method embodiment.
Finally, it should be noted that the computer-readable storage medium (e.g., memory) herein can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. By way of example, and not limitation, nonvolatile memory can include Read Only Memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which can act as external cache memory. By way of example and not limitation, RAM is available in a variety of forms such as synchronous RAM (DRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The storage devices of the disclosed aspects are intended to comprise, without being limited to, these and other suitable types of memory.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
The various illustrative logical blocks, modules, and circuits described in connection with the disclosure herein may be implemented or performed with the following components designed to perform the functions herein: a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP, and/or any other such configuration.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items. The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also combinations between technical features in the above embodiments or in different embodiments are possible, and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. An IPC message processing method is characterized by comprising the following steps:
creating a first thread through a first process of an IPC message sending end, and sending the IPC message to a message linked list through the first thread;
creating a second thread and a circular linked list through a second process of an IPC message receiving end, scanning the message linked list by the second thread, and sending the IPC message to the circular linked list in response to detecting that the IPC message exists in the message linked list;
and distributing the IPC message by the second thread based on the weight of the IPC message in the circular linked list.
2. The method of claim 1, wherein distributing, by the second thread, the IPC message based on the weight of the IPC message in the circularly linked list comprises:
acquiring the IPC message in the circular linked list through the second thread, and allocating corresponding amount of resources to the IPC message according to the weight of the acquired IPC message;
and responding to the completion of resource allocation, and handing the acquired IPC message to a service module for processing through the second thread.
3. The method of claim 2, wherein allocating a corresponding amount of resources to the obtained IPC message according to its weight comprises:
and allocating corresponding amount of resources to the obtained IPC message according to the weight value of the example message in the obtained IPC message.
4. The method of claim 1, further comprising:
and creating a third thread through the first process, and registering a timeout processing function and a callback function to the third thread.
5. The method of claim 4, further comprising:
and responding to the fact that the circular linked list is full, and sending a first completion signal that the linked list is full to the third thread through the IPC message receiving end, so that the third thread triggers callback processing based on the callback function.
6. The method of claim 4, further comprising:
and in response to the completion of the distribution processing of the IPC message through the second process, sending a second completion signal to the IPC message sending end to inform the IPC message sending end of performing callback processing through the third process.
7. The method of claim 4, further comprising:
and in response to the IPC message is not distributed and processed through the second process, sending an exception completion signal or a timeout signal to the IPC message sending end to inform the IPC message sending end to perform special callback processing through the third process.
8. An IPC message processing system, comprising:
the sending module is configured to create a first thread through a first process of an IPC message sending end and send the IPC message to a message linked list through the first thread;
the scanning module is configured to create a second thread and a circular linked list through a second process of an IPC message receiving end, scan the message linked list through the second thread, and send the IPC message to the circular linked list in response to the IPC message detected to exist in the message linked list; and
and the processing module is configured to distribute and process the IPC message through the second thread based on the weight of the IPC message in the circular linked list.
9. A computer-readable storage medium, characterized in that computer program instructions are stored which, when executed by a processor, implement the method according to any one of claims 1-7.
10. A computer arrangement comprising a memory and a processor, characterized in that a computer program is stored in the memory, which computer program, when being executed by the processor, is adapted to carry out the method of any one of the claims 1-7.
CN202210912744.5A 2022-07-31 2022-07-31 IPC message processing method, system, storage medium and equipment Pending CN115098283A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210912744.5A CN115098283A (en) 2022-07-31 2022-07-31 IPC message processing method, system, storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210912744.5A CN115098283A (en) 2022-07-31 2022-07-31 IPC message processing method, system, storage medium and equipment

Publications (1)

Publication Number Publication Date
CN115098283A true CN115098283A (en) 2022-09-23

Family

ID=83300555

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210912744.5A Pending CN115098283A (en) 2022-07-31 2022-07-31 IPC message processing method, system, storage medium and equipment

Country Status (1)

Country Link
CN (1) CN115098283A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116501476A (en) * 2023-06-28 2023-07-28 成都赛力斯科技有限公司 Processing method, device, equipment and medium for linux universal character equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116501476A (en) * 2023-06-28 2023-07-28 成都赛力斯科技有限公司 Processing method, device, equipment and medium for linux universal character equipment
CN116501476B (en) * 2023-06-28 2023-09-12 成都赛力斯科技有限公司 Processing method, device, equipment and medium for linux universal character equipment

Similar Documents

Publication Publication Date Title
CN111756811B (en) Method, system, device and medium for actively pushing distributed system
US10891177B2 (en) Message management method and device, and storage medium
JP6571277B2 (en) Method and apparatus for loading terminal application
CN111367693B (en) Method, system, device and medium for scheduling plug-in tasks based on message queue
CN106537375B (en) Memory caching system with local cache
CN115098283A (en) IPC message processing method, system, storage medium and equipment
CN112261094A (en) Message processing method and proxy server
CN112398845B (en) Data transmission method, data transmission device, data transmission system and electronic equipment
CN113821506A (en) Task execution method, device, system, server and medium for task system
CN108429703B (en) DHCP client-side online method and device
CN112104679A (en) Method, apparatus, device and medium for processing hypertext transfer protocol request
CN113965628A (en) Message scheduling method, server and storage medium
CN110324722B (en) Method, device, equipment and storage medium for acquiring data in live broadcast room
CN113596105B (en) Content acquisition method, edge node and computer readable storage medium
CN109005465B (en) Bullet screen message distribution method, device, equipment and storage medium
CN107729158B (en) Method for simplifying application program register, storage medium and electronic equipment
CN107404504B (en) Communication method, device and system
CN110971637B (en) Method for calling third-party service interface, scheduler and storage medium
CN113660353A (en) Method, device, equipment and medium for managing Provisioner address based on Bluetooth Mesh
CN113742061B (en) Resource management method, system, storage medium and equipment
CN114168233B (en) Data processing method, device, server and storage medium
CN117319297A (en) Message stream processing method, device, equipment and readable storage medium
CN114691329A (en) Query task processing method and device, electronic equipment and readable storage medium
CN113867982A (en) Request processing method, system, storage medium and equipment
CN118069328A (en) Concurrent message distribution method, device, concurrent message distributor and 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