An inter-process communication system, method, and computing device

By introducing an inter-process communication system into the file manager, the isolation mechanism of the main process, service process and proxy server is used to solve the problem of stability and resource concentration after accessing third-party plug-ins, and the stability and efficiency improvement is achieved.

CN114020490BActive Publication Date: 2025-06-27UNIONTECH SOFTWARE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111287820.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-30
Publication Date
2025-06-27
Estimated Expiration
2041-08-30

AI Technical Summary

Technical Problem

In the prior art, after accessing a third-party plug-in, the stability of the file manager is affected, and the method of a single process leads to too concentrated resources, affecting the startup and operation efficiency.

Method used

It provides an inter-process communication system that implements plug-in loading and interface calls through the isolation and collaboration of the main process, service process and proxy server, ensuring isolation between the main process and the plug-in.

Benefits of technology

It realizes the stability of the file manager when using third-party plug-ins, avoids the operational instability caused by plug-in exceptions, and reduces the cost of interface development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114020490B_ABST
    Figure CN114020490B_ABST
Patent Text Reader

Abstract

The present invention discloses an inter-process communication system, including: a main process; a service process created based on the main process, the service process being adapted to load one or more plugins and being adapted to receive a first interface call request sent by the plugin; a proxy server, connected to the main process and the service process respectively, being adapted to obtain the first interface call request from the service process, obtain first interface information from the first interface call request, and send the first interface information to the main process so that the main process can call a first interface of the main process based on the first interface information; receive a second interface call request sent by the main process, obtain second interface information from the second interface call request, and send the second interface information to the service process so that the service process can call a second interface of the plugin based on the second interface information. The present invention also discloses a corresponding inter-process communication method and a computing device. According to the technical solution of the present invention, the instability of the application running process caused by plugin exceptions is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the invention patent application No. 2021110006856 filed on August 30, 2021. Technical Field

[0002] The present invention relates to the field of computer technology, and in particular, to an inter-process communication system, an inter-process communication method, and a computing device. Background Art

[0003] Currently, more and more file managers (hereinafter referred to as "file managers") have been implemented in a plug-in manner. For example, the Nautilus file manager on the Linux platform can load C plug-ins or Python script plug-ins. Through this plug-in loading solution, good scalability can be provided for the file manager, and the dynamic expansion of the file manager functions can be realized. However, this solution has certain risks. Since the stability of third-party plug-ins cannot be guaranteed, the stability of the file manager will be affected to a certain extent after the plug-ins are connected.

[0004] For example, in the prior art, there is a solution to achieve the scalability of the file manager function by directly loading dynamic library plug-ins. The method of directly loading dynamic libraries is relatively simple to implement. The plug-in only needs to inherit the general plug-in base class provided by the main framework and implement its own specific business internally. However, this solution cannot guarantee the stability inside the dynamic library. If an error occurs inside the dynamic library, it may cause the file manager to crash. In addition, the single-process method will cause resources such as memory, threads, and dependent libraries to be too concentrated, affecting the startup efficiency and running efficiency of the file manager main process.

[0005] Based on this, there is a need for an inter-process communication system and method to solve the problems existing in the prior art. Summary of the Invention

[0006] Therefore, the present invention provides an inter-process communication system, an inter-process communication method, and a computing device to solve or at least alleviate the problems described above.

[0007] According to one aspect of the present invention, there is provided an inter-process communication system arranged on an operating system of a computing device. The inter-process communication system includes: a main process; a service process created based on the main process, the service process being adapted to load one or more plugins and being adapted to receive a first interface call request sent by a plugin; and a proxy server, respectively connected to the main process and the service process, and being adapted to: obtain the first interface call request from the service process, obtain first interface information from the first interface call request, and send the first interface information to the main process so that the main process can call a first interface of the main process based on the first interface information; receive a second interface call request sent by the main process, obtain second interface information from the second interface call request, and send the second interface information to the service process so that the service process can call a second interface of the plugin based on the second interface information.

[0008] Optionally, in the inter-process communication system according to the present invention, a file manager is included on the operating system, and the main process is the main process of the file manager.

[0009] Optionally, in the inter-process communication system according to the present invention, the file manager includes a corresponding file management interface, and one or more interface controls are included on the file management interface; by calling the first interface, it is adapted to create a new interface control; by calling the second interface, it is adapted to process a trigger event for the interface control.

[0010] Optionally, in the inter-process communication system according to the present invention, the main process is adapted to: receive a trigger operation event for an interface control, and in response to the trigger operation event, send a second interface call request to the proxy server to request to call a second interface corresponding to the interface control to process the trigger operation event.

[0011] Optionally, in the inter-process communication system according to the present invention, the first interface information includes a first target path, a first function name, and a first parameter value; the second interface information includes a second target path, a second function name, and a second parameter value.

[0012] Optionally, in the inter-process communication system according to the present invention, the main process is adapted to: locate a corresponding target interface object based on the first target path, call a corresponding first function in the target interface object based on the first function name, and pass the first parameter value into the first function.

