CN115576716A - Memory management method based on multiple processes - Google Patents
Memory management method based on multiple processes Download PDFInfo
- Publication number
- CN115576716A CN115576716A CN202211333844.9A CN202211333844A CN115576716A CN 115576716 A CN115576716 A CN 115576716A CN 202211333844 A CN202211333844 A CN 202211333844A CN 115576716 A CN115576716 A CN 115576716A
- Authority
- CN
- China
- Prior art keywords
- memory
- access
- address
- segment
- target
- 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
Images
Landscapes
- Memory System (AREA)
Abstract
The invention discloses a memory management method based on multiple processes, which comprises the steps that if a first processor receives a first memory application request or a first access parameter of an information sharing memory, a first access memory segment is distributed according to the principle of address space continuous distribution, and then identification information of a first target process is bound with the correspondingly distributed first access memory segment; then determining that the first target process completes the memory application operation; under the condition that the second processor determines that the first target process completes the memory application operation, if a second memory application request or a second access parameter of the information sharing memory is received, a second access memory segment is allocated to the second target process according to the address space continuous allocation principle, then an occupation mark is set for a memory segment occupied by data in the second access memory segment, and an access limitation memory segment is set in an unallocated memory space of the target memory.
Description
Technical Field
The invention relates to the technical field of computers, in particular to a memory management method based on multiple processes.
Background
With the development of computer technology, the improvement of chip design level and the improvement of application requirements, multi-core systems are more and more widely applied to products. The current multi-core heterogeneous system generally comprises a plurality of processor cores such as a large core and a small core; the shared memory technology is one of communication modes for data interaction among the multi-core processors, so that the multi-core processors can be designed by cooperatively finishing a certain specific function, the data access is fast, and the real-time performance is strong.
The data access method for the shared memory disclosed in chinese patent application CN103559079A is not adapted to a certain process used in the current software environment scenario, that is, a process-based reasonable communication mechanism is absent in the operating system loaded in the current software environment scenario, and only a method for partitioning the shared memory area is used, so that each partition only corresponds to the write data of one processor and the read data of another processor.
The chinese invention patent CN103559079A needs to copy data between different partitions for many times to achieve the purpose of sharing data between different processors; if a plurality of processes (for example, a process corresponding to an application software running environment requiring data interaction and a process corresponding to a bottom-layer driving algorithm in the same operating system) are adopted to access the same memory at the same time, a data access conflict or an address access out-of-bounds risk still occurs, and since the chinese patent application CN103559079A does not consider the software running environments of a multiprocess task and a single-process task, poor compatibility of the shared memory may be caused, including the application scenarios of being incompatible with various embedded operating systems, non-embedded operating systems, and no operating system, and single-core processors and multi-core processors.
Disclosure of Invention
The application discloses a memory management method based on multiple processes, which comprises the following specific technical scheme:
a memory management method based on multiple processes comprises the following steps: step S1, if a first processor receives a first memory application request or a first access parameter of an information sharing memory to schedule at least two first target processes to start applying for the memory, allocating a first access memory segment in a target memory according to a principle of address space continuous allocation, and then binding identification information of the first target processes and the correspondingly allocated first access memory segment together; then determining that the first target process completes the memory application operation, and controlling the first processor to transmit at least the first address and the memory capacity of the bound first access memory segment to the other processors through the information sharing memory; step S2, under the condition that the second processor determines that the first target process completes the memory application operation, if a second memory application request or a second access parameter of the information sharing memory is received, in the target memory, a second access memory segment is allocated for the second target process according to the principle of continuous allocation of address space, then an occupation mark is set for a memory segment occupied by data in the second access memory segment, and an access limitation memory segment is set in the unallocated memory space of the target memory, so that the effective access range of the second target process in the target memory is limited in the second access memory segment; and controlling the second processor to transmit at least the first address and the memory capacity of the second access memory segment to the first processor through the information sharing memory; wherein, there is address mapping relation between the first access memory segment and the second access memory segment; the information sharing memory is a shared memory for parameter interaction between the first processor and the second processor in the target memory.
Further, the memory management method further includes: step S3, when the first processor receives a first memory release request or a first release parameter of the information sharing memory, the second processor is informed through the information sharing memory; step S4, when the first processor receives a first memory release request or a first release parameter of the information sharing memory, searching a correspondingly bound first access memory segment in the target memory through the identification information of the first target process, then removing the binding relation between the identification information of the first target process and the correspondingly bound first access memory segment, then determining that the first target process completes the memory release operation, and transmitting the information that the first target process completes the memory release operation to the second processor through the information sharing memory; when the first access memory segment is not released from the binding relation with the identification information of the correspondingly bound first target process, the first access memory segment is not accessed by other first target processes except the bound first target process; the address value of the second access memory segment is different from the address value of the first access memory segment; after step S1 is executed, the first address of the first access memory segment obtained most recently and the memory capacity of the first access memory segment are both converted into the first memory release request or the first release parameter of the information sharing memory.
Further, the memory management method further includes: step S5, when the second processor receives a second memory release request or a second release parameter of the information sharing memory, sequentially searching memory segments occupied by data from the first address of the second access memory segment, and clearing the occupation mark of each searched memory segment occupied by data to recover to allow other processes scheduled by the second processor to access; meanwhile, the access restricted memory segment is restored to allow the second target process to access; then determining that the second target process completes the memory release operation, and transmitting the information that the second target process completes the memory release operation to the first processor through the information sharing memory; when the second access memory segment is not cleared of the occupation mark in the relevant address interval, only allowing a second target process allocated to the second access memory segment to access; after step S2 is executed, the first address of the second access memory segment, the memory capacity of the memory segment occupied by the data, and the memory capacity of the access-limited memory segment, which are obtained last, are all converted into the second memory release request or the second release parameter of the information sharing memory.
Further, after the first target process is bound to the first access memory segment in the target storage, when the first target process accesses the first access memory segment, the first processor performs read-write operation on the first access memory segment to which the first target process is bound; the first memory application request comprises scheduling request information of a first target process; after the second target process is allocated to the second access memory segment in the target memory, when the second target process accesses the second access memory segment, the second processor performs read-write operation on the second access memory segment allocated to the second target process; the second memory application request comprises scheduling request information of a second target process; and in the target memory, the first address of the first access memory segment obtains the first address of the second access memory segment through address offset.
Further, in step S1, the method for binding the identification information of the first target process and the correspondingly allocated first access memory segment together includes: under the control of a first memory application request or a first access parameter, setting identification information of a first target process scheduled by a first processor as an index value of a first access memory segment currently accessed by the first target process, so as to locate the first access memory segment to be accessed through the identification information of the first target process, configuring one of the identification information corresponding to the allocated first access memory segment and not allowing the first target process of other identification information to access, forming a mapping relation between the identification information of the first target process and a head address of the first access memory segment currently accessed, determining to bind the identification information of the first target process and the corresponding allocated first access memory segment together, and feeding back the head address of the first access memory segment correspondingly bound to the identification information of the first target process to an intermediate layer, so as to provide operation address information of the first target process for an application software program; the identification information of the first target process is obtained from an interface of a dynamic library encapsulated in an intermediate layer under the scheduling action of the first processor, and the intermediate layer is arranged in an operating system operated by the first processor; and the identification information of the first target process is bound with the correspondingly allocated first access memory segment, which indicates that the first target process only accesses the correspondingly allocated first access memory segment.
Further, the principle of the address space continuous allocation includes: starting from the first address of the target memory, searching the address at the starting position of a continuous free memory space, and setting the address at the starting position of the continuous free memory space searched for the first time as an entry address; detecting whether a continuous free memory space where the entry address is located has an allocation space meeting a memory application request or an allocation space meeting an access parameter requirement; the memory application request or the access parameter comprises a preset entry address and the memory capacity of a required allocation space in a continuous free memory space where the preset entry address is located; when detecting that an allocation space meeting a memory application request exists in a continuous free memory space where an entry address is located, setting the allocation space as a free memory segment for a process to access, determining that the currently detected entry address is the entry address of the allocation space meeting the memory application request, and modifying the address of the starting position of the next continuous free memory space so as to allocate a free memory segment for another process to access in the next continuous free memory space; when detecting that an allocation space meeting the access parameter requirement exists in the continuous free memory space where the entry address is located, setting the allocation space as a free memory segment for a process to access, determining that the currently detected entry address is the entry address of the allocation space meeting the access parameter requirement, and modifying the address of the starting position of the next continuous free memory space so as to allocate a free memory segment for another process to access in the next continuous free memory space; when the continuous free memory space where the entry address is located does not have the allocation space meeting the memory application request and the allocation space meeting the access parameter requirement, adjusting the entry address to the address of the starting position in the next continuous free memory space, and then judging whether the continuous free memory space where the adjusted entry address is located has the allocation space meeting the memory application request or the allocation space meeting the access parameter requirement until the allocation space meeting the memory application request or the allocation space meeting the access parameter requirement is searched; wherein, the starting position in the next continuous free memory space is pre-recorded in the continuous free memory space where the entry address before adjustment is located; the first address of the free memory segment for a process to access and the memory capacity of the free memory segment for the process to access are cached in the information sharing memory.
Further, when a first access memory segment is allocated according to the principle of continuous allocation of the address space, determining that the first access memory segment is an allocation space meeting a first memory application request or an allocation space meeting a first access parameter, wherein a first address of the first access memory segment is a currently adjusted entry address, and the first access memory segment belongs to a continuous free memory space when allocated; and when a second access memory segment is allocated to a second target process according to the principle of continuous allocation of the address space, determining that the second access memory segment is an allocation space meeting the second memory application request or an allocation space meeting second access parameters, wherein the first address of the second access memory segment is the currently adjusted entry address, and the second access memory segment belongs to a continuous free memory space when being allocated.
Further, before allocating the first access memory segment according to the principle of address space continuous allocation, when the entry address meeting the first memory application request or the entry address meeting the first access parameter requirement is within a first preset initial address range, and the memory capacity of the allocation space required in the continuous free memory space where the entry address within the first preset initial address range is located is within a first preset target capacity range, determining that the parameter required by the first target process to access the target memory is legal; before allocating a second access memory segment for a second target process according to the principle of address space continuous allocation, when an entry address meeting a second memory application request or an entry address meeting second access parameter requirements is in a second preset first address range, and the memory capacity of an allocation space required in a continuous free memory space where the entry address in the second preset first address range is located is in a second preset target capacity range, determining that the parameters required by the second target process for accessing the target memory are legal.
Further, in step S4, before searching for the correspondingly bound first access memory segment in the target storage through the identification information of the first target process, when an entry address included in the first memory release request or the first release parameter is within a first preset initial address range, and the memory capacity of the allocation space required in the continuous free memory space where the entry address within the first preset initial address range is located is within a first preset target capacity range, it is determined that the parameter required for the first target process to release the memory in the target storage is legal; in step S5, before sequentially searching the memory segments occupied by the data from the first address of the second access memory segment, when the entry address included in the second memory release request or the second release parameter is within the second preset first address range, and the memory capacity of the allocation space required in the continuous free memory space where the entry address within the second preset first address range is located is within the second preset target capacity range, it is determined that the parameter required by the second target process to release the memory in the target memory is legal.
Further, in step S2, after the second access memory segment is allocated, in a second access memory segment to be accessed by the second target process, starting from the head address of the second access memory segment, whenever it is detected that one memory segment is filled with data, setting the currently detected memory segment as a memory segment occupied by data so that the second access memory segment is not a continuous free memory space, and setting an occupation flag for the currently detected memory segment until all address positions in the second access memory segment are traversed, where all the set occupation flags are used to indicate idle indication information in the second access memory segment to indicate whether the second access memory segment has an idle memory space; each memory segment occupied by the data allows the same second target process to repeatedly access, but does not allow processes except the second target process to access; and setting the memory segments in the target memory except the second access memory segment not to be accessed by the second target process so as to prevent the address from crossing the boundary in the access process of the second target process.
Further, the first processor is a large core architecture processor and the second processor is a small core architecture processor; or the first processor is configured to run a multi-process operating system, and the second processor is configured to run a single-process operating system or no operating system; the system comprises a first processor, a second processor and a third processor, wherein the first processor is used for running at least one first target process, and the second processor is used for running a second target process; the first processor and the second processor are both configured to support reading and writing operations on the information sharing memory.
The technical effects of this application lie in: the method controls two different types of processors to share one target memory, and supports both multi-process access and single-process access; in the access process, a packaging interface is used in a processor of a corresponding type to apply for an idle memory segment required by a corresponding process and make address mapping so as to facilitate read-write operation of the corresponding memory segment, or the processor of the corresponding type directly applies for the idle memory segment required by the corresponding process and makes data occupation marks and access limits; according to the method, each first target process accesses to the correspondingly bound first access memory segment, the second target process accesses to the correspondingly marked second access memory segment, and the multiple first target processes can be scheduled to be bound to the correspondingly distributed first access memory segments through the interface packaged by the middle layer by the aid of the memory management method based on multiple processes, so that compatibility of the system and adaptability of a use scene are improved; the first processor and the second processor can interact address information of memory application, memory release and read-write operation through the same shared memory in the target memory, and the problem that information between two processors of different types cannot be shared is solved; the method can perform information intercommunication among the processors, avoids the situation that two processors read and write data in the same memory segment at the same time, solves the conflict problem among processors of different types, solves the problem that a plurality of processes cannot use a shared memory at the same time, is adaptive to software environments such as a bare computer and different embedded operating systems, is compatible with various embedded operating systems, non-embedded operating systems and software environments without operating systems, and is also compatible with application scenes of a single-core processor and a multi-core processor.
In the first target processes which can be scheduled by the first processor, the identification information of each first target process is set as the index value of a first access memory segment which is currently accessed by the first target process, a one-to-one correspondence relationship is established between the identification information of each first target process and the first address of the first access memory segment which is correspondingly accessed, so that the middle layer is positioned to the first access memory segment which needs to be accessed through the identification information of the first target process, the division into a plurality of first access memory segments in the target memory according to the memory application request required by the first target process is realized, and the first access memory segments positioned under each identification information are configured not to be allowed to be accessed mutually, so that the data in the memory segment accessed by one process is prevented from being changed by other processes, and the problem that the data read and written by the first target processes in the same memory are wrong or the addresses are out of bounds is reduced.
A second processor is added on the basis of a first processor to manage the same target memory, and after the first processor completes memory application operation, the second processor is informed to apply for the memory required by a scheduled second target process, and the results of memory release can be informed to the other side, so that one processor can immediately see the update of the data in the memory occupied by the other processor, and the data interaction between the first processor and the second processor is ensured to be normally carried out and not interfered with each other.
Drawings
Fig. 1 is a flowchart illustrating a memory application operation in a memory management method based on multiple processes according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating a memory release operation in a memory management method based on multiple processes according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In addition, in the present application, the terms "first target process accesses the first access memory segment", "first target process reads and writes the first access memory segment", "first processor operates the first access memory segment", "first processor accesses the first access memory segment", and the like, are often used interchangeably herein. Similarly, the terms "second target process accesses the second accessed memory segment", "second target process reads and writes the second accessed memory segment", "second processor operates the second accessed memory segment", "second processor accesses the second accessed memory segment", and the like, are often used interchangeably herein. The term "and/or" in this application is only one kind of association relationship describing the association object, and means that there may be three kinds of relationships, for example, a and/or B, and may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The embodiment discloses a memory management method based on multiple processes aiming at the compatibility of the same memory in the software running environment of multiple process tasks and single process tasks and the applicability of the same memory in a multi-core processor structure, wherein an execution main body of the memory management method belongs to a memory management device and comprises an access main body of a shared memory or a control circuit device of the shared memory; or, the memory management method may be that the first processor and the second processor execute cooperatively and can notify the other party through a related instruction, that is, a multi-core processor system composed of the first processor and the second processor is used as an execution subject. Specifically, the memory management method may be initiated by a first processor supporting multiple processes (may be controlled by an application software program or an intermediate layer in a running and loading operating system), and then notifies a second processor supporting a single process through a target memory disclosed in the present application; or, initiated by the second processor (which may be directly controlled by the application software program), and then notified to the first processor through the target memory disclosed herein; or the first processor and the second processor execute corresponding steps in sequence after being initiated by a storage control device corresponding to the target storage; and the first processor and the second processor apply for the memory and release the memory in sequence in the process of accessing the target memory.
In this embodiment, the memory management method includes:
step S1, if a first processor receives a first memory application request or a first access parameter of an information sharing memory to schedule at least two first target processes to start applying for the memory, allocating a first access memory segment in a target memory according to the principle of address space continuous allocation, allocating a first access memory segment for the first target processes, and binding identification information of the first target processes and the first access memory segments which are correspondingly allocated together; the identification information of the first target process is bound with the correspondingly allocated first access memory segment, which indicates that the first target process only accesses the correspondingly allocated first access memory segment. Preferably, the identification information of the first target process and the first address of the first access memory segment to be bound have a fixed numerical value conversion relationship, and when one identification information represents an identity identifier of the first target process, the first address of the first access memory segment to be bound by the first target process is unique, so that the first access memory segment to be accessed by the first target process is unique, and it is avoided that different first target processes access the same first access memory segment, which results in repeated reading and writing of data of the same first access memory segment.
Preferably, each first target process corresponds to one first memory application request or one first access parameter, that is, one first target process needs one instruction to perform one memory application, and is allocated to one corresponding first access memory segment through this form of application, then this embodiment configures the identification information of each first target process as the identity identifier of the first target process, so as to distinguish other first target processes; therefore, in the same operating system, the process corresponding to the application software running environment needing data interaction and the process corresponding to the underlying driving algorithm do not interfere with each other when the processes read and write the same memory at the same time. Therefore, the step S1 can support the multi-process operation target memory, and the utilization rate of the memory is improved.
After applying for a memory space meeting a first memory application request or a first access parameter requirement in the target memory, allocating a corresponding first access memory segment in the target memory; although the memory application request or the access parameter required by the first target process includes the first address of the first access memory segment required to be applied and the memory capacity of the first access memory segment required to be applied, the memory application request or the access parameter does not necessarily conform to the actual size of the storage space or the data storage state in the target storage, so that the first access memory segment for performing the actual read-write operation needs to be further allocated according to the principle of continuous allocation of the address space to obtain the first access memory segment; the first processor applies for a memory in the target memory before accessing the first access memory segment, and specifically allocates the first access memory segment in the target memory according to a principle of continuous allocation of address space according to an indication information (including address information and applied memory capacity information) meeting the requirements of the application software program in a first memory application request or a first access parameter pre-stored in the information sharing memory, so that the first processor can adapt to the requirements of each application software program loaded in an operating system and the actual size of a hardware storage space in the target memory.
Under the control of a first processor, after a corresponding first access memory segment is allocated in a target memory, the identification information of a first target process is bound with the corresponding allocated first access memory segment to form an address mapping relation of each first target process in the target memory, and the address mapping relation is recorded as that one identification information corresponds to one first target process, and one identification information is mapped to a unique memory segment, so that each first target process completes the access of the corresponding bound first access memory segment according to the identification information under the scheduling of the first processor; at this time, a first access memory segment meeting the first target process is screened out from all the distributed first access memory segments in a memory mapping mode, a unique first access memory segment is distributed to each first target process, and the first target process is also determined to finish the memory application operation. Then, preferably, the embodiment controls the first processor to update both the first address and the memory capacity of the bound first access memory segment to the same type of parameters in the first access parameters and the same type of parameters in the first memory application request, and then transmits the updated first access parameters and the updated first memory application request to the remaining processors through the information sharing memory, where the remaining processors include the first processors of the same type or processors of different types; in order to achieve normal interaction of memory allocation information between the first processor and the second processor, information that the first target process completes a memory application operation is converted into instruction parameters, the instruction parameters are refreshed into an information sharing memory, and the information sharing memory is transmitted to the second processor, so that the step S2 is conveniently executed.
Step S2, under the condition that the second processor determines that the first target process completes the memory application operation, if a second memory application request or a second access parameter of the information sharing memory is received, in the target memory, a second access memory segment is allocated for the second target process according to the principle of continuous allocation of address space, then an occupation flag is set for a memory segment occupied by data in the second access memory segment, a data read-write state flag is performed on the allocated second access memory segment to indicate that the memory segment occupied by data in the second access memory segment only allows the second target process to access, the second processor obtains the data occupation state of the memory space accessed under a single second target process, and an access limitation memory segment is set in the unallocated memory space of the target memory to limit the effective access range of the second target process in the target memory segment, so as to avoid that the address accessed in the process of reading and writing data of the second target process is out of bounds, and ensure the accuracy of the data read and write of the second processor under the single process task condition. The second processor is controlled to at least transmit the first address and the memory capacity of the second access memory segment to the first processor through the information sharing memory, the embodiment controls the second processor to update the first address and the memory capacity of the allocated second access memory segment to the same type of parameters in the second access parameters and the same type of parameters in the second memory application request, and then transmits the updated second access parameters and the updated second memory application request to the first processor through the information sharing memory; in order to realize normal interaction of memory allocation information between the first processor and the second processor, the information of the second target process completing the memory application operation is converted into instruction parameters, the instruction parameters are refreshed to the information sharing memory, and the information sharing memory is transmitted to the first processor, so that the problems that the information between the first processor and the second processor is not communicated and cannot be shared are solved.
In this embodiment, step S2 is executed only after step S1 notifies the second processor of the information that the first processor completes the memory application operation, so that the second processor can obtain the first address of the first access memory segment allocated by each first target process and the memory capacity of the allocation space required by each first target process when step S2 is executed, and can be used to receive a suitable second memory application request or a second access parameter of the information sharing memory; it should be noted that an address mapping relationship exists between the second access memory segment and the first access memory segment, where the address mapping relationship includes an address offset relationship, that is, a mapping relationship exists between an address of the second access memory segment and an address of the first access memory segment, and in the target storage, an address value of each first access memory segment obtains a corresponding address value in the second access memory segment through address offset, so that a first address of the first access memory segment allocated by the first target process received by the second processor has a reference meaning, so that the first address of the second access memory segment can be adaptively adjusted according to the first address of the first access memory segment, thereby facilitating non-data-interference access of multiple first target processes and second target processes to the target storage, and improving compatibility of the same target storage to an operating system operated by the first processor and an operating system operated by the second processor.
Although the memory application request or the access parameter required by the second target process includes the first address of the second access memory segment required to be applied and the memory capacity of the second access memory segment required to be applied, the memory application request or the access parameter does not necessarily conform to the actual size of the storage space or the data storage state in the target storage, so before the second processor accesses the second access memory segment, the second access memory segment actually used for read-write operation can be allocated in the target storage by further continuously allocating the address space; specifically, according to the indication information (including address information and applied memory capacity information) meeting the requirements of the application software program in the first memory application request or the first access parameters pre-stored in the information sharing memory, the indication information is allocated to the second access memory segment in the target memory according to the principle of continuous allocation of address space, so that the requirement of a single application software program loaded in an operating system can be met, and the actual size of the hardware storage space in the target memory can also be met.
It should be noted that a process is an application entity running in a computer, which is assigned to and executed by a processor of a computer device and uses identification information for identification, such as by an application software program configuring a process with a unique identifier ID.
In this embodiment, the target Memory is preferably a Static Random-Access Memory (SRAM), which means that the data stored in the Memory can be constantly maintained as long as the Memory is powered on; when the control system of the memory is powered down or restarted, the data stored in the SRAM will be lost. The SRAM may be configured as a shared memory for use by the first processor and the second processor; between the first processor and the second processor, the target memory is a communication medium between processes scheduled by the respective processors; for example, in the present application, the fact that two different processes A1 and A2 communicate through a shared memory means that instruction parameters cached in the same physical memory are respectively mapped to process virtual address spaces of the processes A1 and A2, so that the process A1 can immediately see the update of the data in the memory occupied by the process A2, and vice versa; wherein, the processes A1 and A2 may be respectively derived from different processors, or may be derived from the same processor; the same physical memory mapped to processes A1 and A2, respectively, is the information-sharing memory of the target storage.
The information sharing memory is a shared memory for parameter interaction between the first processor and the second processor in the target memory, and may be a segment of memory block with a fixed address and a fixed size. When one processor writes an instruction parameter into the information shared memory, another processor reads the written instruction parameter from the information shared memory, and then determines that one processor transmits the instruction information of the process operation on the memory to the other processor through the information shared memory, wherein the instruction parameter includes the operation information of the process operation on the memory where the information shared memory is located by the processor, and specifically includes a read-write first address (starting address), the capacity of an applied memory segment, an index of the applied or divided memory segment (the corresponding memory segment is specified by a guide address pointer to access data therein), a mapping relationship between the index of the memory segment and the first address of the memory segment, and idle indication information of each address position.
The first processor inputs a data instruction which needs to be read by the second processor in the information sharing memory of the target memory, and the second processor inputs a data instruction which needs to be read by the first processor in the information sharing memory of the target memory. In this embodiment, the first processor is a processor with a large core structure, and the second processor is a processor with a small core structure, where the processor with the large core structure has its own independent resources including a plug-in DDR memory, an SRAM memory, and the like, and the large core structure may be a single core or a multi-core structure; the processor with the small core structure also has own independent resources, comprises an RAM memory and the like, and is generally of a single core structure; the corelet is typically a general purpose MCU level processing core, and memory resources are typically limited. Alternatively, the first processor is configured to run a multi-process operating system, and the second processor is configured to run a single-process operating system or no operating system, for example, the memory application operation executed by the first processor is executed under a linux system, and the memory application operation executed by the second processor is applicable to a non-linux system or a software environment without an operating system. The system comprises a first processor, a second processor and a third processor, wherein the first processor is used for running at least one first target process, and the second processor is used for running a second target process; the first processor and the second processor are both configured to support reading and writing operations on the information sharing memory. Therefore, the first processor and the second processor are configured to perform data interaction or instruction interaction through the target memory, and compatibility of the operating system is improved.
It should be noted that, after the first target process is bound to the first access memory segment in the target storage, when the first target process accesses the first access memory segment, the first processor performs read-write operation on the first access memory segment to which the first target process is bound; the first memory application request may include scheduling request information of the first target process, a first address of the first access memory segment, and a memory capacity of the first access memory segment, where the first access memory segment is a process that the first target process needs to access (the first memory application request needs to be applied for or needs to be allocated).
After the second target process is allocated to the second access memory segment in the target storage (which may be understood as after the second processor receives the second memory application request or the second access parameter), when the second target process accesses the second access memory segment, the second processor performs read-write operation on the second access memory segment allocated to the second target process; the second memory application request may include scheduling request information of the second target process, a first address of the second access memory segment, and a memory capacity of the second access memory segment, where the second access memory segment is a process that the second target process needs to access (needs to apply for or need to allocate).
The specific content included in the memory application request and the access parameter is not limited in this embodiment, and optionally, the memory application request and the access parameter may include the size of the memory to be applied and the initial address of the memory to be applied. The memory applied for the application can be a memory with aligned size, and can also be a memory with non-aligned size. When a processor or a process reads and writes data in a memory, the processor or the process operates according to a basic unit. For example, in a 32-bit processor or 32-bit operating system, 4 bytes (one byte in size) can be read at a time. The starting address of the memory segment is preferably set equal to a multiple of the basic unit, and the memory segment to be applied may be a multiple equal to the basic unit, and the multiple is a power of 2. For example, the size of the memory requested may be 4 kbytes, 8 kbytes, 16 kbytes, 32 kbytes, 64 kbytes, 128 kbytes, etc., and at this time, the size of the memory requested is aligned. For another example, the size of the memory requested may be 6 kbytes, 12 kbytes, 48 kbytes, etc., and at this time, the size of the memory requested is not aligned.
Preferably, the first access memory segment requested by the first processor may be: the memory blocks allocated through the system call interface or the external interface of the dynamic library encapsulated in the middle layer may be shared memory blocks, for example, under a linux system, the first processor maps a 4096-byte memory block through the mmap system call interface; the memory large block in each block corresponds to the identification information called by the interface to form an index of the memory large block so as to adapt to the memory read-write operation of the first processor executing the multi-process task. Moreover, the second access memory segment applied by the second processor can be allocated not through a system call interface or an external interface of a dynamic library packaged in the middle layer, but directly starts from the first address of the target memory to search a continuous free memory space so as to adapt to the second processor performing single-process tasks.
In summary, each first target process accesses to the corresponding bound first access memory segment, the second target process accesses to the corresponding marked second access memory segment, and a plurality of first target processes can be scheduled to be bound to the corresponding allocated first access memory segments through the interface packaged by the middle layer, so that the compatibility of the system and the adaptability of the use scene are improved; the first processor and the second processor can interact the address and the capacity information of the memory application through the same section of shared memory in the target memory; the method can avoid the situation that two processors read and write data in the same memory segment simultaneously in the interaction between the processors and the memory segment bound or marked by the target process, solve the conflict problem between processors of different types, solve the problem that a plurality of processes can not use a shared memory simultaneously, adapt to software environments such as bare computers and different embedded operating systems, and be compatible with various embedded operating systems, non-embedded operating systems and software environments without operating systems, and also be compatible with application scenes of single-core processors and multi-core processors.
As an embodiment of the memory application operation, the step S1 includes a step S11 to a step S13, and the step S2 includes a step S21 to a step S23; referring to fig. 1, the following is specific:
step S11, if the first processor receives the first memory application request or the first access parameter of the information sharing memory to schedule at least two first target processes to start applying for the memory, allocating a first access memory segment in the target storage according to the principle of address space continuous allocation for the operation of each first target process. Then step S12 is performed. It should be noted that the premise that the first processor receives the first memory application request or the first access parameter of the information shared memory may be that at least two first target processes start to open the driving device node of the target memory, and schedule the first target processes to access the target memory sequentially or simultaneously, including accessing the shared memory set in the target memory. The first memory application request or the first access parameter includes address information and capacity information of a memory space that the first target process needs to access, and address information of a memory space that the first target process does not need to access.
Step S12, binding the identification information of the first target process and the correspondingly distributed first access memory segment together; then step S13 is performed. In step S12, based on the first memory application request or the first access parameter, according to the requirements (including the requirements of the first address and the memory capacity) of the memory segment that each first target process needs to access, binding the identification information of each first target process with the corresponding first access memory segment, so that each first target process completes the read-write operation of the corresponding bound first access memory segment under the scheduling of the first processor; in the operating system running inside the first processor, the scheduled first target process needs to be mapped to the first access memory segment that is correspondingly allocated, in this embodiment, the identification information of the first target process is used as an index of the first address of the first access memory segment that is correspondingly mapped, and the correspondingly formed mapping relationship indicates the corresponding relationship between the identification information of the first target process and the first address (start address) of the first access memory segment, so as to accelerate the establishment of the mapping relationship.
In step S12, the method for binding the identification information of the first target process and the correspondingly allocated first access memory segment includes: under the control of a first memory application request or a first access parameter, setting identification information of a first target process scheduled by a first processor as an index value of a first access memory segment currently accessed by the first target process, so that an intermediate layer is positioned to the first access memory segment needing to be accessed through the identification information of the first target process, and at the moment, the intermediate layer configures a target memory to perform memory address mapping operation; configuring a first access memory segment which is correspondingly allocated (correspondingly bound) by one piece of identification information, wherein the first access memory segment does not allow the access of first target processes of other identification information, forming a mapping relation between the identification information of the first target process and a head address of a first access memory segment which is currently accessed, determining that the identification information of each first target process scheduled by a first processor is bound with the first access memory segment which is correspondingly allocated, and further determining that the first access memory segment is really allocated to each first target process, so that the identification information of the first target process and the first access memory segment which is correspondingly allocated are bound together to indicate that the first target process only accesses the first access memory segment which is correspondingly allocated; feeding back a first address of a first access memory segment corresponding to the currently set index value to the middle layer, and providing operation address information of a first target process for the application software program; therefore, when the first target process accesses the target memory, the first processor performs read-write operation on the first access memory segment with the mapping relationship through the identification information of the first target process, that is, accesses the data stored in the first access memory segment through the address specified by the identification information; the identification information of the first target process is obtained from an interface of a dynamic library packaged in the middle layer under the scheduling action of the first processor; the middle layer is disposed in an operating system run by the first processor. The first processor can apply for the memory through the middle layer, and the first memory application request can be from the middle layer and the related application software program thereof; the address spaces of the first target processes are mutually independent, and the first target processes can simultaneously use the target memory to read and write data without mutual interference.
It should be noted that, in step S12, after the identification information of each first target process is bound to the correspondingly allocated first access memory segment, starting from the first address of the first access memory segment, whenever it is detected that one memory segment is occupied by a correspondingly bound first target process scheduled by the first processor, the memory segment is set as an occupied memory segment to indicate whether each first access memory segment is idle, and it is determined that the currently set occupied memory segment does not allow the first target processes other than the correspondingly bound first target process to access. A mapping relation exists between the index and the first address of the first access memory segment; the identification information of the first target process is used as an index of the target storage, and preferably, the first address bound to the first target process may be sequentially searched according to a link sequence of the index in the data structure, so as to read and write data from and to a continuously idle memory block in the target storage. The addresses of the first access memory segment are continuous; the index may uniquely distinguish the different first-accessed memory segments.
Preferably, step S12 further comprises: when the intermediate layer does not configure the target storage to perform the memory address mapping operation, the read-write function configured in advance in the intermediate layer is called to perform the read-write operation on the first access memory segment to be accessed by the first target process, so as to implement the read-write operation on the first access memory segment in a memory copy mode, and the identification information of each first target process and the head address of the first access memory segment distributed correspondingly are not required to be bound together to form the mapping relation according to the mode of the embodiment, but the memory address to be operated is directly positioned according to the parameter rule set in the read-write function configured in advance; feeding back the first address of the read-write operation in the first access memory segment to the application software program; preferably, the memory application request or the first access parameter required by the first target process includes a first address of the first access memory segment to be accessed and a memory capacity of the first access memory segment to be accessed, so as to allocate each first target process to the first access memory segment, and input the first access memory segment to the pre-configured read-write function as a parameter, so as to perform read-write operation on the first access memory segment to be accessed by the first target process.
Step S13, determining that the first target process completes the memory application operation, and controlling the first processor to at least transmit the first address and the memory capacity of the bound first access memory segment to the other processors through the information sharing memory; then step S21 is performed; preferably, the first processor may update both the first address and the memory capacity of the allocated first access memory segment to the first access parameter of the information shared memory, including updating both the first address and the memory capacity of the bound first access memory segment to the same type of parameter in the first access parameter of the information shared memory, or the same type of parameter in the first memory application request; and transmitting the information of the memory application operation completed by the first target process, the updated first access parameter and the updated first memory application request to the second processor through the information sharing memory. Because the first processor and the second processor are processors of different types, the first processor informs the second processor after applying for finishing the memory application operation, and the normal interaction of data between the first processor and the second processor is ensured.
Step S21, if a second memory application request or a second access parameter of the information sharing memory is received, distributing a second access memory segment for a second target process in the target memory according to the principle of continuous address space distribution; then step S22 is performed. Step S21 is executed when the second processor determines that the first target process completes the memory application operation, but the second processor is configured to run a single process, so that the second memory application request or the second access parameter of the information sharing memory determines that only one second access memory segment is allocated to one second target process in the second processor, and only one second target process is allowed to access the corresponding allocated second access memory segment.
Step S22, setting an occupation flag for the memory segment occupied by the data in the second access memory segment, and setting an access limitation memory segment in the unallocated memory space of the target memory, so as to limit the effective access range of the second target process in the target memory to the second access memory segment. Then step S23 is executed.
Specifically, after the second access memory segment is allocated in step S21, the second target process writes data into the second access memory segment, or the second access memory segment prestores data before the second target process writes data; in a second access memory segment which needs to be accessed by a second target process, starting from the first address of the second access memory segment, whenever detecting that one memory segment is filled with data, which can be the data filled by the second target process, setting the memory segment as the memory segment occupied by the data so that the second access memory segment is not a continuous free memory space, and setting an occupation mark for the memory segment until all address positions in the second access memory segment are traversed to obtain all address intervals provided with the occupation mark, wherein all the set occupation marks are used for indicating free indication information in the second access memory segment to indicate whether the second access memory segment has a free memory space; in the second access memory segment, each memory segment occupied by the data only allows the same second target process to repeatedly access, but does not allow processes except the second target process to access, including not being accessed by the first target process and other second target processes; and the memory segments in the target memory except the second access memory segment are set to be not allowed to be accessed by the second target process, so that the situation that the same second target process generates address out-of-range in the process of accessing the second access memory segment and causes wrong read-write operation in the second processor is prevented, and the second processor and the first processor both obtain incorrect data. In some embodiments, the memory application request or the second access parameter required by the second target process may be from an intermediate layer, and particularly, according to the updated first access parameter and the updated first memory application request setting transmitted by the first processor, a specific address mapping relationship is ensured to be formed between the second access memory segment and the first access memory segment, and specifically, an address offset exists between the address of the second access memory segment and the address of the first access memory segment.
Step S23, determining that the second target process completes the memory application operation, and controlling the second processor to transmit at least the first address and the memory capacity of the second access memory segment allocated to the second processor to the first processor through the target shared memory; specifically, the first address and the memory capacity of the allocated first access memory segment are updated to the same type of parameters in the second access parameters of the information sharing memory or the same type of parameters in the second memory application request; and transmitting the information of the memory application operation completed by the second target process, the updated second access parameter and the updated second memory application request to the first processor through the information sharing memory, and maintaining the normal interaction of the data between the first processor and the second processor.
Step S11 to step S13 correspond to a memory application operation constituting a first processor, step S21 to step S23 correspond to a memory application operation constituting a second processor, the first access memory segment corresponds to a read-write operation of the first processor, the second access memory segment corresponds to a read-write operation of the second processor, the number of the first access memory segment may be greater than that of the second access memory segment, the application time of the first access memory segment is earlier than that of the second access memory segment, and preferably, the first access memory segment and the second access memory segment are both located at different address locations of the same target storage but have an address mapping relationship therebetween. For a first target process which can be scheduled by a first processor, setting identification information of each first target process as an index value of a first access memory segment which is currently accessed by the first target process, establishing a one-to-one correspondence relationship between the identification information of each first target process and a first address of the first access memory segment which is correspondingly accessed, so that an intermediate layer is positioned to the first access memory segment which needs to be accessed through the identification information of the first target process, dividing the target memory into a plurality of first access memory segments according to a memory application request required by the first target process, and configuring that the first access memory segments positioned under each identification information are not allowed to be mutually accessed, so that data in the memory segment accessed by one process is prevented from being changed by other processes, and the problem that the data read and written by the first target processes in the same memory are wrong or the address is out of limit is reduced. A second processor is added on the basis of a first processor to manage the same target memory, and after the first processor completes memory application operation, the second processor is informed to apply for the memory required by a scheduled second target process, and the results of memory application of the second processor can be informed to the other side, so that one processor can immediately see the update of the data in the memory occupied by the other processor, and the data interaction between the first processor and the second processor is ensured to be normally carried out and not interfered with each other.
In the embodiment corresponding to the foregoing steps S11 and S21, the principle of continuously allocating the address space includes: starting from the first address of the target memory, searching the address at the starting position of a continuous free memory space, and setting the address at the starting position of the continuous free memory space searched for the first time as an entry address; detecting whether a continuous free memory space where the entry address is located has an allocation space meeting a memory application request or an allocation space meeting an access parameter requirement; the memory application request or the access parameter includes a preset entry address and a memory capacity of a required allocation space in a continuous free memory space where the preset entry address is located.
For detecting whether the continuous free memory space where the entry address is located has an allocation space meeting the memory application request or an allocation space meeting the access parameter requirement, specifically, whether the size of the allocation space belonging to the continuous free space is equal to the size of the space required by the memory application request or the access parameter is judged, and the entry address and the occupation state (the state occupied by the process and the state occupied by the data) can be adaptively adjusted after allocation, so that the continuous free memory space where the entry address specified in the memory application request is located is adjusted to the first access memory segment or the second access memory segment.
When detecting that an allocation space meeting a memory application request exists in a continuous free memory space where an entry address is located, setting the allocation space as a free memory segment accessed by one process, determining that the currently detected entry address is the entry address of the allocation space meeting the memory application request, and modifying an address of a starting position of a next continuous free memory space so as to allocate a free memory segment accessed by another process in the next continuous free memory space, wherein an address range between the currently detected entry address and the address of the starting position of the next continuous free memory space is larger than or equal to an address range covered by the free memory segment accessed by one process.
When detecting that an allocation space meeting the access parameter requirement exists in the continuous free memory space where the entry address is located, setting the allocation space as a free memory segment for a process to access, determining that the currently detected entry address is the entry address of the allocation space meeting the access parameter requirement, and modifying the address of the starting position of the next continuous free memory space so as to allocate a free memory segment for another process to access in the next continuous free memory space; and the address range between the currently detected entry address and the address of the starting position of the next continuous free memory space is greater than or equal to the address range covered by the free memory segment accessed by one process.
When the continuous free memory space where the entry address is located does not have an allocation space meeting the memory application request and an allocation space meeting the access parameter requirement, adjusting the entry address to the address of the starting position in the next continuous free memory space, and then judging whether the adjusted continuous free memory space where the entry address is located has an allocation space meeting the memory application request or an allocation space meeting the access parameter requirement until the allocation space meeting the memory application request or the allocation space meeting the access parameter requirement is searched, otherwise, determining that the memory application fails. It should be noted that the starting position in the next continuous free memory space is pre-recorded in the continuous free memory space where the entry address before adjustment is located; the first address of the free memory segment for a process to access and the memory capacity of the free memory segment for the process to access are cached in the information sharing memory and updated as a part of the access parameters and a part of the release parameters.
On the basis of the foregoing embodiment, each time a corresponding first access memory segment is allocated to the first target process according to the principle of continuous allocation of address spaces, it is determined that the first access memory segment is an allocation space that satisfies a first memory application request or an allocation space that satisfies a first access parameter, and a first address of the first access memory segment is a currently adjusted entry address, where the memory space that can be allocated is an allocable memory segment, that is, an unoccupied space, the memory application request may be a first memory application request, and the access parameter may be a first access parameter, so that the first access memory segment belongs to a continuous free memory space when allocated. The allocation space required in the continuous free memory space where the entry address meeting the first memory application request is located is the allocation space meeting the first memory application request; the allocation space required in the continuous free memory space where the entry address meeting the first access parameter requirement is located is the allocation space meeting the first access parameter requirement.
When a corresponding second access memory segment is allocated to a second target process according to the principle of continuous allocation of the address space, it is determined that the second access memory segment is an allocation space satisfying the second memory application request or an allocation space satisfying a second access parameter, and a first address of the second access memory segment is the currently adjusted entry address, where the allocable memory space is an allocable memory segment, that is, an unoccupied space, the memory application request may be a second memory application request, and the access parameter may be a second access parameter, so that the second access memory segment belongs to a continuous free memory space when allocated. The allocation space required in the continuous free memory space where the entry address meeting the second memory application request is located is the allocation space meeting the second memory application request; and the allocation space required in the continuous free memory space where the entry address meeting the second access parameter requirement is located is the allocation space meeting the second access parameter requirement.
Preferably, before the first processor and the second processor start operating the target storage, the whole memory space in the target storage is a continuous free space, and the whole memory space may generate different continuous free spaces through multiple memory applications and memory releases. The first processor receives a first memory application request sent by an external device, and can obtain memory application data sent by the external device according to the first memory application request, obtain the number of bytes of the memory application data, and correspondingly obtain the memory capacity of a first access memory segment which needs to be allocated or bound (mapped). Meanwhile, the allocated memory space just meets the requirements of memory application requests or access parameters, and the situation that the single application space is too large cannot exist, so that the utilization rate of the memory is improved. The method is also suitable for an embedded Linux system and a high-performance processor.
In some embodiments, the foregoing step S11 further includes: before allocating a corresponding first access memory segment for a first target process according to the principle of address space continuous allocation, judging that parameters required by the first target process for accessing a target memory are legal, wherein the parameters comprise the entry address and the memory capacity of an allocation space; the specific judgment method comprises the following steps: when the entry address meeting the first memory application request or the entry address meeting the first access parameter requirement is in the first preset first address range, and the memory capacity of the allocation space required in the continuous free memory space where the entry address in the first preset first address range is located is in the first preset target capacity range, determining that the parameter required by the first target process to access the target memory is legal, and after the first processor receives the first memory application request or the first access parameter of the information sharing memory, starting to allocate a corresponding first access memory segment for the first target process according to the address space continuous allocation principle.
Specifically, when an entry address included in the first memory application request is within a first preset initial address range and the memory capacity of a required allocation space in a continuous free memory space where the entry address included in the first memory application request is within a first preset target capacity range, determining that a parameter in the first memory application request is legal; or, when the entry address included in the first access parameter is within a first preset initial address range and the memory capacity of the allocation space required in the continuous free memory space where the entry address included in the first access parameter is located is within a first preset target capacity range, determining that the first access parameter is legal. And searching the first access memory segment correspondingly bound in the target memory by the identification information of the first target process.
The first preset initial address range changes with the change of the entry address included in the first memory application request, and the forward offset address interval and the backward offset address interval of each entry address form the first preset initial address range, and the forward offset address interval and the backward offset address interval are determined according to the specific architecture of the first processor and the complexity of the operating system, for example, when the read-write delay time of the first processor to the target memory is long or the allocated memory is unstable, the forward offset address interval and the backward offset address interval are set to be wider, otherwise, the forward offset address interval and the backward offset address interval are set to be narrower; similarly, the first preset target capacity range is set to be larger when the read-write delay time of the first processor to the target memory is longer or the allocated memory is unstable, and is set to be smaller if not. Specifically, when an entry address included in the first memory application request is in a first preset initial address range and the memory capacity of a required allocation space in a continuous free memory space where the entry address included in the first memory application request is in a first preset target capacity range, determining that a parameter in the first memory application request is legal, wherein the required allocation space in the continuous free memory space where the entry address is located is in the continuous free memory space where the entry address is located, and satisfying the allocation space of the first memory application request. Or when the entry address included in the first access parameter is within a first preset initial address range and the memory capacity of the allocation space required in the continuous free memory space where the entry address included in the first access parameter is located is within a first preset target capacity range, determining that the first access parameter is legal, wherein the allocation space required in the continuous free memory space where the entry address is located is in the continuous free memory space where the entry address is located, and meeting the allocation space required by the first access parameter.
Preferably, under the control of an application software program, the intermediate layer saves the entry address and the memory capacity of the corresponding allocation space by setting the target memory, so that the intermediate layer saves the head address of each first access memory segment; in step S11, the intermediate layer provides the entry address and the memory capacity of the corresponding allocation space required by the first target process, and determines whether the entry address required by the first target process is within a first preset initial address range, and determines whether the memory capacity of the allocation space required in the continuous free memory space where the same entry address is located is within a first preset target capacity range.
In some embodiments, the foregoing step S21 further includes: before allocating a corresponding second access memory segment for a second target process according to the principle of address space continuous allocation, judging whether parameters required by the second target process for accessing a target memory are legal, wherein the parameters comprise the entry address and the memory capacity of an allocation space; the specific judgment method comprises the following steps: when the entry address meeting the second memory application request or the entry address meeting the second access parameter requirement is in the second preset initial address range, and the memory capacity of the allocation space required in the continuous free memory space where the entry address in the second preset initial address range is located is in the second preset target capacity range, determining that the parameter required by the second target process to access the target memory is legal, and after the second processor receives the second memory application request or the second access parameter of the information sharing memory, starting to allocate a corresponding second access memory segment for the second target process according to the principle of the continuous allocation of the address space.
The second preset initial address range changes with the change of the entry address included in the second memory application request, and the forward offset address interval and the backward offset address interval of each entry address form the second preset initial address range, when the read-write delay time of the second processor to the target memory is longer or the allocated memory is unstable, the forward offset address interval and the backward offset address interval are set to be wider, otherwise, the forward offset address interval and the backward offset address interval are set to be narrower. Similarly, the second preset target capacity range is set to be larger when the read-write delay time of the second processor to the target memory is longer or the allocated memory is unstable, and is set to be smaller otherwise. Similarly, the second preset target capacity range is set to be larger when the read-write delay time of the second processor to the target memory is longer or the allocated memory is unstable, and is set to be smaller otherwise.
Specifically, when the entry address included in the second memory application request is within a second preset initial address range and the memory capacity of the allocation space required in the continuous free memory space where the entry address included in the second memory application request is within a second preset target capacity range, determining that the parameter in the second memory application request is legal; or, when the entry address included in the second access parameter is within a second preset initial address range, and the memory capacity of the allocation space required in the continuous free memory space where the entry address included in the second access parameter is located is within a second preset target capacity range, determining that the second access parameter is legal.
Preferably, under the control of the application software program, the target storage provides a required entry address and a memory capacity of a corresponding allocation space for the second target process, and the second processor determines whether the entry address required by the second target process is within a second preset initial address range, and determines whether the memory capacity of the allocation space required in a continuous free memory space where the same entry address is located is within the second preset target capacity range.
It should be noted that the middle layer is also called a Hardware Abstraction Layer (HAL) or a Board Support Package (BSP) in an embedded operating system, and separates system upper layer software (application program) from bottom layer hardware, so that a bottom layer driver of the system is unrelated to the upper layer, and an upper layer software developer can develop the system according to an interface provided by the BSP layer without paying attention to the specific situation of the bottom layer hardware, thereby reducing the complexity of program development in an operating system or a processor with multiple processes running.
As an embodiment, after performing the step S1 and the step S2, the memory management method further includes: step S3, when the first processor receives a memory release request, the second processor is informed through the target memory to request the second processor to release the memory; then step S4 and step S5 may be performed simultaneously. In order to release the allocated or bound first access memory segment to maintain the normal operation of the first processor, after the step S1 is executed, the first address of the first access memory segment obtained most recently and the memory capacity of the first access memory segment are both converted into the first memory release request or the first release parameter of the information shared memory. The initiator of step S3 may be the first processor or the second processor.
Step S4, when the first processor receives a first memory release request or a first release parameter of the information sharing memory, searching a corresponding first access memory segment in the target memory through the identification information of a first target process, wherein the searching comprises searching a first address of the first access memory segment; removing the binding relation between the identification information of the first target process and the correspondingly bound first access memory segment so that the first access memory segment is not continuously accessed by the originally bound first target process, removing the occupation relation of the originally bound first target process, and recovering the first access memory segment to support the access of any first target process, wherein the first access memory segment can be accessed by the first target process on the premise of reapplication or allocation of a memory; then determining that the first target process completes the memory release operation, and in some embodiments, the first target process can be recovered to a continuous free space; the first processor also transmits the information that the first target process completes the memory release operation to the second processor through the information sharing memory; when the first access memory segment is not released from the binding relationship with the identification information corresponding to the first target process, the first access memory segment is not accessed by other first target processes; the address value of the second accessed memory segment is different from the address value of the first accessed memory segment.
The memory management method further comprises the following steps: step S5, when the second processor receives the memory release request, sequentially searching the memory segments occupied by the data from the first address of the second access memory segment, wherein the searching comprises searching the first address of the second access memory segment and the allocated memory capacity; clearing the occupation mark of each searched memory segment occupied by the data so as to recover to allow any process to access; specifically, the occupation relationship between the data written by the second target process and the second access memory segment is removed, so that the second access memory segment is not occupied by the original second target process, the second access memory segment can be restored to a continuous free space, the second access memory segment is restored to support the access by the second target process, and the second access memory segment can be continuously accessed by the second target process on the premise of reapplication or memory allocation; simultaneously restoring the access restricted memory segment to allow a second target process to access, wherein the access restricted memory segment is not necessarily kept as a continuous free space; then determining that the second target process completes the memory release, and notifying the first processor of the information that the second target process completes the memory release through the target memory; after step S2 is executed, the first address of the second access memory segment, the memory capacity of the memory segment occupied by the data, and the memory capacity of the memory segment limited for access are all converted into a second memory release request or a second release parameter of the information sharing memory.
To sum up, in this embodiment, a second processor is added on the basis of a first processor to manage a target memory, and after the first processor completes a memory application, the second processor is notified to apply for a memory required by a scheduled second target process, and the results of releasing the memories from each other can be notified to the other, so that one processor can immediately see the update of the other processor on the data in the shared memory, and the normal data interaction between the first processor and the second processor is ensured without mutual interference; the first processor supporting the access of a plurality of first target processes uses and releases a first access memory segment occupied by the processes through an external interface provided by a dynamic library packaged by the middle layer, and after the allocated memory segment is occupied by the threads, other processes are not allowed to access, and only the process access of the memory segment can be applied, so that the data is prevented from being changed by other processes, and the first processor is ensured to read and write correct data. The second processor supporting access by a single second target process uses and releases the second access memory segment occupied by the data by marking the state information.
It should be noted that the first memory release request and the first release parameter may both include release request information of the first access memory segment, a first address of the first access memory segment, and a memory capacity of the first access memory segment; the second memory release request and the second release parameter may both include release request information of the second accessed memory segment, a first address of the second accessed memory segment, and a memory capacity of the second accessed memory segment. Optionally, the memory release request and the release parameters may include a size of the released memory and a first address of the released memory. The released memory may be a memory with aligned size or a memory with non-aligned size. When the processor or the process releases the memory space in the memory, the relationship between the memory space and the occupied data is released according to the basic unit.
As an embodiment of the memory release, the step S4 includes steps S41 to S43, and the step S5 includes steps S51 to S53; referring to fig. 2, the following is specific:
step S3, when the first processor receives a first memory release request or a first release parameter of the information sharing memory, the second processor is informed through the information sharing memory; then triggering step S51 and step S41 to be executed simultaneously.
Step S41, when the first processor receives the first memory release request or the first release parameter of the information shared memory, searching the target storage for the corresponding bound first access memory segment according to the identification information of the first target process, and then executing step S42. The first access memory segment correspondingly bound to is derived from the first access memory segment bound to the identification information of the first target process (derived from the first target process scheduled by the first processor) in step S12 in the foregoing embodiment, and may be all the first access memory segments allocated in step S11, or may be the first access memory segment satisfying the first target process, or may be a part of the first access memory segments allocated in step S11.
On the basis of the principle of address space continuous allocation mentioned in the foregoing step S11 and step S21, after step S3 is executed, in step S4, before searching for a correspondingly allocated first access memory segment in the target storage through the identification information of the first target process, when an entry address included in the first memory release request or the first release parameter is within a first preset first address range, and the memory capacity of an allocation space required in a continuous free memory space where the entry address within the first preset first address range is located is within a first preset target capacity range, it is determined that a parameter required for the first target process to release the memory in the target storage is legal, and then the target storage is searched for the corresponding bound first access memory segment through the identification information of the first target process. The allocation space required in the continuous free memory space where the entry address is located is a memory space required to be released by the first memory release request or the first release parameter, and is derived from a first access memory segment in which the identification information of the first target process is correspondingly bound.
Specifically, when an entry address included in the first memory release request is within the first preset initial address range and the memory capacity of a required allocation space in a continuous free memory space where the entry address included in the first memory release request is within the first preset target capacity range, determining that the parameter in the first memory release request is legal; or, when the entry address included in the first release parameter is within the first preset initial address range and the memory capacity of the allocation space required in the continuous free memory space where the entry address included in the first release parameter is located is within the first preset target capacity range, determining that the first release parameter is legal. And searching the corresponding bound first access memory segment in the target memory by the identification information of the first target process. The definition of the first predetermined initial address range and the definition of the first predetermined target capacity range are the same as those in the embodiment of the memory application operation.
Step S42, removing the binding relationship between the identification information of the first target process and the corresponding first access memory segment, so that the first access memory segment is restored to support the access of any first target process or the continuous access of the first target process in which the first access memory segment is not occupied originally, and the first access memory segment can be reused; then step S43 is performed.
In some embodiments, each time step S41 searches for a first access memory segment corresponding to a binding through the identification information of the first target process, step S42 releases the binding relationship between the identification information of the first target process and the corresponding first access memory segment, so that there is no mapping relationship between the identification information of the first target process and the first address of the first access memory segment to be accessed.
And step S43, determining that the first target process completes the memory release operation, and transmitting information that the first target process completes the memory release operation to the second processor through the information shared memory.
Therefore, in order to ensure the normal operation of the first processor, for the memory release operation required by the first target process, the first processor locates the first address of the first access memory segment required to be released through the identification information of the first target process, and then performs unbinding, so that the first access memory segment can be continuously used.
Step S51, when the second processor receives a second memory release request or a second release parameter of the information sharing memory, sequentially searching, starting from a first address of the second access memory segment, memory segments occupied by data (which may be occupied by one address location or one address interval), and clearing an occupation flag of each searched memory segment occupied by data to recover to allow other processes scheduled by the second processor to access; then step S52 is executed; when the second access memory segment is not cleared of the occupation mark in the relevant address interval, only allowing a second target process applying for the second access memory segment to access; the address value of the second accessed memory segment has a mapping relation with the address value of the first accessed memory segment, but the mapping relation is not necessarily identical, and especially the first addresses of the second accessed memory segment and the first accessed memory segment are different.
In step S51, before sequentially searching the memory segments occupied by the data from the first address of the second access memory segment, when the entry address included in the second memory release request or the second release parameter is within the second preset first address range, and the memory capacity of the allocation space required in the continuous free memory space where the entry address within the second preset first address range is located is within the second preset target capacity range, it is determined that the parameter required by the second target process to release the memory in the target storage is legal, and then, the search of the memory segments occupied by the data and the access restricted memory segments is started, so as to clear the information, including the occupation flag, set in step S2 of the currently searched memory segments. The allocation space required in the continuous free memory space where the entry address is located is the memory space required to be released by the second memory release request or the second release parameter, and is derived from the second access memory segment allocated according to the foregoing step S21.
Specifically, when the entry address included in the second memory release request is within a second preset initial address range, and the memory capacity of the allocation space required in the continuous free memory space where the entry address included in the second memory release request is within a second preset target capacity range, it is determined that the parameter in the second memory release request is legal. Or, when the entry address included in the second release parameter is within a second preset initial address range, and the memory capacity of the allocation space required in the continuous free memory space where the entry address included in the second release parameter is located is within a second preset target capacity range, determining that the second release parameter is legal. The definition of the second predetermined initial address range and the definition of the second predetermined target capacity range are the same as those in the embodiment of the memory application operation.
In step S51, in the second accessed memory segment that needs to be released by the second target process, starting from the first address of the second accessed memory segment, whenever a memory segment occupied by data is detected, the occupied flag of the memory segment is cleared, so as to release the occupied relationship between the data written by the second target process and the memory segment, so that the memory segment is not occupied by the original second target process until all address locations in the second accessed memory segment are traversed.
S52, restoring the access restricted memory segment to allow the second target process to access; then, step S53 is executed. Step S52 sets all the memory segments in the target memory except the second access memory segment to allow the second target process or other processes to access randomly, and removes the access restriction of the second processor to the target memory, where the access restriction memory segment is not necessarily maintained as a continuous free space.
Step S53, determining that the second target process completes the memory release operation, namely determining to release the occupation relation and the access restriction relation between the identification information of the second target process and the second access memory segment; and then the information that the second target process completes the memory release operation is transmitted to the first processor through the information sharing memory, so that the first processor is convenient to schedule the first target process to apply and access a first access memory segment in the target memory, or the second processor is convenient to schedule a new second target process to apply and access a second access memory segment in the target memory.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In the several embodiments provided in the present application, it should be understood that the disclosed shared memory management apparatus in a multi-process system may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
For the sake of simplicity, the foregoing embodiments are described as a series of acts or combinations, but it should be understood by those skilled in the art that the present invention is not limited by the described order of acts, and some steps may be performed in other orders or simultaneously according to the embodiments of the present invention. Furthermore, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (11)
1. A memory management method based on multiple processes is characterized in that the memory management method comprises the following steps:
step S1, if a first processor receives a first memory application request or a first access parameter of an information sharing memory to schedule at least two first target processes to start applying for the memory, allocating a first access memory segment in a target memory according to a principle of address space continuous allocation, and then binding identification information of the first target processes and the correspondingly allocated first access memory segment together; then determining that the first target process completes the memory application operation, and controlling the first processor to transmit at least the first address and the memory capacity of the bound first access memory segment to the second processor through the information sharing memory;
step S2, under the condition that the second processor determines that the first target process completes the memory application operation, if a second memory application request or a second access parameter of the information sharing memory is received, in the target memory, a second access memory segment is allocated for the second target process according to the principle of continuous allocation of address space, then an occupation mark is set for a memory segment occupied by data in the second access memory segment, and an access limitation memory segment is set in the unallocated memory space of the target memory, so that the effective access range of the second target process in the target memory is limited in the second access memory segment; and controlling the second processor to at least transmit the first address and the memory capacity of the second access memory segment to the first processor through the information sharing memory;
wherein, there is address mapping relation between the first access memory segment and the second access memory segment; the information sharing memory is a shared memory for parameter interaction between the first processor and the second processor in the target memory.
2. The memory management method according to claim 1, further comprising:
step S3, when the first processor receives a first memory release request or a first release parameter of the information sharing memory, the second processor is informed through the information sharing memory;
step S4, when the first processor receives a first memory release request or a first release parameter of the information sharing memory, searching a correspondingly bound first access memory segment in the target memory through the identification information of the first target process, then removing the binding relation between the identification information of the first target process and the correspondingly bound first access memory segment, then determining that the first target process completes the memory release operation, and transmitting the information that the first target process completes the memory release operation to the second processor through the information sharing memory; when the first access memory segment is not released from the binding relation with the identification information of the correspondingly bound first target process, the first access memory segment is not accessed by other first target processes except the bound first target process; the address value of the second access memory segment is different from the address value of the first access memory segment;
after step S1 is executed, the first address of the first access memory segment obtained most recently and the memory capacity of the first access memory segment are both converted into the first memory release request or the first release parameter of the information sharing memory.
3. The memory management method according to claim 2, wherein the memory management method further comprises:
step S5, when the second processor receives a second memory release request or a second release parameter of the information sharing memory, sequentially searching the memory segments occupied by the data from the first address of the second access memory segment, and clearing the occupation mark of each searched memory segment occupied by the data to recover to allow other processes scheduled by the second processor to access; meanwhile, the access restricted memory segment is restored to allow the second target process to access; then determining that the second target process completes the memory release operation, and transmitting the information that the second target process completes the memory release operation to the first processor through the information sharing memory; when the second access memory segment is not cleared of the occupation mark in the relevant address interval, only allowing a second target process allocated to the second access memory segment to access;
after step S2 is executed, the first address of the second access memory segment, the memory capacity of the memory segment occupied by the data, and the memory capacity of the access-limited memory segment, which are obtained last, are all converted into the second memory release request or the second release parameter of the information sharing memory.
4. The memory management method according to claim 1, wherein after the first target process is bound to the first access memory segment in the target storage, when the first target process accesses the first access memory segment, the first processor performs read-write operation on the first access memory segment to which the first target process is bound; the first memory application request comprises scheduling request information of a first target process;
after the second target process is allocated to the second access memory segment in the target memory, when the second target process accesses the second access memory segment, the second processor performs read-write operation on the second access memory segment allocated to the second target process; the second memory application request comprises scheduling request information of a second target process;
and in the target memory, the first address of the first access memory segment obtains the first address of the second access memory segment through address offset.
5. The memory management method according to claim 4, wherein in step S1, the method for binding the identification information of the first target process and the correspondingly allocated first access memory segment together includes:
under the control of a first memory application request or a first access parameter, setting identification information of a first target process scheduled by a first processor as an index value of a first access memory segment currently accessed by the first target process, so as to locate the first access memory segment to be accessed through the identification information of the first target process, configuring one of the identification information corresponding to the allocated first access memory segment and not allowing the first target process of other identification information to access, forming a mapping relation between the identification information of the first target process and a head address of the first access memory segment currently accessed, determining to bind the identification information of the first target process and the correspondingly allocated first access memory segment together, and feeding back the head address of the first access memory segment correspondingly bound by the identification information of the first target process to an intermediate layer, so as to provide operation address information of the first target process for an application software program;
the identification information of the first target process is obtained from an interface of a dynamic library encapsulated in an intermediate layer under the scheduling action of the first processor, and the intermediate layer is arranged in an operating system operated by the first processor;
and the identification information of the first target process is bound with the correspondingly allocated first access memory segment, which indicates that the first target process only accesses the correspondingly allocated first access memory segment.
6. The memory management method according to claim 3, wherein the principle of the continuous allocation of the address space comprises:
starting from the first address of the target memory, searching the address at the starting position of a continuous free memory space, and setting the address at the starting position of the continuous free memory space searched for the first time as an entry address;
detecting whether a continuous free memory space where the entry address is located has an allocation space meeting a memory application request or an allocation space meeting an access parameter requirement; the memory application request or the access parameter comprises a preset entry address and the memory capacity of a required allocation space in a continuous free memory space where the preset entry address is located;
when detecting that an allocation space meeting a memory application request exists in a continuous free memory space where an entry address is located, setting the allocation space as a free memory segment for a process to access, determining that the currently detected entry address is the entry address of the allocation space meeting the memory application request, and modifying the address of the starting position of the next continuous free memory space so as to allocate a free memory segment for another process to access in the next continuous free memory space;
when detecting that an allocation space meeting the access parameter requirement exists in the continuous free memory space where the entry address is located, setting the allocation space as a free memory segment for a process to access, determining that the currently detected entry address is the entry address of the allocation space meeting the access parameter requirement, and modifying the address of the starting position of the next continuous free memory space so as to allocate a free memory segment for another process to access in the next continuous free memory space;
when the continuous free memory space where the entry address is located does not have the allocation space meeting the memory application request and the allocation space meeting the access parameter requirement, adjusting the entry address to the address of the starting position in the next continuous free memory space, and then judging whether the continuous free memory space where the adjusted entry address is located has the allocation space meeting the memory application request or the allocation space meeting the access parameter requirement until the allocation space meeting the memory application request or the allocation space meeting the access parameter requirement is searched; wherein, the starting position in the next continuous free memory space is pre-recorded in the continuous free memory space where the entry address before adjustment is located;
the first address of the free memory segment for a process to access and the memory capacity of the free memory segment for the process to access are cached in the information sharing memory.
7. The memory management method according to claim 6, wherein each time a first accessed memory segment is allocated according to the principle of continuous allocation of address space, it is determined that the first accessed memory segment is an allocated space that satisfies a first memory application request or an allocated space that satisfies a first access parameter, and a head address of the first accessed memory segment is a currently adjusted entry address, where the first accessed memory segment belongs to a continuous free memory space when allocated;
and when a second access memory segment is allocated to a second target process according to the principle of continuous allocation of the address space, determining that the second access memory segment is an allocation space meeting the second memory application request or an allocation space meeting second access parameters, wherein the first address of the second access memory segment is the currently adjusted entry address, and the second access memory segment belongs to a continuous free memory space when being allocated.
8. The memory management method according to claim 7, wherein before allocating the first access memory segment according to the principle of address space continuous allocation, when an entry address satisfying the first memory application request or an entry address satisfying the first access parameter requirement is within a first preset first address range, and a memory capacity of an allocation space required in a continuous free memory space where the entry address within the first preset first address range is located is within a first preset target capacity range, it is determined that a parameter required for the first target process to access the target memory is legal;
before allocating a second access memory segment for a second target process according to the principle of address space continuous allocation, when an entry address meeting a second memory application request or an entry address meeting second access parameter requirements is in a second preset first address range, and the memory capacity of an allocation space required in a continuous free memory space where the entry address in the second preset first address range is located is in a second preset target capacity range, determining that the parameters required by the second target process to access a target memory are legal.
9. The memory management method according to claim 8, wherein in step S4, before searching for the correspondingly bound first accessed memory segment in the target storage through the identification information of the first target process, when an entry address included in the first memory release request or the first release parameter is within a first preset first address range, and a memory capacity of an allocation space required in a continuous free memory space where the entry address within the first preset first address range is located is within a first preset target capacity range, it is determined that a parameter required for the first target process to release the memory in the target storage is legal;
in step S5, before sequentially searching the memory segments occupied by the data from the first address of the second accessed memory segment, when the entry address included in the second memory release request or the second release parameter is within a second preset first address range, and the memory capacity of the allocation space required in the continuous free memory space where the entry address within the second preset first address range is located is within a second preset target capacity range, it is determined that the parameter required by the second target process to release the memory in the target memory is legal.
10. The memory management method according to claim 6, wherein in step S2, after the second access memory segment is allocated, in a second access memory segment that needs to be accessed by the second target process, starting from a head address of the second access memory segment, whenever it is detected that one memory segment is filled with data, the currently detected memory segment is set as a memory segment that is occupied by data so that the second access memory segment is not a continuous free memory space, and an occupation flag is set for the currently detected memory segment until all address positions in the second access memory segment are traversed, and all the set occupation flags are used to indicate free indication information in the second access memory segment to indicate whether a free memory space exists in the second access memory segment; each memory segment occupied by the data allows the same second target process to repeatedly access, but does not allow the processes except the second target process to access;
and setting all the memory segments except the second access memory segment in the target memory not to allow the second target process to access so as to prevent the address from crossing the boundary in the process of accessing by the second target process.
11. The memory management method of claim 1, wherein the first processor is a processor with a large core architecture and the second processor is a processor with a small core architecture; or the first processor is configured to run a multi-process operating system, and the second processor is configured to run a single-process operating system or no operating system;
the system comprises a first processor, a second processor and a control module, wherein the first processor is used for running at least one first target process, and the second processor is used for running a second target process; the first processor and the second processor are both configured to support reading and writing operations on the information sharing memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211333844.9A CN115576716A (en) | 2022-10-28 | 2022-10-28 | Memory management method based on multiple processes |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211333844.9A CN115576716A (en) | 2022-10-28 | 2022-10-28 | Memory management method based on multiple processes |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115576716A true CN115576716A (en) | 2023-01-06 |
Family
ID=84587047
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211333844.9A Pending CN115576716A (en) | 2022-10-28 | 2022-10-28 | Memory management method based on multiple processes |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115576716A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116560878A (en) * | 2023-07-07 | 2023-08-08 | 腾讯科技(深圳)有限公司 | Memory sharing method and related device |
CN117272287A (en) * | 2023-11-21 | 2023-12-22 | 联通(广东)产业互联网有限公司 | Application program data redirection method, system and storage medium |
CN118694465A (en) * | 2024-08-27 | 2024-09-24 | 四川天邑康和通信股份有限公司 | Data synchronization method, device, equipment and medium based on FTTR/PON/WIFI |
-
2022
- 2022-10-28 CN CN202211333844.9A patent/CN115576716A/en active Pending
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116560878A (en) * | 2023-07-07 | 2023-08-08 | 腾讯科技(深圳)有限公司 | Memory sharing method and related device |
CN116560878B (en) * | 2023-07-07 | 2024-03-22 | 腾讯科技(深圳)有限公司 | Memory sharing method and related device |
CN117272287A (en) * | 2023-11-21 | 2023-12-22 | 联通(广东)产业互联网有限公司 | Application program data redirection method, system and storage medium |
CN117272287B (en) * | 2023-11-21 | 2024-03-08 | 联通(广东)产业互联网有限公司 | Application program data redirection method, system and storage medium |
CN118694465A (en) * | 2024-08-27 | 2024-09-24 | 四川天邑康和通信股份有限公司 | Data synchronization method, device, equipment and medium based on FTTR/PON/WIFI |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115576716A (en) | Memory management method based on multiple processes | |
US8151275B2 (en) | Accessing copy information of MMIO register by guest OS in both active and inactive state of a designated logical processor corresponding to the guest OS | |
JP4769484B2 (en) | Method and system for migrating virtual machines | |
WO2015169145A1 (en) | Memory management method and device | |
CN105988874B (en) | Resource processing method and device | |
US9086920B2 (en) | Device for managing data buffers in a memory space divided into a plurality of memory elements | |
CN113674131B (en) | Hardware accelerator device management method and device, electronic device and storage medium | |
CN102279712A (en) | Storage control method, system and device applied to network storage system | |
CN102667714B (en) | Support the method and system that the function provided by the resource outside operating system environment is provided | |
CN110069336A (en) | Memory source distribution method, distributor, chip and storage device | |
CN115629882A (en) | Method for managing memory in multiple processes | |
CN107077376B (en) | Frame buffer implementation method and device, electronic equipment and computer program product | |
CN111352873B (en) | NVMe protocol command processing method and device | |
CN105787392B (en) | A kind of data read-write control method and control device | |
CN110019083B (en) | Storage method and device of distributed file system, electronic equipment and storage medium | |
CN109408226A (en) | Data processing method, device and terminal device | |
EP1691287A1 (en) | Information processing device, process control method, and computer program | |
JP2007026094A (en) | Execution device and application program | |
CN113010453A (en) | Memory management method, system, equipment and readable storage medium | |
CN115617542A (en) | Memory exchange method and device, computer equipment and storage medium | |
CN113377545A (en) | Method and device for distributing GPU physical memory | |
CN115599549A (en) | Multi-process-based exception handling method | |
WO2017142525A1 (en) | Allocating a zone of a shared memory region | |
US8689230B2 (en) | Determination of running status of logical processor | |
JP2022514382A (en) | Information processing methods, devices, electronic devices, and recording media |
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 |