Inter-process communication message execution method and device, equipment and storage medium
By distinguishing and processing the types of real-time and non-real-time inter-process communication messages, and using the Epoll mechanism to manage asynchronous execution linked lists, the resource occupation problem caused by inter-process communication messages is solved, and efficient system resource utilization is achieved.
Patent Information
- Application Number
- CN202510491030.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, the execution of inter-process communication messages results in a long overall time and occupies a lot of system resources, especially due to the sequential execution of real-time services and non-real-time services, resulting in low resource utilization.
By judging the type of communication messages between processes, real-time messages are executed immediately by the daemon and returned the results. Non-real-time messages are added to the asynchronous execution linked list in parallel. The Epoll mechanism is used to manage asynchronous execution to realize dynamic execution of messages.
It improves the utilization rate of system resources, ensures timely processing of real-time messages, and executes non-real-time messages in parallel, without affecting overall performance.
Smart Images

Figure CN120336045A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of storage system processes, and particularly relates to a method, apparatus, device, and storage medium for executing inter-process communication messages. Background Art
[0002] Currently, in addition to providing high-performance and reliable input / output services, the input / output processes in the storage system also need to provide necessary management services. For example, there are dozens of inter-process communication messages such as configuring / reading device product information, IP parameters, recording input / output logs to files, running a script, generating input / output card operation logs, etc. However, all of the above inter-process communication messages have a characteristic, that is, they take a long time and there is a risk of abnormal execution. And the main function of the input / output process is to provide high-performance and reliable input / output services, and it does not allow such time-consuming services or scripts that may crash during actual operation in the input / output process, because this will affect the normal and reliable operation of the input / output process.
[0003] Since the above inter-process communication messages are divided into real-time services and non-real-time services, therefore, according to the input / output processes in the related art, they need to be executed sequentially. Therefore, the overall time consumption is long and more resources are occupied.
[0004] Therefore, there is an urgent need for a method for executing inter-process communication messages, which can dynamically execute the above inter-process communication messages and can fully improve the utilization rate of system resources. Summary of the Invention
[0005] The present application provides a method, apparatus, device, and storage medium for executing inter-process communication messages, so as to at least solve the problem that the overall time consumption is long and more system resources are occupied due to the need to sequentially execute inter-process communication messages in the input / output process in the related art.
[0006] The present application provides a method for executing inter-process communication messages, which is applied to a daemon process. The method includes:
[0007] If the asynchronous execution messages in the asynchronous execution linked list are empty, then determine whether an inter-process communication message sent by the input / output process is received;
[0008] If so, obtain the message type of the inter-process communication message;
[0009] If the message type is a real-time message, then execute the inter-process communication message to obtain a first execution result, and send the first execution result to the input / output process;
[0010] If the message type is a non-real-time message, add the inter-process communication message to the asynchronous execution linked list, and send a first feedback message to the input / output process; wherein, the first feedback message is used to indicate that the inter-process communication message is added to the asynchronous execution linked list.
[0011] The present application further provides a method for executing an inter-process communication message, which is applied to an input / output process. The method includes:
[0012] Send an inter-process communication message to the daemon process to control the daemon process to execute the inter-process communication message when the message type of the inter-process communication message is a real-time message, and obtain a first execution result, and return the first execution result to the input / output process;
[0013] If the first execution result is received within a preset time, call a preset service function to process the first execution result to obtain a first service processing result;
[0014] If the first execution result is not received within a preset time, restart the input / output process.
[0015] The present application further provides an apparatus for executing an inter-process communication message, which is applied to a daemon process. The apparatus includes:
[0016] A first judgment module, configured to judge whether an inter-process communication message sent by an input / output process is received if the asynchronous execution message in the asynchronous execution linked list is empty;
[0017] A first obtaining module, configured to obtain the message type of the inter-process communication message if so;
[0018] An execution module, configured to execute the inter-process communication message if the message type is a real-time message, obtain a first execution result, and send the first execution result to the input / output process;
[0019] A first adding module, configured to add the inter-process communication message to the asynchronous execution linked list and send a first feedback message to the input / output process if the message type is a non-real-time message; wherein, the first feedback message is used to indicate that the inter-process communication message is added to the asynchronous execution linked list.
[0020] The present application further provides an apparatus for executing an inter-process communication message, which is applied to an input / output process. The apparatus includes:
[0021] A sending module, configured to send an inter - process communication message to a daemon process to control the daemon process to execute the inter - process communication message when the message type of the inter - process communication message is a real - time message, obtain a first execution result, and return the first execution result to the input / output process;
[0022] An invocation module, configured to, if the first execution result is received within a preset time, invoke a preset business function to process the first execution result to obtain a first business processing result;
[0023] A restart module, configured to, if the first execution result is not received within a preset time, restart the input / output process.
[0024] This application also provides an electronic device, including: a memory, configured to store a computer program; a processor, configured to implement the steps of any of the above - mentioned methods for executing inter - process communication messages when executing the computer program.
[0025] This application also provides a computer - readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above - mentioned methods for executing inter - process communication messages are implemented.
[0026] This application also provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of any of the above - mentioned methods for executing inter - process communication messages are implemented.
[0027] Through this application, different strategies are executed according to the message type of the received inter - process communication message. Specifically, if the message type is a real - time message, the inter - process communication message is executed to obtain a first execution result, and the first execution result is returned to the input / output process; if the message type is a non - real - time message, the inter - process communication message is added to the asynchronous execution linked list, and a first feedback message is sent to the input / output process, that is, the inter - process communication message is executed in parallel in the asynchronous execution linked list to obtain a second execution result. Since real - time messages are executed by the daemon process and non - real - time messages are executed synchronously in the asynchronous execution linked list. Therefore, the above - mentioned inter - process communication messages can be dynamically executed, and the utilization rate of system resources can be fully improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] To more clearly illustrate the embodiments of this application, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of this application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0029] Figure 1 Schematic diagram of an interaction architecture between a daemon process and an input / output process provided by an embodiment of the present application;
[0030] Figure 2 Flowchart of a method for executing an inter-process communication message provided by an embodiment of the present application;
[0031] Figure 3 Flowchart of a method for executing an inter-process communication message provided by an embodiment of the present application;
[0032] Figure 4 Interaction signaling diagram between a daemon process and an input / output process provided by an embodiment of the present application;
[0033] Figure 5 Flowchart of a method for executing an inter-process communication message provided by an embodiment of the present application;
[0034] Figure 6 Interaction signaling diagram between an input / output process and a daemon process provided by an embodiment of the present application;
[0035] Figure 7 Schematic diagram of the structure of an apparatus for executing an inter-process communication message provided by an embodiment of the present application;
[0036] Figure 8 Schematic diagram of the structure of an apparatus for executing an inter-process communication message provided by an embodiment of the present application. Detailed implementation manners
[0037] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0038] It should be noted that in the description of the present application, the terms "include", "comprise" or any other variation thereof are intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0039] In the related art, inter-process communication messages are divided into real-time services and non-real-time services. Among them, real-time services need to be executed as soon as possible, and the timeliness requirements of non-real-time services are relatively low. In the related art, if the execution is still carried out in the order of the inter-process communication messages sent, if the real-time service is behind the non-real-time service, it may cause the real-time service not to be processed in time, while the non-urgent non-real-time service is processed first. In addition, the CPU resources in the storage device are also a relatively scarce resource. How to find a method to maximize the satisfaction of service real-time performance and improve CPU utilization is also an urgent problem to be solved.
[0040] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0041] Combined with the specific application environment architecture on which the execution of the execution method of inter-process communication messages depends, the specific application environment architecture will be described herein. Specifically, reference may be made to Figure 1 The schematic diagram of the interaction architecture between a daemon process and an input / output process shown. Figure 1 In which, the communication between the daemon process and the input / output process is based on the inter-process communication mechanism.
[0042] Specifically, Figure 2 The schematic flowchart of an execution method of inter-process communication messages provided by an embodiment of the present application is shown, which is applied to a daemon process. The specific steps of the method are as follows:
[0043] S201. If the asynchronous execution messages in the asynchronous execution list are empty, it is determined whether an inter-process communication message sent by the input / output process is received.
[0044] In one example, the execution subject of this step is the daemon process. The asynchronous execution list is used to store asynchronous execution messages, where the asynchronous execution message refers to a message whose message type of the inter-process communication message is a non-real-time message. That is, the inter-process communication messages stored in the asynchronous execution list are non-real-time messages.
[0045] In one example, the inter-process communication message is sent from the input / output process to the daemon process.
[0046] In this embodiment, if the asynchronous execution messages in the asynchronous execution list are empty, it means that there are no inter-process communication messages of unprocessed non-real-time messages in the asynchronous execution list.
[0047] Specifically, the asynchronous execution list can be an Epoll list, where Epoll is an I / O multiplexing mechanism designed for efficiently processing a large number of concurrent messages in the Linux system.
[0048] S202. If so, obtain the message type of the inter-process communication message.
[0049] In one example, the message types of inter-process communication messages are divided into real-time messages and non-real-time messages. After determining that an inter-process communication message has been received, obtain the message type of the inter-process communication message.
[0050] S203. If the message type is a real-time message, execute the inter-process communication message to obtain a first execution result, and send the first execution result to the input / output process.
[0051] In one example, if the message type is a real-time message, the daemon process executes the inter-process communication message to obtain a first execution result, and then returns the first execution result to the input / output process.
[0052] S204. If the message type is a non-real-time message, add the inter-process communication message to the asynchronous execution linked list, and send a first feedback message to the input / output process; where the first feedback message is used to indicate that the inter-process communication message has been added to the asynchronous execution linked list.
[0053] In one example, if the message type is a non-real-time message, add the inter-process communication message to the asynchronous execution linked list, and then notify the input / output process that the inter-process communication message will be executed in parallel in the asynchronous execution linked list. Specifically, it is notified to the input / output process with the first feedback message, and then the inter-process communication message is synchronously executed in the asynchronous execution linked list to obtain a second execution result.
[0054] The embodiment of the present application provides a method for executing an inter-process communication message. The method includes: if the asynchronous execution messages in the asynchronous execution linked list are empty, determine whether an inter-process communication message has been received. If so, obtain the message type of the inter-process communication message. If the message type is a real-time message, execute the inter-process communication message to obtain a first execution result, and return the first execution result to the input / output process. If the message type is a non-real-time message, add the inter-process communication message to the asynchronous execution linked list, and send the first feedback message to the input / output process; where the first feedback message is used to indicate that the inter-process communication message has been added to the asynchronous execution linked list; the inter-process communication message is executed in parallel in the asynchronous execution linked list to obtain a second execution result. By adopting this technical solution, the above-mentioned inter-process communication message can be dynamically executed, and the utilization rate of system resources can be fully improved.
[0055] Combined with the above embodiments, Figure 3 The flowchart of a method for executing an inter-process communication message provided by the embodiment of the present application is shown, which is applied to a daemon process. The specific steps of the method are as follows:
[0056] S301. If the asynchronous execution messages in the asynchronous execution linked list are empty, determine whether an inter-process communication message sent by the input / output process is received.
[0057] In one example, after determining whether an inter-process communication message sent by the input / output process is received, the method further includes:
[0058] If not, control the daemon process to enter the sleep state until an inter-process communication message is received.
[0059] In one example, if no inter-process communication message is received, it means that there are neither real-time messages nor non-real-time messages at this time. To save system resources, the daemon process can be controlled to enter the sleep state until an inter-process communication message is received.
[0060] S302. If the asynchronous execution messages in the asynchronous execution linked list are not empty, send a third feedback message to the input / output process; where the third feedback message is used to indicate that the inter-process communication messages in the asynchronous execution linked list are executed in parallel in the asynchronous execution linked list.
[0061] In one example, if the asynchronous execution messages in the asynchronous execution linked list are not empty, it means that the inter-process communication messages in the asynchronous execution linked list for non-real-time message execution need to be executed. First, send a third feedback message to the input / output process to notify the input / output process that the asynchronous execution messages in the asynchronous execution linked list enter the processing state.
[0062] In one example, after sending the third feedback message to the input / output process, the method further includes:
[0063] Query the fifth execution result from the asynchronous execution linked list at a preset frequency and return the fifth execution result to the input / output process; where the fifth execution result is used to indicate the result of the parallel execution of the inter-process communication messages in the asynchronous execution linked list in the asynchronous execution linked list.
[0064] In one example, the preset frequency can be 1S. Since the inter-process communication messages in the asynchronous execution linked list are executed in parallel in the asynchronous execution linked list and the daemon process does not know its execution situation, the daemon process needs to query the asynchronous execution linked list to obtain the fifth execution result of the inter-process communication messages in the asynchronous execution linked list.
[0065] S303. If so, obtain the message type of the inter-process communication message.
[0066] In one example, the content of this step can refer to the content of step S202.
[0067] S304. If the message type is a real-time message, execute the inter-process communication message to obtain a first execution result and send the first execution result to the input / output process.
[0068] In one example, the content of step S203 may be referred to for this step.
[0069] S305. If the message type is a non-real-time message, add the inter-process communication message to the asynchronous execution linked list, and send a first feedback message to the input / output process; wherein, the first feedback message is used to indicate that the inter-process communication message is added to the asynchronous execution linked list.
[0070] In one example, after sending the first feedback message to the input / output process, the method further includes:
[0071] Query the second execution result from the asynchronous execution linked list at a preset frequency, and send the second execution result to the input / output process; wherein, the inter-process communication messages are executed in parallel in the asynchronous execution linked list to obtain the second execution result.
[0072] In one example, the preset frequency may be 1S. Since the inter-process communication messages are executed in parallel in the asynchronous execution linked list and the daemon process does not know its execution situation, the daemon process needs to query the asynchronous execution linked list to obtain the second execution result of the inter-process communication messages in the asynchronous execution linked list.
[0073] S306. Determine whether other inter-process communication messages are received.
[0074] In one example, since the inter-process communication messages of non-real-time messages in step S305 have been executed in parallel in the asynchronous execution linked list, the daemon process can execute other tasks in parallel at this time, and then determine whether other inter-process communication messages are received.
[0075] S307. If so, obtain the message type of the other inter-process communication messages.
[0076] In one example, if so, determine the message type of the other inter-process communication messages. If it is a real-time message, it is executed by the daemon process; if it is a non-real-time message, it continues to be executed in the background by the daemon process.
[0077] S308. If the message type is a real-time message, execute the other inter-process communication messages to obtain a third execution result, and return the third execution result to the input / output process.
[0078] In one example, the content of step S203 may be referred to for this step.
[0079] For a clearer illustration, reference may be made to Figure 4 an interaction signaling diagram between a daemon process and an input / output process shown.
[0080] S309. If the message type is a non-real-time message, add other inter-process communication messages to the asynchronous execution linked list, and send a second feedback message to the input / output process; where the second feedback message is used to indicate that other inter-process communication messages are added to the asynchronous execution linked list; other inter-process communication messages are executed in parallel in the asynchronous execution linked list to obtain a fourth execution result.
[0081] In one example, the content of step S204 can be referred to for this step.
[0082] To clearly illustrate the manner of processing inter-process communication messages in different scenarios, a list of inter-process communication message processing scenarios shown in Table 1 can be referred to.
[0083] Table 1 A list of inter-process communication message processing scenarios
[0084]
[0085] The embodiments of the present application provide a method for executing inter-process communication messages. The method includes: if the asynchronous execution messages in the asynchronous execution linked list are empty, determine whether an inter-process communication message sent by the input / output process is received; if the asynchronous execution messages in the asynchronous execution linked list are not empty, send a third feedback message to the input / output process; if so, obtain the message type of the inter-process communication message. If the message type is a real-time message, execute the inter-process communication message to obtain a first execution result, and send the first execution result to the input / output process. If the message type is a non-real-time message, add the inter-process communication message to the asynchronous execution linked list, and send a first feedback message to the input / output process. Determine whether other inter-process communication messages are received. If so, obtain the message type of the other inter-process communication messages. If the message type is a real-time message, execute the other inter-process communication messages to obtain a third execution result, and return the third execution result to the input / output process. If the message type is a non-real-time message, add the other inter-process communication messages to the asynchronous execution linked list, and send a second feedback message to the input / output process; where the second feedback message is used to indicate that the other inter-process communication messages are added to the asynchronous execution linked list; the other inter-process communication messages are executed in parallel in the asynchronous execution linked list to obtain a fourth execution result. With the technical solution of the present application, the daemon process uses the EPOLL mechanism to enable real-time messages to be synchronously executed immediately, non-real-time messages to be executed asynchronously. In a mixed scenario, real-time messages and non-real-time messages are independent and do not affect each other, while maximizing the utilization rate of the CPU, being easy to implement, and reliable.
[0086] Specifically, Figure 5 The flowchart of a method for executing inter-process communication messages provided by the embodiments of the present application is shown, which is applied to the input / output process. The specific steps of the method are as follows:
[0087] S501. Send an inter - process communication message to the daemon process to control the daemon process to execute the inter - process communication message when the message type of the inter - process communication message is a real - time message, obtain a first execution result, and return the first execution result to the input - output process.
[0088] In one example, the input - output process and the daemon process communicate through an inter - process communication mechanism. The input - output process encapsulates the inter - process communication message in an inter - process communication object, which includes a service type, a processing function after the service is completed, and a sending timestamp. For example, object A includes service type A, a processing function A after the service is completed, and sending timestamp A.
[0089] Since the inter - process communication mechanism follows the FIFO mechanism, a linked list can be predefined to store a large number of unordered inter - process communication objects. In this embodiment, the encapsulated inter - process communication object is inserted into the preset linked list, and then a timer is started. In this embodiment, the timer is only for real - time messages.
[0090] S502. If the first execution result is received within the preset time, call a preset service function to process the first execution result to obtain a first service processing result.
[0091] In this embodiment, the time set by the timer is the preset time, which can be 120S. In this embodiment, the preset time is timed based on the sending timestamp to obtain a cut - off time. For example, if the sending timestamp is 14:35:00, the cut - off time is 14:37:00.
[0092] If the first execution result is received within the preset time, it is possible to first determine whether the service type of the first execution result is consistent with the service type pre - stored in the object. For example, if the service type of the first execution result is service type A, and the service type in object A is also service type A, then they are consistent. Then the preset service function is the processing function A after the service is completed in object A, and the processing function A after the service is completed can be used to process the first execution result to obtain a first service processing result.
[0093] In one example, since this embodiment is for real - time messages, after determining that the service type of the first execution result is consistent with the service type pre - stored in the object, the timer setting is cancelled, then it is judged whether there are other inter - process communication objects in the linked list, and the inter - process communication message is obtained, then the current time is obtained, and then the cut - off time is set based on the timer. Specifically, the cut - off time = sending timestamp+preset time - current time.
[0094] The advantage of such a setting is that a time limit is set separately for each real-time message, and each real-time message can be monitored in real time, so that it can be processed in time.
[0095] In this embodiment, the input / output process may send multiple inter-process communication messages to the daemon process, and each real-time message is timed separately for a preset time.
[0096] S503. If the first execution result is not received within the preset time, restart the input / output process.
[0097] In this embodiment, if the first execution result is not received within the preset time, it is considered that an irrecoverable blockage has occurred in the inter-process communication channel, and the inter-process communication channel is reset.
[0098] In one example, the method further includes:
[0099] Receiving a first feedback message; wherein, the first feedback message is used to indicate that the inter-process communication message is added to the asynchronous execution linked list;
[0100] Or, receiving a second feedback message; wherein, the second feedback message is used to indicate that other inter-process communication messages are added to the asynchronous execution linked list;
[0101] Or, receiving a third feedback message; wherein, the third feedback message is used to indicate that the inter-process communication messages in the asynchronous execution linked list are executed in parallel in the asynchronous execution linked list.
[0102] In one example, the first feedback message, the second feedback message, and the third feedback message are received at different times, and each feedback message is independent.
[0103] For a clearer illustration, reference may be made to Figure 6 An interaction signaling diagram of an input / output process and a daemon process shown.
[0104] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.
[0105] Specifically, Figure 7 shows a schematic structural diagram of an execution device for inter-process communication messages provided by an embodiment of the present application, which is applied to a daemon process. The device 70 includes:
[0106] A first judgment module 701, configured to judge whether an inter-process communication message sent by an input / output process is received if the asynchronous execution messages in the asynchronous execution linked list are empty;
[0107] The first acquisition module 702 is configured to, if so, acquire the message type of the inter-process communication message;
[0108] The execution module 703 is configured to, if the message type is a real-time message, execute the inter-process communication message to obtain a first execution result, and send the first execution result to the input / output process;
[0109] The first addition module 704 is configured to, if the message type is a non-real-time message, add the inter-process communication message to the asynchronous execution linked list, and send a first feedback message to the input / output process; wherein, the first feedback message is used to indicate that the inter-process communication message is added to the asynchronous execution linked list.
[0110] In one example, after sending the first feedback message to the input / output process, the apparatus 70 further includes:
[0111] The second determination module 705 is configured to determine whether other inter-process communication messages are received;
[0112] The second acquisition module 706 is configured to, if so, acquire the message type of the other inter-process communication messages;
[0113] The return module 707 is configured to, if the message type is a real-time message, execute the other inter-process communication messages to obtain a third execution result, and return the third execution result to the input / output process;
[0114] The second addition module 708 is configured to, if the message type is a non-real-time message, add the other inter-process communication messages to the asynchronous execution linked list, and send a second feedback message to the input / output process; wherein, the second feedback message is used to indicate that the other inter-process communication messages are added to the asynchronous execution linked list; the other inter-process communication messages are executed in parallel in the asynchronous execution linked list to obtain a fourth execution result.
[0115] In one example, after sending the first feedback message to the input / output process, the apparatus 70 further includes:
[0116] The first query module 709 is configured to query the second execution result from the asynchronous execution linked list at a preset frequency, and send the second execution result to the input / output process; wherein, the inter-process communication messages are executed in parallel in the asynchronous execution linked list to obtain the second execution result.
[0117] In one example, after determining whether an inter-process communication message sent by the input / output process is received, the apparatus 70 further includes:
[0118] The control module 710 is configured to, if not, control the daemon process to enter the sleep state until an inter-process communication message is received.
[0119] In one example, the apparatus 70 further includes:
[0120] A third determination module 711, configured to, if the asynchronous execution messages in the asynchronous execution linked list are not empty, send a third feedback message to the input / output process; wherein, the third feedback message is used to indicate that the inter-process communication messages in the asynchronous execution linked list are executed in parallel in the asynchronous execution linked list.
[0121] In one example, after sending the third feedback message to the input / output process, the apparatus 70 further includes:
[0122] A second query module 712, configured to query a fifth execution result from the asynchronous execution linked list at a preset frequency and return the fifth execution result to the input / output process; wherein, the fifth execution result is used to indicate the result of the parallel execution of the inter-process communication messages in the asynchronous execution linked list in the asynchronous execution linked list.
[0123] In this embodiment, for the description of the features corresponding to the embodiment of an apparatus for executing inter-process communication messages, reference may be made to the relevant description of the embodiment of the method for executing inter-process communication messages, which will not be elaborated herein one by one.
[0124] Specifically, Figure 8 FIG. shows a schematic structural diagram of an apparatus for executing inter-process communication messages provided by an embodiment of the present application, which is applied to an input / output process. The apparatus 80 includes:
[0125] A sending module 801, configured to send an inter-process communication message to a daemon process to control the daemon process to execute the inter-process communication message when the message type of the inter-process communication message is a real-time message, obtain a first execution result, and return the first execution result to the input / output process;
[0126] A calling module 802, configured to, if the first execution result is received within a preset time, call a preset service function to process the first execution result to obtain a first service processing result;
[0127] A restart module 803, configured to, if the first execution result is not received within a preset time, restart the input / output process.
[0128] In one example, the apparatus 80 further includes:
[0129] A receiving module 804, configured to receive a first feedback message; wherein, the first feedback message is used to indicate that the inter-process communication message is added to the asynchronous execution linked list;
[0130] Or, receive a second feedback message; wherein, the second feedback message is used to indicate that other inter-process communication messages are added to the asynchronous execution linked list;
[0131] Alternatively, a third feedback message is received; wherein, the third feedback message is used to characterize that the inter-process communication messages in the asynchronous execution linked list are executed in parallel in the asynchronous execution linked list.
[0132] In this embodiment, for the descriptions of the features corresponding to the embodiments of the execution device for inter-process communication messages, reference can be made to the relevant descriptions of the embodiments corresponding to the execution method for inter-process communication messages, which will not be elaborated here one by one.
[0133] An embodiment of the present application further provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any of the above embodiments of the execution method for inter-process communication messages.
[0134] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in any of the above embodiments of the execution method for inter-process communication messages when running.
[0135] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: USB flash drive, read-only memory (ROM for short), random access memory (RAM for short), mobile hard disk, magnetic disk, or optical disc, etc., various media that can store computer programs.
[0136] An embodiment of the present application further provides a computer program product. The above computer program product includes a computer program, and when the computer program is executed by a processor, the steps in any of the above embodiments of the execution method for inter-process communication messages are implemented.
[0137] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above embodiments of the execution method for inter-process communication messages are implemented.
[0138] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the present application.
[0139] The above has introduced in detail a method for executing inter-process communication messages provided by this application. Specific examples are used in this article to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A method for executing inter-process communication messages, characterized in that Applied to a daemon process, the method includes: If the asynchronous execution messages in the asynchronous execution linked list are empty, determine whether an inter-process communication message sent by an input / output process is received; If so, obtain the message type of the inter-process communication message; If the message type is a real-time message, execute the inter-process communication message to obtain a first execution result, and send the first execution result to the input / output process; If the message type is a non-real-time message, add the inter-process communication message to the asynchronous execution linked list, and send a first feedback message to the input / output process; wherein, the first feedback message is used to indicate that the inter-process communication message is added to the asynchronous execution linked list.
2. The method according to claim 1, wherein After sending the first feedback message to the input / output process, the method further includes: Determine whether another inter-process communication message is received; If so, obtain the message type of the other inter-process communication message; If the message type is a real-time message, execute the other inter-process communication message to obtain a third execution result, and return the third execution result to the input / output process; If the message type is a non-real-time message, add the other inter-process communication message to the asynchronous execution linked list, and send a second feedback message to the input / output process; wherein, the second feedback message is used to indicate that the other inter-process communication message is added to the asynchronous execution linked list; the other inter-process communication messages are executed in parallel in the asynchronous execution linked list to obtain a fourth execution result.
3. The method according to claim 1, wherein After sending the first feedback message to the input / output process, the method further includes: Query the second execution result from the asynchronous execution linked list at a preset frequency, and send the second execution result to the input / output process; wherein, the inter-process communication message is executed in parallel in the asynchronous execution linked list to obtain a second execution result.
4. The method according to claim 1, wherein After determining whether an inter-process communication message sent by an input / output process is received, the method further includes: If not, control the daemon process to enter a sleep state until the inter-process communication message is received.
5. The method according to claim 1, wherein The method further includes: If the asynchronous execution messages in the asynchronous execution linked list are not empty, send a third feedback message to the input / output process; wherein, the third feedback message is used to indicate that the inter-process communication messages in the asynchronous execution linked list are executed in parallel in the asynchronous execution linked list.
6. The method according to claim 5, wherein After sending the third feedback message to the input / output process, the method further includes: Query the fifth execution result from the asynchronous execution linked list at a preset frequency, and return the fifth execution result to the input / output process; wherein, the fifth execution result is used to indicate the result of the parallel execution of the inter-process communication messages in the asynchronous execution linked list.
7. A method for executing inter-process communication messages, characterized in that Applied to an input / output process, the method includes: Send an inter-process communication message to the daemon process to control the daemon process to execute the inter-process communication message when the message type of the inter-process communication message is a real-time message, obtain a first execution result, and return the first execution result to the input / output process; If the first execution result is received within a preset time, call a preset service function to process the first execution result to obtain a first service processing result; If the first execution result is not received within a preset time, restart the input / output process.
8. The method according to claim 7, wherein The method further includes: Receiving a first feedback message; wherein, the first feedback message is used to indicate that the inter-process communication message is added to the asynchronous execution linked list; Or, receiving a second feedback message; wherein, the second feedback message is used to indicate that other inter-process communication messages are added to the asynchronous execution linked list; Or, receiving a third feedback message; wherein, the third feedback message is used to indicate that the inter-process communication messages in the asynchronous execution linked list are executed in parallel in the asynchronous execution linked list.
9. An execution device for inter-process communication messages, characterized in that, Applied to a daemon process, the device includes: A first judgment module, configured to judge whether an inter-process communication message sent by an input / output process is received if the asynchronous execution messages in the asynchronous execution linked list are empty; A first acquisition module, configured to, if so, acquire the message type of the inter-process communication message; An execution module, configured to execute the inter-process communication message if the message type is a real-time message, obtain a first execution result, and send the first execution result to the input / output process; A first addition module, configured to, if the message type is a non-real-time message, add the inter-process communication message to the asynchronous execution linked list, and send a first feedback message to the input / output process; wherein, the first feedback message is used to indicate that the inter-process communication message is added to the asynchronous execution linked list.
10. An execution device for inter-process communication messages, characterized in that, Applied to an input / output process, the device includes: A sending module, configured to send an inter-process communication message to a daemon process to control the daemon process to execute the inter-process communication message when the message type of the inter-process communication message is a real-time message, obtain a first execution result, and return the first execution result to the input / output process; A calling module, configured to, if the first execution result is received within a preset time, call a preset service function to process the first execution result to obtain a first service processing result; A restart module, configured to restart the input / output process if the first execution result is not received within a preset time.
11. An electronic device, characterized in that, Includes: A memory, configured to store a computer program; A processor, configured to implement the steps of the method according to any one of claims 1 to 6 or implement the steps of the method according to any one of claims 7 to 8 when executing the computer program.
12. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of the method according to any one of claims 1 to 6 or implements the steps of the method according to any one of claims 7 to 8 when executed by a processor.