[0013] Optionally, in the inter-process communication system according to the present invention, a first mapping table is included in the main process, and the main process is further adapted to: obtain a corresponding first function pointer from the mapping table based on the first function name, and call the first function based on the first function pointer.

[0014] Optionally, in the inter-process communication system according to the present invention, the service process is adapted to: locate a corresponding target plug-in object based on the second target path, call a corresponding second function in the target plug-in object based on the second function name, and pass the parameter value into the second function.

[0015] Optionally, in the inter-process communication system according to the present invention, the service process includes a second mapping table, and the service process is further adapted to: obtain a corresponding second function pointer from the second mapping table based on the second function name, and call the second function based on the second function pointer.

[0016] Optionally, in the inter-process communication system according to the present invention, the proxy server is connected to the main process and the service process through a bus.

[0017] Optionally, in the inter-process communication system according to the present invention, the main process includes a first data processing module connected to the bus; the service process includes a second data processing module connected to the bus.

[0018] Optionally, in the inter-process communication system according to the present invention, it further includes: a monitoring module, connected to the main process and the service process respectively, adapted to monitor the running state of the service process, wherein the monitoring module is adapted to obtain the termination signal of the service process and send the termination signal to the main process, so as to create a service process again based on the main process.

[0019] Optionally, in the inter-process communication system according to the present invention, the service process is a child process created based on the main process by using the Fork method.

[0020] According to an aspect of the present invention, there is provided an inter-process communication method, which is executed in an inter-process communication system. The method includes the steps of: creating a service process based on a main process; loading one or more plug-ins through the service process and receiving a first interface call request sent by the plug-in; obtaining the first interface call request from the service process through a proxy server, obtaining first interface information from the first interface call request, and sending the first interface information to the main process so that the main process calls a first interface of the main process based on the first interface information; and receiving a second interface call request sent by the main process through the proxy server, obtaining second interface information from the second interface call request, and sending the second interface information to the service process so that the service process calls a second interface of the plug-in based on the second interface information.

[0021] Optionally, in the inter-process communication method according to the present invention, the main process is the main process of a file manager.

[0022] Optionally, in the inter - process communication method according to the present invention, the file manager includes a corresponding file management interface, and one or more interface controls are included on the file management interface; a new interface control is adapted to be created by invoking a first interface; and a trigger event for the interface control is adapted to be processed by invoking a second interface.

[0023] Optionally, in the inter - process communication method according to the present invention, receiving a second - interface call request sent by the main process includes: receiving a second - interface call request sent by the main process in response to a trigger operation event on the interface control.

[0024] Optionally, in the inter - process communication method according to the present invention, the step of creating a service process based on the main process includes: using the Fork method to create a corresponding child process as the service process based on the main process.

[0025] According to one aspect of the present invention, there is provided a computing device, including: at least one processor; a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, and the program instructions include instructions for executing the inter - process communication method as described above.

[0026] According to one aspect of the present invention, there is provided a readable storage medium storing program instructions, which, when read and executed by a computing device, cause the computing device to execute the inter - process communication method as described above.

[0027] According to the technical solution of the present invention, there is provided an inter - process communication system and method. After applications such as a file manager are started, corresponding child processes can be created as service processes based on the main process. The main process and the service process are isolated from each other and interact via a proxy server. The service process is used to load third - party plugins and receive call requests from the plugins to the main - process interface. The interface calls between the service process and the main process are all implemented via the proxy server. Thus, the main process can call the interfaces provided by the plugins in a state isolated from the plugins, ensuring the stability of applications such as the file manager during the use of third - party plugins. In this way, according to the technical solution of the present invention, while applications such as the file manager are extended in function based on third - party plugins, the effect of isolation from the third - party plugins is achieved, avoiding the problem of unstable operation of the file manager due to abnormalities of the third - party plugins. In addition, the main process and the service process communicate via a proxy server, enabling the main process and the service process to share most interfaces, thereby reducing the interface development cost.

[0028] Further, the monitoring module can monitor and obtain the termination signal of the service process. By sending the termination signal to the main process, the service process can be created again based on the main process. In this way, the service process can be restarted after crashing and terminating, further improving the stability of applications such as the file manager.

[0029] The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable, the following specific embodiments of the present invention are specifically given. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] To achieve the above and related purposes, certain illustrative aspects are described herein in connection with the following description and drawings, which indicate various ways in which the principles disclosed herein can be practiced, and all aspects and their equivalent aspects are intended to fall within the scope of the claimed subject matter. By reading the following detailed description in conjunction with the drawings, the above and other purposes, features and advantages of the present disclosure will become more apparent. Throughout the present disclosure, like reference numerals generally refer to like components or elements.

[0031] Figure 1 FIG. 1 shows a schematic diagram of an inter-process communication system 100 according to an embodiment of the present invention;

[0032] Figure 2 FIG. 2 shows a schematic diagram of a computing device 200 according to an embodiment of the present invention;

[0033] Figure 3 FIG. 3 shows a schematic diagram of a document management interface according to an embodiment of the present invention; and

[0034] Figure 4 FIG. 4 shows a flowchart of an inter-process communication method 400 according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0035] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art.

[0036] In view of the instability problems existing in the implementation solution of the file manager plug-in in the prior art, the present invention proposes an inter-process communication solution, which can be used for the interaction between processes of applications such as file managers. Among them, the main process of the application is isolated from the service process and communicates via the proxy server. In this way, not only can the function of the application be extended by using third-party plug-ins, but also the effect of isolation from the third-party plug-ins can be achieved, avoiding the instability of the application during operation due to the abnormality of the third-party plug-ins.

[0037] Figure 1 FIG. shows a schematic diagram of an inter-process communication system 100 according to an embodiment of the present invention. The inter-process communication system 100 is arranged on the operating system of the computing device.

[0038] As Figure 1 shown, the inter-process communication system 100 includes a main process 110 of the application, a service process 120 created based on the main process, and a proxy server 130. Among them, the main process 110 and the service process 120 are isolated from each other, and the main process 110 and the service process 120 are respectively connected to the proxy server 130. In this way, the main process 110 and the service process 120 can communicate through the proxy server 130.

[0039] According to an embodiment of the present invention, one or more applications can run on the operating system of the computing device, and the applications include, for example, file managers. The main process 110 in the inter-process communication system 100 can be the main process of any application running on the operating system, for example, the main process of the file manager. And, after the application is started, a corresponding child process can be created based on the main process 110 as the service process 120. The main process 110 of the application is isolated from the service process 120 and can communicate via the proxy server 130. It should be noted that the present invention does not limit the types of applications, and the inter-process communication system 100 of the present invention can be used for various types of applications so that the application main process can use the plug-ins in a state isolated from the third-party plug-ins.

[0040] According to an embodiment of the present invention, an application on an operating system includes a file manager. The main process 110 in the inter-process communication system 100 can be implemented as the main process of the file manager, so that the inter-process communication system 100 is used for data interaction between file manager processes. After the file manager is started, it can use the Fork method to create corresponding child processes as service processes 120 based on the main process 110, that is, the service process 120 is a child process created based on the main process 110 using the Fork method. Moreover, the main process 110 of the file manager communicates with the service process 120 via the proxy server 130. In this way, the plug-in of the file manager can be realized while isolating third-party plug-ins, and the problem of unstable operation of the file manager during use due to abnormal third-party plug-ins can be avoided.

[0041] In the following, only the file manager is taken as an example to describe the inter-process communication system 100 of the present invention in detail. However, it should be noted that the inter-process communication system 100 of the present invention can be used for data interaction between various types of application processes.

[0042] Among them, the service process 120 is connected to an external plug-in library, and one or more third-party plug-ins (hereinafter referred to as "plug-ins") in the plug-in library can be loaded through the service process 120. In this way, the present invention not only realizes the plug-in of the file manager and expands the functions of the file manager by loading plug-ins through the service process created based on the main process, but also realizes the reuse of some logics, and only one set of program codes needs to be maintained. It should be noted that the present invention is not limited to the specific type of plug-ins and the extended functions of the file manager implemented based on the plug-ins.

[0043] In an embodiment, the proxy server 130, the main process 110, and the service process 120 are respectively connected to the DBus bus, so that the proxy server 130 can communicate with the main process 110 and the service process 120 through the DBus bus. Based on the proxy server, most interfaces can be shared between the main process 110 and the service process 120, and different logics are only needed during the interface call process, thereby reducing the interface development cost. As Figure 1 shown, both the main process 110 and the service process 120 include a module for implementing communication data processing. Among them, the main process 110 includes a first data processing module 111 connected to the DBus bus, and the service process 120 includes a second data processing module 122 connected to the DBus bus. In this way, the main process 110 can perform data interaction with the DBus bus through the first data processing module 111, and the service process 120 can perform data interaction with the DBus bus through the second data processing module 122.

[0044] It should be noted that the first data processing module 111 and the second data processing module 122 both inherit from the base classes related to DBus. In addition, the first data processing module 111 and the second data processing module 122 can both implement one or more data processing interfaces. Due to inheriting the base classes of DBus, these data processing interfaces can be registered on the DBus bus so as to provide these data processing interfaces for other processes to call.

[0045] In one embodiment, the application includes a corresponding application interface for the user to interact with the application based on the application interface. One or more interface controls may be included on the application interface, and the user can trigger corresponding events by operating these interface controls.

[0046] In one implementation, the file manager includes a corresponding file management interface for the user to interact with the file manager based on the file management interface. One or more interface controls may be included on the file management interface, such as controls in the left sidebar, right sidebar, toolbar, etc. The user can trigger corresponding events by operating these interface controls. Hereinafter, only the file management interface is taken as an example to detail the processing mechanism of the interface control triggering events. However, it should be noted that the file management interface is the application interface corresponding to the file manager. When the inter-process communication system 100 of the present invention is applied to other applications, it can be correspondingly replaced with the interfaces of other applications.

[0047] It should be noted that according to the technical solution of the present invention, in order to realize the plug-in of applications such as the file manager and extend the functions of the file manager based on the plug-in, the main process of the file manager (application side) needs to provide some interfaces to the outside, which may specifically include interfaces for creating new interface controls on the file management interface, so that the plug-in can call this interface to create new interface controls corresponding to the plug-in on the file management interface, such as adding new entries to the sidebar of the file management interface, adding new tools to the toolbar, etc. In this way, the user can use the corresponding extended functions implemented based on the plug-in by operating the new interface controls. For the plug-in, it needs to call the interfaces provided by the main process of the file manager. Here, the interfaces provided by the main process are called "first interfaces".

[0048] In addition, after creating interface controls corresponding to the extended functions implemented by the plug-in on the file management interface, when the user triggers the corresponding interface controls when needing to use the extended functions, the main process of the file manager will process the triggering events of the interface controls, and the specific extended functions need to be implemented by the plug-in. Based on this, the main process of the file management needs to send the triggering event information of the interface controls to the inside of the plug-in and process the triggering events of the interface controls by calling the interfaces inside the plug-in. Here, the interfaces provided by the plug-in are called "second interfaces".

[0049] According to the inter-process communication system 100 of the present invention, the plugin can call the first interface provided by the main process of the file manager (application side), and the main process of the file manager can call the second interface in the plugin.

[0050] In an embodiment of the present invention, after creating the service process 120 based on the main process 110 of the file manager, the service process 120 can load one or more plugins from the plugin library. After loading the plugins, the plugins send a first interface call request to the service process 120 to request to call the first interface of the main process of the file manager. In one embodiment, a new interface control corresponding to the plugin can be created by calling the first interface, and the new interface control can be displayed on the file management interface.

[0051] As described above, the service process 120 can communicate with the main process 110 through the proxy server 130. Based on this, after receiving the first interface call request sent by the plugin, the service process 120 can send the first interface call request to the proxy server 130, so as to communicate with the main process 110 via the proxy server 130 to implement the call of the first interface of the main process. Specifically, the proxy server 130 can obtain the first interface information from the first interface call request and package and send the first interface information to the main process 110, so that the main process 110 can call the first interface of the main process of the file manager based on the first interface information. A new interface control corresponding to the plugin can be created by calling the first interface, and the new interface control can be displayed on the file management interface.

[0052] In one embodiment, after creating a new interface control corresponding to the plugin by calling the first interface, one or more new interface controls corresponding to one or more plugins are displayed on the file management interface. When the user operates any interface control on the interface, the main process 110 of the file manager can receive the trigger operation event of the user on the interface control. If the user triggers a new interface control created by the plugin (i.e., the third-party plugin) by calling the first interface, after receiving the trigger operation event of the user on the interface control, the main process 110 will request to call the second interface in the plugin corresponding to the triggered interface control.

[0053] Specifically, based on the fact that the main process 110 can communicate with the service process 120 through the proxy server 130, the main process 110 can send a second interface call request to the proxy server 130 in response to the trigger operation event of the user on the interface control, to request to call the second interface corresponding to the interface control, so as to process the trigger operation event of the interface control by calling the second interface. Here, it should be noted that the interface control here is created based on the plugin, and the second interface corresponding to the interface control is the event processing interface provided by the plugin for processing the trigger operation event of the interface control.

[0054] In an embodiment of the present invention, when the proxy server 130 receives the second interface call request sent by the main process 110, it can send the second interface call request to the proxy server 130, so as to communicate with the service process 120 via the proxy server 130 to implement the call of the second interface in the plugin. Specifically, the proxy server 130 can obtain the second interface information from the second interface call request, and package and send the second interface information to the service process 120, so that the service process 120 can call the second interface provided by the plugin based on the second interface information.

[0055] In one embodiment, the first interface information obtained by the proxy server 130 from the first interface call request includes a first source path, a first target path, a first function name, and a first parameter value, and the obtained first target path, first function name, and first parameter value are packaged and sent to the main process 110 via the DBus bus. Here, the first target path is the path corresponding to the target interface object. It should be noted that the interface object is an instance object corresponding to the interface control, and the target interface object is the interface object corresponding to the new interface control to be created by the plugin.

[0056] After obtaining the first interface information, the main process 110 can locate the corresponding target interface object based on the first target path, and call the corresponding first function (the function corresponding to the first interface) in the target interface object based on the first function name. When calling the first function, the first parameter value is passed into the first function, thereby realizing the call of the first function, and the result returned by the first function can be obtained. Here, the execution result of the first function can be to create a new interface control corresponding to the plugin and display the new interface control on the document management interface. In this way, the process of a third-party plugin calling the first interface provided by the file manager is realized according to the inter-process communication system 100 of the present invention.

[0057] In one embodiment, the second interface information obtained by the proxy server 130 from the second interface call request includes a second source path, a second target path, a second function name, and a second parameter value, and the obtained second target path, second function name, and second parameter value are packaged and sent to the service process 120 via the DBus bus. Here, the second target path is the path corresponding to the target plugin object. It should be noted that the target plugin object is an instance object of the plugin corresponding to the interface control triggered by the user.

[0058] After obtaining the second interface information, the service process 120 can locate the corresponding target plug-in object based on the second target path, call the second function in the target plug-in object based on the second function name, and pass the parameter value to the second function when calling the second function, so as to implement the call of the second function, and the result returned by the second function can be obtained. That is, the trigger operation event of the processing interface control is implemented by calling the second function. In this way, the file management main process can call the second interface provided by the plug-in in a state isolated from the plug-in according to the inter-process communication system 100 of the present invention, thereby ensuring the stability of the file manager during the use of the third-party plug-in.

[0059] Figure 3 FIG. shows a schematic diagram of a file management interface according to an embodiment of the present invention. As Figure 3 shown, the left side of the file management interface includes a sidebar, which includes a plurality of sidebar items, such as recently used, main directory, desktop, video, picture, music, document, download, recycle bin, computer, system disk, data disk, etc.

[0060] In one implementation, the first interface can be implemented as an interface for adding an item to the sidebar. Specifically, when the plug-in needs to add an item to the sidebar on the file management interface, it first locates the Sidebar object in the service process 120, requests to call the addItem interface in the Sidebar object, and passes in the relevant parameters of the Item, such as the item name and other attributes. Subsequently, the Sidebar object determines whether to use the proxy logic according to the flag bit. If the flag bit is true, it enters the proxy logic and sends the call request for the addItem interface to the proxy server 120. The proxy server 130 obtains the interface information such as the source path, target path, function name, and input parameters from the interface call request, and packages and sends the interface information to the main process 110 of the file manager. After the main process 110 implements the call of the corresponding add item interface based on the interface information, a new sidebar item can be added to the file management interface, and the user can operate the new sidebar item by clicking or other means.

[0061] It should be noted that the newly added Sidebar Item object can be obtained through the Sidebar object. The Sidebar Item object can register a Handle object for responding to and processing the trigger event of the sidebar item.

[0062] When the user operates on the newly added sidebar entry, the main process 110 can, through the Handle object, respond to the triggering operation event of the user on the sidebar entry, and will judge the current Fork flag. If the flag is true, it will send a call request (the second interface call request) for the interface of the corresponding plugin to the proxy server 130 to request to call the interface (the second interface) of the plugin corresponding to the sidebar entry. The proxy server 130 obtains interface information such as the source path, target path, function name, and input parameters from the interface call request, and packages and sends the interface information to the service process 120. After receiving the interface information, the service process 120 implements the call of the interface of the corresponding plugin based on the interface information, so as to implement the processing of the triggering operation event of the sidebar entry.

[0063] In one implementation, the main process 110 of the file manager defines a member variable of the type Map<URL, Object> and stores the interface objects corresponding to one or more interface controls on the file management interface based on this variable, so that the main process 110 can locate the corresponding interface object based on the URL path. For example, the first target path can be implemented as ui: / / / window / sidebar, and correspondingly, the target interface object stored in the Map can be implemented as insert(“ui: / / / window / sidebar”, sidebarObject). In this way, the corresponding target interface object can be located based on the first target path.

[0064] Correspondingly, the service process 120 can also store one or more plugin objects through a member variable of the type Map<URL, Object>, so that the service process 120 can locate the corresponding plugin object based on the URL path. The corresponding target plugin object can be located based on the second target path.

[0065] Here, take ui: / / / window / sidebar as an example to illustrate the path of the object. In ui: / / / window / sidebar, "ui" is the sheme field, and the sheme is specifically defined according to different scenarios. In the embodiments of the present invention, "ui" is used to represent the positioning interface object, and "plugin" is used to represent the positioning plugin object. In addition, "sidebar" is used to identify the name of the final object. Here, sidebar represents the sidebar object of the document management. "window" is the parent set of "sidebar". In the URL, the set on the left contains the set or object on the right. For example, for the URL "ui: / / / window / toolbar / addressbar", the addressbar object belongs to the toolbar set, and the toolbar set belongs to the window set. By using the URL method, the problem of duplicate search paths can be effectively avoided, and it is also more intuitive.

[0066] It should be noted that since functions cannot be directly called between two processes, according to the technical solution of the present invention, the proxy server 130 realizes the function call by sending the function name and parameter values of the function to be called. In addition, a corresponding mapping table needs to be established at the receiving end (main process, service process) based on the function names and function pointers in their respective objects (interface object, plugin object). In this way, when receiving the call request sent by the proxy server 130, after determining the target object based on the target path, the corresponding function pointer can be queried from the mapping table based on the received function name, and the function can be called based on the function pointer and the corresponding parameter values can be passed in to realize the function call.

[0067] Among them, the main process 110 establishes a corresponding first mapping table based on the interface objects corresponding to each interface control stored and the function names and function pointers of the functions in the interface objects. In the first mapping table, a one-to-one mapping relationship is established between the function names in the interface objects and the function pointers. In this way, the main process 110 includes a pre-established first mapping table. After obtaining the first interface information and locating the target interface object based on the first target path, the corresponding first function pointer can be obtained from the first mapping table based on the first function name, and the first function can be called based on the first function pointer.

[0068] The service process 120 establishes a corresponding second mapping table based on the function names and function pointers of the functions in each stored plug-in object. In the second mapping table, a one-to-one mapping relationship is established between the function names and function pointers in the plug-in object. In this way, the service process 120 includes a pre-established second mapping table. After obtaining the second interface information and locating the target plug-in object based on the second target path, the corresponding second function pointer can be obtained from the second mapping table based on the second function name, and the second function can be called based on the second function pointer.

