Shared memory communication method and apparatus, electronic device, and storage medium

By obtaining the anonymous service interface and file descriptor of the publishing application, secure shared memory communication between the subscribing application and the publishing application is achieved in the Android system, solving the security problem of permission amplification and improving communication efficiency.

WO2024193016A1PCT designated stage expired Publication Date: 2024-09-26ECARX (HUBEI) TECHCO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/125170
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-21
Filing Date
2023-10-18
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

In the Android system, publishing applications requires greater permissions to register explicit services, which leads to security issues. Especially when publishing applications are only ordinary applications, permission amplification can cause unsafe shared memory communication.

Method used

By obtaining the target information of the publishing application, obtaining its anonymous service interface, and obtaining the target file descriptor of the shared memory file through interface calling, secure shared memory communication between the subscribing application and the publishing application is achieved, avoiding the need for permissions in the publishing application. Zoom in on.

Benefits of technology

It realizes safe shared memory communication between subscribing applications and publishing applications without enlarging the publishing application permissions, reducing the difficulty of permission configuration and improving communication efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023125170_26092024_PF_FP
    Figure CN2023125170_26092024_PF_FP
Patent Text Reader

Abstract

A shared memory communication method and apparatus, an electronic device, and a storage medium. The method is applied to a subscribing application, and comprises: acquiring target information of a publishing application (S101); according to the target information of the publishing application, acquiring an anonymous service interface corresponding to the publishing application (S102); according to the anonymous service interface, acquiring, in an interface calling manner, a target file descriptor corresponding to a shared memory file (S103); and reading block data information in the shared memory file according to the target file descriptor corresponding to the shared memory file, and the target information (S104).
Need to check novelty before this filing date? Find Prior Art

Description

Shared memory communication method, device, electronic device and storage medium

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 21, 2023, with application number 202310279596.2, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of vehicle technology, for example, to a shared memory communication method, device, electronic device and storage medium. Background Art

[0003] The SoftBus serves as a software development kit (SDK) for use by multiple modules within the Android system. The Android system has strict security restrictions and generally uses a shared memory approach. The publisher writes communication data into a shared memory file, and the subscriber directly reads the contents of the shared memory file. The data is copied from the publisher's user state to the kernel state, and the subscriber copies the data from the kernel state to the user state of its own process. This eliminates the need to copy data between the kernel states of the two processes, greatly improving communication efficiency.

[0004] When a publisher writes communication data to a shared memory file, it must pass the file descriptor corresponding to the shared memory file to the subscriber. Therefore, the publisher must register an explicit service (an explicit service is a service visible to the publisher, as opposed to an implicit or anonymous service) so that the subscriber can find the explicit service and access the interface. However, registering an explicit service requires extensive permissions, and the publisher may be just an ordinary application in the system and may not have permission to register explicit services. Increasing the publisher's permissions can lead to security risks.

[0005] Summary of the Invention

[0006] The present application provides a shared memory communication method, device, electronic device and storage medium to implement shared memory communication between a subscribing application and a publishing application securely by registering an anonymous service without amplifying the permissions of the publishing application.

[0007] An embodiment of the present application provides a shared memory communication method, which is applied to a subscription application, including:

[0008] Get target information for publishing applications;

[0009] Acquire the anonymous service interface corresponding to the publishing application according to the target information of the publishing application;

[0010] Obtain the target file descriptor corresponding to the shared memory file by calling the interface according to the anonymous service interface;

[0011] The block data information in the shared memory file is read according to the target file descriptor corresponding to the shared memory file and the target information.

[0012] In one or more embodiments, the target information of the published application includes: a process ID corresponding to the published application and an int value of a shared memory file descriptor.

[0013] In one or more embodiments, obtaining an anonymous service interface corresponding to the publishing application according to target information of the publishing application includes:

[0014] Generate an interface acquisition request according to the process number corresponding to the publishing application and the int value of the shared memory file descriptor, and send the interface acquisition request to the management service;

[0015] Receive the anonymous service interface corresponding to the process of publishing the application fed back by the management service.

[0016] In one or more embodiments, the target information for publishing the application includes: location information of the block data information in the shared memory file;

[0017] Reading block data information in the shared memory file according to a target file descriptor corresponding to the shared memory file and the target information includes:

[0018] The block data information at the target position in the shared memory file is read according to the target file descriptor corresponding to the shared memory file and the position information of the block data information in the shared memory file, wherein the target position is the position corresponding to the position information of the block data information in the shared memory file.

[0019] In one or more embodiments, obtaining target information for publishing an application includes:

[0020] Get the target information of the broadcast application based on multicast mode.

[0021] The present invention also provides a shared memory communication device, which includes:

[0022] A first acquisition module is configured to acquire target information of a published application;

[0023] A second acquisition module is configured to acquire an anonymous service interface corresponding to the publishing application according to target information of the publishing application;

[0024] A third acquisition module is configured to acquire a target file descriptor corresponding to the shared memory file by calling the anonymous service interface;

[0025] The reading module is configured to read the block data information in the shared memory file according to the target file descriptor corresponding to the shared memory file and the target information.

[0026] In one or more embodiments, the target information of the published application includes: a process ID corresponding to the published application and an int value of a shared memory file descriptor.

[0027] In one or more embodiments, the second acquisition module includes:

[0028] A generating unit configured to generate an interface acquisition request according to a process number corresponding to the publishing application and an int value of a shared memory file descriptor, and send the interface acquisition request to a management service;

[0029] The receiving unit is configured to receive the anonymous service interface corresponding to the process of publishing the application fed back by the management service.

[0030] An embodiment of the present application further provides an electronic device, comprising:

[0031] at least one processor; and

[0032] a memory communicatively connected to the at least one processor; wherein,

[0033] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the shared memory communication method described in any embodiment of the present application.

[0034] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the shared memory communication method described in any embodiment of the present application when executed. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] FIG1 is a flow chart of a shared memory communication method according to an embodiment of the present application;

[0036] FIG2 is a schematic diagram of a shared memory communication method in an embodiment of the present application;

[0037] FIG3 is a schematic structural diagram of a shared memory communication device according to an embodiment of the present application;

[0038] FIG4 is a schematic structural diagram of an electronic device that implements the shared memory communication method according to an embodiment of the present application. DETAILED DESCRIPTION

[0039] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. The described embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0040] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. The numbers used in this way can be interchanged where appropriate, so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units listed, but may include other steps or units that are not listed or that are inherent to these processes, methods, products or devices.

[0041] Example 1

[0042] Figure 1 is a flowchart of a shared memory communication method in an embodiment of the present application. This embodiment is applicable to the case of shared memory communication. The method can be executed by a shared memory communication device in an embodiment of the present application. The device can be implemented in software and / or hardware. As shown in Figure 1, the method includes the following steps.

[0043] S101: Obtain target information for publishing an application.

[0044] In an embodiment of the present application, a shared memory communication method is applied to a subscribing application. In actual operation, the subscribing application may correspond to a publishing application. The publishing application may create a shared memory file and write communication data to the shared memory file, and the subscribing application may read the contents of the shared memory file. Both the subscribing application and the publishing application may be applications using the Softbus SDK. For example, the publishing application may be represented as DFS NODE1, and the subscribing application may be represented as DFS NODE2. These two applications may be both publishing applications and subscribing applications.

[0045] The target information may be information sent by the publishing application, for example, it may include the process number corresponding to the publishing application, the integer (integer, int) value of the shared memory file descriptor, and the location information of the block data information in the shared memory file, and may also include other corresponding file information, which is not limited in the embodiments of the present application.

[0046] DFS NODE1 or DFS NODE2 serves as a subscribing application and receives target information sent by the publishing application DFS NODE2 or DFS NODE1. The target information may include, for example, the process ID of the publishing application, the int value of the shared memory file descriptor, and the location information of the block data information in the shared memory file.

[0047] S102: Acquire an anonymous service interface corresponding to the published application according to target information of the published application.

[0048] The anonymous service interface may be an interface for publishing an anonymous application service.

[0049] For example, when the publishing and subscribing applications initialize, they register their Service objects with a centralized management service, shmem_dfs_server_manager. That is, the Distributed File System (DFS) SDK processes of the publishing and subscribing applications register their anonymous services with the management service, shmem_dfs_server_manager, using anonymous services. Based on the publishing application's target information, the subscribing application requests the management service, shmem_dfs_server_manager, for the publishing application's anonymous service interface object.

[0050] S103: Obtain a target file descriptor corresponding to the shared memory file through an interface call according to the anonymous service interface.

[0051] In this embodiment, the shared memory file can be a memory file used to store communication data. The Android system has strict permission restrictions on security and generally adopts a shared memory approach. The publisher writes the communication data into the shared memory file, and the subscriber directly reads the content of the shared memory file.

[0052] The destination file descriptor can be a real shared memory file descriptor.

[0053] For example, the subscribing application requests the management service shmem_dfs_server_manager to obtain the interface object of the anonymous service of the publishing application. After the subscribing application obtains the anonymous service interface of the publishing application process, it obtains the real shared memory file descriptor through the interface call according to the anonymous service interface (Android's own Binder mechanism realizes cross-process sharing of file descriptors).

[0054] S104: Read block data information in the shared memory file according to the target file descriptor and target information corresponding to the shared memory file.

[0055] The block data information may be block communication data information stored in a shared memory file.

[0056] For example, after the subscribing application obtains the real shared memory file descriptor, the subscribing application opens the shared memory file according to the target file descriptor corresponding to the shared memory file, and reads the block data information at a specific location in the shared memory file according to the target information sent by the publishing application, thereby realizing the shared memory communication method under the Android platform.

[0057] In practice, the publishing application registers an anonymous service with the management service shmem_dfs_server_manager, which is registered with the system. Because the management service shmem_dfs_server_manager is system-controlled and has configurable permissions, this ensures secure shared memory communication between the subscribing and publishing applications without amplifying the permissions of DFS users.

[0058] The embodiment of the present application obtains the target information of the publishing application, obtains the anonymous service interface corresponding to the publishing application based on the target information of the publishing application, obtains the target file descriptor corresponding to the shared memory file through an interface call based on the anonymous service interface, and reads the block data information in the shared memory file based on the target file descriptor and target information corresponding to the shared memory file. The technical solution of the present application can achieve secure shared memory communication between the subscribing application and the publishing application by registering an anonymous service without amplifying the permissions of the publishing application.

[0059] Optionally, the target information of the published application includes: the process ID corresponding to the published application and the int value of the shared memory file descriptor.

[0060] Obtain the anonymous service interface corresponding to the published application based on the target information of the published application, including:

[0061] Get the anonymous service interface corresponding to the process of publishing the application based on the process ID corresponding to the publishing application and the int value of the shared memory file descriptor.

[0062] Exemplarily, the subscribing application requests the management service shmem_dfs_server_manager to obtain the interface object of the anonymous service of the publishing application according to the process ID corresponding to the publishing application and the int value of the shared memory file descriptor.

[0063] Optionally, obtain the anonymous service interface corresponding to the published application based on the target information of the published application, including:

[0064] Generate an interface acquisition request based on the process ID corresponding to the publishing application and the int value of the shared memory file descriptor, and send the interface acquisition request to the management service.

[0065] The interface acquisition request may be generated by the subscription application and sent to the management service, and is used to obtain the anonymous service interface corresponding to the process of the publishing application from the management service.

[0066] In this embodiment, the management service shmem_dfs_server_manager may be a process for implementing the management service.

[0067] Exemplarily, the subscribing application generates an interface acquisition request according to the process ID corresponding to the publishing application and the int value of the shared memory file descriptor, and sends the interface acquisition request to the management service.

[0068] An anonymous service interface corresponding to the process of publishing applications that receives feedback from the management service.

[0069] Exemplarily, the subscribing application receives the anonymous service interface corresponding to the publishing application process fed back by the management service.

[0070] In actual operation, the management service shmem_dfs_server_manager, as a system service, requires important and dangerous permissions. However, as applications using the DFS SDK, the subscription application and the publishing application only need to be configured with permissions to access the management service shmem_dfs_server_manager. This reduces the difficulty of soft bus SDK development and configuration and enhances its versatility.

[0071] Optionally, the target information for publishing the application includes: location information of block data information in the shared memory file.

[0072] The location information may be location information where the block data information to be read by the subscribing application is stored in the shared memory file.

[0073] Read the block data information in the shared memory file according to the target file descriptor and target information corresponding to the shared memory file, including:

[0074] The block data information in the shared memory file is read according to the target file descriptor corresponding to the shared memory file and the position information of the block data information at the target position in the shared memory file.

[0075] The target location is a location corresponding to the location information of the block data information in the shared memory file.

[0076] Exemplarily, the subscribing application reads the block data information at a specific location in the shared memory file according to the target file descriptor corresponding to the shared memory file and the location information of the block data information in the shared memory file.

[0077] In actual operation, the target information of the published application may further include: size information of the block data information in the shared memory file.

[0078] Accordingly, the block data information in the shared memory file is read according to the target file descriptor and target information corresponding to the shared memory file, including:

[0079] The block data information in the shared memory file is read according to the target file descriptor corresponding to the shared memory file, the position information of the block data information in the shared memory file, and the size information of the block data information in the shared memory file.

[0080] Exemplarily, the subscribing application reads block data information of a specific location and a specific size in the shared memory file according to the target file descriptor corresponding to the shared memory file, the location information of the block data information in the shared memory file, and the size information of the block data information in the shared memory file.

[0081] Optionally, obtain target information for publishing the application, including:

[0082] Get the target information of the broadcast application based on multicast mode.

[0083] In this embodiment, the multicast mode can be understood as a publishing application sending target information through broadcasting, and multiple subscribing applications can respectively receive the target information sent by the publishing application, which is a "one send, multiple receive" information transmission mode.

[0084] Exemplarily, the subscribing application may obtain the target information broadcasted by the publishing application in a multicast manner.

[0085] The technical solution of the embodiment of the present application is that the subscribing application obtains the target information of the publishing application based on a multicast method. The target information of the publishing application includes: the process number corresponding to the publishing application and the int value of the shared memory file descriptor. The subscribing application generates an interface acquisition request based on the process number corresponding to the publishing application and the int value of the shared memory file descriptor, and sends the interface acquisition request to the management service, receives the anonymous service interface corresponding to the publishing application process fed back by the management service, and the subscribing application obtains the target file descriptor corresponding to the shared memory file through an interface call based on the anonymous service interface. The target information of the publishing application includes: the location information of the block data information in the shared memory file. The subscribing application reads the block data information in the shared memory file based on the target file descriptor and the location information of the block data information in the shared memory file. Through the technical solution of the present application, it is possible to achieve shared memory communication between the subscribing application and the publishing application securely by registering an anonymous service without amplifying the permissions of the publishing application.

[0086] As an exemplary description of an embodiment of the present application, FIG2 is a schematic diagram of a shared memory communication method in an embodiment of the present application. As shown in FIG2, DFS NODE1 and DFS NODE2 are both applications using the soft bus SDK. These two applications can be either publishing applications or subscribing applications. DFS NODE1 and DFS NODE2 both include an anonymous Binder Service and a Client Manager. When initialized, DFS NODE1SDK and DFS NODE2SDK register their own Service objects with the management service shmem_dfs_server_manager. That is, the DFS SDK processes of the publishing application and the subscribing application both use anonymous services and register their own anonymous services in a centralized management service shmem_dfs_server_manager. When DFS NODE1 acts as a subscribing application, DFS NODE1 obtains the shared memory file descriptor created by the publishing application DFS NODE2 process; when DFS NODE2 acts as a subscribing application, DFS NODE2 obtains the shared memory file descriptor created by the publishing application DFS NODE1 process.

[0087] During the implementation process, DFS NODE1 or DFS NODE2, as the subscribing application, receives the process ID and int value of the shared memory file descriptor broadcast by the publishing application through multicast. Using this information, the subscribing application requests the management service shmem_dfs_server_manager to obtain the anonymous service interface of the publishing application process. After the subscribing application obtains the anonymous service interface of the publishing application process, it obtains the actual shared memory file descriptor through an interface call (Android's own Binder mechanism implements cross-process sharing of file descriptors). The subscribing application opens the shared memory file and reads the block data information at a specific location in the shared memory file through the information multicasted by the publishing application control channel, thereby implementing the shared memory communication method under the Android platform.

[0088] The technical solution of the embodiment of the present application can transfer file descriptors between the publishing application and the subscribing application by registering an anonymous service with as little permission change as possible, thereby achieving the purpose of soft bus shared memory communication under the Android platform.

[0089] Example 2

[0090] FIG3 is a schematic diagram of the structure of a shared memory communication device according to an embodiment of the present application. This embodiment is applicable to shared memory communication scenarios. The device can be implemented using software and / or hardware and can be integrated into any device that provides shared memory communication functionality. As shown in FIG3 , the shared memory communication device includes a first acquisition module 201, a second acquisition module 202, a third acquisition module 203, and a reading module 204.

[0091] Wherein, the first acquisition module 201 is configured to acquire target information of the published application;

[0092] The second acquisition module 202 is configured to acquire the anonymous service interface corresponding to the publishing application according to the target information of the publishing application;

[0093] The third acquisition module 203 is configured to acquire the target file descriptor corresponding to the shared memory file by calling the anonymous service interface;

[0094] The reading module 204 is configured to read the block data information in the shared memory file according to the target file descriptor corresponding to the shared memory file and the target information.

[0095] Optionally, the target information of the published application includes: a process number corresponding to the published application and an int value of a shared memory file descriptor.

[0096] Optionally, the second obtaining module 202 includes:

[0097] A generating unit configured to generate an interface acquisition request according to a process number corresponding to the publishing application and an int value of a shared memory file descriptor, and send the interface acquisition request to a management service;

[0098] The receiving unit is configured to receive the anonymous service interface corresponding to the process of publishing the application fed back by the management service.

[0099] Optionally, the target information of the published application includes: location information of the block data information in the shared memory file;

[0100] The reading module 204 includes:

[0101] A reading unit is configured to read the block data information at a target position in the shared memory file according to a target file descriptor corresponding to the shared memory file and the position information of the block data information in the shared memory file, wherein the target position is a position corresponding to the position information of the block data information in the shared memory file.

[0102] Optionally, the first obtaining module 201 includes:

[0103] The acquisition unit is configured to acquire target information broadcasted by the publishing application based on a multicast method.

[0104] The above-mentioned product can execute the shared memory communication method provided in any embodiment of the present application, and has the corresponding functional modules and effects for executing the shared memory communication method.

[0105] Example 3

[0106] FIG4 shows a block diagram of an electronic device 30 that can be used to implement an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0107] As shown in Figure 4, the electronic device 30 includes at least one processor 31 and a memory connected to the at least one processor 31, such as a read-only memory (ROM) 32 and a random access memory (RAM) 33. The memory stores a computer program that can be executed by the at least one processor 31. The processor 31 can perform various appropriate actions and processes according to the computer program stored in the ROM 32 or the computer program loaded from the storage unit 38 into the RAM 33. In the RAM 33, various programs and data required for the operation of the electronic device 30 can also be stored. The processor 31, ROM 32, and RAM 33 are connected to each other via a bus 34. An input / output (I / O) interface 35 is also connected to the bus 34.

[0108] Multiple components in the electronic device 30 are connected to the I / O interface 35, including an input unit 36, such as a keyboard, a mouse, etc.; an output unit 37, such as various types of displays, speakers, etc.; a storage unit 38, such as a magnetic disk, an optical disk, etc.; and a communication unit 39, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 39 allows the electronic device 30 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0109] The processor 31 may be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the processor 31 include a central processing unit (CPU), a graphics processing unit (GPU), a variety of dedicated artificial intelligence (AI) computing chips, a variety of processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 31 performs the multiple methods and processes described above, such as a shared memory communication method, which includes:

[0110] Get target information for publishing applications;

[0111] Acquire the anonymous service interface corresponding to the publishing application according to the target information of the publishing application;

[0112] Obtain the target file descriptor corresponding to the shared memory file by calling the interface according to the anonymous service interface;

[0113] The block data information in the shared memory file is read according to the target file descriptor corresponding to the shared memory file and the target information.

[0114] In some embodiments, the shared memory communication method can be implemented as a computer program that is tangibly contained in a computer-readable storage medium, such as a storage unit 38. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 30 via the ROM 32 and / or the communication unit 39. When the computer program is loaded into the RAM 33 and executed by the processor 31, one or more steps of the shared memory communication method described above can be performed. Alternatively, in other embodiments, the processor 31 can be configured to perform the shared memory communication method in any other appropriate manner (e.g., by means of firmware).

[0115] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard parts (ASSPs), system on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0116] Computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0117] In the context of the present application, computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage medium can include electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage medium can be a machine-readable signal medium. Machine-readable storage medium includes an electrical connection based on one or more lines, a portable computer disk, a hard disk, RAM, ROM, erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device or any suitable combination of the foregoing. Storage medium can be a non-transitory storage medium.

[0118] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a cathode ray tube (CRT) or a liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0119] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0120] A computing system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. The client-server relationship arises through computer programs running on the respective computers and establishing a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within a cloud computing service ecosystem that addresses the management difficulties and limited scalability of physical hosts and virtual private server (VPS) services.

[0121] The various forms of processes shown above can be used to reorder, add, or delete steps. For example, the multiple steps described in this application can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of this application can be achieved. This document is not limited here.

[0122] The above embodiments do not limit the scope of protection of this application. Various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors.

Claims

1. A shared memory communication method, applied to a subscription application, comprising: Get the target information of the published application; Acquire an anonymous service interface corresponding to the published application according to the target information of the published application; Obtaining a target file descriptor corresponding to the shared memory file by calling the anonymous service interface; The block data information in the shared memory file is read according to the target file descriptor corresponding to the shared memory file and the target information.

2. The method according to claim 1, wherein: The target information of the published application includes: the process number corresponding to the published application and the integer int value of the shared memory file descriptor.

3. The method according to claim 2, wherein: The step of obtaining the anonymous service interface corresponding to the publishing application according to the target information of the publishing application includes: Generate an interface acquisition request according to the process number corresponding to the publishing application and the int value of the shared memory file descriptor, and send the interface acquisition request to the management service; Receive the anonymous service interface corresponding to the process of publishing the application fed back by the management service.

4. The method according to claim 1, wherein: The target information of the published application includes: location information of the block data information in the shared memory file; The step of reading the block data information in the shared memory file according to the target file descriptor corresponding to the shared memory file and the target information includes: The block data information at the target position in the shared memory file is read according to the target file descriptor corresponding to the shared memory file and the position information of the block data information in the shared memory file, wherein the target position is the position corresponding to the position information of the block data information in the shared memory file.

5. The method according to claim 1, wherein: The step of obtaining target information of the published application includes: Based on the multicast mode, the target information broadcasted by the publishing application is obtained.

6. A shared memory communication device, comprising: A first acquisition module is configured to acquire target information of a published application; A second acquisition module is configured to acquire an anonymous service interface corresponding to the published application according to target information of the published application; A third acquisition module is configured to acquire a target file descriptor corresponding to the shared memory file by calling the anonymous service interface; The reading module is configured to read the block data information in the shared memory file according to the target file descriptor corresponding to the shared memory file and the target information.

7. The device according to claim 6, wherein: The target information of the published application includes: the process number corresponding to the published application and the integer int value of the shared memory file descriptor.

8. The device according to claim 7, wherein: The second acquisition module includes: A generating unit, configured to generate an interface acquisition request according to a process number corresponding to the publishing application and an int value of the shared memory file descriptor, and send the interface acquisition request to a management service; The receiving unit is configured to receive the anonymous service interface corresponding to the process of publishing the application fed back by the management service.

9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the shared memory communication method according to any one of claims 1 to 5.

10. A computer-readable storage medium, wherein: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the shared memory communication method according to any one of claims 1 to 5 when executed.

Citation Information

Patent Citations

  • Inter-process communication method, device and system, medium and terminal

    CN110399229A

  • Cross-process communication method and device, equipment and storage medium

    CN115145748A

  • Inter-process communication method and device, computer equipment and storage medium

    CN115576708A

  • Shared memory communication method and device, equipment and storage medium

    CN116382940A

  • Fork-safe memory allocation from memory-mapped files with anonymous memory behavior

    US20160283127A1