CN105975407B - Memory address mapping method and device - Google Patents
Memory address mapping method and device Download PDFInfo
- Publication number
- CN105975407B CN105975407B CN201610164190.XA CN201610164190A CN105975407B CN 105975407 B CN105975407 B CN 105975407B CN 201610164190 A CN201610164190 A CN 201610164190A CN 105975407 B CN105975407 B CN 105975407B
- Authority
- CN
- China
- Prior art keywords
- memory
- address
- virtual
- physical
- module
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/10—Address translation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/65—Details of virtual memory and virtual address translation
- G06F2212/656—Address space sharing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Storage Device Security (AREA)
Abstract
本发明实施例公开了一种内存地址的映射方法及设备。本申请实施例中在进行内存地址映射时,第一业务进程通过申请得到物理内存,通过预先计算的物理内存地址和虚拟内存地址的偏移值,从预先确定的虚拟内存空间确定该物理内存地址对应的虚拟内存地址,建立映射关系,创建共享内存区,同时第二业务进程获取与第一业务进程一样的内存大小和内存区标识创建相同的共享内存区,实现内存地址的映射,由于物理内存地址与虚拟内存地址之间的转换只需要通过预先计算的偏移值就可以得到,提高了物理内存地址与虚拟内存地址的转换效率。
The embodiment of the present invention discloses a memory address mapping method and device. When performing memory address mapping in the embodiment of the present application, the first service process obtains the physical memory by applying, and determines the physical memory address from the pre-determined virtual memory space according to the offset value of the pre-calculated physical memory address and the virtual memory address. Corresponding virtual memory addresses, establish a mapping relationship, and create a shared memory area. At the same time, the second business process obtains the same memory size and memory area ID as the first business process to create the same shared memory area to realize the mapping of memory addresses. The conversion between the address and the virtual memory address only needs to be obtained through the pre-calculated offset value, which improves the conversion efficiency of the physical memory address and the virtual memory address.
Description
技术领域technical field
本发明涉及计算机技术领域,特别涉及一种内存地址的映射方法及设备。The present invention relates to the technical field of computers, in particular to a memory address mapping method and device.
背景技术Background technique
在Linux操作系统或者Unix操作系统中,mmap接口可将一个文件或者其它对象映射进内存,对文件或者其他对象的操作就可以像操作内存一样方便。一般用于进程间数据共享、用户态与内核态免拷贝数据共享、用户程序直接操作设备等场景。In the Linux operating system or Unix operating system, the mmap interface can map a file or other object into memory, and the operation of the file or other object can be as convenient as operating the memory. It is generally used in scenarios such as data sharing between processes, copy-free data sharing between user mode and kernel mode, and user programs directly operating devices.
操作系统中软件进程调用mmap接口映射一段物理内存空间,完成后返回该段物理内存空间对应的起始虚拟内存地址,软件建立了物理内存地址与虚拟内存地址的映射关系。软件与现场可编程门阵列(Field-Programmable Gate Array,FPGA)设备交互时,需要告诉FPGA存放待处理数据的物理内存地址,FPGA处理完后返回,软件读取处理结果时,需要先把存放处理结果的物理内存地址转换为虚拟内存地址。The software process in the operating system calls the mmap interface to map a segment of physical memory space, and returns the starting virtual memory address corresponding to the segment of physical memory space after completion. The software establishes the mapping relationship between the physical memory address and the virtual memory address. When the software interacts with a Field-Programmable Gate Array (FPGA) device, it needs to tell the FPGA the physical memory address where the data to be processed is stored, and the FPGA returns after processing it. When the software reads the processing result, it needs to store and process it first. The resulting physical memory address is converted to a virtual memory address.
当有多个进程需要与FPGA设备进行交互时,由于FPGA资源限制,无法与每个进程提供一对一的交互队列(比如有1000个进程与FPGA进行交互,如果需要每个进程都提供一对队列,则需要2000个队列,每个进程各有1个接收队列、1个发送队列)。因此,一般采用进程共享队列的方式,如图1所示,业务进程处理具体的业务,把需要处理的报文通过请求队列发送给FPGA;FPGA处理完毕后,把处理结果放入结果队列;转发进程从结果队列读取结果,并根据结果解析,报文属于哪个业务进程,转发给相应的业务进程,或者直接处理结果。When there are multiple processes that need to interact with the FPGA device, due to the limitation of FPGA resources, it is impossible to provide a one-to-one interaction queue with each process (for example, there are 1000 processes interacting with the FPGA, if each process needs to provide a one-to-one interaction queue Queue, you need 2000 queues, each process has 1 receive queue, 1 send queue). Therefore, the process of sharing the queue is generally adopted. As shown in Figure 1, the business process processes specific services and sends the messages to be processed to the FPGA through the request queue; after the FPGA is processed, the processing results are placed in the result queue; forwarding The process reads the result from the result queue, and parses the result based on which business process the message belongs to, and forwards it to the corresponding business process, or directly processes the result.
因此,转发进程必须能够识别结果队列的内容,解析内容的信息并处理,要求各个业务进程申请的物理内存空间与转发进程共享。在这种共享场景下,转发进程存在着多个内存区的地址映射关系,如果业务进程很多,或者每个业务进程创建的内存区很多,那么这个映射表条目将会更大,虚拟内存地址与物理内存地址的转换需要查表,转换效率低。Therefore, the forwarding process must be able to identify the content of the result queue, parse and process the information of the content, and require the physical memory space applied by each business process to be shared with the forwarding process. In this sharing scenario, the forwarding process has the address mapping relationship of multiple memory areas. If there are many business processes, or each business process creates many memory areas, the entry of this mapping table will be larger, and the virtual memory address will be the same as The conversion of physical memory addresses requires a table lookup, and the conversion efficiency is low.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供了一种内存地址的映射方法及设备,提高了物理内存地址与虚拟内存地址的转换效率。Embodiments of the present invention provide a memory address mapping method and device, which improve the conversion efficiency between physical memory addresses and virtual memory addresses.
一方面,本申请实施例中提供一种内存地址的映射方法,该方法应用于目标设备中,所述目标设备为终端或服务器,所述目标设备中安装有操作系统,所述操作系统中包括至少一个业务进程,所述至少一个业务进程中包括第一业务进程和第二业务进程,所述方法包括:On the one hand, an embodiment of the present application provides a method for mapping a memory address, and the method is applied to a target device, where the target device is a terminal or a server, and an operating system is installed in the target device, and the operating system includes At least one business process, the at least one business process includes a first business process and a second business process, and the method includes:
通过所述第一业务进程生成第一内存申请请求,所述第一内存申请请求包括申请内存大小和内存区标识;A first memory application request is generated by the first business process, where the first memory application request includes an application memory size and a memory area identifier;
通过所述第一业务进程根据所述内存申请请求从预留的物理内存空间中分配第一物理内存地址,并根据预先计算的物理内存地址和虚拟内存地址的偏移值,从预先确定的虚拟内存空间中分配所述第一物理内存地址对应的第一虚拟内存地址,所述虚拟内存空间通过所述物理内存空间确定;The first physical memory address is allocated from the reserved physical memory space by the first business process according to the memory application request, and according to the offset value of the pre-calculated physical memory address and the virtual memory address, the virtual memory Allocate a first virtual memory address corresponding to the first physical memory address in the memory space, and the virtual memory space is determined by the physical memory space;
通过所述第一业务进程建立所述第一物理内存地址对应的第一虚拟内存地址之间的映射关系,创建第一共享内存区;Establishing, by the first service process, a mapping relationship between the first virtual memory addresses corresponding to the first physical memory addresses, and creating a first shared memory area;
通过所述第二业务进程获取所述申请内存大小和所述内存区标识;Obtain the requested memory size and the memory area identifier through the second business process;
通过所述第二业务进程根据所述申请内存大小和所述内存区标识,创建所述第一共享内存区。The first shared memory area is created by the second service process according to the requested memory size and the memory area identifier.
本申请实施例中在进行内存地址映射时,业务进程通过申请得到物理内存,通过预先计算的物理内存地址和虚拟内存地址的偏移值,从预先确定的虚拟内存空间确定该物理内存地址对应的虚拟内存地址,建立映射关系,创建共享内存区,同时将内存大小和内存区标识通知给第二业务进程,以使得第二业务进程创建相同的共享内存区,实现内存地址的映射,由于物理内存地址与虚拟内存地址之间的转换只需要通过预先计算的偏移值就可以得到,提高了物理内存地址与虚拟内存地址的转换效率。In the embodiment of the present application, when performing memory address mapping, the business process obtains the physical memory by applying, and determines the corresponding physical memory address from the pre-determined virtual memory space by using the pre-calculated offset value of the physical memory address and the virtual memory address. virtual memory address, establish a mapping relationship, create a shared memory area, and notify the second business process of the memory size and memory area identifier, so that the second business process creates the same shared memory area and realizes the mapping of memory addresses. The conversion between the address and the virtual memory address only needs to be obtained through the pre-calculated offset value, which improves the conversion efficiency between the physical memory address and the virtual memory address.
在一种可能的设计中,在所述根据预先计算的物理内存地址和虚拟内存地址的偏移值,计算所述第一物理内存地址对应的第一虚拟内存地址之前,可以预先计算好物理内存地址和虚拟内存地址之间的偏移值,以用作物理内存地址和虚拟内存地址之间计算的基准值。In a possible design, before calculating the first virtual memory address corresponding to the first physical memory address according to the pre-calculated offset value of the physical memory address and the virtual memory address, the physical memory may be pre-calculated The offset value between the address and the virtual memory address to use as a base value for calculations between the physical memory address and the virtual memory address.
此时,即在所述根据预先计算的物理内存地址和虚拟内存地址的偏移值,计算所述第一物理内存地址对应的第一虚拟内存地址之前,所述方法还可以包括:At this time, that is, before calculating the first virtual memory address corresponding to the first physical memory address according to the pre-calculated offset value of the physical memory address and the virtual memory address, the method may further include:
计算物理内存地址和虚拟内存地址的偏移值,该物理内存地址和虚拟内存地址的偏移值可以是预留物理内存空间的起始地址(如phy_start)和预先分配的虚拟内存地址空间的起始地址(如vir_start)之间的偏移值:即例如偏移值offset=phy_start-vir_start。Calculate the offset value of the physical memory address and the virtual memory address. The offset value of the physical memory address and the virtual memory address can be the starting address of the reserved physical memory space (such as phy_start) and the starting address of the pre-allocated virtual memory address space. Offset value between start addresses (such as vir_start): that is, for example, the offset value offset=phy_start-vir_start.
在另一种可能的设计中,所述计算物理内存地址和虚拟内存地址的偏移值,可以包括:In another possible design, the calculating the offset value between the physical memory address and the virtual memory address may include:
获取所述物理内存空间的起始地址及所述物理内存空间的大小;Obtain the starting address of the physical memory space and the size of the physical memory space;
根据所述预留物理内存空间的起始地址及所述物理内存空间的大小,分配所述虚拟内存空间;Allocate the virtual memory space according to the starting address of the reserved physical memory space and the size of the physical memory space;
根据所述物理内存空间的起始地址和所述虚拟内存空间的起始地址,计算物理内存地址和虚拟内存地址的偏移值。According to the starting address of the physical memory space and the starting address of the virtual memory space, the offset value of the physical memory address and the virtual memory address is calculated.
在另一种可能的设计中,所述虚拟内存空间中虚拟内存地址未分配前权限设置为不可访问;In another possible design, the permission is set to be inaccessible before the virtual memory address in the virtual memory space is not allocated;
在从预先确定的虚拟内存空间中分配所述第一物理内存地址对应的第一虚拟内存地址之后,所述方法还包括:After allocating the first virtual memory address corresponding to the first physical memory address from the predetermined virtual memory space, the method further includes:
在所述虚拟内存空间中将所述第一虚拟内存地址设置为仅供所述第一业务进程访问。The first virtual memory address is set in the virtual memory space to be accessed only by the first service process.
这样,进程只能访问分配给它的内存空间,而不能访问其他进程的内存空间或者未分配的内存空间,达到了内存隔离和保护的效果。In this way, a process can only access the memory space allocated to it, but cannot access the memory space or unallocated memory space of other processes, achieving the effect of memory isolation and protection.
在另一种可能的设计中,所述通过所述第二业务进程获取所述申请内存大小和所述内存区标识,可以包括:In another possible design, the acquiring the requested memory size and the memory area identifier through the second business process may include:
通过所述第一业务进程向所述第二业务进程发送通知消息,所述通知消息中包括所述申请内存大小和所述内存区标识;Send a notification message to the second service process through the first service process, where the notification message includes the requested memory size and the memory area identifier;
通过所述第二业务进程接收所述通知消息,获取所述申请内存大小和所述内存区标识。The notification message is received by the second service process, and the requested memory size and the memory area identifier are acquired.
此种情况下,是业务进程通过发送通知消息的方式去通知第二业务进程所述申请内存大小和所述内存区标识,以使得第二业务进程创建与业务进程相同的共享内存区,实现内存地址的映射,可以理解的是,通过所述第二业务进程获取所述申请内存大小和所述内存区标识还可以是:通过在第二业务进程和业务进程预先约定相同的规则去获取所述申请内存大小和所述内存区标识,例如在第二业务进程和业务进程预先约定好申请内存大小和内存区标识,第二业务进程和业务进程获取约定好的所述申请内存大小和所述内存区标识。In this case, the business process notifies the second business process of the size of the application memory and the memory area identifier by sending a notification message, so that the second business process creates the same shared memory area as the business process and realizes the memory For the mapping of addresses, it can be understood that obtaining the application memory size and the memory area identifier through the second business process may also be: obtaining the Applying for the memory size and the memory area identifier, for example, the application memory size and memory area identifier are pre-agreed in the second business process and the business process, and the second business process and the business process obtain the agreed application memory size and the memory area District ID.
在另一种可能的设计中,本申请实施例中可以有多个业务进程与第二业务进程之间创建共享内存区,此时,所述至少一个业务进程中还可以包括第三业务进程,所述方法还可以包括:In another possible design, in this embodiment of the present application, a shared memory area may be created between multiple service processes and the second service process. In this case, the at least one service process may further include a third service process, The method may also include:
通过所述第三业务进程生成第二内存申请请求,所述第二内存申请请求包括申请内存大小和内存区标识;A second memory application request is generated by the third business process, and the second memory application request includes the application memory size and the memory area identifier;
通过所述第三业务进程根据所述内存申请请求从所述物理内存空间中分配第二物理内存地址,并根据预先计算的物理内存地址和虚拟内存地址的偏移值,从所述虚拟内存空间中分配所述第二物理内存地址对应的第二虚拟内存地址;A second physical memory address is allocated from the physical memory space by the third business process according to the memory application request, and a second physical memory address is allocated from the virtual memory space according to the pre-calculated offset value of the physical memory address and the virtual memory address. Allocate the second virtual memory address corresponding to the second physical memory address in ;
通过所述第三业务进程建立所述第二物理内存地址对应的第二虚拟内存地址之间的映射关系,创建第二共享内存区;Establish a mapping relationship between the second virtual memory addresses corresponding to the second physical memory addresses by the third service process, and create a second shared memory area;
所述第二业务进程获取所述第二申请请求中的申请内存大小和所述内存区标识;The second business process obtains the application memory size and the memory area identifier in the second application request;
通过所述第二业务进程根据所述第二申请请求中的申请内存大小和所述内存区标识,创建所述第二共享内存区。The second shared memory area is created by the second business process according to the application memory size and the memory area identifier in the second application request.
此时,本申请实施例中可以多个业务进程与第二业务进程之间创建共享内存区,实现多个内存地址的映射。At this time, in the embodiment of the present application, a shared memory area may be created between multiple service processes and the second service process, so as to realize the mapping of multiple memory addresses.
在另一种可能的设计中,所述至少一个业务进程中还包括第四业务进程,所述方法还包括:In another possible design, the at least one business process further includes a fourth business process, and the method further includes:
获取所述申请内存大小和所述内存区标识;Obtain the requested memory size and the memory area identifier;
通过所述第四业务进程根据所述申请内存大小和所述内存区标识,创建所述第一共享内存区。The first shared memory area is created by the fourth business process according to the requested memory size and the memory area identifier.
此种情况下,不管是什么进程,多少个进程,只有获取到相同的内存区标识和内存大小信息,根据该内存区标识和内存大小创建的内存区就是同一个共享内存区,实现了内存区的合理使用。In this case, no matter what process or how many processes, only the same memory area identifier and memory size information are obtained. The memory area created according to the memory area identifier and memory size is the same shared memory area, which realizes the memory area. fair use.
第二方面,本申请实施例提供一种设备,所述设备为终端或服务器,所述设备中包括至少一个处理器以及存储器,所述存储器中存储有操作系统,所述操作系统中包括至少一个业务进程,所述至少一个业务进程中包括第一业务进程和第二业务进程;所述第一业务进程包括业务模块和内存模块,所述第二业务进程包括业务模块和内存模块;In a second aspect, an embodiment of the present application provides a device, the device is a terminal or a server, the device includes at least one processor and a memory, the memory stores an operating system, and the operating system includes at least one a business process, the at least one business process includes a first business process and a second business process; the first business process includes a business module and a memory module, and the second business process includes a business module and a memory module;
所述至少一个处理器用于运行存储在所述存储器中的进程以执行如下步骤:The at least one processor is configured to run a process stored in the memory to perform the following steps:
通过所述第一业务进程的业务模块生成第一内存申请请求,所述第一内存申请请求包括申请内存大小和内存区标识;A first memory application request is generated by the service module of the first service process, and the first memory application request includes an application memory size and a memory area identifier;
通过所述第一业务进程的内存模块根据所述内存申请请求从预留的物理内存空间中分配第一物理内存地址,并根据预先计算的物理内存地址和虚拟内存地址的偏移值,从预先确定的虚拟内存空间中分配所述第一物理内存地址对应的第一虚拟内存地址,所述虚拟内存空间通过所述物理内存空间确定;The memory module of the first business process allocates the first physical memory address from the reserved physical memory space according to the memory application request, and according to the pre-calculated offset value of the physical memory address and the virtual memory address, from the pre-calculated physical memory address Allocate a first virtual memory address corresponding to the first physical memory address in the determined virtual memory space, and the virtual memory space is determined by the physical memory space;
通过所述第一业务进程的内存模块还用于建立所述第一物理内存地址对应的第一虚拟内存地址之间的映射关系,创建第一共享内存区;The memory module of the first business process is also used to establish a mapping relationship between the first virtual memory addresses corresponding to the first physical memory addresses, and to create a first shared memory area;
通过所述第二业务进程的业务模块获取所述申请内存大小和所述内存区标识;Obtain the application memory size and the memory area identifier through the service module of the second service process;
通过所述第二业务进程的内存模块根据所述申请内存大小和所述内存区标识,创建所述第一共享内存区。The first shared memory area is created by the memory module of the second service process according to the requested memory size and the memory area identifier.
在一种可能的设计中,在所述第一业务进程的内存模块根据预先计算的物理内存地址和虚拟内存地址的偏移值,计算所述第一物理内存地址对应的第一虚拟内存地址之前,所述至少一个处理器具体用于通过所述第一业务进程的内存模块计算物理内存地址和虚拟内存地址的偏移值。In a possible design, before the memory module of the first service process calculates the first virtual memory address corresponding to the first physical memory address according to the pre-calculated offset value of the physical memory address and the virtual memory address , the at least one processor is specifically configured to calculate the offset value of the physical memory address and the virtual memory address through the memory module of the first service process.
在另一种可能的设计中,所述至少一个处理器具体用于通过所述第一业务进程的内存模块获取所述物理内存空间的起始地址及所述物理内存空间的大小;根据所述预留物理内存空间的起始地址及所述物理内存空间的大小,分配所述虚拟内存空间;根据所述物理内存空间的起始地址和所述虚拟内存空间的起始地址,计算物理内存地址和虚拟内存地址的偏移值。In another possible design, the at least one processor is specifically configured to obtain the starting address of the physical memory space and the size of the physical memory space through the memory module of the first service process; according to the Reserve the starting address of the physical memory space and the size of the physical memory space, and allocate the virtual memory space; calculate the physical memory address according to the starting address of the physical memory space and the starting address of the virtual memory space and the offset value of the virtual memory address.
在另一种可能的设计中,所述虚拟内存空间中虚拟内存地址未分配前权限设置为不可访问;In another possible design, the permission is set to be inaccessible before the virtual memory address in the virtual memory space is not allocated;
在从预先确定的虚拟内存空间中分配所述第一物理内存地址对应的第一虚拟内存地址之后,,所述至少一个处理器还用于通过所述第一业务进程的内存模块在所述虚拟内存空间中将所述第一虚拟内存地址设置为仅供所述第一业务进程访问。After allocating the first virtual memory address corresponding to the first physical memory address from the predetermined virtual memory space, the at least one processor is further configured to use the memory module of the first service process in the virtual memory In the memory space, the first virtual memory address is set to be accessed only by the first service process.
在另一种可能的设计中,所述至少一个处理器具体用于通过所述第一业务进程的业务模块向所述第二业务进程的业务模块发送通知消息,所述通知消息中包括所述申请内存大小和所述内存区标识;In another possible design, the at least one processor is specifically configured to send a notification message to the service module of the second service process through the service module of the first service process, where the notification message includes the Apply for the memory size and the memory area identifier;
所述至少一个处理器具体还用于通过所述第二业务进程的业务模块接收所述通知消息,获取所述申请内存大小和所述内存区标识。The at least one processor is further configured to receive the notification message through the service module of the second service process, and acquire the requested memory size and the memory area identifier.
在另一种可能的设计中,所述至少一个业务进程中还包括第三业务进程,所述第三业务进程包括业务模块和内存模块;In another possible design, the at least one business process further includes a third business process, and the third business process includes a business module and a memory module;
所述至少一个处理器还用于通过所述第三业务进程的业务模块生成第二内存申请请求,所述第二内存申请请求包括申请内存大小和内存区标识;The at least one processor is further configured to generate a second memory application request through the service module of the third service process, where the second memory application request includes an application memory size and a memory area identifier;
所述至少一个处理器还用于通过所述第三业务进程的内存模块根据所述内存申请请求从预留的物理内存空间中分配第二物理内存地址,并根据预先计算的物理内存地址和虚拟内存地址的偏移值,从预先确定的虚拟内存空间中分配所述第二物理内存地址对应的第二虚拟内存地址,所述虚拟内存空间通过所述物理内存空间确定;The at least one processor is further configured to allocate a second physical memory address from the reserved physical memory space through the memory module of the third service process according to the memory application request, and allocate a second physical memory address according to the pre-calculated physical memory address and virtual memory space. The offset value of the memory address, the second virtual memory address corresponding to the second physical memory address is allocated from a predetermined virtual memory space, and the virtual memory space is determined by the physical memory space;
所述至少一个处理器还用于通过所述第三业务进程的内存模块通建立所述第二物理内存地址对应的第二虚拟内存地址之间的映射关系,创建第二共享内存区;The at least one processor is further configured to create a second shared memory area by establishing a mapping relationship between the second virtual memory addresses corresponding to the second physical memory addresses through the memory module of the third service process;
所述至少一个处理器还用于通过所述第二业务进程的业务模块获取所述第二申请请求中的申请内存大小和所述内存区标识;The at least one processor is further configured to obtain the application memory size and the memory area identifier in the second application request through the service module of the second service process;
所述至少一个处理器还用于通过所述第二业务进程的内存模块根据所述第二申请请求中的申请内存大小和所述内存区标识,创建所述第二共享内存区。The at least one processor is further configured to, through the memory module of the second service process, create the second shared memory area according to the size of the application memory and the memory area identifier in the second application request.
在另一种可能的设计中,所述至少一个业务进程中还包括第四业务进程,所述第四业务进程包括业务模块和内存模块;In another possible design, the at least one business process further includes a fourth business process, and the fourth business process includes a business module and a memory module;
所述至少一个处理器还用于运行存储在所述存储器中的进程以执行如下步骤:The at least one processor is also configured to run a process stored in the memory to perform the steps of:
通过所述第四业务进程的业务模块获取所述申请内存大小和所述内存区标识;Obtain the application memory size and the memory area identifier through the service module of the fourth service process;
通过所述第四业务进程的内存模块根据所述申请内存大小和所述内存区标识,创建所述第一共享内存区。The first shared memory area is created by the memory module of the fourth service process according to the requested memory size and the memory area identifier.
从以上技术方案可以看出,本发明实施例具有以下优点:As can be seen from the above technical solutions, the embodiments of the present invention have the following advantages:
本申请实施例中在进行内存地址映射时,第一业务进程通过申请得到物理内存,通过预先计算的物理内存地址和虚拟内存地址的偏移值,从预先确定的虚拟内存空间确定该物理内存地址对应的虚拟内存地址,建立映射关系,创建共享内存区,同时将内存大小和内存区标识通知给第二业务进程,以使得第二业务进程创建相同的共享内存区,实现内存地址的映射,由于物理内存地址与虚拟内存地址之间的转换只需要通过预先计算的偏移值就可以得到,提高了物理内存地址与虚拟内存地址的转换效率。In the embodiment of the present application, when performing memory address mapping, the first service process obtains the physical memory by applying, and determines the physical memory address from the pre-determined virtual memory space by using the pre-calculated offset value of the physical memory address and the virtual memory address. Corresponding virtual memory address, establish a mapping relationship, create a shared memory area, and notify the second business process of the memory size and memory area identifier, so that the second business process creates the same shared memory area and realizes the mapping of memory addresses. The conversion between the physical memory address and the virtual memory address only needs to be obtained through the pre-calculated offset value, which improves the conversion efficiency of the physical memory address and the virtual memory address.
附图说明Description of drawings
图1是现有技术内存地址的映射方法的系统框架图;1 is a system frame diagram of a prior art memory address mapping method;
图2是本发明实施例中第一业务进程和第二业务进程的模块图;2 is a block diagram of a first service process and a second service process in an embodiment of the present invention;
图3是本发明实施例中内存地址的映射方法的一个实施例示意图;3 is a schematic diagram of an embodiment of a method for mapping memory addresses in an embodiment of the present invention;
图4是本发明实施例中内存地址的映射方法的另一个实施例示意图;4 is a schematic diagram of another embodiment of a method for mapping a memory address in an embodiment of the present invention;
图5是本发明实施例中设备的另一个实施例示意图。FIG. 5 is a schematic diagram of another embodiment of the device in the embodiment of the present invention.
具体实施方式Detailed ways
本发明实施例提供了一种内存地址的映射方法及设备,提高了物理内存地址与虚拟内存地址的转换效率。Embodiments of the present invention provide a memory address mapping method and device, which improve the conversion efficiency between physical memory addresses and virtual memory addresses.
为了使本技术领域的人员更好地理解本发明方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分的实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本发明保护的范围。In order to make those skilled in the art better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only Embodiments are part of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
本发明的说明书和权利要求书及上述附图中的术语“第一”、“第二”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", etc. (if present) in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It is to be understood that data so used may be interchanged under appropriate circumstances so that the embodiments described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having" and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those expressly listed Rather, those steps or units may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.
本申请实施例中应用在目标设备中,该目标可以是终端或者服务器,所述目标设备中安装有操作系统,该操作系统可以是Linux操作系统或者Unix操作系统,所述操作系统中包括至少一个业务进程,所述至少一个业务进程包括第一业务进程和第二业务进程,第二业务进程和第一业务进程之间的的关系可以如图2所示,其中,每个业务进程中均可以包括业务模块和内存模块,业务模块用于接收或发送报文消息,内存模块用于管理、分配物理内存空间和虚拟内存空间,其中,第二业务进程的业务模块和第一业务进程的业务模块之间建立连接,第一业务进程、第二业务进程各自中的业务模块和内存模块之间可以交互信息。The embodiments of the present application are applied in a target device, the target may be a terminal or a server, an operating system is installed in the target device, and the operating system may be a Linux operating system or a Unix operating system, and the operating system includes at least one Business process, the at least one business process includes a first business process and a second business process, and the relationship between the second business process and the first business process may be as shown in FIG. Including a business module and a memory module, the business module is used to receive or send messages, and the memory module is used to manage and allocate physical memory space and virtual memory space, wherein the business module of the second business process and the business module of the first business process A connection is established between them, and information can be exchanged between the service modules and the memory modules in the first service process and the second service process.
下面介绍本申请实施例中内存地址的映射方法。The following describes the mapping method of the memory address in the embodiment of the present application.
请参阅图3,本发明实施例中内存地址的映射方法的一个实施例包括:Referring to FIG. 3, an embodiment of a method for mapping a memory address in an embodiment of the present invention includes:
301、通过所述第一业务进程生成第一内存申请请求;301. Generate a first memory application request through the first business process;
其中,所述第一内存申请请求包括申请内存大小和内存区标识;Wherein, the first memory application request includes an application memory size and a memory area identifier;
302、通过所述第一业务进程根据所述内存申请请求从预留的物理内存空间中分配第一物理内存地址;302. Allocate a first physical memory address from the reserved physical memory space through the first business process according to the memory application request;
303、根据预先计算的物理内存地址和虚拟内存地址的偏移值,从预先确定的虚拟内存空间中分配所述第一物理内存地址对应的第一虚拟内存地址;303. Allocate a first virtual memory address corresponding to the first physical memory address from a predetermined virtual memory space according to the pre-calculated offset value of the physical memory address and the virtual memory address;
其中,所述虚拟内存空间通过所述物理内存空间确定;Wherein, the virtual memory space is determined by the physical memory space;
本申请实施例中,在所述根据预先计算的物理内存地址和虚拟内存地址的偏移值,计算所述第一物理内存地址对应的第一虚拟内存地址之前,可以预先计算好物理内存地址和虚拟内存地址之间的偏移值,以用作物理内存地址和虚拟内存地址之间计算的基准值。In this embodiment of the present application, before calculating the first virtual memory address corresponding to the first physical memory address according to the pre-calculated offset value of the physical memory address and the virtual memory address, the physical memory address and the virtual memory address may be pre-calculated. Offset value between virtual memory addresses to use as a baseline for calculations between physical memory addresses and virtual memory addresses.
此时,即在所述根据预先计算的物理内存地址和虚拟内存地址的偏移值,计算所述第一物理内存地址对应的第一虚拟内存地址之前,所述方法还可以包括:At this time, that is, before calculating the first virtual memory address corresponding to the first physical memory address according to the pre-calculated offset value of the physical memory address and the virtual memory address, the method may further include:
计算物理内存地址和虚拟内存地址的偏移值,该物理内存地址和虚拟内存地址的偏移值可以是预留物理内存空间的起始地址(如phy_start)和预先分配的虚拟内存地址空间的起始地址(如vir_start)之间的偏移值:即例如偏移值offset=phy_start-vir_start。Calculate the offset value of the physical memory address and the virtual memory address. The offset value of the physical memory address and the virtual memory address can be the starting address of the reserved physical memory space (such as phy_start) and the starting address of the pre-allocated virtual memory address space. Offset value between start addresses (such as vir_start): that is, for example, the offset value offset=phy_start-vir_start.
具体的,所述计算物理内存地址和虚拟内存地址的偏移值,可以包括:Specifically, the calculating the offset value between the physical memory address and the virtual memory address may include:
获取所述物理内存空间的起始地址及所述物理内存空间的大小;Obtain the starting address of the physical memory space and the size of the physical memory space;
根据所述预留物理内存空间的起始地址及所述物理内存空间的大小,分配所述虚拟内存空间;Allocate the virtual memory space according to the starting address of the reserved physical memory space and the size of the physical memory space;
根据所述物理内存空间的起始地址和所述虚拟内存空间的起始地址,计算物理内存地址和虚拟内存地址的偏移值。According to the starting address of the physical memory space and the starting address of the virtual memory space, the offset value of the physical memory address and the virtual memory address is calculated.
304、通过所述第一业务进程建立所述第一物理内存地址对应的第一虚拟内存地址之间的映射关系,创建第一共享内存区;304. Create a first shared memory area by establishing a mapping relationship between the first virtual memory addresses corresponding to the first physical memory addresses by the first service process;
305、通过所述第二业务进程获取所述申请内存大小和所述内存区标识;305. Obtain the requested memory size and the memory area identifier through the second service process;
可选的,所述通过所述第二业务进程获取所述申请内存大小和所述内存区标识,可以有多种方式,具体可以如下:Optionally, the obtaining of the size of the application memory and the identifier of the memory area through the second business process may be performed in a variety of ways, which may be specifically as follows:
(1)所述通过所述第二业务进程获取所述申请内存大小和所述内存区标识,包括:通过所述第一业务进程向所述第二业务进程发送通知消息,所述通知消息中包括所述申请内存大小和所述内存区标识;通过所述第二业务进程接收所述通知消息,获取所述申请内存大小和所述内存区标识。(1) Obtaining the application memory size and the memory area identifier through the second service process includes: sending a notification message to the second service process through the first service process, where the notification message contains The application memory size and the memory area identifier are included; the notification message is received by the second service process, and the applied memory size and the memory area identifier are acquired.
(2)通过在第二业务进程和业务进程预先约定相同的规则去获取所述申请内存大小和所述内存区标识,例如在第二业务进程和业务进程预先约定好申请内存大小和内存区标识,第二业务进程和业务进程获取约定好的所述申请内存大小和所述内存区标识。(2) Obtain the application memory size and the memory area identifier by pre-agreing the same rules in the second business process and the business process, for example, pre-agreed the application memory size and memory area identifier in the second business process and the business process , the second service process and the service process obtain the agreed upon application memory size and the memory area identifier.
306、通过所述第二业务进程根据所述申请内存大小和所述内存区标识,创建所述第一共享内存区。306. Create the first shared memory area by the second service process according to the size of the applied memory and the memory area identifier.
本申请实施例中在进行内存地址映射时,业务进程通过申请得到物理内存,通过预先计算的物理内存地址和虚拟内存地址的偏移值,从预先确定的虚拟内存空间确定该物理内存地址对应的虚拟内存地址,建立映射关系,创建共享内存区,同时将内存大小和内存区标识通知给第二业务进程,以使得第二业务进程创建相同的共享内存区,实现内存地址的映射,由于物理内存地址与虚拟内存地址之间的转换只需要通过预先计算的偏移值就可以得到,提高了物理内存地址与虚拟内存地址的转换效率。In the embodiment of the present application, when performing memory address mapping, the business process obtains the physical memory by applying, and determines the corresponding physical memory address from the pre-determined virtual memory space by using the pre-calculated offset value of the physical memory address and the virtual memory address. virtual memory address, establish a mapping relationship, create a shared memory area, and notify the second business process of the memory size and memory area identifier, so that the second business process creates the same shared memory area and realizes the mapping of memory addresses. The conversion between the address and the virtual memory address only needs to be obtained through the pre-calculated offset value, which improves the conversion efficiency between the physical memory address and the virtual memory address.
可选的,所述虚拟内存空间中虚拟内存地址未分配前权限设置为不可访问;在从预先确定的虚拟内存空间中分配所述第一物理内存地址对应的第一虚拟内存地址之后,所述方法还包括:Optionally, the permission is set to be inaccessible before the virtual memory address in the virtual memory space is allocated; after the first virtual memory address corresponding to the first physical memory address is allocated from the predetermined virtual memory space, the Methods also include:
在所述虚拟内存空间中将所述第一虚拟内存地址设置为仅供所述第一业务进程访问。The first virtual memory address is set in the virtual memory space to be accessed only by the first service process.
这样,进程只能访问分配给它的内存空间,而不能访问其他进程的内存空间或者未分配的内存空间,达到了内存隔离和保护的效果。In this way, a process can only access the memory space allocated to it, but cannot access the memory space or unallocated memory space of other processes, achieving the effect of memory isolation and protection.
可选的,本申请实施例中可以有多个业务进程与第二业务进程之间创建共享内存区,此时,所述至少一个业务进程中还可以包括第三业务进程,所述方法还可以包括:Optionally, in the embodiment of the present application, a shared memory area may be created between multiple service processes and the second service process. In this case, the at least one service process may further include a third service process, and the method may also include:
通过所述第三业务进程生成第二内存申请请求,所述第二内存申请请求包括申请内存大小和内存区标识;A second memory application request is generated by the third business process, and the second memory application request includes the application memory size and the memory area identifier;
通过所述第三业务进程根据所述内存申请请求从所述物理内存空间中分配第二物理内存地址,并根据预先计算的物理内存地址和虚拟内存地址的偏移值,从所述虚拟内存空间中分配所述第二物理内存地址对应的第二虚拟内存地址;A second physical memory address is allocated from the physical memory space by the third business process according to the memory application request, and a second physical memory address is allocated from the virtual memory space according to the pre-calculated offset value of the physical memory address and the virtual memory address. Allocate the second virtual memory address corresponding to the second physical memory address in ;
通过所述第三业务进程建立所述第二物理内存地址对应的第二虚拟内存地址之间的映射关系,创建第二共享内存区;Establish a mapping relationship between the second virtual memory addresses corresponding to the second physical memory addresses by the third service process, and create a second shared memory area;
所述第二业务进程获取所述第二申请请求中的申请内存大小和所述内存区标识;The second business process obtains the application memory size and the memory area identifier in the second application request;
通过所述第二业务进程根据所述第二申请请求中的申请内存大小和所述内存区标识,创建所述第二共享内存区。The second shared memory area is created by the second business process according to the application memory size and the memory area identifier in the second application request.
所述至少一个业务进程中还包括第四业务进程,所述方法还包括:The at least one business process further includes a fourth business process, and the method further includes:
获取所述申请内存大小和所述内存区标识;Obtain the requested memory size and the memory area identifier;
通过所述第四业务进程根据所述申请内存大小和所述内存区标识,创建所述第一共享内存区。The first shared memory area is created by the fourth business process according to the requested memory size and the memory area identifier.
此种情况下,不管是什么进程,多少个进程,只有获取到相同的内存区标识和内存大小信息,根据该内存区标识和内存大小创建的内存区就是同一个共享内存区,实现了内存区的合理使用。In this case, no matter what process or how many processes, only the same memory area identifier and memory size information are obtained. The memory area created according to the memory area identifier and memory size is the same shared memory area, which realizes the memory area. fair use.
为了便于更好的理解技术,下面实施例以一具体应用场景对上述实施例中描述的内存地址的方法进行详细描述。In order to facilitate a better understanding of the technology, the following embodiments describe in detail the memory address method described in the foregoing embodiments in a specific application scenario.
如图4所示,某终端的linux系统有三个业务进程:业务进程1、业务进程2和业务进程3,各进程都包括业务模块和内存模块,各进程初始化时,各进程的内存模块获取系统预留内存的起始物理地址phy_start=0x3c8000000及大小phy_size=0x40000000;然后调用open接口创建一个新文件,文件名为“mem_vap”,如fd=open("mem_vap",O_RDONLY|O_CREAT);创建文件成功后调用mmap接口申请虚拟内存,大小为物理内存的大小0x40000000,如mmap(NULL,0x40000000,PROT_NONE,MAP_PRIVATE,fd,0)。As shown in Figure 4, the Linux system of a terminal has three business processes:
三个业务进程分别返回系统分配的起始虚拟内存地址为:The initial virtual memory addresses that the three business processes return to the system are:
vir_start_1=0x7fffb0000000;vir_start_1=0x7fffb0000000;
vir_start_2=0x7fffa0000000;vir_start_2=0x7fffa0000000;
vir_start_3=0x7fff00000000。vir_start_3=0x7fff00000000.
各进程根据Step1的起始虚拟内存地址,计算得到的偏移值分别为offset_1=0x7ffbe8000000,offset_2=0x7ffbd8000000,offset_3=0x7ffb38000000。According to the starting virtual memory address of Step1, each process calculates the offset values as offset_1=0x7ffbe8000000, offset_2=0x7ffbd8000000, and offset_3=0x7ffb38000000.
业务进程1的业务模块申请32MB的共享内存,调用内存模块的申请函数shm_alloc(0x2000000,shared,“p1_share_1”);内存模块根据分配算法,得到物理地址为0x3c8000000,并计算对应的虚拟内存为0x3c8000000+0x7ffbe8000000=0x7fffb0000000。The business module of
业务进程1的内存模块调用munmap函数解除Step1申请的内存空间,大小为32MB,munmap(0x7fffb0000000,0x2000000)。The memory module of
业务进程1的内存模块调用mmap函数建立分配的物理内存地址与虚拟内存地址的映射关系。首先打开设备fd=open("/dev/mem",O_RDWR,S_IRUSR|S_IWUSR),然后调用mmap(0x7fffb0000000,0x2000000,PROT_READ|PROT_WRITE,MAP_SHARED|MAP_FIXED,0x3c8000000)。The memory module of the
业务进程1的内存模块返回0x7fffb0000000给业务进程1的业务模块。The memory module of
业务进程1的业务模块发送通知消息给业务进程3的业务模块,参数为0x2000000,shared,“p1_share_1”。The service module of
业务进程3的业务模块收到消息后,调用业务进程3的内存模块申请共享内存,例如,shm_alloc(0x2000000,shared,“p1_share_1”)。After the business module of business process 3 receives the message, it calls the memory module of business process 3 to apply for shared memory, for example, shm_alloc(0x2000000, shared, "p1_share_1").
业务进程3的内存模块根据申请的名字“p1_share_1”,确定该名字对应的内存区的物理内存为0x3c8000000。计算对应的虚拟内存为0x3c8000000+0x7ffb38000000=0x7fff00000000。According to the applied name "p1_share_1", the memory module of business process 3 determines that the physical memory of the memory area corresponding to the name is 0x3c8000000. The virtual memory corresponding to the calculation is 0x3c8000000+0x7ffb38000000=0x7fff00000000.
业务进程3的内存模块调用munmap解除Step1申请的内存空间,大小为32MB,munmap(0x7fff00000000,0x2000000)。The memory module of business process 3 calls munmap to release the memory space requested by
业务进程3的内存模块调用mmap建立分配的物理内存地址与虚拟内存地址的映射关系。首先打开设备fd=open("/dev/mem",O_RDWR,S_IRUSR|S_IWUSR),然后调用mmap(0x7fff00000000,0x2000000,PROT_READ|PROT_WRITE,MAP_SHARED|MAP_FIXED,0x3c8000000)。The memory module of the business process 3 calls mmap to establish a mapping relationship between the allocated physical memory address and the virtual memory address. First open the device fd=open("/dev/mem", O_RDWR, S_IRUSR|S_IWUSR), then call mmap(0x7fff00000000, 0x2000000, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, 0x3c8000000).
业务进程3的内存模块返回0x7fff00000000给业务进程3的业务模块。The memory module of business process 3 returns 0x7fff00000000 to the business module of business process 3.
至此,在业务进程与业务进程3间建立了共享内存区,建立的共享内存区的虚拟地址是通过分配的物理地址加上初始化时确定的偏移值得到的。业务进程1、或者其他的业务进程重复上述的步骤就可以建立多个共享内存区,如“图4内存区映射图”所示,业务进程1建立了两个共享内存区、业务进程2建立了一个共享内存区。So far, a shared memory area is established between the business process and the business process 3, and the virtual address of the established shared memory area is obtained by adding the allocated physical address and the offset value determined during initialization.
下面介绍本发明实施例中设备的实施例。The following describes the embodiment of the device in the embodiment of the present invention.
请参阅图5,为本申请实施例中设备500的一个实施例,所述设备为终端或服务器所述设备中包括至少一个处理器以及存储器,所述存储器中存储有操作系统,所述操作系统中包括至少一个业务进程,所述至少一个业务进程中包括第一业务进程(业务进程1)和第二业务进程(业务进程2);所述第一业务进程包括业务模块和内存模块,所述第二业务进程包括业务模块和内存模块;本领域技术人员可以理解,图5中示出的设备的结构并不构成对本发明的限定,它既可以是总线形结构,也可以是星型结构,还可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Please refer to FIG. 5 , which is an example of a
所述至少一个处理器用于运行存储在所述存储器中的进程以执行如下步骤:The at least one processor is configured to run a process stored in the memory to perform the following steps:
通过所述第一业务进程的业务模块生成第一内存申请请求,所述第一内存申请请求包括申请内存大小和内存区标识;A first memory application request is generated by the service module of the first service process, and the first memory application request includes an application memory size and a memory area identifier;
通过所述第一业务进程的内存模块根据所述内存申请请求从预留的物理内存空间中分配第一物理内存地址,并根据预先计算的物理内存地址和虚拟内存地址的偏移值,从预先确定的虚拟内存空间中分配所述第一物理内存地址对应的第一虚拟内存地址,所述虚拟内存空间通过所述物理内存空间确定;The memory module of the first business process allocates the first physical memory address from the reserved physical memory space according to the memory application request, and according to the pre-calculated offset value of the physical memory address and the virtual memory address, from the pre-calculated physical memory address Allocate a first virtual memory address corresponding to the first physical memory address in the determined virtual memory space, and the virtual memory space is determined by the physical memory space;
通过所述第一业务进程的内存模块还用于建立所述第一物理内存地址对应的第一虚拟内存地址之间的映射关系,创建第一共享内存区;The memory module of the first business process is also used to establish a mapping relationship between the first virtual memory addresses corresponding to the first physical memory addresses, and to create a first shared memory area;
通过所述第二业务进程的业务模块获取所述申请内存大小和所述内存区标识;Obtain the application memory size and the memory area identifier through the service module of the second service process;
通过所述第二业务进程的内存模块根据所述申请内存大小和所述内存区标识,创建所述第一共享内存区。The first shared memory area is created by the memory module of the second service process according to the requested memory size and the memory area identifier.
可选的,在所述第一业务进程的内存模块根据预先计算的物理内存地址和虚拟内存地址的偏移值,计算所述第一物理内存地址对应的第一虚拟内存地址之前,所述至少一个处理器具体用于通过所述第一业务进程的内存模块计算物理内存地址和虚拟内存地址的偏移值。Optionally, before the memory module of the first service process calculates the first virtual memory address corresponding to the first physical memory address according to the pre-calculated offset value of the physical memory address and the virtual memory address, the at least A processor is specifically configured to calculate the offset value of the physical memory address and the virtual memory address through the memory module of the first service process.
可选的,所述至少一个处理器具体用于通过所述第一业务进程的内存模块获取所述物理内存空间的起始地址及所述物理内存空间的大小;根据所述预留物理内存空间的起始地址及所述物理内存空间的大小,分配所述虚拟内存空间;根据所述物理内存空间的起始地址和所述虚拟内存空间的起始地址,计算物理内存地址和虚拟内存地址的偏移值。Optionally, the at least one processor is specifically configured to obtain the starting address of the physical memory space and the size of the physical memory space through the memory module of the first service process; according to the reserved physical memory space The starting address of the physical memory space and the size of the physical memory space, allocate the virtual memory space; according to the starting address of the physical memory space and the starting address of the virtual memory space, calculate the physical memory address and the virtual memory address. offset value.
可选的,所述虚拟内存空间中虚拟内存地址未分配前权限设置为不可访问;Optionally, the permission is set to be inaccessible before the virtual memory address in the virtual memory space is not allocated;
在从预先确定的虚拟内存空间中分配所述第一物理内存地址对应的第一虚拟内存地址之后,所述至少一个处理器还用于通过所述第一业务进程的内存模块在所述虚拟内存空间中将所述第一虚拟内存地址设置为仅供所述第一业务进程访问。After allocating the first virtual memory address corresponding to the first physical memory address from the predetermined virtual memory space, the at least one processor is further configured to use the memory module of the first service process to store the virtual memory in the virtual memory In the space, the first virtual memory address is set to be accessed only by the first service process.
可选的,所述至少一个处理器具体用于通过所述第一业务进程的业务模块向所述第二业务进程的业务模块发送通知消息,所述通知消息中包括所述申请内存大小和所述内存区标识;Optionally, the at least one processor is specifically configured to send a notification message to the service module of the second service process through the service module of the first service process, where the notification message includes the application memory size and the requested memory size. the memory area identifier;
所述至少一个处理器具体还用于通过所述第二业务进程的业务模块接收所述通知消息,获取所述申请内存大小和所述内存区标识。The at least one processor is further configured to receive the notification message through the service module of the second service process, and acquire the requested memory size and the memory area identifier.
可选的,所述至少一个业务进程中还包括第三业务进程,所述第三业务进程包括业务模块和内存模块;Optionally, the at least one service process further includes a third service process, and the third service process includes a service module and a memory module;
所述至少一个处理器还用于通过所述第三业务进程的业务模块生成第二内存申请请求,所述第二内存申请请求包括申请内存大小和内存区标识;The at least one processor is further configured to generate a second memory application request through the service module of the third service process, where the second memory application request includes an application memory size and a memory area identifier;
所述至少一个处理器还用于通过所述第三业务进程的内存模块根据所述内存申请请求从预留的物理内存空间中分配第二物理内存地址,并根据预先计算的物理内存地址和虚拟内存地址的偏移值,从预先确定的虚拟内存空间中分配所述第二物理内存地址对应的第二虚拟内存地址,所述虚拟内存空间通过所述物理内存空间确定;The at least one processor is further configured to allocate a second physical memory address from the reserved physical memory space through the memory module of the third service process according to the memory application request, and allocate a second physical memory address according to the pre-calculated physical memory address and virtual memory space. The offset value of the memory address, the second virtual memory address corresponding to the second physical memory address is allocated from a predetermined virtual memory space, and the virtual memory space is determined by the physical memory space;
所述至少一个处理器还用于通过所述第三业务进程的内存模块通建立所述第二物理内存地址对应的第二虚拟内存地址之间的映射关系,创建第二共享内存区;The at least one processor is further configured to create a second shared memory area by establishing a mapping relationship between the second virtual memory addresses corresponding to the second physical memory addresses through the memory module of the third service process;
所述至少一个处理器还用于通过所述第二业务进程的业务模块获取所述第二申请请求中的申请内存大小和所述内存区标识;The at least one processor is further configured to obtain the application memory size and the memory area identifier in the second application request through the service module of the second service process;
所述至少一个处理器还用于通过所述第二业务进程的内存模块根据所述第二申请请求中的申请内存大小和所述内存区标识,创建所述第二共享内存区。The at least one processor is further configured to, through the memory module of the second service process, create the second shared memory area according to the size of the application memory and the memory area identifier in the second application request.
可选的,所述至少一个业务进程中还包括第四业务进程,所述第四业务进程包括业务模块和内存模块;Optionally, the at least one business process further includes a fourth business process, and the fourth business process includes a business module and a memory module;
所述至少一个处理器还用于运行存储在所述存储器中的进程以执行如下步骤:The at least one processor is also configured to run a process stored in the memory to perform the steps of:
通过所述第四业务进程的业务模块获取所述申请内存大小和所述内存区标识;Obtain the application memory size and the memory area identifier through the service module of the fourth service process;
通过所述第四业务进程的内存模块根据所述申请内存大小和所述内存区标识,创建所述第一共享内存区。The first shared memory area is created by the memory module of the fourth service process according to the requested memory size and the memory area identifier.
本申请实施例中,所述处理器可以由集成电路(英文全称:Integrated Circuit,缩写:IC)组成,例如可以由单颗封装的IC所组成,也可以由连接多颗相同功能或不同功能的封装IC而组成。举例来说,处理器可以仅包括中央处理器(英文全称:CentralProcessing Unit,缩写:CPU),也可以是GPU、数字信号处理器(英文全称:Digital SignalProcessor,缩写:DSP)、及通信管理模块中的控制芯片(例如基带芯片)的组合。在本发明实施方式中,CPU可以是单运算核心,也可以包括多运算核心。In the embodiment of the present application, the processor may be composed of an integrated circuit (full name in English: Integrated Circuit, abbreviation: IC), for example, may be composed of a single packaged IC, or may be composed of multiple chips connected to the same function or different functions. It is composed of packaging IC. For example, the processor may only include a central processing unit (full name in English: CentralProcessing Unit, abbreviation: CPU), or may be a GPU, a digital signal processor (full name in English: Digital SignalProcessor, abbreviation: DSP), and a communication management module. combination of control chips (such as baseband chips). In the embodiment of the present invention, the CPU may be a single computing core, or may include multiple computing cores.
如图5所示,在本申请的一些实施例中,本申请实施例中设备还可以包括通信装置、输入装置、输出装置、外设接口以及电源等,此处不作限定。As shown in FIG. 5 , in some embodiments of the present application, the device in the embodiments of the present application may further include a communication device, an input device, an output device, a peripheral interface, and a power supply, etc., which are not limited here.
其中,输入装置用于实现用户与所述设备的交互和/或信息输入到所述设备中。例如,输入装置可以接收用户输入的数字或字符信息,以产生与用户设置或功能控制有关的信号输入。在本发明具体实施方式中,输入装置可以是触控面板,也可以是其他人机交互界面,例如实体输入键、麦克风等,还可是其他外部信息撷取装置,例如摄像头等。触控面板,也称为触摸屏或触控屏,可收集用户在其上触摸或接近的操作动作。比如用户使用手指、触笔等任何适合的物体或附件在触控面板上或接近触控面板的位置的操作动作,并根据预先设定的程式驱动相应的连接装置。可选的,触控面板可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸操作,并将检测到的触摸操作转换为电信号,以及将所述电信号传送给触摸控制器;触摸控制器从触摸检测装置上接收所述电信号,并将它转换成触点坐标,再送给处理器单元。所述触摸控制器还可以接收处理单元发来的命令并执行。此外,可以采用电阻式、电容式、红外线(Infrared)以及表面声波等多种类型实现触控面板。在本发明的其他实施方式中,输入装置所采用的实体输入键可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。麦克风形式的输入装置可以收集用户或环境输入的语音并将其转换成电信号形式的、处理单元可执行的命令。Wherein, the input device is used to realize the interaction between the user and the device and/or the input of information into the device. For example, the input device may receive numerical or character information input by the user to generate signal input related to user settings or function control. In a specific embodiment of the present invention, the input device may be a touch panel, or other human-computer interaction interfaces, such as physical input keys, a microphone, etc., or other external information capturing devices, such as a camera. A touch panel, also known as a touch screen or touch screen, collects the actions of a user touching or approaching it. For example, the user uses any suitable object or accessory, such as a finger, a stylus, or an operation action on the touch panel or a position close to the touch panel, and drives the corresponding connection device according to a preset program. Optionally, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects a user's touch operation, converts the detected touch operation into an electrical signal, and transmits the electrical signal to the touch controller; the touch controller receives the electrical signal from the touch detection device, and transmits the electrical signal to the touch controller. It is converted into contact coordinates and sent to the processor unit. The touch controller can also receive and execute commands sent by the processing unit. In addition, the touch panel can be realized by various types such as resistive type, capacitive type, infrared (Infrared), and surface acoustic wave. In other embodiments of the present invention, the physical input keys used by the input device may include, but are not limited to, one of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, etc. or more. Input devices in the form of microphones can collect speech input by the user or the environment and convert them into electrical signals in the form of commands executable by the processing unit.
在本申请的其他一些实施方式中,所述输入装置还可以是各类传感器件,例如霍尔器件,用于侦测所述设备的物理量,例如力、力矩、压力、应力、位置、位移、速度、加速度、角度、角速度、转数、转速以及工作状态发生变化的时间等,转变成电量来进行检测和控制。其他的一些传感器件还可以包括重力感应计、三轴加速计、陀螺仪、电子罗盘、环境光传感器、接近传感器、温度传感器、湿度传感器、压力传感器、心率传感器、指纹识别器等。In some other embodiments of the present application, the input device may also be various sensor devices, such as Hall devices, for detecting the physical quantities of the device, such as force, torque, pressure, stress, position, displacement, Speed, acceleration, angle, angular velocity, number of revolutions, rotational speed, and the time when the working state changes, etc., are converted into electricity for detection and control. Some other sensor devices can also include gravity sensor, three-axis accelerometer, gyroscope, electronic compass, ambient light sensor, proximity sensor, temperature sensor, humidity sensor, pressure sensor, heart rate sensor, fingerprint reader, etc.
输出装置包括但不限于影像输出装置和声音输出装置。影像输出装置用于输出文字、图片和/或视频。所述影像输出装置可包括显示面板,例如采用LCD(Liquid CrystalDisplay,液晶显示器)、OLED(Organic Light-Emitting Diode,有机发光二极管)、场发射显示器(英文全称:field emission display,缩写:FED)等形式来配置的显示面板。或者所述影像输出装置可以包括反射式显示器,例如电泳式(electrophoretic)显示器,或利用光干涉调变技术(Interferometric Modulation of Light)的显示器。所述影像输出装置可以包括单个显示器或不同尺寸的多个显示器。在本发明的具体实施方式中,上述输入装置所采用的触控面板亦可同时作为输出装置的显示面板。例如,当触控面板检测到在其上的触摸或接近的手势操作后,传送给处理单元以确定触摸事件的类型,随后处理单元根据触摸事件的类型在显示面板上提供相应的视觉输出。虽然在图5中,输入装置与输出装置是作为两个独立的部件来实现所述设备的输入和输出功能,但是在某些实施例中,可以将触控面板与显示面板集成一体而实现所述设备的输入和输出功能。例如,所述影像输出装置可以显示各种图形化用户接口(英文全称:Graphical User Interface,缩写:GUI)以作为虚拟控制组件,包括但不限于窗口、卷动轴、图标及剪贴簿,以供用户通过触控方式进行操作。Output devices include but are not limited to video output devices and audio output devices. The video output device is used to output text, pictures and/or video. The image output device may include a display panel, such as LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, organic light-emitting diode), field emission display (English full name: field emission display, abbreviation: FED), etc. form to configure the display panel. Alternatively, the image output device may include a reflective display, such as an electrophoretic display, or a display using Interferometric Modulation of Light. The image output device may comprise a single display or multiple displays of different sizes. In a specific embodiment of the present invention, the touch panel used in the above-mentioned input device can also be used as a display panel of the output device at the same time. For example, when the touch panel detects a touch or an approaching gesture operation on it, it is transmitted to the processing unit to determine the type of the touch event, and then the processing unit provides corresponding visual output on the display panel according to the type of the touch event. Although in FIG. 5, the input device and the output device are used as two independent components to realize the input and output functions of the device, in some embodiments, the touch panel and the display panel can be integrated to realize the Describe the input and output functions of the device. For example, the image output device can display various graphical user interfaces (English full name: Graphical User Interface, abbreviation: GUI) as virtual control components, including but not limited to windows, scrolling scrolls, icons and scrapbooks for The user operates by touch.
在本发明具体实施方式中,影像输出装置包括滤波器及放大器,用来将处理单元所输出的视频滤波及放大。音频输出装置包括数字模拟转换器,用来将处理单元所输出的音频信号从数字格式转换为模拟格式。In a specific embodiment of the present invention, the image output device includes a filter and an amplifier for filtering and amplifying the video output by the processing unit. The audio output device includes a digital-to-analog converter for converting the audio signal output from the processing unit from a digital format to an analog format.
通信装置可以用于建立通信信道,使所述设备通过所述通信信道与远端电子设备或服务器进行语音通信、文字通信、数据通信。所述通信装置可以包括无线局域网(英文全称:Wireless Local Area Network,缩写:WLAN)模块、蓝牙模块、基带(Base Band)模块等通信模块,以及所述通信模块对应的射频(英文全称:Radio Frequency,缩写:RF)电路,用于进行无线局域网络通信、蓝牙通信、红外线通信及/或蜂窝式通信系统通信,例如宽带码分多重接入(英文全称:Wideband Code Division Multiple Access,缩写:WCDMA)及/或高速下行封包存取(英文全称:High Speed Downlink Packet Access,缩写:HSDPA)。所述通信模块用于控制所述设备中的各组件的通信,并且可以支持直接内存存取(Direct MemoryAccess)。The communication device can be used to establish a communication channel, so that the device can perform voice communication, text communication and data communication with a remote electronic device or a server through the communication channel. The communication device may include communication modules such as a wireless local area network (full name in English: Wireless Local Area Network, abbreviation: WLAN) module, a Bluetooth module, a base band (Base Band) module, and a radio frequency (full name in English: Radio Frequency) corresponding to the communication module. , Abbreviation: RF) circuit for wireless local area network communication, Bluetooth communication, infrared communication and/or cellular communication system communication, such as wideband code division multiple access (English full name: Wideband Code Division Multiple Access, abbreviation: WCDMA) And/or high-speed downlink packet access (full name in English: High Speed Downlink Packet Access, abbreviation: HSDPA). The communication module is used to control the communication of each component in the device, and can support direct memory access (Direct Memory Access).
在本发明的不同实施方式中,所述通信装置中的各种通信模块一般以集成电路芯片(Integrated Circuit Chip)的形式出现,并可进行选择性组合,而不必包括所有通信模块及对应的天线组。例如,所述通信装置可以仅包括基带芯片、射频芯片以及相应的天线以在一个蜂窝通信系统中提供通信功能。经由所述通信装置建立的无线通信连接,例如无线局域网接入或WCDMA接入,所述设备可以连接至蜂窝网(Cellular Network)或因特网(Internet)。In different embodiments of the present invention, various communication modules in the communication device generally appear in the form of integrated circuit chips (Integrated Circuit Chip), and can be selectively combined, instead of including all communication modules and corresponding antennas Group. For example, the communication device may only include a baseband chip, a radio frequency chip, and a corresponding antenna to provide communication functions in a cellular communication system. Via a wireless communication connection established by the communication device, such as wireless local area network access or WCDMA access, the device can be connected to a cellular network (Cellular Network) or the Internet (Internet).
射频电路用于信息收发或通话过程中接收和发送信号。例如,将基站的下行信息接收后,给处理单元处理;另外,将设计上行的数据发送给基站。通常,所述射频电路包括用于执行这些功能的公知电路,包括但不限于天线系统、射频收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、编解码(Codec)芯片组、用户身份模块(SIM)卡、存储器等等。此外,射频电路还可以通过无线通信与网络和其他设备通信。所述无线通信可以使用任一通信标准或协议,包括但不限于GSM(Global System of Mobilecommunication,全球移动通讯系统)、GPRS(General Packet Radio Service,通用分组无线服务)、CDMA(Code Division Multiple Access,码分多址)、WCDMA(Wideband CodeDivision Multiple Access,宽带码分多址)、高速下行链路分组接入技术(High SpeedDownlink Packet Access,HSDPA)、LTE(Long Term Evolution,长期演进)、电子邮件、SMS(Short Messaging Service,短消息服务)等。The radio frequency circuit is used to receive and transmit signals during information transmission and reception or during a call. For example, after the downlink information of the base station is received, it is processed by the processing unit; in addition, the data of the designed uplink is sent to the base station. Typically, the radio frequency circuits include well-known circuits for performing these functions, including but not limited to antenna systems, radio frequency transceivers, one or more amplifiers, tuners, one or more oscillators, digital signal processors, codecs (Codec) Chipset, Subscriber Identity Module (SIM) card, memory, etc. In addition, radio frequency circuits can also communicate with networks and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System of Mobilecommunication, Global System for Mobile Communications), GPRS (General Packet Radio Service, General Packet Radio Service), CDMA (Code Division Multiple Access, Code Division Multiple Access), WCDMA (Wideband CodeDivision Multiple Access, Wideband Code Division Multiple Access), High Speed Downlink Packet Access (HSDPA), LTE (Long Term Evolution, Long Term Evolution), email, SMS (Short Messaging Service, short message service) and so on.
本发明实施例还提供一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序执行时包括上述方法实施例中记载的至少内存地址的映射的方法的部分或全部步骤。Embodiments of the present invention further provide a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program includes at least some or all of the steps of the method for mapping memory addresses described in the above method embodiments.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, in the above embodiments, the description of each embodiment has its own emphasis. A description of the example.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。It should be noted that, for the sake of simple description, the foregoing method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence. As in accordance with the present invention, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-OnlyMemory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: U disk, removable hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes.
以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: The technical solutions described in the embodiments are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions depart from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (15)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610164190.XA CN105975407B (en) | 2016-03-22 | 2016-03-22 | Memory address mapping method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610164190.XA CN105975407B (en) | 2016-03-22 | 2016-03-22 | Memory address mapping method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105975407A CN105975407A (en) | 2016-09-28 |
CN105975407B true CN105975407B (en) | 2020-10-09 |
Family
ID=56988695
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610164190.XA Active CN105975407B (en) | 2016-03-22 | 2016-03-22 | Memory address mapping method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105975407B (en) |
Families Citing this family (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106649133B (en) * | 2016-12-29 | 2019-12-06 | 杭州迪普科技股份有限公司 | Method and equipment for optimizing PCI (peripheral component interconnect) memory space |
CN107329790B (en) * | 2017-06-30 | 2021-01-15 | 联想(北京)有限公司 | Data processing method and electronic equipment |
CN109669784B (en) | 2017-10-13 | 2021-06-22 | 华为技术有限公司 | Method and system for interprocess communication |
CN107861888B (en) * | 2017-11-08 | 2020-03-24 | 郑州云海信息技术有限公司 | DDR method, system and device for FPGA card and readable storage medium |
CN107908475B (en) * | 2017-11-09 | 2021-11-26 | 深圳市创维软件有限公司 | Memory capacity judging method, server and storage medium |
CN108334413A (en) * | 2017-12-22 | 2018-07-27 | 天津麒麟信息技术有限公司 | Information transmitting methods between a kind of firmware and operating system based on platform of soaring |
CN110096453B (en) * | 2019-04-11 | 2020-01-03 | 北京华三通信技术有限公司 | Data processing method and device |
CN110231989A (en) * | 2019-05-14 | 2019-09-13 | 深圳市亿联智能有限公司 | A kind of embedded intelligent terminal dynamic memory optimization method |
CN110287044B (en) * | 2019-07-02 | 2021-08-03 | 广州虎牙科技有限公司 | Lock-free shared memory processing method and device, electronic equipment and readable storage medium |
CN111221758B (en) * | 2019-09-30 | 2023-06-27 | 华为技术有限公司 | Method and computer device for processing remote direct memory access request |
CN111679921B (en) * | 2020-06-09 | 2023-08-01 | Oppo广东移动通信有限公司 | Memory sharing method, memory sharing device and terminal equipment |
CN112148229B (en) * | 2020-10-12 | 2024-01-30 | 北京计算机技术及应用研究所 | Method for accelerating read-write efficiency of nonvolatile memory under Feiteng server platform |
CN114006859B (en) * | 2021-09-18 | 2023-05-30 | 深圳震有科技股份有限公司 | Message forwarding method, terminal and computer readable storage medium |
CN114253844B (en) * | 2021-12-16 | 2024-09-24 | 安天科技集团股份有限公司 | Program running method and device, electronic equipment and storage medium |
CN117914860A (en) * | 2022-10-12 | 2024-04-19 | 华为技术有限公司 | Collective communication method and computing cluster |
CN116185565A (en) * | 2022-12-29 | 2023-05-30 | 芯动微电子科技(武汉)有限公司 | Memory data isolation and sharing system and method |
CN117492933B (en) * | 2023-12-28 | 2024-03-22 | 苏州元脑智能科技有限公司 | Data exchange method, device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0747827A1 (en) * | 1995-06-07 | 1996-12-11 | International Business Machines Corporation | System and method for providing shared memory using shared virtual segment identification in a computer system |
CN102253855A (en) * | 2011-06-17 | 2011-11-23 | 北京书生国际信息技术有限公司 | Method and device for transferring shared memory |
CN103414535A (en) * | 2013-07-31 | 2013-11-27 | 华为技术有限公司 | Data sending method, data receiving method and relevant devices |
CN104636260A (en) * | 2013-11-06 | 2015-05-20 | 深圳市风景智联科技有限公司 | Data management method and system for charging services |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9343185B2 (en) * | 2013-09-26 | 2016-05-17 | International Business Machines Corporation | Electronic circuit for fitting a virtual address range to a physical memory containing faulty address |
-
2016
- 2016-03-22 CN CN201610164190.XA patent/CN105975407B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0747827A1 (en) * | 1995-06-07 | 1996-12-11 | International Business Machines Corporation | System and method for providing shared memory using shared virtual segment identification in a computer system |
CN102253855A (en) * | 2011-06-17 | 2011-11-23 | 北京书生国际信息技术有限公司 | Method and device for transferring shared memory |
CN103414535A (en) * | 2013-07-31 | 2013-11-27 | 华为技术有限公司 | Data sending method, data receiving method and relevant devices |
CN104636260A (en) * | 2013-11-06 | 2015-05-20 | 深圳市风景智联科技有限公司 | Data management method and system for charging services |
Also Published As
Publication number | Publication date |
---|---|
CN105975407A (en) | 2016-09-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105975407B (en) | Memory address mapping method and device | |
WO2018170833A1 (en) | Uplink data transmission method, terminal, network side device and system | |
WO2018227398A1 (en) | Display method and apparatus | |
WO2016127426A1 (en) | Method and apparatus for displaying application and picture, and electronic device | |
EP3190763A1 (en) | Screen sharing method, sharing device and receiving device | |
US11099898B2 (en) | Method for allocating memory resources and terminal device | |
CN111240768A (en) | Configuration parameter configuration method and device and computer storage medium | |
EP3409073B1 (en) | Method and electronic device for providing tethering service | |
US9998924B2 (en) | Electronic device and method for acquiring biometric information thereof | |
US9756674B2 (en) | Method of transmitting and receiving data of electronic device and electronic device using the method | |
CN106446111B (en) | Data migration method and terminal | |
WO2019184631A1 (en) | Information processing method and apparatus, computer-readable storage medium, and terminal | |
AU2018399177A1 (en) | Electronic transaction method and terminal | |
EP3249899B1 (en) | Call forwarding method and terminal | |
CN106534288B (en) | A data transmission method and mobile terminal | |
CN109144723B (en) | Method and terminal for allocating storage space | |
WO2017206901A1 (en) | Process control method and related device | |
CN114827914A (en) | Short message processing method and device and electronic equipment | |
CN106534093B (en) | Terminal data processing method, device and system | |
CN107451546A (en) | Iris identification method and related product | |
CN106714279A (en) | A hotspot network switching method and terminal equipment | |
WO2018103440A1 (en) | Network positioning method and terminal device | |
CN106681670B (en) | Sensor data reporting method and device | |
CN106487878B (en) | Method and terminal for data migration | |
CN106535229B (en) | WiFi signal receiving sensitivity testing method and mobile terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20211224 Address after: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province Patentee after: xFusion Digital Technologies Co., Ltd. Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd. |
|
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20250306 Address after: 10/F, Chuangzhi Tiandi Building, Dongshigeng Street, Zhongdao East Road, Longzihu Wisdom Island, Zhengdong New District, Zhengzhou City, Henan Province, 450000 Patentee after: Henan Kunlun Technology Co.,Ltd. Country or region after: China Patentee after: xFusion Digital Technologies Co., Ltd. Address before: 450046 Floor 9, building 1, Zhengshang Boya Plaza, Longzihu wisdom Island, Zhengdong New Area, Zhengzhou City, Henan Province Patentee before: xFusion Digital Technologies Co., Ltd. Country or region before: China |
|
TR01 | Transfer of patent right |