[0069] According to one embodiment, the inter-process communication system further includes a monitoring module 150. The monitoring module 150 is respectively connected to the main process 110 and the service process 120, and is adapted to monitor the running state of the service process 120 and obtain the signal of the service process 120. When the service process 120 crashes due to an exception, the monitoring module 150 can obtain the termination signal of the service process 120 and send the termination signal to the main process 110, so as to create the service process again based on the main process. In this way, it can be realized that the service process is restarted after crashing and terminating its operation, further improving the stability of applications such as file managers.

[0070] According to the inter-process communication system 100 of the present invention, applications such as file managers can create corresponding child processes as service processes based on the main process after startup. The main process and the service process are isolated from each other and interact via a proxy server. The service process is used to load third-party plug-ins and receive call requests from the plug-ins to the main process interface. The interface calls between the service process and the main process are all realized via the proxy server. Thus, it can be realized that the main process calls the interface provided by the plug-in in a state isolated from the plug-in, ensuring the stability of applications such as file managers during the use of third-party plug-ins. In this way, according to the technical solution of the present invention, while realizing function expansion based on third-party plug-ins in applications such as file managers, the effect of isolation from third-party plug-ins is achieved, avoiding the problem of unstable operation of the file manager due to exceptions of third-party plug-ins. In addition, the communication between the main process and the service process via the proxy server enables the main process and the service process to share most interfaces, thereby reducing the interface development cost.

[0071] Figure 2 FIG. shows a schematic diagram of a computing device 200 according to an embodiment of the present invention.

[0072] As Figure 2 shown, in the basic configuration 202, the computing device 200 typically includes a system memory 206 and one or more processors 204. The memory bus 208 can be used for communication between the processor 204 and the system memory 206.

[0073] Depending on the desired configuration, processor 204 can be any type of processor, including but not limited to: a microprocessor (UP), a microcontroller (UC), a digital information processor (DSP), or any combination thereof. Processor 204 can include one or more levels of cache, such as level one cache 210 and level two cache 212, a processor core 214, and registers 216. Exemplary processor core 214 can include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. Exemplary memory controller 218 can be used with processor 204, or in some implementations, memory controller 218 can be an internal part of processor 204.

[0074] Depending on the desired configuration, system memory 206 can be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. System memory 206 can include an operating system 220, one or more applications 222, and program data 224. Applications 222 are actually multiple program instructions that are used to direct processor 204 to perform corresponding operations. In some embodiments, applications 222 can be arranged to cause processor 204 to operate on program data 224 on top of the operating system.

[0075] Computing device 200 further includes storage device 232, which includes removable storage 236 and non-removable storage 238.

[0076] Computing device 200 can also include a storage interface bus 234. Storage interface bus 234 enables communication from storage device 232 (e.g., removable storage 236 and non-removable storage 238) via bus / interface controller 230 to basic configuration 202. At least a portion of operating system 220, applications 222, and data 224 can be stored on removable storage 236 and / or non-removable storage 238, and when computing device 200 is powered on or an application 222 is to be executed, it is loaded into system memory 206 via storage interface bus 234 and executed by one or more processors 204.

[0077] The computing device 200 may also include an interface bus 240 that facilitates communication from various interface devices (e.g., output device 242, peripheral interface 244, and communication device 246) to the basic configuration 202 via the bus / interface controller 230. Example output devices 242 include a graphics processing unit 248 and an audio processing unit 250. They may be configured to facilitate communication with various external devices such as a display or speakers via one or more A / V ports 252. Example peripheral interfaces 244 may include a serial interface controller 254 and a parallel interface controller 256, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.) via one or more I / O ports 258. Example communication device 246 may include a network controller 260, which may be arranged to facilitate communication with one or more other computing devices 262 via one or more communication ports 264 over a network communication link.

[0078] The network communication link may be an example of a communication medium. A communication medium typically may embody computer readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery medium. A "modulated data signal" may be a signal that has one or more of its data set or its changes set in a manner that encodes information in the signal. By way of non-limiting example, the communication medium may include wired media such as a wired network or a dedicated line network, as well as various wireless media such as sound, radio frequency (RF), microwave, infrared (IR), or other wireless media. The term computer readable medium as used herein may include both storage media and communication media.

[0079] In an embodiment according to the present invention, the computing device 100 is configured to execute an inter-process communication method 400 according to the present invention. Multiple program instructions for executing the inter-process communication method 400 according to the present invention are included on the operating system of the computing device 100, such that the inter-process communication method 400 according to the present invention can be executed in the operating system of the computing device 100.

[0080] According to an embodiment of the present invention, an inter-process communication system 100 resides in the computing device 200, and the inter-process communication system 100 is arranged on the operating system of the computing device 200. The inter-process communication system 100 includes multiple program instructions for executing the inter-process communication method 400, and these program instructions may instruct the processor 204 to execute the inter-process communication method 400 according to the present invention, such that the inter-process communication method 400 according to the present invention can be executed in the inter-process communication system 100.

