CN117234751A - Cross-partition process communication method and device, electronic equipment and storage medium - Google Patents
Cross-partition process communication method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117234751A CN117234751A CN202311153779.6A CN202311153779A CN117234751A CN 117234751 A CN117234751 A CN 117234751A CN 202311153779 A CN202311153779 A CN 202311153779A CN 117234751 A CN117234751 A CN 117234751A
- Authority
- CN
- China
- Prior art keywords
- service
- publisher
- management service
- shared memory
- soft bus
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 154
- 238000005192 partition Methods 0.000 title claims abstract description 136
- 230000008569 process Effects 0.000 title claims abstract description 103
- 238000004891 communication Methods 0.000 title claims abstract description 60
- 230000006870 function Effects 0.000 claims abstract description 20
- 230000005540 biological transmission Effects 0.000 claims abstract description 16
- 238000013507 mapping Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 16
- 238000010586 diagram Methods 0.000 description 9
- 239000011230 binding agent Substances 0.000 description 8
- 230000007246 mechanism Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 6
- 230000026676 system process Effects 0.000 description 6
- FFBHFFJDDLITSX-UHFFFAOYSA-N benzyl N-[2-hydroxy-4-(3-oxomorpholin-4-yl)phenyl]carbamate Chemical compound OC1=C(NC(=O)OCC2=CC=CC=C2)C=CC(=C1)N1CCOCC1=O FFBHFFJDDLITSX-UHFFFAOYSA-N 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000003993 interaction Effects 0.000 description 2
- 239000003550 marker Substances 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 239000011521 glass Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a communication method, a device, electronic equipment and a storage medium of a cross-partition process. Wherein the method comprises the following steps: creating a publisher service in a first system partition, and registering the publisher service to a shared memory soft bus management service according to a main management service; creating subscriber service in a second system partition, and acquiring the publisher service in the shared memory soft bus management service according to the main management service; and acquiring data to be communicated created by the publisher service in the first system partition according to the subscriber service in the second system partition. The embodiment of the invention can solve the data communication problem of processes in different partitions, can realize cross-partition transmission of data, reduces the difficulty of realizing system functions and enhances the use experience of users.
Description
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for cross-partition process communication, an electronic device, and a storage medium.
Background
At present, with the development of mobile terminal devices, multiple partitions may exist in an android System environment, for example, a System partition, a Vendor partition and the like, and multiple processes may be respectively provided in different partitions, where the processes may be processes corresponding to the partitions, for example, a System process in the System partition, a Vendor process in the Vendor partition and the like, and the types of the processes may be a Binary program, a HAL service, an APK program, a System service and the like, and in order to distinguish the processes, the processes of different partitions may be respectively managed by using different selinux labels. The DFS soft bus needs to communicate between different partition processes, but the data to be communicated is not limited to common characters, but needs to include a file descriptor FD, but a communication protocol such as TCP/IP temporarily does not support cross-partition transmission of the file descriptor, so a data communication method of the cross-partition process is needed currently.
Disclosure of Invention
The invention provides a communication method, a device, electronic equipment and a storage medium of a cross-partition process, which are used for solving the data communication problem of processes in different partitions, realizing the cross-partition transmission of data, reducing the realization difficulty of system functions and enhancing the use experience of users.
According to one aspect of the present invention, there is provided a communication method for a cross-partition process, where the method includes:
creating a publisher service in a first system partition, and registering the publisher service to a shared memory soft bus management service according to a main management service;
creating subscriber service in a second system partition, and acquiring the publisher service in the shared memory soft bus management service according to the main management service;
and acquiring data to be communicated created by the publisher service in the first system partition according to the subscriber service in the second system partition.
According to another aspect of the present invention, there is provided a communication apparatus for cross-partition processes, wherein the apparatus includes:
the system comprises a publisher registration module, a shared memory soft bus management module and a shared memory soft bus management module, wherein the publisher registration module is used for creating publisher services in a first system partition and registering the publisher services to the shared memory soft bus management service according to a main management service;
the subscriber registration module is used for creating subscriber services in a second system partition, and acquiring the publisher services from the shared memory soft bus management service according to the main management service;
and the communication transmission module is used for acquiring data to be communicated, which are created by the publisher service in the first system partition, in the second system partition according to the subscriber service.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of cross-partition process communication of any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement a method of cross-partition process according to any one of the embodiments of the present invention when executed.
According to the technical scheme, the publisher service is created in the first system partition, the publisher service is registered to the shared memory soft bus management service through the main management service, the subscriber service is created in the second system partition, the publisher service is acquired in the shared memory soft bus management service according to the main management service, the data to be communicated created by the publisher service in the first system partition is acquired in the second system partition through the subscriber service, the communication problem of process data in different system partitions is solved, the data trans-regional transmission cost can be reduced, the system function realization difficulty is reduced, and the user experience of a user is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is an exemplary diagram of a prior art cross-partition process communication provided in accordance with the principles of the present invention;
FIG. 2 is a flow chart of a method of communication across partition processes according to a first embodiment of the present invention;
FIG. 3 is a flowchart of another method for communication across partition processes according to a second embodiment of the present invention;
FIG. 4 is an exemplary diagram of a communication method across partition processes according to a third embodiment of the present invention;
FIG. 5 is an exemplary diagram of a communication flow across partition processes provided in accordance with a third embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a communication device for cross-partition process according to a fourth embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device implementing a method for communicating across partition processes according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
At present, data communication is realized through a Binder driver in an android System environment, but three Binder service schemes of the prior android native cannot realize cross-partition file descriptor transfer, referring to fig. 1, the three Binder services of the prior art can only support cross-partition transmission in partial System partitions, wherein the first Binder mechanism only acts on a System process and does not support a Vendor process. Second kind: although the HwBinder mechanism locally opens up communication between the Vendor process and the System process, the HwBinder mechanism has great limitation that the Vendor process can only be used as a server, the System process can not be used as a server, and the Vendor process scene used as a server can only be HAL service. Third kind: the VnBinder mechanism only acts on the Vendor process and does not support the System process. In summary, in view of the above problems, the embodiment of the present invention provides a communication method for cross-partition processes, which can implement inter-process communication in any system partition, and break through the communication constraint condition of the existing android system.
Example 1
Fig. 2 is a flowchart of a method for cross-partition process communication according to a first embodiment of the present invention, where the method may be performed by a cross-partition process communication device, and the cross-partition process communication device may be implemented in hardware and/or software. As shown in fig. 2, the method provided by the embodiment of the invention includes:
and 110, creating a publisher service in the first system partition, and registering the publisher service to the shared memory soft bus management service according to the main management service.
The first System partition may be a configuration area for storing information for providing a terminal System service in the electronic device, the first System partition may include information such as a user interface and pre-installed software, for example, the first System partition may include a core application, a virtual machine, a local library, a dynamic link library, a JAVA archive package and the like, the publisher anonymous service may be a service executed by a process in the first System partition, the publisher anonymous service may be a data provider for communicating with a process in another System partition, and the publisher service may utilize a shared memory. The shared memory soft bus management service may be a service for managing the shared memory, and the shared memory soft bus management service may allocate the shared memory to other services, so that other services allocated to the shared memory may operate on the shared memory. The master management service may be a service that manages all services, and in some inventive embodiments, the master management service may include a servicemanager service in a Binder service, or a custom service, or the like.
In the embodiment of the invention, the publisher service can be created in the first system partition, the created publisher service can be executed by a process in the first system partition, the created publisher service can be registered in the master management service, the master management service can be used for managing the publisher service, the shared memory soft bus management service can be acquired, and the created publisher service can be registered in the shared memory soft bus management service, so that the publisher service can use the shared memory through the shared memory soft bus management service.
And 120, creating subscriber services in the second system partition, and acquiring publisher services in the shared memory soft bus management service according to the main management service.
The second system partition may be a different system partition from the first system partition, may have different service functions from the first system partition, may also include content such as core applications, virtual machines, local libraries, dynamic link libraries, JAVA archive packages, and the like, and in some exemplary embodiments, may include a Vendor system partition including customized applications and library files. The subscriber service may be a service that obtains data within other partitioned systems and may be performed by processes within the second system partition.
In the embodiment of the invention, the subscriber service can be created in the second system partition, the second system partition can allocate a corresponding process for the subscriber service to execute the data receiving function, after the subscriber service is created, the shared memory soft bus management service can be obtained through the main management service, the registered publisher service is determined in the shared memory soft bus management service, the subscriber service can obtain the data created by the publisher service, and it can be understood that the subscriber service can monitor through the shared memory when the shared memory allocated to the publisher service is determined through the shared memory soft bus management service, so as to obtain the data created by the publisher service.
And 130, acquiring data to be communicated created by the publisher service in the first system partition according to the subscriber service in the second system partition.
The data to be communicated may be data transmitted to subscribers by the publisher service, and the data to be communicated may include, but is not limited to, common characters, file descriptors, and the like.
In the embodiment of the invention, after the subscriber service acquires the publisher service from the shared memory soft bus management service, the shared memory allocated by the publisher service can be monitored through the subscriber service, and after the publisher service in the first system partition creates the data to be communicated in the shared memory, the subscriber service can read the data to be communicated in the shared memory, so that the second system partition acquires the data to be communicated created by the process of the publisher service in the first partition through the subscriber service.
In the embodiment of the invention, the publisher service is created in the first system partition, the publisher service is registered to the shared memory soft bus management service through the main management service, the subscriber service is created in the second system partition, the publisher service is acquired in the shared memory soft bus management service according to the main management service, and the data to be communicated created by the publisher service in the first system partition is acquired in the second system partition through the subscriber service, so that the communication problem of process data in different system partitions is solved, the data trans-regional transmission cost is reduced, the system function realization difficulty is reduced, and the use experience of users is improved.
Example two
Fig. 3 is a flowchart of another cross-partition process communication method according to a second embodiment of the present invention, where the embodiment of the present invention is embodied on the basis of the above embodiment of the present invention, and referring to fig. 3, the method provided by the embodiment of the present invention specifically includes the following steps:
step 210, creating a soft bus management service as a master management service and starting a shared memory soft bus management service.
The soft bus management service may be a system service, and the soft bus management service may implement management service management, where the soft bus management service may include dfsservicemanager service, servicema nager service, and the like. The shared memory soft bus management service may include a shmem_dfs_server_manager service within the Binder service, and the like.
In the embodiment of the invention, a soft bus management service can be created, corresponding computing resources are allocated for the soft bus management service, the computing resources comprise but are not limited to a user space, a kernel space and the like, a process running the soft bus management service function can be registered as a master management service after the soft bus management service is created, a shared memory soft bus management service can be created, and the created shared memory soft bus management service is registered in the master management service, so that the shared memory soft bus management service can be called by other services.
Step 220, opening the kernel device node in the first system partition, and creating mappings of the publisher service with the user space and the kernel space, respectively.
The kernel device node may be a directory for implementing mapping between the kernel and the user layer, the kernel device node may be a logical file for driving devices, the kernel device node may be implemented in the form of a directory, each device node may be a file, and the file may include a service running according to the device node. The user space may be a user-layer computing resource, the kernel space may be a system kernel space, and the mapping of the user space and the kernel space may be a correspondence between the user-layer computing resource of the kernel device node and the computing resource of the kernel space.
In the embodiment of the invention, the first system partition can be used for creating the publisher service, opening the catalog of the kernel equipment node, adding the publisher service into the catalog of the kernel equipment node, and establishing the mapping between the user space and the kernel space for the publisher service, so that the publisher service can provide service through the computing resource of the kernel equipment node. Further, the first system partition may be preconfigured with permissions to open kernel device nodes, e.g., selinux permissions.
Step 230, obtaining the main management service, and determining the shared memory soft bus management service in the main management service.
In the embodiment of the invention, the main management service can be acquired, the shared memory soft bus management service can be acquired through the main management service, for example, the process for executing the main management service can be called to acquire the identification information of the shared memory soft bus management service, and the shared memory soft bus management service can be called according to the identification information.
Step 240, register the publisher service with the shared memory soft bus management service.
In the embodiment of the invention, the publisher service may be registered to the shared memory soft bus management service, and the shared memory may be allocated to the publisher service by the shared memory soft bus management service. Further, in some embodiments of the present invention, the anonymous service of the publisher service may be registered with the shared memory soft bus management service, so that the shared memory soft bus management service provides a management function of the shared memory for the anonymous service of the publisher service.
Step 250, opening the kernel device node in the second system partition, and establishing a mapping between the subscriber service and the user space and the kernel space.
Specifically, with creating a publisher service type in the first system partition, a subscriber service may be created in the second system partition, a directory in which the kernel device node is located is opened, and the subscriber service is added to the directory in which the kernel device node is located, and a mapping between a user space and a kernel space of the subscriber service is created. Furthermore, before the pre-kernel device node is opened, the second system partition may also verify selinux authority of the second system partition to the kernel device node.
Step 260, call the main management service to obtain the shared memory soft bus management service.
In the embodiment of the invention, the main management service can be acquired, and the shared memory soft bus management service can be acquired through the main management service. For example, a process identifier of the shared memory soft bus management service may be registered in the master management service, and the shared memory soft bus management service may be obtained through the process identifier.
Step 270, searching the publisher service in the shared memory soft bus management service.
Specifically, a process of the shared memory soft bus management service may be invoked, and the publisher service is found through the process, it may be understood that the process of the shared memory soft bus management service may store registration information of the publisher service, and may obtain an execution process of the publisher service according to the registration information.
And 280, determining that the shared memory mapped by the publisher service has data to be communicated created by the publisher service according to the subscription service.
In the embodiment of the invention, whether the shared memory is ready for communicating data or not can be determined by continuously monitoring the shared memory allocated by the publisher service through the process of the subscriber service.
And 290, reading the data to be communicated in the shared memory according to the subscriber service.
In the embodiment of the invention, the process of the subscriber service can be called, so that the subscriber service reads the data to be communicated created in the shared memory by the publisher service, and the second system partition acquires the data to be communicated in the first system partition.
In the embodiment of the invention, the soft bus management service is created as the master management service, the shared memory soft bus management service is started, the kernel equipment nodes are respectively opened in the first system partition and the second system partition, the mapping of the user space and the kernel space is respectively created for the created publisher service and the subscriber service, the master management service is obtained, the shared memory soft bus management service is determined in the master management service, the publisher service is registered to the shared memory soft bus management service, the shared memory soft bus management service registered by the master management service is obtained in the second system partition, the shared memory of the publisher service is monitored by the subscriber service to determine to-be-communicated data, the subscriber service obtains the to-be-communicated data, the transmission of process data in different system partitions is realized, the limitation of the communication condition of the existing android system is broken, the data trans-regional transmission cost is reduced, the system function realization difficulty is lowered, and the user experience is improved.
Further, on the basis of the embodiment of the present invention, creating a soft bus management service as a primary management service includes:
opening a kernel device node, and creating mapping between the soft bus management service and a user space and between the soft bus management service and a kernel space respectively; and calling a preset context as a function to set the soft bus management service as the main management service.
The preset context function may be a service registration function, and the preset context function may be a logic program configured with service registration in advance.
In the embodiment of the invention, the kernel equipment node can be opened, the soft bus management service is registered to the kernel equipment node, the mapping between the user space and the kernel space is created, the preset context can be called to become a function, and the process of the soft bus management service is registered as the master management service.
Further, on the basis of the embodiment of the invention, the method further comprises the following steps:
invoking the shared memory soft bus service to determine registration information of the publisher service; and searching the shared memory corresponding to the publisher service according to the registration information.
The registration information may include, among other things, a service identifier of the publisher service and a process identifier of the publisher service process. Registration information may be stored within the process of the shared memory soft bus service.
In the embodiment of the invention, the shared memory soft bus service can be obtained, the registration information of the publisher service can be read in the process of the shared memory soft bus service, the shared memory corresponding to the publisher service can be determined by the shared memory soft bus service according to the registration information, and the publisher service can operate the shared memory.
Example III
FIG. 4 is an exemplary diagram of a method for cross-partition process communication according to a third embodiment of the present invention, where the method for cross-partition process communication may be implemented by using a Binder driver implementation of the android system itself, and a new driving device node/dev/dfsBinder may be created, and a static library (dfsBinder_static) and a management service (dfsservicemanager) may be created to use the driving device node/dev/dfsBinder. In the embodiment of the invention, by means of selinux authority configuration, the system process and the vendor process can use the mechanism to communicate, and referring to fig. 4, the communication method of the cross-regional process can be composed of a/dev/dfsbinder, a dfsbinder_static library, dfsservic emanager service, a shmem_dfs_server_manager service, a talker service and a Listener service, wherein the shmem_dfs_server_manager is a sub-service managed by the dfsservicemanager, and the processes of the talker service and the Listener service query and acquire the shmem_dfs_server_manager service from dfsse rvicemanager management service by using the dfsbinder_static. the processes of the talker service and the Listener service finally carry out message communication in a mode of transferring the shmem_dfs_server_manager service. Referring to fig. 5, the process of message communication refers to 4 processes of dfsservicemanager service, shmem_dfs_server_manager service, talker service and listner service, and the working flows of the 4 processes are sequentially from 1 to 12, and one process may occupy multiple flows. The final result achieved is: the marker service process sends the file descriptor of the shared memory created by the marker service process to the Listener service process through a bin der communication mechanism. Specifically, the process comprises the following steps:
1. dfsservicemanager service registration;
1.1, open/dev/dfsbinder device node. (Process 1)
1.2, building mmap mapping. (Process 1)
1.3, calling a becometextmanager (context_check_func checkFunc, void_userdata) function, and taking the process of the dfsservicemanager service itself as a management service. (Process 1)
2. The shmem_dfs_server_manager service is registered;
2.1, open/dev/dfsbinder device node. (Process 2)
2.2, building mmap mapping. (Process 2)
2.3, obtaining dfsservicemanager. (Process 3)
2.4, registering the shmem_dfs_server_manager service to the dfsservicemanager service. (Process 3)
3. the talker publisher registers for anonymous services;
3.1, open/dev/dfsbinder device node. (Process 4)
And 3.2, building mmap mapping. (Process 4)
3.3, obtaining dfsservicemanager. (Process 5)
And 3.4, acquiring a shmem_dfs_server_manager service. (Process 6)
And 3.5, registering the anonymous service of the talker publisher into the shmem_dfs_server_manager service. (Process 7)
4. A Listener subscriber acquires a subscriber shared memory file descriptor;
4.1, open/dev/dfsbinder device node. (Process 8)
4.2, building mmap mapping. (Process 8)
4.3, obtaining dfsservicemanager. (flow 9)
4.4, obtaining a shmem_dfs_server_manager service. (flow 10)
4.5, acquiring the anonymous service registered in the shmem_dfs_server_manager service. (flow 11)
And 4.6, calling an interface of the anonymous service, and acquiring a file descriptor of the shared memory created by the talker publisher. (flow 12)
Example IV
Fig. 6 is a schematic structural diagram of a communication device for cross-partition process according to a fourth embodiment of the present invention. As shown in fig. 6, an apparatus provided in an embodiment of the present invention includes: a publisher registration module 301, a subscriber registration module 302, and a communication transmission module 303.
The publisher registration module 301 is configured to create a publisher service in the first system partition, and register the publisher service to the shared memory soft bus management service according to the master management service.
And the subscriber registration module 302 is configured to create a subscriber service in the second system partition, and obtain the publisher service from the shared memory soft bus management service according to the master management service.
And the communication transmission module 303 is configured to obtain, in a second system partition, data to be communicated created by a publisher service in the first system partition according to the subscriber service.
In the embodiment of the invention, the publisher registration module creates the publisher service in the first system partition, registers the publisher service to the shared memory soft bus management service through the main management service, creates the subscriber service in the second system partition, acquires the publisher service in the shared memory soft bus management service according to the main management service, and the communication transmission module acquires the data to be communicated created by the publisher service in the first system partition through the subscriber service in the second system partition, thereby solving the communication problem of process data in different system partitions, reducing the data trans-regional transmission cost, reducing the realization difficulty of system functions and improving the use experience of users.
Further, on the basis of the above embodiment of the present invention, the apparatus further includes: and the initialization module is used for creating the soft bus management service as a main management service and starting the shared memory soft bus management service.
Further, on the basis of the above embodiment of the present invention, the initializing module in the device includes:
the device node unit is used for opening a kernel device node by the kernel and creating the mapping between the soft bus management service and the user space and the kernel space respectively;
and the service registration unit is used for calling a preset context as a function to set the soft bus management service as the master management service.
Further, on the basis of the above embodiment of the present invention, the publisher registration module 301 is specifically configured to: opening a kernel device node in the first system partition, and creating mappings of the publisher service with a user space and a kernel space respectively; acquiring the main management service, and determining the shared memory soft bus management service in the main management service; registering the publisher service with the shared memory soft bus management service.
Further, on the basis of the above embodiment of the present invention, the subscriber registration module 302 is specifically configured to: opening a kernel device node in the second system partition, and establishing mapping between the subscriber service and a user space and between the subscriber service and the kernel space; calling the main management service to acquire the shared memory soft bus management service; and searching the publisher service in the shared memory soft bus management service.
Further, on the basis of the above embodiment of the present invention, the communication transmission module 303 includes:
and the data monitoring unit is used for data monitoring, wherein the shared memory mapped by the publisher service is determined to have the data to be communicated created by the publisher service according to the subscription service.
And the data reading unit is used for reading the data to be communicated in the shared memory according to the subscriber service.
Further, on the basis of the above embodiment of the present invention, the communication transmission module 303 further includes: invoking the shared memory soft bus service to determine registration information of the publisher service; and searching the shared memory corresponding to the publisher service according to the registration information.
The communication device of the cross-partition process provided by the embodiment of the invention can execute the communication method of the cross-partition process provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example five
Fig. 7 is a schematic structural diagram of an electronic device implementing a method for communicating across partition processes according to an embodiment of the present invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 7, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the communication method across partition processes.
In some embodiments, the method of communication across partition processes may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the above-described method of communicating across partition processes may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the communication method of the cross-partition process in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention 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, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, 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: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Claims (10)
1. A method of communicating across partitioned processes, the method comprising:
creating a publisher service in a first system partition, and registering the publisher service to a shared memory soft bus management service according to a main management service;
creating subscriber service in a second system partition, and acquiring the publisher service in the shared memory soft bus management service according to the main management service;
and acquiring data to be communicated created by the publisher service in the first system partition according to the subscriber service in the second system partition.
2. The method as recited in claim 1, further comprising:
the soft bus management service is created as a master management service and the shared memory soft bus management service is started.
3. The method of claim 2, wherein creating the soft bus management service is a master management service, comprising:
opening a kernel device node, and creating mapping between the soft bus management service and a user space and between the soft bus management service and a kernel space respectively;
and calling a preset context as a function to set the soft bus management service as the main management service.
4. The method of claim 1, wherein creating a publisher service in the first system partition, registering the publisher service with a shared memory soft bus management service according to a master management service, comprises:
opening a kernel device node in the first system partition, and creating mappings of the publisher service with a user space and a kernel space respectively;
acquiring the main management service, and determining the shared memory soft bus management service in the main management service;
registering the publisher service with the shared memory soft bus management service.
5. The method of claim 1, wherein creating a subscriber service at the second system partition, and obtaining the publisher service within the shared memory soft bus management service according to the primary management service, comprises:
opening a kernel device node in the second system partition, and establishing mapping between the subscriber service and a user space and between the subscriber service and the kernel space;
calling the main management service to acquire the shared memory soft bus management service;
and searching the publisher service in the shared memory soft bus management service.
6. The method of claim 1, wherein the obtaining, at the second system partition, data to be communicated created by the publisher service in the first system partition according to the subscriber service comprises:
determining that the shared memory mapped by the publisher service has the data to be communicated created by the publisher service according to the subscription service;
and reading the data to be communicated in the shared memory according to the subscriber service.
7. The method as recited in claim 6, further comprising:
invoking the shared memory soft bus service to determine registration information of the publisher service; and searching the shared memory corresponding to the publisher service according to the registration information.
8. A communication device for cross-partition processes, the device comprising:
the system comprises a publisher registration module, a shared memory soft bus management module and a shared memory soft bus management module, wherein the publisher registration module is used for creating publisher services in a first system partition and registering the publisher services to the shared memory soft bus management service according to a main management service;
the subscriber registration module is used for creating subscriber services in a second system partition, and acquiring the publisher services from the shared memory soft bus management service according to the main management service;
and the communication transmission module is used for acquiring data to be communicated, which are created by the publisher service in the first system partition, in the second system partition according to the subscriber service.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the cross-partition process communication method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the method of communicating across partition processes of any of claims 1-7 when executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311153779.6A CN117234751A (en) | 2023-09-06 | 2023-09-06 | Cross-partition process communication method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311153779.6A CN117234751A (en) | 2023-09-06 | 2023-09-06 | Cross-partition process communication method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117234751A true CN117234751A (en) | 2023-12-15 |
Family
ID=89095913
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311153779.6A Pending CN117234751A (en) | 2023-09-06 | 2023-09-06 | Cross-partition process communication method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117234751A (en) |
-
2023
- 2023-09-06 CN CN202311153779.6A patent/CN117234751A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10701139B2 (en) | Life cycle management method and apparatus | |
US10917294B2 (en) | Network function instance management method and related device | |
CN109587281B (en) | Container configuration method and computing node | |
CN109995552B (en) | VNF service instantiation method and device | |
CN112905304B (en) | Communication method and device between virtual machines, physical host and medium | |
WO2021088444A1 (en) | Ns instantiation method and nfvo | |
CN116800616B (en) | Management method and related device of virtualized network equipment | |
CN114625536A (en) | Video memory allocation method, device, medium and electronic equipment | |
US20210157652A1 (en) | Customized partitioning of compute instances | |
CN113162835B (en) | Method, device, equipment and storage medium for accessing service resource | |
CN109905258B (en) | PaaS management method, device and storage medium | |
CN112905273A (en) | Service calling method and device | |
CN117194068A (en) | Cross-process data transmission method, system, equipment and storage medium | |
JP2024501005A (en) | Management method and device for container clusters | |
CN113612643B (en) | Network configuration method, device and equipment of cloud mobile phone and storage medium | |
CN109618016B (en) | DNS request sending and processing method, related method and related device | |
CN113541987A (en) | Method and device for updating configuration data | |
CN116032614A (en) | Container network micro-isolation method, device, equipment and medium | |
CN114726657B (en) | Interrupt management and data receiving and transmitting management method and device and intelligent network card | |
CN115665231A (en) | Service creation method, device and computer-readable storage medium | |
CN117234751A (en) | Cross-partition process communication method and device, electronic equipment and storage medium | |
US20230114321A1 (en) | Cloud Data Ingestion System | |
WO2021232860A1 (en) | Communication method, apparatus and system | |
CN112889247B (en) | VNF service instantiation method and device | |
CN115277568B (en) | Data transmission method, device, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |