Inter-process communication method and device and electronic equipment
By listening to the key press information of the target application and encoding it into key press sequences, and leveraging the key event listening feature of the target plugin, inter-process communication between the external program and the plugin is realized, solving the communication limitation problem in the plugin system and expanding the plugin's functionality.
Patent Information
- Application Number
- CN202510655062.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-10-28
AI Technical Summary
In game plugin systems, plugins cannot directly communicate with external programs using traditional inter-process communication mechanisms, resulting in a lack of effective technical means.
By monitoring the key press information of the target application and utilizing the key event monitoring feature of the target plugin, the information is encoded into a key sequence, and the external program simulates key events to achieve inter-process communication.
Bypassing the limitations of traditional inter-process communication mechanisms, it enables effective communication between external programs and target plugins, thus expanding the functionality of plugins.
Smart Images

Figure CN120849150A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of communication technology, and in particular to an inter-process communication method, apparatus and electronic device. Background Technology
[0002] In a game's plugin system, plugins are scripts and programs written by players or developers. They utilize the game's APIs to implement various functions, such as interface optimization, information prompts, and task assistance. However, for security reasons, games strictly limit the capabilities of plugins. Plugins can only access a limited set of game APIs and cannot directly use inter-process communication mechanisms at the operating system or network layer. Therefore, traditional inter-process communication methods are unsuitable for scenarios involving communication between external programs and plugins. Summary of the Invention
[0003] The purpose of this disclosure is to provide an inter-process communication method, apparatus, and electronic device to enable communication between different processes.
[0004] In a first aspect, this disclosure provides an inter-process communication method. This method is applied to a target plugin, which communicates with a target application, and the target application communicates with an external program. The target plugin is used to: listen for key events and extend specified functions for the target application. The method includes: listening for key information input in a graphical user interface provided by the target application; in response to listening for specified key information, converting the specified key information into target binary data; wherein the input method for the specified key information is: after the external program converts the target information into target binary data, it sequentially simulates key events for each binary bit in the target binary data to input the specified key information corresponding to each binary bit into the graphical user interface; determining the target information sent by the external program based on the target binary data; and executing corresponding target interactive behaviors according to the target information; wherein different information sent by the external program is configured with corresponding interactive behaviors.
[0005] Secondly, this disclosure provides an inter-process communication method. This method is applied to an external program, which communicates with a target application, and the target application communicates with a target plugin. The method includes: when the external program sends target information to the target plugin, converting the target information into target binary data; sequentially simulating key events for each binary bit in the target binary data, inputting specified key information corresponding to each binary bit into the graphical user interface provided by the target application; when the target plugin detects the input of specified key information in the graphical user interface, converting the specified key information into target binary data through the target plugin, determining the target information sent by the external program based on the target binary data, and executing corresponding target interactive behaviors according to the target information; wherein different information sent by the external program is configured with corresponding interactive behaviors.
[0006] Thirdly, this disclosure provides an inter-process communication device. This device is located in a target plugin, which is communicatively connected to a target application. The target application is communicatively connected to an external program. The target plugin is used to: listen for key events and extend specified functions for the target application. The device includes: an information listening module for listening to key information input in the graphical user interface provided by the target application; a data conversion module for converting specified key information into target binary data in response to the detected key information; wherein the input method of the specified key information is: after the external program converts the target information into target binary data, it sequentially simulates key events for each binary bit in the target binary data to input the specified key information corresponding to each binary bit into the graphical user interface; an information determination module for determining the target information sent by the external program based on the target binary data; and a behavior execution module for executing corresponding target interactive behaviors according to the target information; wherein different information sent by the external program is configured with corresponding interactive behaviors.
[0007] Fourthly, this disclosure provides an inter-process communication device. This device is located in an external program, which communicates with a target application, and the target application communicates with a target plugin. The device includes: a data conversion module, used to convert target information into target binary data when the external program sends target information to the target plugin; a key event simulation module, used to sequentially simulate key events for each binary bit in the target binary data, inputting specified key information corresponding to each binary bit into the graphical user interface provided by the target application; and a communication interaction module, used to convert the specified key information into target binary data through the target plugin when the target plugin detects the input of specified key information in the graphical user interface, and determine the target information sent by the external program based on the target binary data, and execute corresponding target interactive behaviors according to the target information; wherein different information sent by the external program is configured with corresponding interactive behaviors.
[0008] Fifthly, this disclosure provides an electronic device including a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the aforementioned inter-process communication method.
[0009] In a sixth aspect, this disclosure provides a computer-readable storage medium storing computer-executable instructions that, when invoked and executed by a processor, cause the processor to implement the aforementioned inter-process communication method.
[0010] The embodiments disclosed herein bring the following beneficial effects:
[0011] This disclosure provides an inter-process communication method, apparatus, and electronic device. The target plugin first listens to key input in the graphical user interface provided by the target application; then, in response to listening to specified key input, it converts the specified key input into target binary data. The input method for the specified key input is as follows: after the external program converts the target information into target binary data, it sequentially simulates key events for each binary bit in the target binary data to input the specified key input corresponding to each binary bit into the graphical user interface; then, it determines the target information sent by the external program based on the target binary data; and executes the corresponding target interactive behavior according to the target information. Different information sent by the external program is configured with corresponding interactive behaviors. This method utilizes the target plugin's ability to listen to key events, simulates specific key events by the external program, encodes the information into a key sequence, and the plugin reconstructs the information by decoding the key sequence, thereby achieving inter-process communication between the external program and the target plugin.
[0012] Other features and advantages of this disclosure will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.
[0013] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0014] To more clearly illustrate the technical solutions in the specific embodiments of this disclosure or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0015] Figure 1 A flowchart illustrating an inter-process communication method provided in this embodiment of the disclosure;
[0016] Figure 2 A flowchart illustrating another inter-process communication method provided in this embodiment of the disclosure;
[0017] Figure 3 This is a schematic diagram of the structure of an inter-process communication device provided in an embodiment of the present disclosure;
[0018] Figure 4 A schematic diagram of another inter-process communication device provided in this disclosure embodiment;
[0019] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. The components of the embodiments of this disclosure described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0021] Therefore, the following detailed description of the embodiments of this disclosure provided in the accompanying drawings is not intended to limit the scope of the claimed disclosure, but merely to illustrate selected embodiments of the disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.
[0022] In modern computer software systems, inter-process communication (IPC) is a core technology for enabling data exchange between different programs or modules. Common IPC mechanisms include pipes, sockets, shared memory, and signals. These mechanisms provide efficient and flexible ways for programs to collaborate and are widely used in operating systems, network communication, distributed systems, and software extension development.
[0023] However, in certain application scenarios, such as game plugin development, the application's API may severely limit the plugin's capabilities. In a game's plugin system, plugins are scripts and programs written by players or developers that implement various functions by calling the game's provided API interfaces, such as interface optimization, information prompts, and task assistance. At the same time, the plugin system allows players to customize and enhance their gaming experience. However, plugins can only access a limited set of APIs provided by the game, which typically do not support traditional inter-process communication mechanisms such as pipes, TCP / IP communication, or signal handling. Therefore, when external programs need to communicate with plugins within the game, there is a lack of effective technical means.
[0024] In view of the above problems, the present disclosure provides an inter-process communication method, apparatus and electronic device. This technology can be applied to any inter-process communication scenario, especially the communication scenario between different programs or between plug-ins and programs.
[0025] To facilitate understanding of the embodiments of this disclosure, a method for inter-process communication disclosed in this disclosure will first be described in detail, such as... Figure 1 As shown, this method is applied to a target plugin, which communicates with a target application, and the target application communicates with external programs. The target plugin is used to listen for key events and extend specified functions for the target application. The method includes the following specific steps:
[0026] Step S102: Listen for key input in the graphical user interface provided by the target application.
[0027] In practical implementation, the target application can be determined according to development needs. For example, the target application can be a game app, a chat app, or other applications. The target application typically includes a plugin system, which is a plugin for the target application. This plugin can extend the target application with specified functions by calling the API interfaces provided by the target application. These specified functions include, but are not limited to, interface optimization, information prompts, and task assistance.
[0028] The aforementioned external program refers to an application outside the target application that can communicate with it. This external program can be determined based on development needs; for example, it could be a chat app or an app store. The target plugin needs to have the function of listening to key events, which are events triggered when a user presses a physical key on the keyboard.
[0029] In practical implementation, when a user presses a physical key on the keyboard and the corresponding key information is displayed in the graphical user interface, the target plugin can detect this. Specifically, the target plugin can listen for user key presses through the API provided by the target application.
[0030] Step S104: In response to the detection of specified key information, the specified key information is converted into target binary data; wherein, the input method of the specified key information is: after the external program converts the target information into target binary data, it simulates key events for each binary bit in the target binary data in turn to input the specified key information corresponding to each binary bit into the graphical user interface.
[0031] The specified key information mentioned above is usually the key information corresponding to the specified physical key displayed in the graphical user interface. For example, the specified physical key can be the combination of Ctrl+PageUp and Ctrl+PageDown, or it can be other physical keys, which can be determined according to the development needs.
[0032] When the target plugin detects a specified key press, it records that key press and marks each key press with a sequence identifier to ensure the order and integrity of the key press events. Then, it converts the key press information into binary data sequentially, where the correspondence between each key press and its corresponding binary bits is pre-defined.
[0033] In practice, the specified key information is input into the graphical user interface by an external program simulating key events. That is, when the external program needs to send target information to the target plugin, it first converts the target information into target binary data, and then simulates key events for each bit in the target binary data to input the specified key information corresponding to each bit into the graphical user interface. The correspondence between the physical key corresponding to each bit set in the external program and the binary bits corresponding to each physical key set in the target plugin is consistent.
[0034] Step S106: Determine the target information sent by the external program based on the target binary data.
[0035] In practical implementation, target binary data can be converted into target information according to preset rules. This target information is the information that the external program needs to send to the target plugin. The preset rules can be determined based on development needs. For example, the preset rules could be to convert the target binary data into ASCII code and use the converted ASCII code as the target information. Alternatively, a correspondence table can be set up, which includes the correspondence between each binary data item and each piece of information, allowing the target information corresponding to the target binary data to be determined based on the correspondence table.
[0036] Step S108: Execute the corresponding target interaction behavior according to the target information; wherein, different information sent by the external program is configured with corresponding interaction behaviors.
[0037] In practice, the external program and the target plugin pre-agree on the interaction behaviors corresponding to different information. When the target plugin receives a certain information sent by the external program, it first determines the corresponding interaction behavior and then executes that interaction behavior. For example, when the external program sends target information 1, the target plugin executes behavior A; when the external program sends target information 2, the target plugin executes behavior B.
[0038] This disclosure provides an inter-process communication method that utilizes the feature of a target plugin that can listen to key events. By simulating specific key events through an external program, the information is encoded into a key sequence. The plugin then decodes the key sequence to restore the information, thereby enabling inter-process communication between the external program and the target plugin.
[0039] The following examples describe the information determination method.
[0040] Specifically, the above-mentioned process of converting the specified key information into target binary data in response to listening to the specified key information further includes: recording the specified key information in response to listening to the specified key information; converting the specified key information into binary bits in sequence, and combining the binary bits into target binary data.
[0041] When the target plugin detects specified key press information through the API provided by the target application, it first records the specified key press information in sequence to ensure the order and integrity of the key press information. Then, it decodes the recorded specified key press information, that is, it converts the specified key press information into binary bits one by one, and then combines the converted binary bits in sequence to obtain the target binary data.
[0042] In practice, different binary bits correspond to different physical buttons, and different physical buttons correspond to different virtual key codes; external programs simulate button events through virtual key codes.
[0043] In practical applications, external programs and target plugins need to agree on which physical keys will be used to map binary 0 and binary 1. Specifically, two infrequently used key combinations can be chosen as the mappings for binary 0 and binary 1. For example, binary 1 can be mapped to the Ctrl+PageUp key event, and binary 0 can be mapped to the Ctrl+PageDown key event. These two key combinations are rarely used in normal operation, so they will not interfere with the user's normal operation.
[0044] When mapping a binary bit 1 to the Ctrl+PageUp key event and a binary bit 0 to the Ctrl+PageDown key event, VK_RCONTROL can be used as the virtual key code for the physical Ctrl key, and VK_PRIOR and VK_NEXT can be used as the virtual key codes for the PageUp and PageDown keys, respectively. Here, oneOrZero is the value of the current binary bit (1 or 0).
[0045] When an external program wants to send target information to a target plugin, it first needs to convert the target information into target binary data. Then, the external program finds the handle for inputting the information into the graphical user interface provided by the target application through a preset function. Then, according to the binary encoding, it simulates the Ctrl+PageUp key event or the Ctrl+PageDown key event in sequence, and uses PostMessageW to send window messages to simulate key presses and releases in order to input the specified key information in the graphical user interface. The specified key information is the Ctrl+PageUp key event and / or the Ctrl+PageDown key event.
[0046] In its implementation, the target plugin listens for user key presses, particularly the target key combinations Ctrl+PageUp and Ctrl+PageDown, via the API provided by the target application. When the target plugin detects a target key combination (equivalent to the specified key information mentioned above), it records the key event and marks it with a sequence ID to ensure the order and integrity of the key events. Then, the detected key events are converted into binary bits, with Ctrl+PageUp corresponding to a 1 and Ctrl+PageDown corresponding to a 0.
[0047] Furthermore, the specific process of determining the target information sent by the external program based on the target binary data may include: converting the target binary data into ASCII code, and determining the ASCII code as the target information sent by the external program.
[0048] In practice, once the target plugin converts the binary data to 8 bits, it converts it to ASCII code to reconstruct the original target information, which is the target information sent by the external program. For example, the target binary data 00110001 is the character "1" in ASCII. The target plugin then performs corresponding operations based on the received information. For example, upon receiving the character "1", the target plugin can trigger specific in-game events or execute specific logic.
[0049] In the above method, when an external program needs to inform the target plugin of some information, it converts the command to be sent into binary, simulates a keyboard event, and sends it to the graphical user interface provided by the target application. Then, the target plugin listens for the corresponding key press in the graphical user interface, records it, and when it has 8 bits, converts it into ASCII code to reconstruct the specific information, thus enabling the corresponding operation. This method bypasses the limitations of traditional inter-process communication mechanisms and utilizes the target plugin's existing functionality (key press monitoring) to achieve inter-process communication.
[0050] The following embodiments provide another inter-process communication method, which is applied to an external program, where the external program communicates with a target application, and the target application communicates with a target plugin, such as... Figure 2 As shown, the method includes:
[0051] Step S202: When the external program sends target information to the target plugin, the target information is converted into target binary data.
[0052] In practice, the external program needs to convert the target information to be transmitted into binary form. For example, when the external program needs to transmit the character "1", since the ASCII code of the character "1" is 49, the corresponding binary code is 00110001. Therefore, the target binary data corresponding to the character "1" is 00110001.
[0053] Step S204: Simulate key events sequentially for each binary bit in the target binary data, and input the specified key information corresponding to each binary bit into the graphical user interface provided by the target application.
[0054] Since the target binary data includes multiple binary bits, the external program needs to simulate the key events corresponding to each binary bit in turn, so as to display the specified key information corresponding to each binary bit in the graphical user interface provided by the target application.
[0055] In the actual implementation, the external program and the target plugin group need to agree on which physical keys to use as the mapping for binary 1s and binary 0s. Usually, different binary bits correspond to different physical keys. For example, two less frequently used key combinations can be selected as the mapping for 1 and 0, mapping binary 1 to the Ctrl+PageUp key event and binary 0 to the Ctrl+PageDown key event.
[0056] Based on the above description, the specific process of simulating key events for each binary bit in the target binary data and inputting the specified key information corresponding to each binary bit into the graphical user interface provided by the target application may include: for each binary bit in the target binary data, performing the following operations: mapping the current binary bit to a key event of the physical key corresponding to the current binary bit; and inputting the key information of the physical key corresponding to the current binary bit into the graphical user interface through the key event.
[0057] For example, assuming the target binary data is 00110001, it is necessary to map the binary bit 1 to the Ctrl+PageUp key event and the binary bit 0 to the Ctrl+PageDown key event, and then input the key information corresponding to the key events into the graphical user interface.
[0058] Furthermore, different physical buttons correspond to different virtual key codes. Based on this, the specific process of mapping the current binary bit to the physical button corresponding to the current binary bit can include: determining the physical button corresponding to the current binary bit, and the target virtual key code corresponding to the physical button corresponding to the current binary bit; simulating the press and release operation of the physical button corresponding to the current binary bit according to the target virtual key code and a preset message constant, to obtain the button event of the physical button corresponding to the current binary bit; wherein, the preset message constant is used to simulate the press and release operation of the physical button.
[0059] In practical implementation, the aforementioned preset message constants can be determined according to development needs. The virtual key codes corresponding to different physical keys can also be determined based on development requirements. For example, WM_KEYDOWN and WM_KEYUP are Windows message constants, representing key press and release, respectively. VK_RCONTROL is the virtual key code for the Ctrl key, and VK_PRIOR and VK_NEXT are the virtual key codes for PageUp and PageDown, respectively. One and Zero are the values of the current binary bits (1 or 0). Based on the binary encoding corresponding to the target binary data, the Ctrl+PageUp or Ctrl+PageDown key events are simulated sequentially, and window messages are sent using PostMessageW to simulate key presses and releases.
[0060] In an optional embodiment, the specific process of inputting the key information of the physical key corresponding to the current binary bit to the graphical user interface through key events may include: finding the interface handle corresponding to the target application through a preset function, and sending the key event to the target application based on the interface handle, so as to display the key information of the physical key corresponding to the current binary bit in the graphical user interface provided by the target application.
[0061] In practical implementation, the aforementioned preset function can be determined according to development needs. For example, the preset function can be the FindWindow function or other functions. The aforementioned interface handle is used to input key information into a specified window in the graphical user interface provided by the target application.
[0062] Step S206: When the target plugin detects the input of a specified key information in the graphical user interface, the target plugin converts the specified key information into target binary data, determines the target information sent by the external program based on the target binary data, and executes the corresponding target interactive behavior according to the target information; wherein, different information sent by the external program is configured with corresponding interactive behaviors.
[0063] In practical applications, the target application mentioned above can be a game program, and the interface handle mentioned above can be the game window handle. When the external program needs to send the character "1" to the target plugin, it first converts the character "1" into binary 00110001, and then finds the game window handle hwnd. Key events are simulated sequentially: 0 is mapped to Ctrl+PageDown; 0 is mapped to Ctrl+PageDown; 1 is mapped to Ctrl+PageUp; 1 is mapped to Ctrl+PageUp; 0 is mapped to Ctrl+PageDown; 0 is mapped to Ctrl+PageDown; 1 is mapped to Ctrl+PageUp; 0 is mapped to Ctrl+PageDown. The external program uses PostMessageW to send window messages, simulating key presses and releases. When the target plugin listens for a specified key event in the game window, it converts the specified key event into target binary data 00110001, converts the target binary data into the character "1", and executes the corresponding logic based on the character "1".
[0064] This disclosure provides an inter-process communication method that utilizes the feature of a target plugin that can listen to key events. A specific key event is simulated by an external program, and the information is encoded into a key sequence. The plugin then decodes the key sequence to restore the information, thereby realizing inter-process communication between the external program and the target plugin.
[0065] Corresponding to the above Figure 1The method embodiment shown in this disclosure also provides an inter-process communication device. This device is disposed in a target plugin, which communicates with a target application. The target application communicates with external programs. The target plugin is used to: listen for key events and extend specified functions for the target application, such as... Figure 3 As shown, the device includes:
[0066] The information monitoring module 30 is used to monitor key input information in the graphical user interface provided by the target application.
[0067] The data conversion module 31 is used to convert the specified key information into target binary data in response to the listening of specified key information. The input method of the specified key information is as follows: after the external program converts the target information into target binary data, it simulates key events for each binary bit in the target binary data in turn to input the specified key information corresponding to each binary bit into the graphical user interface.
[0068] The information determination module 32 is used to determine the target information sent by the external program based on the target binary data.
[0069] The behavior execution module 33 is used to execute the corresponding target interactive behavior according to the target information; wherein, different information sent by the external program is configured with corresponding interactive behaviors.
[0070] The aforementioned inter-process communication device utilizes the target plugin's ability to listen to key events. It simulates specific key events through an external program, encodes the information into key sequences, and the plugin reconstructs the information by decoding the key sequences, thereby enabling inter-process communication between the external program and the target plugin.
[0071] Furthermore, the aforementioned data conversion module 31 is used to: record the specified key information in response to listening to the specified key information; convert the specified key information into binary bits in sequence, and combine the binary bits into target binary data.
[0072] Furthermore, different binary bits correspond to different physical buttons, and different physical buttons correspond to different virtual key codes; among them, external programs simulate key events through virtual key codes.
[0073] Furthermore, the aforementioned information determination module 32 is used to: convert the target binary data into ASCII code, and determine the ASCII code as the target information sent by the external program.
[0074] The inter-process communication device provided in this disclosure has the same implementation principle and technical effects as the aforementioned method embodiments. For the sake of brevity, any parts not mentioned in the device embodiments can be referred to the corresponding content in the aforementioned method embodiments.
[0075] Corresponding to the above Figure 2 The method embodiment shown in this disclosure also provides another inter-process communication device, which is located in an external program. The external program communicates with the target application, and the target application communicates with the target plugin, such as... Figure 4 As shown, the device includes:
[0076] The data conversion module 40 is used to convert target information into target binary data when an external program sends target information to the target plugin.
[0077] The key event simulation module 41 is used to simulate key events sequentially for each binary bit in the target binary data, and input the specified key information corresponding to each binary bit into the graphical user interface provided by the target application.
[0078] The communication interaction module 42 is used to convert the specified key information into target binary data through the target plugin when the target plugin listens for the input of specified key information in the graphical user interface, and to determine the target information sent by the external program based on the target binary data, and to execute the corresponding target interaction behavior according to the target information; wherein, different information sent by the external program are configured with corresponding interaction behaviors.
[0079] The aforementioned inter-process communication device utilizes the target plugin's ability to listen to key events. It simulates specific key events through an external program, encodes the information into key sequences, and the plugin reconstructs the information by decoding the key sequences, thereby enabling inter-process communication between the external program and the target plugin.
[0080] Furthermore, different binary bits correspond to different physical buttons; based on this, the aforementioned button event simulation module 41 is used to: for each binary bit in the target binary data, perform the following operations: map the current binary bit to the button event of the physical button corresponding to the current binary bit; and input the button information of the physical button corresponding to the current binary bit to the graphical user interface through the button event.
[0081] Furthermore, different physical buttons correspond to different virtual key codes; based on this, the aforementioned button event simulation module 41 is also used to: determine the physical button corresponding to the current binary bit, and the target virtual key code corresponding to the physical button corresponding to the current binary bit; simulate the pressing and releasing operation of the physical button corresponding to the current binary bit according to the target virtual key code and the preset message constant, and obtain the button event of the physical button corresponding to the current binary bit; wherein, the preset message constant is used to simulate the pressing and releasing operation of the physical button.
[0082] Furthermore, the aforementioned key event simulation module 41 is also used to: find the interface handle corresponding to the target application through a preset function, and send the key event to the target application based on the interface handle, so as to display the key information of the physical key corresponding to the current binary bit in the graphical user interface provided by the target application.
[0083] The inter-process communication device provided in this disclosure has the same implementation principle and technical effects as the aforementioned method embodiments. For the sake of brevity, any parts not mentioned in the device embodiments can be referred to the corresponding content in the aforementioned method embodiments.
[0084] This disclosure also provides an electronic device, such as... Figure 5 As shown, the electronic device includes a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor, which executes the machine-executable instructions to implement the aforementioned inter-process communication method.
[0085] An inter-process communication method is applied to a target plugin. The target plugin communicates with a target application, and the target application communicates with an external program. The target plugin is used to listen for key events and extend specified functions for the target application. The method includes: listening for key information input in the graphical user interface provided by the target application; in response to listening for specified key information, converting the specified key information into target binary data; wherein the input method of the specified key information is as follows: after the external program converts the target information into target binary data, it sequentially simulates key events for each binary bit in the target binary data to input the specified key information corresponding to each binary bit into the graphical user interface; determining the target information sent by the external program based on the target binary data; and executing the corresponding target interactive behavior according to the target information; wherein different information sent by the external program is configured with corresponding interactive behaviors.
[0086] In an optional embodiment, the step of converting the specified key information into target binary data in response to listening to the specified key information includes: recording the specified key information in response to listening to the specified key information; converting the specified key information into binary bits in sequence, and combining the binary bits into target binary data.
[0087] In an optional embodiment, different binary bits correspond to different physical buttons, and different physical buttons correspond to different virtual key codes; wherein, an external program simulates button events through virtual key codes.
[0088] In an optional embodiment, the step of determining the target information sent by the external program based on the target binary data includes: converting the target binary data into ASCII code, and determining the ASCII code as the target information sent by the external program.
[0089] Another inter-process communication method is applied to an external program. The external program communicates with a target application, and the target application communicates with a target plugin. This method includes: when the external program sends target information to the target plugin, converting the target information into target binary data; sequentially simulating key events for each binary bit in the target binary data, inputting the specified key information corresponding to each binary bit into the graphical user interface provided by the target application; when the target plugin detects the input of the specified key information in the graphical user interface, converting the specified key information into target binary data through the target plugin, determining the target information sent by the external program based on the target binary data, and executing the corresponding target interactive behavior according to the target information; wherein, different information sent by the external program is configured with corresponding interactive behaviors.
[0090] In an optional embodiment, different binary bits correspond to different physical buttons. Based on this, the above-described step of simulating button events for each binary bit in the target binary data and inputting the specified button information corresponding to each binary bit into the graphical user interface provided by the target application includes: for each binary bit in the target binary data, performing the following operations: mapping the current binary bit to a button event of the physical button corresponding to the current binary bit; and inputting the button information of the physical button corresponding to the current binary bit into the graphical user interface through the button event.
[0091] In an optional embodiment, different physical buttons correspond to different virtual key codes. Based on this, the step of mapping the current binary bit to the key event of the physical button corresponding to the current binary bit includes: determining the physical button corresponding to the current binary bit and the target virtual key code corresponding to the physical button corresponding to the current binary bit; simulating the press and release operation of the physical button corresponding to the current binary bit according to the target virtual key code and a preset message constant to obtain the key event of the physical button corresponding to the current binary bit; wherein, the preset message constant is used to simulate the press and release operation of the physical button.
[0092] In an optional embodiment, the step of inputting the key information of the physical key corresponding to the current binary bit to the graphical user interface through key events includes: finding the interface handle corresponding to the target application through a preset function, and sending the key event to the target application based on the interface handle, so as to display the key information of the physical key corresponding to the current binary bit in the graphical user interface provided by the target application.
[0093] The above-mentioned inter-process communication method utilizes the target plugin's ability to listen to key events. It simulates specific key events through an external program, encodes the information into key sequences, and the plugin restores the information by decoding the key sequences, thereby realizing inter-process communication between the external program and the target plugin.
[0094] Furthermore, Figure 5 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 101, the communication interface 103 and the memory 100 connected via the bus 102.
[0095] The memory 100 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0096] Processor 101 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 101 or by instructions in software form. The processor 101 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 100, and processor 101 reads information from memory 100 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0097] This disclosure also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are invoked and executed by a processor, they cause the processor to implement the aforementioned inter-process communication method. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0098] An inter-process communication method is applied to a target plugin. The target plugin communicates with a target application, and the target application communicates with an external program. The target plugin is used to listen for key events and extend specified functions for the target application. The method includes: listening for key information input in the graphical user interface provided by the target application; in response to listening for specified key information, converting the specified key information into target binary data; wherein the input method of the specified key information is as follows: after the external program converts the target information into target binary data, it sequentially simulates key events for each binary bit in the target binary data to input the specified key information corresponding to each binary bit into the graphical user interface; determining the target information sent by the external program based on the target binary data; and executing the corresponding target interactive behavior according to the target information; wherein different information sent by the external program is configured with corresponding interactive behaviors.
[0099] In an optional embodiment, the step of converting the specified key information into target binary data in response to listening to the specified key information includes: recording the specified key information in response to listening to the specified key information; converting the specified key information into binary bits in sequence, and combining the binary bits into target binary data.
[0100] In an optional embodiment, different binary bits correspond to different physical buttons, and different physical buttons correspond to different virtual key codes; wherein, an external program simulates button events through virtual key codes.
[0101] In an optional embodiment, the step of determining the target information sent by the external program based on the target binary data includes: converting the target binary data into ASCII code, and determining the ASCII code as the target information sent by the external program.
[0102] Another inter-process communication method is applied to an external program. The external program communicates with a target application, and the target application communicates with a target plugin. This method includes: when the external program sends target information to the target plugin, converting the target information into target binary data; sequentially simulating key events for each binary bit in the target binary data, inputting the specified key information corresponding to each binary bit into the graphical user interface provided by the target application; when the target plugin detects the input of the specified key information in the graphical user interface, converting the specified key information into target binary data through the target plugin, determining the target information sent by the external program based on the target binary data, and executing the corresponding target interactive behavior according to the target information; wherein, different information sent by the external program is configured with corresponding interactive behaviors.
[0103] In an optional embodiment, different binary bits correspond to different physical buttons. Based on this, the above-described step of simulating button events for each binary bit in the target binary data and inputting the specified button information corresponding to each binary bit into the graphical user interface provided by the target application includes: for each binary bit in the target binary data, performing the following operations: mapping the current binary bit to a button event of the physical button corresponding to the current binary bit; and inputting the button information of the physical button corresponding to the current binary bit into the graphical user interface through the button event.
[0104] In an optional embodiment, different physical buttons correspond to different virtual key codes. Based on this, the step of mapping the current binary bit to the key event of the physical button corresponding to the current binary bit includes: determining the physical button corresponding to the current binary bit and the target virtual key code corresponding to the physical button corresponding to the current binary bit; simulating the press and release operation of the physical button corresponding to the current binary bit according to the target virtual key code and a preset message constant to obtain the key event of the physical button corresponding to the current binary bit; wherein, the preset message constant is used to simulate the press and release operation of the physical button.
[0105] In an optional embodiment, the step of inputting the key information of the physical key corresponding to the current binary bit to the graphical user interface through key events includes: finding the interface handle corresponding to the target application through a preset function, and sending the key event to the target application based on the interface handle, so as to display the key information of the physical key corresponding to the current binary bit in the graphical user interface provided by the target application.
[0106] The above-mentioned inter-process communication method utilizes the target plugin's ability to listen to key events. It simulates specific key events through an external program, encodes the information into key sequences, and the plugin restores the information by decoding the key sequences, thereby realizing inter-process communication between the external program and the target plugin.
[0107] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal device, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0108] In the description of this disclosure, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this disclosure and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this disclosure. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0109] Finally, it should be noted that the above-described embodiments are merely specific implementations of this disclosure, used to illustrate the technical solutions of this disclosure, and not to limit it. The protection scope of this disclosure is not limited thereto. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this disclosure. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this disclosure, and should all be covered within the protection scope of this disclosure. Therefore, the protection scope of this disclosure should be determined by the protection scope of the claims.
Claims
1. A method for inter-process communication, characterized in that, The method is applied to a target plugin, which is communicatively connected to a target application, and the target application is communicatively connected to an external program. The target plugin is used to: listen for key events and extend specified functions for the target application. The method includes: Listen for keystrokes input in the graphical user interface provided by the target application; In response to the detection of a specified key press, the specified key press information is converted into target binary data; wherein, the input method of the specified key press information is: after the external program converts the target information into target binary data, it sequentially simulates key press events for each binary bit in the target binary data to input the specified key press information corresponding to each binary bit into the graphical user interface; The target information sent by the external program is determined based on the target binary data. Execute the corresponding target interactive behavior according to the target information; wherein, different information sent by the external program are configured with corresponding interactive behaviors.
2. The method according to claim 1, characterized in that, The step of converting the specified key information into target binary data in response to the detection of specified key information includes: In response to the detection of a specified key press, the specified key press information is recorded; The specified key information is sequentially converted into binary bits, and the binary bits are combined into the target binary data.
3. The method according to claim 2, characterized in that, Different binary bits correspond to different physical buttons, and different physical buttons correspond to different virtual key codes; wherein, the external program simulates button events through virtual key codes.
4. The method according to claim 1, characterized in that, The step of determining the target information sent by the external program based on the target binary data includes: The target binary data is converted into ASCII code, and the ASCII code is determined as the target information sent by the external program.
5. A method for inter-process communication, characterized in that, The method is applied to an external program, which is communicatively connected to a target application, and the target application is communicatively connected to a target plugin. The method includes: When the external program sends target information to the target plugin, the target information is converted into target binary data; For each binary bit in the target binary data, a key event is simulated sequentially, and the specified key information corresponding to each binary bit is input into the graphical user interface provided by the target application. When the target plugin detects the input of a specified key in the graphical user interface, it converts the specified key information into target binary data, determines the target information sent by the external program based on the target binary data, and executes the corresponding target interactive behavior according to the target information; wherein, different information sent by the external program are configured with corresponding interactive behaviors.
6. The method according to claim 5, characterized in that, Different binary bits correspond to different physical buttons; The step of sequentially simulating key events for each binary bit in the target binary data and inputting the specified key information corresponding to each binary bit into the graphical user interface provided by the target application includes: For each bit in the target binary data, perform the following operation: Map the current binary bit to the key press event of the physical key corresponding to the current binary bit; The button event is used to input the button information of the physical button corresponding to the current binary bit into the graphical user interface.
7. The method according to claim 6, characterized in that, Different physical buttons correspond to different virtual key codes; The step of mapping the current binary bit to the key event of the physical key corresponding to the current binary bit includes: Determine the physical key corresponding to the current binary bit, and the target virtual key code corresponding to the physical key corresponding to the current binary bit; Based on the target virtual key code and the preset message constant, the pressing and releasing operations of the physical key corresponding to the current binary bit are simulated to obtain the key event of the physical key corresponding to the current binary bit; wherein, the preset message constant is used to simulate the pressing and releasing operations of the physical key.
8. The method according to claim 6, characterized in that, The step of inputting the key information of the physical key corresponding to the current binary bit to the graphical user interface through the key event includes: The interface handle corresponding to the target application is found by using a preset function, and the key event is sent to the target application based on the interface handle, so as to display the key information of the physical key corresponding to the current binary bit in the graphical user interface provided by the target application.
9. An inter-process communication device, characterized in that, The device is disposed in the target plugin, the target plugin is communicatively connected to the target application, and the target application is communicatively connected to external programs. The target plugin is used to: listen for key events and extend specified functions for the target application. The device includes: The information monitoring module is used to monitor key input information in the graphical user interface provided by the target application; The data conversion module is used to convert the specified key information into target binary data in response to the detection of specified key information; wherein, the input method of the specified key information is as follows: after the external program converts the target information into target binary data, it simulates key events for each binary bit in the target binary data in turn to input the specified key information corresponding to each binary bit into the graphical user interface; The information determination module is used to determine the target information sent by the external program based on the target binary data; The behavior execution module is used to execute the corresponding target interactive behavior according to the target information; wherein, different information sent by the external program are configured with corresponding interactive behaviors.
10. An inter-process communication device, characterized in that, The device is installed in an external program, the external program is communicatively connected to a target application, and the target application is communicatively connected to a target plugin. The device includes: The data conversion module is used to convert the target information into target binary data when the external program sends target information to the target plugin; The key event simulation module is used to simulate key events sequentially for each binary bit in the target binary data, and input the specified key information corresponding to each binary bit into the graphical user interface provided by the target application. The communication interaction module is used to convert the specified key information into target binary data through the target plugin when the target plugin detects the input of specified key information in the graphical user interface, and to determine the target information sent by the external program based on the target binary data, and to execute the corresponding target interaction behavior according to the target information; wherein, different information sent by the external program are configured with corresponding interaction behaviors.
11. An electronic device, characterized in that, It includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the inter-process communication method according to any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the inter-process communication method according to any one of claims 1 to 8.