[0081] In an embodiment according to the present invention, one or more applications can run on the operating system of the computing device 200, which may include a file manager. The inter-process communication system 100 includes a main process 110 of the application, a service process 120 created based on the main process, and a proxy server 130. Among them, the main process 110 and the service process 120 are isolated from each other, and the main process 110 and the service process 120 are respectively connected to the proxy server 130. In this way, the main process 110 and the service process 120 can communicate through the proxy server 130. The main process 110 in the inter-process communication system 100 can be the main process of any application running on the operating system.

[0082] In one embodiment, the main process 110 can be implemented as the main process of the file manager, so that the inter-process communication method 400 of the present invention can be used for data interaction between file manager processes.

[0083] Figure 4 The flowchart of the inter-process communication method 400 according to an embodiment of the present invention is shown. The method 400 is adapted to be executed in the inter-process communication system 100.

[0084] As Figure 4 shown, the method 400 starts from step S410.

[0085] In step S410, a service process is created based on the main process 110. Here, after the application (such as a file manager) is started, it can use the Fork method to create a corresponding child process as the service process 120 based on the main process 110.

[0086] Subsequently, in step S420, one or more plugins are loaded from an external plugin library through the service process 120, and then a first interface call request sent by the plugin is received.

[0087] Subsequently, in step S420, the first interface call request is obtained from the service process through the proxy server 130, the first interface information is obtained from the first interface call request, and the first interface information is sent to the main process so that the main process 110 can call the first interface of the main process based on the first interface information.

[0088] Finally, in step S440, the second interface call request sent by the main process is received through the proxy server 130, the second interface information is obtained from the second interface call request, and the second interface information is sent to the service process so that the service process 120 can call the second interface of the plugin based on the second interface information.

[0089] In one implementation, the file manager includes a corresponding file management interface for the user to interact with the file manager based on the file management interface. One or more interface controls may be included on the file management interface, such as controls in the left sidebar, right sidebar, toolbar, etc. The user can trigger corresponding events by operating these interface controls.

[0090] In one embodiment, a new interface control corresponding to the plugin can be created by calling the first interface and displayed on the file management interface. The trigger operation event of the user on the interface control can be processed by calling the second interface.

[0091] Specifically, the main process 110 can respond to the trigger operation event of the user on the interface control and send a second interface call request to the proxy server 130 to request to call the second interface corresponding to the interface control, so as to process the trigger operation event of the interface control by calling the second interface. It should be noted that the interface control here can be created based on the plugin, and the second interface corresponding to the interface control is an event processing interface provided by the plugin for processing the trigger operation event of the interface control.

[0092] The proxy server 130 can receive the second interface call request sent by the main process in response to the trigger operation event of the interface control. Subsequently, the proxy server 130 can send the second interface call request to the proxy server 130 to communicate with the service process 120 via the proxy server 130 to implement the call of the second interface in the plugin. Specifically, the proxy server 130 can obtain the second interface information from the second interface call request and package and send the second interface information to the service process 120, so that the service process 120 can call the second interface provided by the plugin based on the second interface information.

[0093] It should be noted that in steps S410 - S440, the specific communication logic and implementation manner among the main process 110, the service process 120, and the proxy server 130 refer to the specific description of the inter - process communication system 100 above and will not be repeated here.

[0094] The various technologies described here can be implemented in combination with hardware or software, or a combination of them. Thus, the method and device of the present invention, or certain aspects or parts of the method and device of the present invention, may take the form of program code (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, USB flash drive, floppy disk, CD - ROM, or any other machine - readable storage medium. When the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.

[0095] When the program code is executed on a programmable computer, a mobile terminal generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memories and / or storage elements), at least one input device, and at least one output device. Among them, the memory is configured to store the program code; the processor is configured to execute the inter-process communication method of the present invention according to the instructions in the program code stored in the memory.

[0096] By way of example, and not limitation, a readable medium includes a readable storage medium and a communication medium. A readable storage medium stores information such as computer-readable instructions, data structures, program modules, or other data. A communication medium generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and includes any information delivery medium. A combination of any of the above is also included within the scope of the readable medium.

[0097] In the specification provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other device. A variety of general-purpose systems may also be used with the examples of the present invention. Based on the above description, the structure required to construct such a system is obvious. In addition, the present invention is not directed to any particular programming language. It should be understood that the content of the present invention described herein can be implemented using various programming languages, and the description of a particular language above is for disclosing the best mode of the present invention.

[0098] In the specification provided herein, a large number of specific details are set forth. However, it can be understood that the embodiments of the present invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0099] Similarly, it should be understood that, in order to streamline this disclosure and assist in understanding one or more of the various inventive aspects, in the above description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, the disclosed method should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Thus, the claims following the detailed description are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate embodiment of the present invention.

[0100] Those skilled in the art should understand that the modules or units or components of the devices in the examples disclosed herein can be arranged in the devices as described in the embodiments, or alternatively can be located in one or more devices different from the devices in the examples. The modules in the foregoing examples can be combined into one module or further can be divided into multiple sub-modules.

[0101] Those skilled in the art can understand that the modules in the devices of the embodiments can be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and further can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, any combination can be adopted to combine all the features disclosed in this specification (including the accompanying claims, abstract and drawings) and all the processes or units of any method or device thus disclosed. Unless otherwise explicitly stated, each feature disclosed in this specification (including the accompanying claims, abstract and drawings) can be replaced by an alternative feature that provides the same, equivalent or similar purpose.

[0102] In addition, those skilled in the art can understand that although some of the embodiments described herein include certain features included in other embodiments rather than other features, the combination of the features of different embodiments means that it is within the scope of the present invention and forms different embodiments.

[0103] In addition, some of the embodiments herein are described as combinations of methods or method elements that can be implemented by a processor of a computer system or by other devices performing the functions. Therefore, a processor having the necessary instructions for implementing the method or method element forms a device for implementing the method or method element. In addition, the elements described herein in the device embodiments are examples of the following devices: the device is used to implement the functions performed by the elements for the purpose of implementing the invention.

[0104] As used herein, unless otherwise specified, the use of ordinal numbers "first", "second", "third", etc. to describe ordinary objects only indicates different instances of similar objects and does not intend to imply that the objects so described must have a given order in terms of time, space, sorting, or in any other way.

[0105] Although the present invention has been described in terms of a limited number of embodiments, those skilled in the art, having the benefit of the foregoing description, will appreciate that other embodiments can be devised within the scope of the invention as thus described. In addition, it should be noted that the language used in this specification has been principally selected for readability and instructional purposes and not to limit or define the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. For the scope of the present invention, the disclosure of the present invention is illustrative and not restrictive, and the scope of the present invention is defined by the appended claims.

Claims

1. An inter - process communication system is arranged on the operating system of a computing device. The operating system includes a file manager, the file manager includes a corresponding file management interface, and the file management interface includes a plurality of interface controls. The inter - process communication system includes: The main process of the file manager, which is adapted to receive a trigger operation event of an interface control. In response to the trigger operation event, it sends a second interface call request to a proxy server to request to call a second interface corresponding to the interface control to process the trigger operation event; A service process created by the file manager based on the main process using the Fork method after startup. The service process is adapted to load one or more plugins and is adapted to receive a first interface call request sent by the plugin; And A proxy server, which is connected to the main process and the service process respectively, and is adapted to: Obtain a first interface call request from the service process, obtain first interface information from the first interface call request, and send the first interface information to the main process, so that the main process calls the first interface of the main process based on the first interface information to create a new interface control through the first interface; Receive a second interface call request sent by the main process, obtain second interface information from the second interface call request, and send the second interface information to the service process, so that the service process calls the second interface of the plugin based on the second interface information to process the trigger event of the interface control through the second interface.

2. The system according to claim 1, wherein The first interface information includes a first target path, a first function name, and a first parameter value; The second interface information includes a second target path, a second function name, and a second parameter value.

3. The system according to claim 2, wherein The main process is adapted to: Locate a corresponding target interface object based on the first target path, call a corresponding first function in the target interface object based on the first function name, and pass the first parameter value into the first function.

4. The system according to any one of claims 1 - 3, wherein The proxy server is connected to the main process and the service process through a bus; The main process includes a first data - processing module, and the first data - processing module is connected to the bus; the service process includes a second data - processing module, and the second data - processing module is connected to the bus.

5. The system according to any one of claims 1-3, wherein, It further includes: A monitoring module, which is connected to the main process and the service process respectively, and is adapted to monitor the running state of the service process. Among them, the monitoring module is adapted to obtain a termination signal of the service process and send the termination signal to the main process, so as to create a service process again based on the main process.

6. An inter - process communication method is executed in an inter - process communication system. The inter - process communication system is arranged on the operating system of a computing device. The operating system includes a file manager, the file manager includes a corresponding file management interface, and the file management interface includes a plurality of interface controls. The method includes the steps: After starting up, the file manager uses the Fork method to create a service process based on the main process of the file manager. The main process is adapted to receive a trigger operation event for an interface control. In response to the trigger operation event, a second interface call request is sent to the proxy server to request to call a second interface corresponding to the interface control to process the trigger operation event; Load one or more plugins through the service process and receive a first interface call request sent by the plugin; Obtain the first interface call request from the service process through the proxy server, obtain first interface information from the first interface call request, and send the first interface information to the main process so that the main process can call the first interface of the main process based on the first interface information to create a new interface control through the first interface; And Receive the second interface call request sent by the main process through the proxy server, obtain second interface information from the second interface call request, and send the second interface information to the service process so that the service process can call the second interface of the plugin based on the second interface information to process the trigger event for the interface control through the second interface.

7. A computing device, comprising: At least one processor; And A memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, and the program instructions include instructions for performing the method according to claim 6.

8. A readable storage medium storing program instructions, when the program instructions are read and executed by a computing device, causing the computing device to execute the method according to claim 6.

Citation Information

Patent Citations

  • Implementation method for plug-in type development of desktop application

    CN105912366A

  • Webpage element acquisition method and device

    CN108959062A