WO2021135574A1 - Data storage method and apparatus, and terminal device - Google Patents

Data storage method and apparatus, and terminal device Download PDF

Info

Publication number
WO2021135574A1
WO2021135574A1 PCT/CN2020/124093 CN2020124093W WO2021135574A1 WO 2021135574 A1 WO2021135574 A1 WO 2021135574A1 CN 2020124093 W CN2020124093 W CN 2020124093W WO 2021135574 A1 WO2021135574 A1 WO 2021135574A1
Authority
WO
WIPO (PCT)
Prior art keywords
storage space
storage
data
request
data storage
Prior art date
Application number
PCT/CN2020/124093
Other languages
French (fr)
Chinese (zh)
Inventor
黎立煌
王和国
曹庆新
李炜
李爱军
Original Assignee
深圳云天励飞技术股份有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 深圳云天励飞技术股份有限公司 filed Critical 深圳云天励飞技术股份有限公司
Publication of WO2021135574A1 publication Critical patent/WO2021135574A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A data storage method and apparatus, and a terminal device, applicable to the technical field of data processing. The data storage method comprises: receiving a data storage request, wherein the data storage request comprises a required storage space and a required storage speed (101); and in the case that the required storage speed is greater than a threshold, and a continuous space corresponding to the required storage space exists in an internal storage space, allocating, in the internal storage space, a corresponding first storage space for the data storage request, and in first allocation table information, recording that the first storage space is occupied (103). By allocating, for the data storage request having a required high storage speed, the corresponding storage space in the internal storage space, the present invention can fully use the internal storage space to increase the speed of accessing the storage space, thereby improving the data storage capability of a system, and making the system not be limited to the problem of a "memory wall".

Description

数据存储方法、装置及终端设备Data storage method, device and terminal equipment 技术领域Technical field
本申请属于数据处理技术领域,尤其涉及数据存储方法、装置及终端设备。This application belongs to the field of data processing technology, and particularly relates to data storage methods, devices, and terminal equipment.
背景技术Background technique
在人工智能芯片实现中,基于冯•诺伊曼体系结构,运算能力的提高相对数据存储能力的提高是比较容易实现的。其中,数据存储是基于片内存储器和片外存储器实现的,数据存储能力是指片内存储器和片外存储器存储数据的能力(如,存储速度、存储容量等)。然而,当数据存储能力无法匹配运算能力时,则会形成所谓的冯•诺伊曼“瓶颈”,或“内存墙”问题。In the realization of artificial intelligence chips, based on the von Neumann architecture, the improvement of computing power is relatively easy to achieve relative to the improvement of data storage capacity. Among them, data storage is based on on-chip memory and off-chip memory. Data storage capacity refers to the ability of on-chip memory and off-chip memory to store data (such as storage speed, storage capacity, etc.). However, when the data storage capacity cannot match the computing power, the so-called von Neumann "bottleneck" or "memory wall" problem will be formed.
技术解决方案Technical solutions
为克服相关技术中的“内存墙”问题,本申请实施例提供了数据存储方法、装置及终端设备。In order to overcome the "memory wall" problem in related technologies, embodiments of the present application provide data storage methods, devices, and terminal equipment.
本申请是通过如下技术方案实现的:This application is realized through the following technical solutions:
第一方面,本申请实施例提供了一种数据存储方法,包括:In the first aspect, an embodiment of the present application provides a data storage method, including:
接收数据存储请求,所述数据存储请求包括所需存储空间和所需存储速度;Receiving a data storage request, the data storage request including the required storage space and the required storage speed;
在所述所需存储速度大于阈值,且内部存储空间中存在与所述所需存储空间对应的连续空间的情况下,在所述内部存储空间中为所述数据存储请求分配对应的第一存储空间,并在第一分配表格信息中记录所述第一存储空间已被占用。In the case where the required storage speed is greater than the threshold, and there is a continuous space corresponding to the required storage space in the internal storage space, allocate the corresponding first storage in the internal storage space for the data storage request And record in the first allocation table information that the first storage space has been occupied.
可选的,所述所需存储速度包括存储周期数和/或每周期存储空间。Optionally, the required storage speed includes the number of storage cycles and/or the storage space per cycle.
可选的,所述第一存储空间包括第一存储空间标识、第一存储起始位置和第一存储结束位置,基于该第一存储空间标识、第一存储起始位置和第一存储结束位置确定上述第一存储空间。Optionally, the first storage space includes a first storage space identifier, a first storage start position, and a first storage end position, based on the first storage space identifier, the first storage start position, and the first storage end position Determine the first storage space mentioned above.
可选的,所述第一存储空间包括第一存储空间标识、第一存储起始位置和第一存储结束位置,可以根据该第一存储空间标识确定数据释放请求所需释放的存储空间为内部存储空间,根据第一存储起始位置和第一存储结束位置确定该内部存储空间中的存储区域,将确定出的存储区域进行释放。Optionally, the first storage space includes a first storage space identifier, a first storage start position, and a first storage end position, and it may be determined according to the first storage space identifier that the storage space required to be released by the data release request is internal In the storage space, the storage area in the internal storage space is determined according to the first storage start position and the first storage end position, and the determined storage area is released.
第二方面,本申请实施例提供了一种数据存储方法,包括:In the second aspect, an embodiment of the present application provides a data storage method, including:
生成数据存储请求,所述数据存储请求包括所需存储空间和所需存储速度;Generating a data storage request, the data storage request including the required storage space and the required storage speed;
将所述数据存储请求发送给控制端,所述数据存储请求用于请求所述控制端根据所述所需存储空间和所需存储速度分配目标存储空间;Sending the data storage request to the control terminal, where the data storage request is used to request the control terminal to allocate a target storage space according to the required storage space and the required storage speed;
生成数据释放请求,所述数据释放请求包括所述目标存储空间;Generating a data release request, where the data release request includes the target storage space;
将所述数据释放请求发送给所述控制端,所述数据释放请求用于请求所述控制端释放所述目标存储空间。The data release request is sent to the control terminal, and the data release request is used to request the control terminal to release the target storage space.
第三方面,本申请实施例提供了一种数据存储装置,包括:In a third aspect, an embodiment of the present application provides a data storage device, including:
存储接收模块,用于接收数据存储请求,所述数据存储请求包括所需存储空间和所需存储速度;The storage receiving module is configured to receive a data storage request, where the data storage request includes the required storage space and the required storage speed;
第一分配模块,用于在所述所需存储速度大于阈值,且内部存储空间中存在与所述所需存储空间对应的连续空间的情况下,在所述内部存储空间中为所述数据存储请求分配对应的第一存储空间,并在第一分配表格信息中记录所述第一存储空间已被占用。The first allocation module is configured to store the data in the internal storage space when the required storage speed is greater than a threshold and there is a continuous space corresponding to the required storage space in the internal storage space Request to allocate the corresponding first storage space, and record in the first allocation table information that the first storage space is occupied.
第四方面,本申请实施例提供了一种数据存储装置,包括:In a fourth aspect, an embodiment of the present application provides a data storage device, including:
第一生成模块,用于生成数据存储请求,所述数据存储请求包括所需存储空间和所需存储速度;The first generation module is configured to generate a data storage request, where the data storage request includes the required storage space and the required storage speed;
第一发送模块,用于将所述数据存储请求发送给控制端,所述数据存储请求用于请求所述控制端根据所述所需存储空间和所需存储速度分配目标存储空间;The first sending module is configured to send the data storage request to the control terminal, and the data storage request is used to request the control terminal to allocate a target storage space according to the required storage space and the required storage speed;
第二生成模块,用于生成数据释放请求,所述数据释放请求包括所述目标存储空间;A second generation module, configured to generate a data release request, where the data release request includes the target storage space;
第二发送模块,用于将所述数据释放请求发送给所述控制端,所述数据释放请求用于请求所述控制端释放所述目标存储空间。The second sending module is configured to send the data release request to the control terminal, and the data release request is used to request the control terminal to release the target storage space.
第五方面,本申请实施例提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如第一方面任一项所述的数据存储方法,或实现如第二方面所述的数据存储方法。In a fifth aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, Implement the data storage method according to any one of the first aspect, or implement the data storage method according to the second aspect.
第六方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如第一方面任一项所述的数据存储方法,或实现如第二方面所述的数据存储方法。In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements the process described in any one of the first aspects. Data storage method, or implement the data storage method as described in the second aspect.
第七方面,本申请实施例提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行上述第一方面中任一项所述的数据存储方法,或实现如第二方面所述的数据存储方法。In the seventh aspect, the embodiments of the present application provide a computer program product, which when the computer program product runs on a terminal device, causes the terminal device to execute the data storage method described in any one of the above-mentioned first aspects, or implement the data storage method as described in the first aspect. The data storage method described in the second aspect.
本申请实施例与现有技术相比存在的有益效果是:Compared with the prior art, the embodiments of this application have the following beneficial effects:
本申请实施例,在所需存储速度大于阈值且内部存储空间中存在与所需存储空间对应的连续空间的情况下,在内部存储空间中为数据存储请求分配对应的第一存储空间,即,通过为所需存储速度较高的数据存储请求在内部存储空间中分配对应的存储空间,以让存储速度较高的数据能速快地进行存储,从而提高了数据存储能力,以使数据存储能力能与运算能力匹配,进而使得系统不会受限于“内存墙”问题。In the embodiment of the present application, when the required storage speed is greater than the threshold and there is a continuous space corresponding to the required storage space in the internal storage space, the first storage space corresponding to the data storage request is allocated in the internal storage space, that is, By allocating corresponding storage space in the internal storage space for data storage requests with higher storage speeds, so that the data with higher storage speeds can be stored quickly, thereby improving the data storage capacity, so that the data storage capacity It can match the computing power, so that the system will not be limited by the "memory wall" problem.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本说明书。It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit this specification.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only of the present application. For some embodiments, for those of ordinary skill in the art, other drawings may be obtained based on these drawings without creative labor.
图1是本申请一实施例提供的数据存储方法的应用场景示意图;FIG. 1 is a schematic diagram of an application scenario of a data storage method provided by an embodiment of the present application;
图2是本申请一实施例提供的数据存储方法的流程示意图;FIG. 2 is a schematic flowchart of a data storage method provided by an embodiment of the present application;
图3是本申请一实施例提供的数据存储方法的流程示意图;FIG. 3 is a schematic flowchart of a data storage method provided by an embodiment of the present application;
图4是本申请一实施例提供的数据存储方法的流程示意图;FIG. 4 is a schematic flowchart of a data storage method provided by an embodiment of the present application;
图5是本申请一实施例提供的数据存储方法应用的系统的框架示意图FIG. 5 is a schematic diagram of the framework of a system to which the data storage method provided by an embodiment of the present application is applied
图6是本申请一实施例提供的数据存储方法的流程示意图;FIG. 6 is a schematic flowchart of a data storage method provided by an embodiment of the present application;
图7是本申请一实施例提供的数据存储方法的流程示意图;FIG. 7 is a schematic flowchart of a data storage method provided by an embodiment of the present application;
图8是本申请一实施例提供的数据存储方法的工作场景示意图;FIG. 8 is a schematic diagram of a working scenario of a data storage method provided by an embodiment of the present application;
图9是本申请一实施例提供的存储空间分配流程示意图;FIG. 9 is a schematic diagram of a storage space allocation process provided by an embodiment of the present application;
图10是本申请一实施例提供的数据存储方法的流程示意图;FIG. 10 is a schematic flowchart of a data storage method provided by an embodiment of the present application;
图11是本申请一实施例提供的请求端和控制端之间的数据交互流程图;FIG. 11 is a flow chart of data exchange between a requesting end and a controlling end provided by an embodiment of the present application;
图12是本申请一实施例提供的数据存储装置的结构示意图;FIG. 12 is a schematic structural diagram of a data storage device provided by an embodiment of the present application;
图13是本申请一实施例提供的数据存储装置的结构示意图;FIG. 13 is a schematic structural diagram of a data storage device provided by an embodiment of the present application;
图14是本申请一实施例提供的终端设备的结构示意图;FIG. 14 is a schematic structural diagram of a terminal device provided by an embodiment of the present application;
[根据细则91更正 02.02.2021] 
[Corrected according to Rule 91 02.02.2021]
本发明的实施方式Embodiments of the present invention
在人工智能芯片实现中,基于冯•诺伊曼体系结构,运算能力的提高相对数据存储能力的提高是比较容易实现的,而如果数据存储能力无法匹配运算能力时,则会形成所谓的冯•诺伊曼“瓶颈”,或“内存墙”问题。In the implementation of artificial intelligence chips, based on the von Neumann architecture, the improvement of computing power is relatively easy to achieve relative to the improvement of data storage capacity. If the data storage capacity cannot match the computing power, the so-called von Neumann architecture will be formed. Neumann's "bottleneck", or "memory wall" problem.
其中,数据存储是基于片内存储器和片外存储器实现的,在上述片内存储器和片外存储器中进行数据存储时,通常是在整个片外存储器和片内存储器中的一固定存储空间进行数据存储。由于在片内存储器中存储数据的速度快于在片外存储器中存储数据的速度,而片内存储器中只有一部分存储空间是用于数据存储的,片内存储器的利用率较低导致数据存储的整体速度较慢,进而形成上述“内存墙”问题。Among them, data storage is based on on-chip memory and off-chip memory. When data is stored in the above-mentioned on-chip memory and off-chip memory, data is usually stored in the entire off-chip memory and a fixed storage space in the on-chip memory. storage. Because the speed of storing data in the on-chip memory is faster than the speed of storing data in the off-chip memory, and only a part of the storage space in the on-chip memory is used for data storage, the utilization rate of the on-chip memory is low, resulting in data storage The overall speed is slow, which in turn causes the aforementioned "memory wall" problem.
基于上述“内存墙”问题,本申请实施例提供一种数据存储方法、装置及终端设备,根据接收到的数据存储请求中的所需存储空间和所需存储速度,为对应的数据存储请求分配存储空间。具体地,在所需存储速度大于阈值且内部存储空间中存在与所需存储空间对应的连续空间的情况下,在内部存储空间中为数据存储请求分配对应的存储空间,否则,在外部存储空间中为数据存储请求分配对应的存储空间。本申请实施例通过为所需存储速度较高的数据存储请求在内部存储空间中分配对应的存储空间,能够充分利用内部存储空间为数据存储请求提供所需的存储空间,而访问内部存储空间的速度快于访问外部存储空间的速度,因此充分利用内部存储空间能够提升访问存储空间的速度,从而提高系统的数据存储能力,使得系统不会受限于“内存墙”问题导致计算能力无法充分利用,并且能够降低对外部存储空间的需求。Based on the above-mentioned "memory wall" problem, embodiments of the application provide a data storage method, device, and terminal device, which allocate the corresponding data storage request according to the required storage space and the required storage speed in the received data storage request storage. Specifically, when the required storage speed is greater than the threshold and there is a continuous space corresponding to the required storage space in the internal storage space, the corresponding storage space is allocated in the internal storage space for the data storage request; otherwise, the external storage space Allocate the corresponding storage space for the data storage request. The embodiment of the application allocates corresponding storage space in the internal storage space for data storage requests that require a high storage speed, and can make full use of the internal storage space to provide the required storage space for the data storage request, while accessing the internal storage space The speed is faster than the speed of accessing external storage space, so making full use of internal storage space can increase the speed of accessing storage space, thereby improving the data storage capacity of the system, so that the system will not be limited by the "memory wall" problem and the computing power cannot be fully utilized , And can reduce the demand for external storage space.
举例说明,本申请实施例可以应用到如图1所示的示例性场景中。在该场景中,请求端10可以将数据存储请求和数据释放请求发送给控制端20。控制端20根据数据存储请求中的所需存储空间和所需存储速度为各个数据存储请求分匹配对应的存储空间。其中,请求端10为至少一个,可以为一个也可以为多个,对应的,该请求端10可以生成至少一个数据存储请求并发送给控制端20,或者可以多个请求端10生成各自的数据存储请求后均发送给控制端20。For example, the embodiments of the present application can be applied to the exemplary scenario shown in FIG. 1. In this scenario, the request end 10 may send the data storage request and the data release request to the control end 20. The control terminal 20 matches the corresponding storage space for each data storage request according to the required storage space and the required storage speed in the data storage request. Wherein, there is at least one requesting end 10, which may be one or multiple. Correspondingly, the requesting end 10 may generate at least one data storage request and send it to the control end 20, or multiple requesting ends 10 may generate respective data. After the storage requests are sent to the control terminal 20.
在上述场景中,请求端10可以为终端设备中需要申请存储空间的模块,例如CPU(Central Processing Unit,中央处理单元)、DSP(Digital Signal Processing,数字信号处理单元)等;控制端20可以为终端设备中的控制模块。上述终端设备可以为计算机、平板电脑、笔记本电脑、上网本、个人数字助理(personal digital assistant,PDA)、智能手机等终端设备,本申请实施例对终端设备的具体类型不作任何限制。In the above scenario, the requester 10 may be a module in the terminal device that needs to apply for storage space, such as CPU (Central Processing Unit, central processing unit), DSP (Digital Signal Processing, digital signal processing unit), etc.; the control end 20 may be a control module in a terminal device. The above-mentioned terminal devices can be computers, tablets, laptops, netbooks, and personal digital assistants (personal digital assistants). Digital assistants, PDAs), smart phones and other terminal devices, the embodiments of this application do not impose any restrictions on the specific types of terminal devices.
为了使本技术领域的人员更好地理解本发明方案,下面将结合图1,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to FIG. 1. Obviously, the described embodiments are only a part of the embodiments of the present invention. , Not all examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
图2是本申请一实施例提供的数据存储方法的示意性流程图,该数据存储方法可以应用于控制端。参照图2,对该数据存储方法的详述如下:FIG. 2 is a schematic flowchart of a data storage method provided by an embodiment of the present application. The data storage method may be applied to the control terminal. Referring to Figure 2, the details of the data storage method are as follows:
在步骤101中,接收数据存储请求,所述数据存储请求包括所需存储空间和所需存储速度。In step 101, a data storage request is received, where the data storage request includes a required storage space and a required storage speed.
其中,上述数据存储请求可以为需要申请存储空间的模块生成的请求,例如为终端设备中的CPU、DSP   等。例如,上述模块在需要申请存储空间时,可以首先生成包括所需存储空间和所需存储速度的数据存储请求,发送给终端设备中的控制端。The aforementioned data storage request may be a request generated by a module that needs to apply for storage space, such as a CPU, DSP, etc. in a terminal device. For example, when the aforementioned module needs to apply for storage space, it may first generate a data storage request including the required storage space and the required storage speed, and send it to the control terminal in the terminal device.
本步骤中,上述所需存储空间用于表征该数据存储请求所需的存储空间的大小,上述所需存储速度用于表征对该数据存储请求对应的数据进行存储所需的存储速度,其中所需存储速度越大,该数据存储请求所需的存储需求越高,所需存储速度越小,该数据存储请求所需的存储需求越低。In this step, the aforementioned required storage space is used to characterize the size of the storage space required by the data storage request, and the aforementioned required storage speed is used to characterize the storage speed required to store the data corresponding to the data storage request, where The greater the required storage speed, the higher the storage requirement required for the data storage request, and the lower the required storage speed, the lower the storage requirement required for the data storage request.
示例性的,由于存储器是以循环周期的形式对数据进行存储的,因此所需存储速度可以包括存储周期数,根据所需存储空间和该存储周期数可以确定数据存储请求的KBPC(Kilobyte per cycle,每个存储周期所需的存储空间),KBPC为对该数据存储请求对应的数据进行存储时,每个存储周期所需提供的存储空间的大小,其中KBPC越大说明对该数据存储请求对应的数据进行存储所需的存储速度越高,KBPC越小说明对该数据存储请求对应的数据进行存储所需的存储速度越低。Exemplarily, because the memory stores data in the form of cyclic cycles, the required storage speed may include the number of storage cycles. According to the required storage space and the number of storage cycles, the KBPC (Kilobyte byte) of the data storage request can be determined. per cycle, the storage space required for each storage cycle), when KBPC stores the data corresponding to the data storage request, the size of the storage space required for each storage cycle, where the larger the KBPC, the storage of the data The higher the storage speed required for storing the data corresponding to the request, and the smaller the KBPC, the lower the storage speed required for storing the data corresponding to the data storage request.
其中,内部存储空间的存储速度相对于外部存储空间的存储速度较快,即内部存储空间在每个存储周期能够提供的存储空间,要大于外部存储空间在每个存储周期能够提供的存储空间。可以理解的,通常外部存储空间相对于内部存储空间较大,但是对于存储一定大小的数据得情况下,外部存储空间需要的存储周期数要多于内部存储空间需要的存储周期数。Among them, the storage speed of the internal storage space is faster than that of the external storage space, that is, the storage space that the internal storage space can provide in each storage cycle is greater than the storage space that the external storage space can provide in each storage cycle. It is understandable that the external storage space is generally larger than the internal storage space, but for storing a certain size of data, the number of storage cycles required by the external storage space is more than the number of storage cycles required by the internal storage space.
另外,所需存储速度也可以包括每个存储周期所需的存储空间KBPC,或所需存储速度也可以包括存储周期数和每个存储周期所需的存储空间KBPC,本申请实施例对此不予限定。In addition, the required storage speed may also include the storage space KBPC required for each storage cycle, or the required storage speed may also include the number of storage cycles and the storage space KBPC required for each storage cycle. I limited it.
在步骤103中,在上述所需存储速度大于阈值,且内部存储空间中存在与上述所需存储空间对应的连续空间的情况下,在上述内部存储空间中为所述数据存储请求分配对应的第一存储空间,并在第一分配表格信息中记录上述第一存储空间已被占用。In step 103, in the case where the required storage speed is greater than the threshold, and there is a continuous space corresponding to the required storage space in the internal storage space, the data storage request is allocated a corresponding second in the internal storage space. A storage space, and record in the first allocation table information that the first storage space has been occupied.
其中,上述所需存储速度大于阈值说明对应的数据存储请求所需的存储需求较高,而内部存储空间相对于外部存储空间,由于不依赖于带宽,所以会有更快的存储速度,因此可以在内存储空间中为该数据存储请求分配存储空间。此时,如果内部存储空间中也存在与上述所需存储空间对应的连续空间,就可以在内部存储空间中为该数据存储请求分配对应的存储空间。本申请实施例,通过对所需存储速度较大的数据存储请求在内部存储空间中分配一存储空间进行数据存储,能够充分利用内部存储空间对所需存储速度较大的数据进行存储,而不仅仅是利用内部存储空间中的一固定存储空间存储数据,而且所需存储速度较大的数据在内部存储空间中的存储速度快于在外部存储空间中的存储速度,因此能够极大的提高数据存储能力,使得系统不会受限于“内存墙”的问题,并且能够降低对外部存储空间的需求。本步骤中,第一分配表格信息可以用于记录内部存储空间中已被占用存储空间和可用存储空间的情况,在为数据存储请求分配了第一存储空间之后,可以将该第一存储空间记录在第一分配表格信息中,以备之后为其他数据存储请求分配存储空间之前,通过该第一分配表格信息确认内部存储空间中的可用存储空间。Among them, the above-mentioned required storage speed is greater than the threshold value, indicating that the corresponding data storage request requires a higher storage requirement. Compared with the external storage space, the internal storage space does not depend on the bandwidth, so there will be a faster storage speed. Allocate storage space in the internal storage space for the data storage request. At this time, if there is also a continuous space corresponding to the aforementioned required storage space in the internal storage space, the storage space corresponding to the data storage request can be allocated in the internal storage space. In the embodiment of the present application, by assigning a storage space to the internal storage space for data storage by requesting a data storage request with a higher storage speed, the internal storage space can be fully utilized to store data with a higher storage speed. It only uses a fixed storage space in the internal storage space to store data, and the storage speed of the data that requires a larger storage speed in the internal storage space is faster than the storage speed in the external storage space, so it can greatly improve the data Storage capacity, so that the system will not be limited by the "memory wall" problem, and can reduce the demand for external storage space. In this step, the first allocation table information can be used to record the occupied storage space and available storage space in the internal storage space. After the first storage space is allocated for the data storage request, the first storage space can be recorded In the first allocation table information, before allocating storage space for other data storage requests in the future, the available storage space in the internal storage space is confirmed through the first allocation table information.
示例性的,所述第一存储空间可以包括第一存储空间标识、第一存储起始位置和第一存储结束位置,基于该第一存储空间标识、第一存储起始位置和第一存储结束位置确定上述第一存储空间。其中,上述第一存储空间标识表征内部存储空间,例如可以表征静态随机存取存储器(static RAM,SRAM)对应的存储空间。Exemplarily, the first storage space may include a first storage space identifier, a first storage start position, and a first storage end position, based on the first storage space identifier, first storage start position, and first storage end The location determines the above-mentioned first storage space. Wherein, the above-mentioned first storage space identifier represents internal storage space, for example, it can represent static random access memory (static random access memory). RAM, SRAM) corresponding storage space.
需要说明的是,上述阈值可以根据实际需要进行设定,对于不同的系统该阈值可以不同,对于同一系统在不同的时间段该阈值可以不同,本申请实施例对此不予限定。It should be noted that the above threshold can be set according to actual needs. The threshold can be different for different systems, and the threshold can be different for the same system in different time periods, which is not limited in the embodiment of the present application.
参见图3,基于图2所示的实施例,上述数据存储方法还可以包括:Referring to FIG. 3, based on the embodiment shown in FIG. 2, the foregoing data storage method may further include:
在步骤105中,在上述所需存储速度小于等于阈值,或上述内部存储空间中不存在与上述所需存储空间对应的连续空间的情况下,在外部存储空间中为上述数据存储请求分配对应的第二存储空间,并在第二分配表格信息中记录上述第二存储空间已被占用。In step 105, in the case that the required storage speed is less than or equal to the threshold, or the continuous space corresponding to the required storage space does not exist in the internal storage space, the corresponding data storage request is allocated in the external storage space. Second storage space, and record in the second allocation table information that the second storage space has been occupied.
其中,上述所需存储速度小于阈值说明对应的数据存储请求所需的存储需求不高,而内部存储空间相对外部存储空间较小,存储空间有限,因此可在外部存储空间为该数据存储请求分配一存储空间,将内部存储空间留给所需存储速度较大的数据存储请求,从而能够在提高提高内部存储空间的利用率的同时,尽可能用内部存储空间存储所需存储速度较大的数据存储请求对应的数据,进而能够尽可能地提高系统的计算能力。本步骤中,第二分配表格信息可以用于记录外部存储空间中已被占用存储空间和可用存储空间的情况,在为数据存储请求分配了第二存储空间之后,可以将该第二存储空间记录在第二分配表格信息中,以备之后为其他数据存储请求分配存储空间之前,通过该第二分配表格信息确认外部存储空间中的可用存储空间。Among them, the above-mentioned required storage speed is less than the threshold value, indicating that the storage requirement of the corresponding data storage request is not high, and the internal storage space is relatively small compared with the external storage space, and the storage space is limited. Therefore, the external storage space can be allocated for the data storage request A storage space. The internal storage space is reserved for data storage requests that require a higher storage speed, so that while improving the utilization of the internal storage space, it is possible to use the internal storage space to store data with a higher storage speed as much as possible The data corresponding to the storage request can then improve the computing power of the system as much as possible. In this step, the second allocation table information can be used to record the occupied storage space and available storage space in the external storage space. After the second storage space is allocated for the data storage request, the second storage space can be recorded In the second allocation table information, before allocating storage space for other data storage requests, confirm the available storage space in the external storage space through the second allocation table information.
示例性的,所述第二存储空间可以包括第二存储空间标识、第二存储起始位置和第二存储结束位置,基于该第二存储空间标识、第二存储起始位置和第二存储结束位置确定上述第二存储空间。其中,上述第二存储空间标识表征外部存储空间,例如可以表征双倍数据速率同步动态随机存取存储器(Double Data  Rate SDRAM,DDR SDRAM)对应的存储空间。Exemplarily, the second storage space may include a second storage space identifier, a second storage start position, and a second storage end position, based on the second storage space identifier, second storage start position, and second storage end The location determines the above-mentioned second storage space. Wherein, the above-mentioned second storage space identifier represents an external storage space, for example, it can represent a double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM) corresponding storage space.
参见图4,基于图2所示的实施例,在步骤101之后,上述数据存储方法还可以包括:Referring to FIG. 4, based on the embodiment shown in FIG. 2, after step 101, the above data storage method may further include:
在步骤102中,将接收到的各个数据存储请求预存到存储空间申请队列中。In step 102, each received data storage request is pre-stored in the storage space application queue.
其中,执行步骤103之前,从上述存储空间申请队列中读取上述数据存储请求。Wherein, before step 103 is executed, the above-mentioned data storage request is read from the above-mentioned storage space application queue.
本实施例中,设置一存储空间申请队列,用于存储请求端发送来的各个数据存储请求,而控制端可以在执行步骤103之前,从该存储空间申请队列中读取数据存储请求,而不需要控制端对接收到的数据存储请求实时分配存储空间,降低控制端的处理压力。In this embodiment, a storage space application queue is set up to store each data storage request sent by the requesting end, and the control end can read the data storage request from the storage space application queue before performing step 103. The control end needs to allocate storage space in real time to the received data storage request, reducing the processing pressure on the control end.
示例性的,上述存储空间申请队列可以为先进先出队列,上述从上述存储空间申请队列中读取上述数据存储请求,具体可以为:控制端可以按照先进先出的规则从该存储空间申请队列中依次读取数据存储请求,然后执行步骤103。Exemplarily, the aforementioned storage space application queue may be a first-in-first-out queue, and the aforementioned data storage request read from the aforementioned storage space application queue may specifically be: the control terminal can apply for a queue from the storage space according to a first-in first-out rule. Read the data storage request in sequence, and then execute step 103.
示例性的,每个数据存储请求可以对应有优先级,各个数据存储请求的优先级不尽相同;上述从上述存储空间申请队列中读取上述数据存储请求,具体可以为:按照上述存储空间申请队列中各个数据存储请求的优先级的顺序,依次读取各个数据存储请求,执行步骤103。Exemplarily, each data storage request may correspond to a priority, and the priority of each data storage request is not the same; the above-mentioned reading of the above-mentioned data storage request from the above-mentioned storage space application queue may specifically be: application according to the above-mentioned storage space In the order of priority of each data storage request in the queue, read each data storage request in turn, and execute step 103.
具体地,控制端可以首先检测该存储空间申请队列是否为非空队列,在该存储空间申请队列为非空队列的情况下,按照先进先出的规则或优先级的顺序从该存储空间申请队列中依次读取数据存储请求,然后执行步骤103,在该存储空间申请队列为空队列的情况下,则不需执行后续步骤。Specifically, the control terminal may first detect whether the storage space application queue is a non-empty queue, and if the storage space application queue is a non-empty queue, apply the queue from the storage space according to the first-in first-out rule or priority order. Read the data storage request in sequence in, and then execute step 103. In the case that the storage space application queue is empty, the subsequent steps do not need to be executed.
参见图5,在请求端向控制模块(controller unit,CU)发送数据存储请求后,控制模块CU将该数据存储请求预存至存储空间申请队列中;控制模块CU从存储空间申请队列中依次读取数据存储请求,根据该数据存储请求的所需存储空间和所需存储速度为其分配存储空间,为该请求端发送内存授权。具体地,在为该数据存储请求分配到内部存储空间中的一存储空间后,在第一分配表格信息中记录该存储空间,在为该数据存储请求分配到外部存储空间中的一存储空间后,在第二分配表格中记录该存储空间。Referring to Figure 5, after the requesting end sends a data storage request to the control module (controller unit, CU), the control module CU pre-stores the data storage request in the storage space application queue; the control module CU reads from the storage space application queue in turn For a data storage request, storage space is allocated according to the required storage space and required storage speed of the data storage request, and a memory authorization is sent to the requesting end. Specifically, after the data storage request is allocated to a storage space in the internal storage space, the storage space is recorded in the first allocation table information, and after the data storage request is allocated to a storage space in the external storage space , And record the storage space in the second allocation table.
示例性的,内部存储空间可以为片内存储空间,例如可以为SRAM的存储空间;第一分配表格信息可以为与片内存储空间对应的分配表格信息,例如可以为与SRAM对应的分配表格信息。Exemplarily, the internal storage space may be on-chip storage space, for example, it may be the storage space of SRAM; the first allocation table information may be allocation table information corresponding to the on-chip storage space, for example, it may be allocation table information corresponding to SRAM .
另外,图5中的PM(program memory)为控制模块CU的指令存储器,CM(controller unit data memory)为控制模块CU的数据存储器。In addition, PM (program memory) in Figure 5 is the instruction memory of the control module CU, and CM (controller unit data memory) is the data memory of the control module CU.
参见图6,基于图2所示的实施例,上述数据存储方法还可以包括:Referring to FIG. 6, based on the embodiment shown in FIG. 2, the foregoing data storage method may further include:
在步骤107中,接收数据释放请求,所述数据释放请求包含对应的存储空间。In step 107, a data release request is received, and the data release request includes a corresponding storage space.
其中,上述对应的存储空间可以为第一存储空间,或第二存储空间。Wherein, the aforementioned corresponding storage space may be the first storage space or the second storage space.
具体地,在根据步骤103为请求端的数据存储请求分配第一存储空间之后,请求端可以将与该数据存储请求对应的任务产生的数据存放在上述第一存储空间之中;在完成上述任务之后,请求端可以向控制端发送请求控制端释放该第一存储空间的数据释放请求,以便于及时为其他数据存储请求让出内部存储空间。Specifically, after allocating the first storage space for the data storage request of the requesting side according to step 103, the requesting side may store the data generated by the task corresponding to the data storage request in the first storage space; after completing the above task , The requesting end may send a data release request requesting the control end to release the first storage space to the control end, so that the internal storage space can be released for other data storage requests in time.
也可以根据步骤105为请求端的数据存储请求分配第二存储空间之后,请求端可以将与该数据存储请求对应的任务产生的数据存放在上述第一存储空间之中,或第二存储空间之中;在完成上述任务之后,请求端可以向控制端发送请求控制端释放该第一存储空间的数据释放请求,以便于及时为其他数据存储请求让出内部存储空间,或请求端可以向控制端发送请求控制端释放该第二存储空间的数据释放请求,以便于及时为其他数据存储请求让出外部存储空间,。After allocating the second storage space for the data storage request of the requesting end according to step 105, the requesting end can store the data generated by the task corresponding to the data storage request in the first storage space or the second storage space. ; After completing the above tasks, the requesting end can send to the control end a data release request requesting the control end to release the first storage space, so as to give up the internal storage space for other data storage requests in time, or the requesting end can send to the control end Request the control terminal to release the data release request of the second storage space, so as to promptly release the external storage space for other data storage requests.
需要说明的是,在步骤103中可以为多个满足步骤103中要求的数据存储请求分配对应的第一存储空间,而在本步骤中,每个数据释放请求可以对应一个第一存储空间。同样的,在步骤105中可以为多个满足步骤105中要求的数据存储请求分配对应的第二存储空间,而在本步骤中,每个数据释放请求可以对应一个第二存储空间。It should be noted that in step 103, multiple data storage requests that meet the requirements in step 103 may be allocated corresponding first storage spaces, and in this step, each data release request may correspond to a first storage space. Similarly, in step 105, a plurality of data storage requests that meet the requirements in step 105 can be allocated corresponding second storage spaces, and in this step, each data release request can correspond to a second storage space.
在步骤109中,根据所述数据释放请求,将对应的存储空间释放,并在对应的分配表格信息中记录所述存储空间未被占用。In step 109, the corresponding storage space is released according to the data release request, and the storage space is not occupied in the corresponding allocation table information.
其中,上述对应的分配表格信息可以为第一分配表格信息或第二分配表格信息。在步骤107中的存储空间为第一存储空间时,这里的分配表格即为第一分配表格信息;在步骤107中的存储空间为第二存储空间时,这里的分配表格即为第二分配表格信息。Wherein, the aforementioned corresponding allocation table information may be the first allocation table information or the second allocation table information. When the storage space in step 107 is the first storage space, the allocation table here is the first allocation table information; when the storage space in step 107 is the second storage space, the allocation table here is the second allocation table information.
一种可能的实施方式中,可以提取数据释放请求中所包含的第一存储空间,然后将内部存储空间中与该第一存储空间对应的数据释放。In a possible implementation manner, the first storage space included in the data release request may be extracted, and then the data corresponding to the first storage space in the internal storage space may be released.
具体地,所述第一存储空间可以包括第一存储空间标识、第一存储起始位置和第一存储结束位置,因此可以根据该第一存储空间标识确定数据释放请求所需释放的存储空间为内部存储空间,再根据第一存储起始位置和第一存储结束位置确定内部存储空间中的存储区域,最后将确定出的存储区域进行释放。Specifically, the first storage space may include a first storage space identifier, a first storage start position, and a first storage end position. Therefore, it can be determined according to the first storage space identifier that the storage space required by the data release request is In the internal storage space, the storage area in the internal storage space is determined according to the first storage start position and the first storage end position, and finally the determined storage area is released.
本步骤中,在将内部存储空间中与该第一存储空间对应的数据释放之后,可以将第一存储空间已被释放记录在第一分配表格信息中,表示该第一存储空间未被占用,能够再次被划分为其他数据存储请求对应的存储空间,以备之后为其他数据存储请求分配存储空间之前,通过该第一分配表格信息确认内部存储空间中的可用存储空间。In this step, after the data corresponding to the first storage space in the internal storage space is released, the release of the first storage space may be recorded in the first allocation table information, indicating that the first storage space is not occupied, It can be divided into storage space corresponding to other data storage requests again, so as to confirm the available storage space in the internal storage space through the first allocation table information before allocating storage space for other data storage requests.
一种可能的实施方式中,也可以提取数据释放请求中所包含的第二存储空间,然后将外部存储空间中与该第二存储空间对应的数据释放。In a possible implementation manner, the second storage space included in the data release request may also be extracted, and then the data corresponding to the second storage space in the external storage space may be released.
具体地,所述第二存储空间可以包括第二存储空间标识、第二存储起始位置和第二存储结束位置,因此可以根据该第二存储空间标识确定为外部存储空间,再根据第二存储起始位置和第二存储结束位置确定外部存储空间中的存储区域,最后将确定出的存储区域进行释放。Specifically, the second storage space may include a second storage space identifier, a second storage start position, and a second storage end position. Therefore, it may be determined as an external storage space according to the second storage space identifier, and then according to the second storage space. The start position and the second storage end position determine the storage area in the external storage space, and finally release the determined storage area.
本步骤中,在将外部存储空间中与该第二存储空间对应的数据释放之后,可以将第二存储空间已被释放记录在第二分配表格信息中,表示该第二存储空间未被占用,能够再次被划分为其他数据存储请求对应的存储空间,以备之后为其他数据存储请求分配存储空间之前,通过该第二分配表格信息确认外部存储空间中的可用存储空间。In this step, after the data corresponding to the second storage space in the external storage space is released, the release of the second storage space may be recorded in the second allocation table information, indicating that the second storage space is not occupied, It can be divided into storage space corresponding to other data storage requests again, so as to confirm the available storage space in the external storage space through the second allocation table information before allocating storage space for other data storage requests.
一些实施例中,基于图6所示的实施例,上述数据存储方法还可以包括:In some embodiments, based on the embodiment shown in FIG. 6, the foregoing data storage method may further include:
将接收到的各个所述数据释放请求预存到存储空间释放队列中;Pre-store each of the received data release requests in a storage space release queue;
从所述存储空间申请队列中读取所述数据释放请求,并执行步骤109。The data release request is read from the storage space application queue, and step 109 is executed.
本实施例中,设置一存储空间释放队列,用于存储请求端发送来的各个数据释放请求,而控制端可以在执行步骤109之前,从该存储空间释放队列中读取数据释放请求,而不需要控制端对接收到的数据释放请求实时释放对应的存储空间,降低控制端的处理压力。In this embodiment, a storage space release queue is set to store each data release request sent by the requesting end, and the control end can read the data release request from the storage space release queue before step 109 is executed. The control terminal needs to release the corresponding storage space in real time for the received data release request, and reduce the processing pressure of the control terminal.
示例性的,上述存储空间释放队列可以为先进先出队列,上述从所述存储空间释放队列中读取所述数据释放请求,具体可以为:控制端可以按照先进先出的规则从该存储空间释放队列中依次读取数据释放请求,然后执行步骤109。Exemplarily, the foregoing storage space release queue may be a first-in first-out queue, and the foregoing reading of the data release request from the storage space release queue may specifically be: the control terminal may access the storage space according to a first-in first-out rule. The data release request is read in the release queue in sequence, and then step 109 is executed.
示例性的,每个数据释放请求也可以对应有优先级,各个数据释放请求的优先级不尽相同;上述从所述存储空间释放队列中读取所述数据释放请求,具体可以为:按照上述存储空间释放队列中各个数据释放请求的优先级的顺序,依次读取各个数据释放请求,执行步骤109。Exemplarily, each data release request may also correspond to a priority, and the priority of each data release request is not the same; the foregoing reading of the data release request from the storage space release queue may specifically be: In the order of priority of each data release request in the storage space release queue, read each data release request in turn, and execute step 109.
具体地,控制端可以首先检测该存储空间释放队列是否为非空队列,在该存储空间释放队列为非空队列的情况下,按照先进先出的规则或优先级的顺序从该存储空间释放队列中依次读取数据释放请求,然后执行步骤109;而在该存储空间释放队列为空队列的情况下,则不需执行后续步骤。Specifically, the control terminal may first detect whether the storage space release queue is a non-empty queue, and if the storage space release queue is a non-empty queue, release the queue from the storage space according to the first-in first-out rule or priority order. Read the data release request in sequence in, and then execute step 109; and in the case that the storage space release queue is an empty queue, the subsequent steps do not need to be executed.
参见图5,在请求端向控制模块CU发送数据释放请求后,控制模块CU将该数据释放请求预存至存储空间释放队列中;控制模块CU从存储空间释放队列中依次读取数据释放请求,为该请求端发送内存授权,并对读取的数据释放请求所包含的存储空间进行释放。具体地,可以在对该数据释放请求对应的第一存储空间释放后,在第一分配表格信息中记录该第一存储空间未被占用,可以在对该数据释放请求对应的第二存储空间释放后,在第二分配表格中记录该第二存储空间未被占用。Referring to Figure 5, after the requesting end sends a data release request to the control module CU, the control module CU pre-stores the data release request in the storage space release queue; the control module CU reads the data release request sequentially from the storage space release queue, which is The requesting end sends a memory authorization and releases the storage space included in the read data release request. Specifically, after the first storage space corresponding to the data release request is released, it may be recorded in the first allocation table information that the first storage space is not occupied, and the second storage space corresponding to the data release request may be released. Afterwards, it is recorded in the second allocation table that the second storage space is not occupied.
一些实施例中,所述所需存储空间可以包括工作存储空间和结果存储空间,所述数据存储请求可以包括至少一在先数据存储请求和一在后数据存储请求;其中,所述在先数据存储请求的结果存储空间中存储的数据,为所述在后数据存储请求对应的数据存储工作所需的数据。In some embodiments, the required storage space may include a work storage space and a result storage space, and the data storage request may include at least one prior data storage request and a subsequent data storage request; wherein, the prior data storage request The data stored in the result storage space of the storage request is the data required for the data storage work corresponding to the subsequent data storage request.
参见图7,上述数据存储方法还可以包括:Referring to FIG. 7, the foregoing data storage method may further include:
在步骤201中,接收请求端在上述在先数据请求对应的数据存储工作完成后发送的第一数据释放请求。In step 201, the first data release request sent by the requesting end after the data storage work corresponding to the previous data request is completed is received.
在步骤202中,根据所述第一数据释放请求,将所述在先数据存储请求对应的工作存储空间释放。In step 202, the working storage space corresponding to the previous data storage request is released according to the first data release request.
在步骤203中,在所述在后数据请求对应的数据存储工作完成后,接收第二数据释放请求。In step 203, after the data storage work corresponding to the subsequent data request is completed, a second data release request is received.
在步骤204中,根据所述第二数据释放请求,将所述在先数据存储请求对应的结果存储空间和所述在后数据存储请求对应的工作存储空间。In step 204, according to the second data release request, the result storage space corresponding to the previous data storage request and the working storage space corresponding to the subsequent data storage request are combined.
其中,第二数据释放请求可以为请求端发出的,也可以为控制端发出的,还可以为其他装置发出的,本申请实施例对此不予限定。Wherein, the second data release request may be issued by the requesting end, may also be issued by the control end, or may also be issued by other devices, which is not limited in the embodiment of the present application.
示例性的,以CPU、DSP和NN0为例对图7所示的实施例进行说明。图8为以CPU、DSP和NN0为例的工作场景示意图,本实施例中,工作任务链条为CPU先工作,然后再把第一输出结果给DSP,DSP基于该第一输出结果继续工作,DSP完成之后再将第二输出结果给NN0,由NN0来完成后续的工作。Exemplarily, the embodiment shown in FIG. 7 is described by taking CPU, DSP, and NN0 as examples. Figure 8 is a schematic diagram of a working scenario taking CPU, DSP and NN0 as an example. In this embodiment, the task chain is that the CPU works first, and then sends the first output result to the DSP. The DSP continues to work based on the first output result. After completion, the second output result is given to NN0, and NN0 will complete the subsequent work.
首先,在T1时刻,CPU需要为自己负责的任务申请一块CPU工作存储空间,并为第一输出结果申请一块CPU结果存储空间,那么CPU则生成两份数据存储请求发送给控制端。控制端根据两份数据存储请求为CPU分配一CPU工作存储空间和一CPU结果存储空间。CPU工作完成之后产生的第一输出结果存储在CPU结果存储空间中,然后可以给控制端发送CPU工作存储空间释放请求,并通知DSP开始工作。控制端根据CPU工作存储空间释放请求释放CPU工作存储空间。First, at time T1, the CPU needs to apply for a CPU working storage space for the task it is responsible for, and a CPU result storage space for the first output result, then the CPU generates two data storage requests and sends it to the control end. The control end allocates a CPU working storage space and a CPU result storage space to the CPU according to the two data storage requests. The first output result generated after the CPU work is completed is stored in the CPU result storage space, and then the CPU working storage space release request can be sent to the control end, and the DSP is notified to start working. The control terminal releases the CPU working storage space according to the CPU working storage space release request.
DSP为自己负责的任务申请一块DSP工作存储空间,并为第二输出结果申请一块DSP结果存储空间,那么DSP则生成两份数据存储请求发送给控制端。控制端根据两份数据存储请求为DSP分配一DSP工作存储空间和一DSP结果存储空间。DSP基于CPU结果存储空间存放的第一输出结果完成工作之后,生成第二输出结果存储在DSP结果存储空间中,然后可以给控制端发送DSP工作存储空间释放请求和CPU结果存储空间释放请求,并通知NN0开始工作。控制端根据DSP工作存储空间释放请求释放DSP工作存储空间和CPU结果存储空间。The DSP applies for a DSP working storage space for the task it is responsible for, and applies for a DSP result storage space for the second output result, then the DSP generates two data storage requests and sends it to the control end. The control end allocates a DSP working storage space and a DSP result storage space for the DSP according to the two data storage requests. After the DSP completes the work based on the first output result stored in the CPU result storage space, it generates the second output result and stores it in the DSP result storage space, and then can send the DSP work storage space release request and the CPU result storage space release request to the control end, and Notify NN0 to start work. The control end releases the DSP working storage space and the CPU result storage space according to the DSP working storage space release request.
NN0为自己负责的任务申请一块NN0工作存储空间,并为第三输出结果申请一块NN0结果存储空间,那么NN0则生成两份数据存储请求发送给控制端。控制端根据两份数据存储请求为NN0分配一NN0工作存储空间和一NN0结果存储空间。NN0基于DSP结果存储空间存放的第二输出结果完成工作之后,生成第三输出结果存储在NN0结果存储空间中。其中,在NN0完成工作之后整个工作任务链条完成,然后可以给控制端发送DSP结果存储空间释放请求和NN0工作存储空间释放请求,并通知CPU数据存储工作已完成。控制端根据DSP工作存储空间释放请求和NN0工作存储空间释放请求释放DSP工作存储空间和NN0工作存储空间。NN0 applies for a piece of NN0 working storage space for the task it is responsible for, and a piece of NN0 result storage space for the third output result, then NN0 generates two data storage requests and sends it to the control end. The control end allocates a NN0 working storage space and a NN0 result storage space for NN0 according to the two data storage requests. After NN0 completes its work based on the second output result stored in the DSP result storage space, it generates a third output result and stores it in the NN0 result storage space. Among them, after NN0 completes the work, the entire work task chain is completed, and then the DSP result storage space release request and NN0 working storage space release request can be sent to the control end, and the CPU data storage work is completed. The control end releases the DSP working storage space and the NN0 working storage space according to the DSP working storage space release request and the NN0 working storage space release request.
另外,CPU在获知数据存储工作已完成后,可以给控制端发送NN0结果存储空间释放请求;控制端根据NN0结果存储空间释放请求释放NN0结果存储空间。In addition, after the CPU knows that the data storage work has been completed, it can send the NN0 result storage space release request to the control end; the control end releases the NN0 result storage space according to the NN0 result storage space release request.
图9为本申请实施例提供的存储空间分配流程示意图,参见图9,填充部分表示已授权分配的存储空间,也即被占用的存储空间,未填充部分表示暂未使用的存储空间,也即能够分配的存储空间。Figure 9 is a schematic diagram of a storage space allocation process provided by an embodiment of this application. See Figure 9. The filled part represents the storage space authorized to be allocated, that is, the occupied storage space, and the unfilled part represents the temporarily unused storage space, that is, The storage space that can be allocated.
上述在内部存储空间中为所述数据存储请求分配对应的第一存储空间,可以包括:The foregoing allocating the corresponding first storage space for the data storage request in the internal storage space may include:
步骤A1,按照内部存储空间的存储地址的顺序,获取内部存储空间中的可用连续存储区域,检测获取到的可用连续存储区域的大小是否能够满足该数据存储请求中所需存储空间的大小;Step A1: Obtain the available continuous storage area in the internal storage space in the order of the storage addresses of the internal storage space, and detect whether the size of the obtained available continuous storage area can meet the size of the storage space required in the data storage request;
步骤B1,在可用连续存储区域的大小能够满足该数据存储请求中所需存储空间的大小的情况下,在该可用连续存储区域中为该数据存储请求分配第一存储空间;Step B1, in the case where the size of the available continuous storage area can meet the size of the storage space required in the data storage request, allocate the first storage space in the available continuous storage area for the data storage request;
步骤C1,在可用连续存储区域的大小不能够满足该数据存储请求中所需存储空间的大小的情况下,获取内部存储空间中的下一可用连续存储区域,并执行步骤A1中的检测获取到的可用连续存储区域的大小是否能够满足该数据存储请求中所需存储空间的大小的步骤;Step C1, in the case that the size of the available continuous storage area cannot meet the size of the storage space required in the data storage request, obtain the next available continuous storage area in the internal storage space, and execute the detection in step A1 to obtain The step of whether the size of the available continuous storage area can meet the size of the storage space required in the data storage request;
其中,在所述内部存储空间不存在可用连续存储区域能够为该数据存储请求分配第一存储空间的情况下,等待数据释放请求,并在执行一数据释放请求之后,继续执行A1至步骤C1。Wherein, when there is no available continuous storage area in the internal storage space that can allocate the first storage space for the data storage request, wait for the data release request, and after executing a data release request, continue to execute A1 to step C1.
上述在外部存储空间中为所述数据存储请求分配对应的第二存储空间,可以包括:The foregoing allocating the corresponding second storage space for the data storage request in the external storage space may include:
步骤A2,按照外部存储空间的存储地址的顺序,获取外部存储空间中的可用连续存储区域,检测获取到的可用连续存储区域的大小是否能够满足该数据存储请求中所需存储空间的大小;Step A2: Obtain the available continuous storage area in the external storage space in the order of the storage addresses of the external storage space, and detect whether the size of the obtained available continuous storage area can meet the size of the storage space required in the data storage request;
步骤B2,在可用连续存储区域的大小能够满足该数据存储请求中所需存储空间的大小的情况下,在该可用连续存储区域中为该数据存储请求分配第二存储空间;Step B2, when the size of the available continuous storage area can meet the size of the storage space required in the data storage request, allocate a second storage space in the available continuous storage area for the data storage request;
步骤C2,在可用连续存储区域的大小不能够满足该数据存储请求中所需存储空间的大小的情况下,获取外部存储空间中的下一可用连续存储区域,并执行步骤A2中的检测获取到的可用连续存储区域的大小是否能够满足该数据存储请求中所需存储空间的大小的步骤;Step C2, in the case that the size of the available continuous storage area cannot meet the size of the storage space required in the data storage request, obtain the next available continuous storage area in the external storage space, and perform the detection in step A2 to obtain The step of whether the size of the available continuous storage area can meet the size of the storage space required in the data storage request;
其中,在所述外部存储空间不存在可用连续存储区域能够为该数据存储请求分配第二存储空间的情况下,等待数据释放请求,并在执行一数据释放请求之后,继续执行A2至步骤C2。Wherein, in the case that there is no available continuous storage area in the external storage space that can allocate a second storage space for the data storage request, wait for the data release request, and after executing a data release request, continue to execute A2 to step C2.
具体地,初始化的时候,整个存储空间{0,1024}共1024KB均为待分配状态;其中,该存储空间可以为内部存储空间,也可以为外部存储空间,本申请实施例对此不予限定;Specifically, at the time of initialization, the entire storage space {0,1024} totaling 1024KB is to be allocated; the storage space can be internal storage space or external storage space, which is not limited in the embodiment of this application ;
在T0时刻,模块1申请100KB的存储空间,控制端为模块1的申请分配100KB的存储空间,例如为{0,100},在T1时刻对应的存储空间的示意图中,该100KB的存储空间为填充态;At time T0, module 1 applies for 100KB of storage space, and the control end allocates 100KB of storage space for the application of module 1, such as {0,100}. In the schematic diagram of the corresponding storage space at time T1, the 100KB of storage space is filled ;
在T1时刻,模块2申请250KB的存储空间,由于该存储空间的剩余可存储空间足够,则为模块2的申请分配250KB的存储空间,模块2的存储空间可以与模块1的100KB的存储空间相邻,例如为{101,350};在T2时刻对应的存储空间的示意图中,该250KB的存储空间为填充态;At time T1, module 2 applies for 250KB of storage space. Since the remaining storage space of the storage space is sufficient, 250KB of storage space is allocated for the application of module 2. The storage space of module 2 can be the same as the 100KB storage space of module 1. Next, for example {101,350}; in the schematic diagram of the storage space corresponding to time T2, the 250KB storage space is filled;
在T2时刻,模块3申请195KB的存储空间,由于该存储空间的剩余可存储空间足够,则为模块3的申请分配195KB的存储空间,模块3的存储空间可以与模块2的250KB的存储空间相邻,例如为{351,545};在T3时刻对应的存储空间的示意图中,该195KB的存储空间为填充态;At T2, module 3 applies for 195KB of storage space. Since the remaining storage space of the storage space is sufficient, 195KB of storage space is allocated for the application of module 3. The storage space of module 3 can be the same as that of module 2’s 250KB storage space. Next, for example {351,545}; in the schematic diagram of the storage space corresponding to time T3, the 195KB storage space is filled;
在T3时刻,模块2申请的250KB的存储空间被模块2申请释放,该250KB的存储空间被记录为释放状态(未填充态,参见T4时刻存储空间的示意图);At time T3, the 250KB of storage space requested by module 2 is released by module 2, and the 250KB of storage space is recorded as a released state (unfilled state, see the schematic diagram of storage space at T4);
在T4时刻,模块4申请261KB的存储空间,由于T3 时刻释放的250KB的存储空间不满足模块4申请的261KB的存储空间,则从为模块3分配的195KB的存储空间之后给模块4分配261KB的存储空间,例如为{546,806};在T2时刻对应的存储空间的示意图中,该261KB的存储空间为填充态;At T4, module 4 applies for 261KB of storage space. Since the 250KB of storage space released at T3 does not meet the 261KB of storage space requested by module 4, module 4 is allocated 261KB of storage space after 195KB of storage space allocated for module 3 Storage space, for example {546,806}; in the schematic diagram of the storage space corresponding to time T2, the 261KB storage space is filled;
在T5时刻,模块3申请的195KB的存储空间被模块3申请释放,该195KB的存储空间被记录为释放状态;在T6时刻对应的存储空间的示意图中,该95KB的存储空间为未填充态;At time T5, the 195KB of storage space requested by module 3 is released by module 3, and the 195KB of storage space is recorded as a released state; in the schematic diagram of the corresponding storage space at time T6, the 95KB of storage space is in an unfilled state;
T6时刻对应的存储空间的示意图中,445KB和218KB对应的存储区域能够为其他数据存储请求分配存储空间。In the schematic diagram of the storage space corresponding to time T6, the storage areas corresponding to 445KB and 218KB can allocate storage space for other data storage requests.
本实施例中,为一个数据存储请求分配一个连续的存储空间便于进行数据存储和读取,而且实现简单;根据数据释放请求释放不用的存储空间,能够及时为其他数据存储请求提供存储空间,提高存储空间的利用率。In this embodiment, allocating a continuous storage space for a data storage request is convenient for data storage and reading, and is simple to implement; releasing unused storage space according to the data release request can provide storage space for other data storage requests in time, improving Utilization of storage space.
图10是本申请一实施例提供的数据存储方法的示意性流程图,该数据存储方法可以应用于请求端。参照图10,对该数据存储方法的详述如下:FIG. 10 is a schematic flowchart of a data storage method provided by an embodiment of the present application. The data storage method may be applied to the requesting end. 10, the details of the data storage method are as follows:
在步骤301中,生成数据存储请求,所述数据存储请求包括所需存储空间和所需存储速度。In step 301, a data storage request is generated, and the data storage request includes the required storage space and the required storage speed.
其中,上述数据存储请求可以为需要申请存储空间的模块生成的请求,例如可以为终端设备中的CPU、DSP  等。例如,上述模块在需要申请存储空间时,可以首先生成包括所需存储空间和所需存储速度的数据存储请求,发送给终端设备中的控制端。The aforementioned data storage request may be a request generated by a module that needs to apply for storage space, for example, a CPU, DSP, etc. in a terminal device. For example, when the aforementioned module needs to apply for storage space, it may first generate a data storage request including the required storage space and the required storage speed, and send it to the control terminal in the terminal device.
本步骤中,上述所需存储空间用于表征该数据存储请求所需的存储空间的大小,上述所需存储速度用于表征对该数据存储请求对应的数据进行存储所需的存储速度,其中所需存储速度越大,该数据存储请求所需的存储需求越高,所需存储速度越小,该数据存储请求所需的存储需求越低。In this step, the aforementioned required storage space is used to characterize the size of the storage space required by the data storage request, and the aforementioned required storage speed is used to characterize the storage speed required to store the data corresponding to the data storage request, where The greater the required storage speed, the higher the storage requirement required for the data storage request, and the lower the required storage speed, the lower the storage requirement required for the data storage request.
示例性的,由于存储器是以循环周期的形式对数据进行存储的,因此所需存储速度可以包括存储周期数,根据所需存储空间和该存储周期数可以确定数据存储需求的KBPC,KBPC为对该数据存储请求对应的数据进行存储时,每个存储周期所需提供的存储空间的大小,其中KBPC越大说明对该数据存储请求对应的数据进行存储所需的存储需求越高,KBPC越小说明对该数据存储请求对应的数据进行存储所需的存储需求越低。Exemplarily, because the memory stores data in the form of cyclic cycles, the required storage speed may include the number of storage cycles. According to the required storage space and the number of storage cycles, the KBPC of the data storage requirement can be determined, and KBPC is the right When the data corresponding to the data storage request is stored, the size of the storage space required for each storage cycle. The larger the KBPC, the higher the storage requirement for storing the data corresponding to the data storage request, and the smaller the KBPC. It indicates that the storage requirement required for storing the data corresponding to the data storage request is lower.
其中,内部存储空间的存储速度相对于外部存储空间的存储速度较快,即内部存储空间在每个存储周期能够提供的存储空间,要大于外部存储空间在每个存储周期能够提供的存储空间。可以理解的,通常外部存储空间相对于内部存储空间较大,但是对于存储一定大小的数据得情况下,外部存储空间需要的存储周期数要多于内部存储空间需要的存储周期数。Among them, the storage speed of the internal storage space is faster than that of the external storage space, that is, the storage space that the internal storage space can provide in each storage cycle is greater than the storage space that the external storage space can provide in each storage cycle. It is understandable that the external storage space is generally larger than the internal storage space, but for storing a certain size of data, the number of storage cycles required by the external storage space is more than the number of storage cycles required by the internal storage space.
另外,所需存储速度也可以包括每周期存储空间,或所需存储速度也可以包括存储周期数和每周期存储空间,本申请实施例对此不予限定。In addition, the required storage speed may also include the storage space per cycle, or the required storage speed may also include the number of storage cycles and the storage space per cycle, which is not limited in the embodiment of the present application.
在步骤302中,将所述数据存储请求发送给控制端,所述数据存储请求用于请求所述控制端根据所述所需存储空间和所需存储速度分配目标存储空间。In step 302, the data storage request is sent to the control terminal, and the data storage request is used to request the control terminal to allocate a target storage space according to the required storage space and the required storage speed.
其中,控制端根据上述所需存储空间和所需存储速度分配目标存储空间的过程,本步骤中不作详细说明,具体过程可以参考前述应用于控制端的数据存储方法的实施例中的相关内容。Wherein, the control terminal allocates the target storage space according to the required storage space and the required storage speed. This step will not be described in detail. For the specific process, please refer to the relevant content in the aforementioned embodiment of the data storage method applied to the control terminal.
需要说明的是,本步骤中的目标存储空间可以包括前述的第一存储空间,也可以包括前述的第二存储空间,也可以包括前述的第一存储空间和第二存储空间,本申请实施例对此不予限定。It should be noted that the target storage space in this step can include the aforementioned first storage space, can also include the aforementioned second storage space, or can also include the aforementioned first storage space and second storage space. There is no restriction on this.
在步骤303中,生成数据释放请求,所述数据释放请求包括所述目标存储空间。In step 303, a data release request is generated, and the data release request includes the target storage space.
其中,在控制端为请求端的数据存储请求分配目标存储空间之后,请求端可以将与该数据存储请求对应的任务产生的数据存放在上述目标存储空间之中;在完成上述任务之后,请求端可以向控制端发送请求控制端释放该目标存储空间的数据释放请求,以便于及时为其他数据存储请求让出存储空间。Among them, after the control end allocates the target storage space for the data storage request of the requesting end, the requesting end may store the data generated by the task corresponding to the data storage request in the target storage space; after completing the above task, the requesting end may Send a data release request to the control terminal requesting the control terminal to release the target storage space, so as to make storage space for other data storage requests in a timely manner.
在步骤304中,将所述数据释放请求发送给所述控制端,所述数据释放请求用于请求所述控制端释放所述目标存储空间。In step 304, the data release request is sent to the control terminal, and the data release request is used to request the control terminal to release the target storage space.
其中,控制端根据上述目标存储空间释放对应的存储空间的过程,本步骤中不作详细说明,具体过程可以参考前述应用于控制端的数据存储方法的实施例中的相关内容。Wherein, the control terminal releases the corresponding storage space process according to the foregoing target storage space, which is not described in detail in this step. For the specific process, please refer to the relevant content in the foregoing embodiment of the data storage method applied to the control terminal.
上述数据存储方法,在所需存储速度大于阈值且内部存储空间中存在与所需存储空间对应的连续空间的情况下,在内部存储空间中为数据存储请求分配对应的存储空间,否则,在外部存储空间中为数据存储请求分配对应的存储空间,通过对所需存储速度较大的数据存储请求在内部存储空间中分配一存储空间进行数据存储,能够充分利用内部存储空间对所需存储速度较大的数据进行存储,而不仅仅是利用内部存储空间中的一固定存储空间存储数据,而且所需存储速度较大的数据在内部存储空间中的存储速度快于在外部存储空间中的存储速度,因此能够极大的提高数据存储能力,使得系统不会受限于“内存墙”的问题,并且能够降低对外部存储空间的需求。In the above data storage method, when the required storage speed is greater than the threshold and there is a continuous space corresponding to the required storage space in the internal storage space, the corresponding storage space is allocated to the data storage request in the internal storage space; otherwise, the external storage space is allocated. In the storage space, the corresponding storage space is allocated for data storage requests. By allocating a storage space in the internal storage space for data storage for data storage requests that require a higher storage speed, the internal storage space can be fully utilized to reduce the required storage speed. Large data is stored, not just using a fixed storage space in the internal storage space to store data, and the storage speed of the data that requires a larger storage speed in the internal storage space is faster than the storage speed in the external storage space Therefore, it can greatly improve the data storage capacity, so that the system will not be limited by the "memory wall" problem, and can reduce the demand for external storage space.
图11是本申请一实施例提供的控制端和请求端之间的数据交互流程图,参照图11,对该数据交互过程详述如下:Fig. 11 is a flow chart of data exchange between the control end and the request end provided by an embodiment of the present application. With reference to Fig. 11, the data exchange process is described in detail as follows:
在步骤401中,请求端生成数据存储请求,该数据存储请求包括所需存储空间和所需存储速度; In step 401, the requesting end generates a data storage request, and the data storage request includes the required storage space and the required storage speed;
在步骤402中,请求端将该数据存储请求发送给控制端;其中,该请求端可以生成至少一个数据存储请求并发送给控制端,或者可以多个请求端生成各自的数据存储请求后均发送给控制端;In step 402, the requesting end sends the data storage request to the control end; wherein, the requesting end may generate at least one data storage request and send it to the control end, or multiple requesting ends may generate each data storage request and send it all To the control end
在步骤403中,控制端将接收到的各个数据存储请求预存到存储空间申请队列中;In step 403, the control terminal pre-stores each received data storage request into the storage space application queue;
在步骤404中,控制端从存储空间申请队列中读取数据存储请求;In step 404, the control terminal reads the data storage request from the storage space application queue;
在步骤405中,控制端在所需存储速度大于阈值,且内部存储空间中存在与所需存储空间对应的连续空间的情况下,在内部存储空间为数据存储请求分配对应的第一存储空间,并在第一分配表格信息中记录第一存储空间已被占用;In step 405, when the required storage speed is greater than the threshold and there is a continuous space corresponding to the required storage space in the internal storage space, the control terminal allocates the first storage space corresponding to the data storage request in the internal storage space, And record in the first allocation table information that the first storage space has been occupied;
在步骤406中,控制端在所需存储速度小于等于阈值,或内部存储空间不存在与所需存储空间对应的连续空间的情况下,在外部存储空间为数据存储请求分配对应的第二存储空间,并在第二分配表格信息中记录第二存储空间已被占用;In step 406, when the required storage speed is less than or equal to the threshold, or the internal storage space does not have a continuous space corresponding to the required storage space, the control terminal allocates a second storage space corresponding to the data storage request in the external storage space. , And record in the second allocation table information that the second storage space has been occupied;
在步骤407中,请求端生成数据释放请求,所述数据释放请求包括所述目标存储空间;In step 407, the requesting end generates a data release request, and the data release request includes the target storage space;
在步骤408中,请求端发送数据释放请求给控制端;其中,该请求端可以生成至少一个数据释放请求并发送给控制端,或者可以多个请求端生成各自的数据释放请求后均发送给控制端;In step 408, the requesting end sends a data release request to the control end; wherein, the requesting end can generate at least one data release request and send it to the control end, or multiple request ends can generate their own data release request and then send it to the control end. end;
在步骤409中,控制端将接收到的各个所述数据释放请求预存到存储空间释放队列中;In step 409, the control terminal prestores each of the received data release requests into the storage space release queue;
在步骤410中,控制端从存储空间释放队列中读取数据释放请求;In step 410, the control terminal reads the data release request from the storage space release queue;
在步骤411中,控制端根据数据释放请求,将对应的第一存储空间释放,并在第一分配表格信息中记录第一存储空间未被占用,或将对应的第二存储空间释放,并在第二分配表格信息中记录第二存储空间违背占用。In step 411, the control terminal releases the corresponding first storage space according to the data release request, and records in the first allocation table information that the first storage space is not occupied, or releases the corresponding second storage space, and The second allocation table information records the illegal occupation of the second storage space.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence number of each step in the foregoing embodiment does not mean the order of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
对应于上文实施例所述的应用于控制端的数据存储方法,图12示出了本申请实施例提供的数据存储装置的结构框图,该数据存储装置可以用于控制端,为了便于说明,仅示出了与本申请实施例相关的部分。Corresponding to the data storage method applied to the control terminal described in the above embodiment, FIG. 12 shows a structural block diagram of the data storage device provided in an embodiment of the present application. The data storage device can be used for the control terminal. For ease of description, only The parts related to the embodiments of the present application are shown.
参见图12,本申请实施例中的数据存储装置可以包括接收模块501和第一分配模块502。Referring to FIG. 12, the data storage device in the embodiment of the present application may include a receiving module 501 and a first distribution module 502.
其中,接收模块501,用于接收数据存储请求,所述数据存储请求包括所需存储空间和所需存储速度;Wherein, the receiving module 501 is configured to receive a data storage request, where the data storage request includes a required storage space and a required storage speed;
第一分配模块502,用于在所述所需存储速度大于阈值,且内部存储空间中存在与所述所需存储空间对应的连续空间的情况下,在所述内部存储空间为所述数据存储请求分配对应的第一存储空间,并在第一分配表格信息中记录所述第一存储空间已被占用。 The first allocation module 502 is configured to: when the required storage speed is greater than a threshold and there is a continuous space corresponding to the required storage space in the internal storage space, the internal storage space is the data storage Request to allocate the corresponding first storage space, and record in the first allocation table information that the first storage space is occupied.
一些实施例中,基于图8所示的数据存储装置,上述装置还可以包括:In some embodiments, based on the data storage device shown in FIG. 8, the foregoing device may further include:
第一分配模块503,用于在所述所需存储速度小于等于阈值,或所述内部存储空间不存在与所述所需存储空间对应的连续空间的情况下,在外部存储空间为所述数据存储请求分配对应的第二存储空间,并在第二分配表格信息中记录所述第二存储空间已被占用。The first allocation module 503 is configured to: when the required storage speed is less than or equal to a threshold, or the internal storage space does not have a continuous space corresponding to the required storage space, the external storage space is the data The storage request allocates the corresponding second storage space, and records in the second allocation table information that the second storage space is occupied.
一些实施例中,基于图12所示的数据存储装置,上述装置还可以包括:In some embodiments, based on the data storage device shown in FIG. 12, the foregoing device may further include:
申请队列存储模块,用于将接收到的各个所述数据存储请求预存到存储空间申请队列中,在对所述数据存储请求分配存储空间之前,从所述存储空间申请队列中读取所述数据存储请求。The application queue storage module is used to pre-store each of the received data storage requests in a storage space application queue, and read the data from the storage space application queue before allocating storage space to the data storage request Storage request.
一些实施例中,基于图12所示的数据存储装置,上述装置还可以包括:In some embodiments, based on the data storage device shown in FIG. 12, the foregoing device may further include:
第一释放接收模块,用于接收数据释放请求,所述数据释放请求包括对应的第一存储空间;A first release receiving module, configured to receive a data release request, where the data release request includes the corresponding first storage space;
第一释放模块,用于根据所述数据释放请求,将对应的第一存储空间释放,并在所述第一分配表格信息中记录所述第一存储空间未被占用。The first release module is configured to release the corresponding first storage space according to the data release request, and record in the first allocation table information that the first storage space is not occupied.
一些实施例中,基于图12所示的数据存储装置,上述装置还可以包括:In some embodiments, based on the data storage device shown in FIG. 12, the foregoing device may further include:
第二释放接收模块,用于接收数据释放请求,所述数据释放请求包括对应的第二存储空间;A second release receiving module, configured to receive a data release request, where the data release request includes a corresponding second storage space;
第二释放模块,用于根据所述数据释放请求,将对应的第二存储空间释放,并在所述第二分配表格信息中记录所述第二存储空间未被占用。The second release module is configured to release the corresponding second storage space according to the data release request, and record in the second allocation table information that the second storage space is not occupied.
一些实施例中,基于图12所示的数据存储装置,上述装置还可以包括:In some embodiments, based on the data storage device shown in FIG. 12, the foregoing device may further include:
释放队列存储模块,用于将接收到的各个所述数据释放请求预存到存储空间释放队列中;The release queue storage module is used to pre-store each of the received data release requests in the storage space release queue;
释放读取模块,用于从所述存储空间申请队列中读取所述数据存储请求;A release reading module, configured to read the data storage request from the storage space application queue;
在所述释放读取模块读取所述诗句释放请求之后,所述第一释放模块执行所述根据所述数据释放请求,将对应的第一存储空间释放,并在所述第一分配表格信息中记录所述第一存储空间未被占用。After the release reading module reads the verse release request, the first release module executes the release of the corresponding first storage space according to the data release request, and stores the information in the first allocation table. Recording in the first storage space is not occupied.
一些实施例中,所述所需存储空间包括工作存储空间和结果存储空间,所述数据存储请求包括至少一在先数据存储请求和一在后数据存储请求;其中,所述在先数据存储请求的结果存储空间中存储的数据,为所述在后数据存储请求对应的数据存储工作所需的数据。基于图12所示的数据存储装置,上述装置还可以包括:In some embodiments, the required storage space includes a working storage space and a result storage space, and the data storage request includes at least one prior data storage request and a subsequent data storage request; wherein, the prior data storage request The data stored in the result storage space is the data required for the data storage work corresponding to the subsequent data storage request. Based on the data storage device shown in FIG. 12, the foregoing device may further include:
第三释放接收模块,用于接收请求端在所述在先数据请求对应的数据存储工作完成后发送的第一数据释放请求;The third release receiving module is configured to receive the first data release request sent by the requesting end after the data storage work corresponding to the previous data request is completed;
第三释放模块,用于根据所述第一数据释放请求,将所述在先数据存储请求对应的工作存储空间释放;The third release module is configured to release the working storage space corresponding to the previous data storage request according to the first data release request;
第四释放接收模块,用于接收所述请求端在所述在后数据请求对应的数据存储工作完成后发送的第二数据释放请求;A fourth release receiving module, configured to receive a second data release request sent by the requesting end after the data storage work corresponding to the subsequent data request is completed;
第四释放模块,用于根据所述第二数据释放请求,将所述在先数据存储请求对应的结果存储空间和所述在后数据存储请求对应的工作存储空间释放。The fourth release module is configured to release the result storage space corresponding to the previous data storage request and the working storage space corresponding to the subsequent data storage request according to the second data release request.
对应于上文实施例所述的应用于请求端的数据存储方法,图13示出了本申请实施例提供的数据存储装置的结构框图,该数据存储装置可以用于请求端,为了便于说明,仅示出了与本申请实施例相关的部分。Corresponding to the data storage method applied to the requesting side described in the above embodiment, FIG. 13 shows a structural block diagram of the data storage device provided by the embodiment of the present application. The data storage device can be used for the requesting side. For ease of description, only The parts related to the embodiments of the present application are shown.
参见图13,本申请实施例中的数据存储装置可以包括第一生成模块601、第一发送模块602、第二生成模块603和第二发送模块604。Referring to FIG. 13, the data storage device in the embodiment of the present application may include a first generating module 601, a first sending module 602, a second generating module 603, and a second sending module 604.
其中,第一生成模块601,用于生成数据存储请求,所述数据存储请求包括所需存储空间和所需存储速度;Wherein, the first generation module 601 is configured to generate a data storage request, where the data storage request includes a required storage space and a required storage speed;
第一发送模块602,用于将所述数据存储请求发送给控制端,所述数据存储请求用于请求所述控制端根据所述所需存储空间和所需存储速度分配目标存储空间;The first sending module 602 is configured to send the data storage request to the control terminal, where the data storage request is used to request the control terminal to allocate a target storage space according to the required storage space and the required storage speed;
第二生成模块603,用于生成数据释放请求,所述数据释放请求包括所述目标存储空间;The second generating module 603 is configured to generate a data release request, where the data release request includes the target storage space;
第二发送模块604,用于将所述数据释放请求发送给所述控制端,所述数据释放请求用于请求所述控制端释放所述目标存储空间。The second sending module 604 is configured to send the data release request to the control terminal, and the data release request is used to request the control terminal to release the target storage space.
需要说明的是,上述装置/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其具体功能及带来的技术效果,具体可参见方法实施例部分,此处不再赘述。It should be noted that the information interaction and execution process between the above-mentioned devices/units are based on the same concept as the method embodiment of this application, and its specific functions and technical effects can be found in the method embodiment section. I won't repeat it here.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and conciseness of description, only the division of the above functional units and modules is used as an example. In practical applications, the above functions can be allocated to different functional units and modules as required. Module completion, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist alone physically, or two or more units can be integrated into one unit. The above-mentioned integrated units can be hardware-based Formal realization can also be realized in the form of a software functional unit. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the present application. For the specific working process of the units and modules in the foregoing system, reference may be made to the corresponding process in the foregoing method embodiment, which will not be repeated here.
本申请实施例还提供了一种终端设备,参见图14,该终端设备700可以包括:至少一个处理器710、存储器720以及存储在所述存储器720中并可在所述至少一个处理器710上运行的计算机程序,所述处理器710执行所述计算机程序时实现上述任意各个方法实施例中的步骤,例如图2所示实施例中的步骤101至步骤103,例如图10所示实施例中的步骤301至步骤304。或者,处理器710执行所述计算机程序时实现上述各装置实施例中各模块/单元的功能,例如图12所示模块501至502的功能,例如图13所示模块601至604的功能。An embodiment of the present application also provides a terminal device. Referring to FIG. 14, the terminal device 700 may include: at least one processor 710, a memory 720, and is stored in the memory 720 and can be stored on the at least one processor 710. A running computer program, when the processor 710 executes the computer program, the steps in any of the foregoing method embodiments are implemented, such as steps 101 to 103 in the embodiment shown in FIG. 2, for example, in the embodiment shown in FIG.的Steps 301 to 304. Alternatively, when the processor 710 executes the computer program, the functions of the modules/units in the foregoing device embodiments are implemented, for example, the functions of the modules 501 to 502 shown in FIG. 12, for example, the functions of the modules 601 to 604 shown in FIG.
示例性的,计算机程序可以被分割成一个或多个模块/单元,一个或者多个模块/单元被存储在存储器720中,并由处理器710执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序段,该程序段用于描述计算机程序在终端设备700中的执行过程。Exemplarily, the computer program may be divided into one or more modules/units, and one or more modules/units are stored in the memory 720 and executed by the processor 710 to complete the application. The one or more modules/units may be a series of computer program segments capable of completing specific functions, and the program segments are used to describe the execution process of the computer program in the terminal device 700.
本领域技术人员可以理解,图14仅仅是终端设备的示例,并不构成对终端设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如输入输出设备、网络接入设备、总线等。Those skilled in the art can understand that FIG. 14 is only an example of a terminal device, and does not constitute a limitation on the terminal device. It may include more or less components than those shown in the figure, or a combination of certain components, or different components, such as Input and output equipment, network access equipment, bus, etc.
处理器710可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 710 may be a central processing unit (Central Processing Unit, CPU), it can also be other general processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
存储器720可以是终端设备的内部存储单元,也可以是终端设备的外部存储设备,例如插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。所述存储器720用于存储所述计算机程序以及终端设备所需的其他程序和数据。所述存储器720还可以用于暂时地存储已经输出或者将要输出的数据。The memory 720 may be an internal storage unit of the terminal device, or an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), Secure Digital (Secure Digital, SD) card, flash memory card (Flash Card) and so on. The memory 720 is used to store the computer program and other programs and data required by the terminal device. The memory 720 can also be used to temporarily store data that has been output or will be output.
总线可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互连(Peripheral Component,PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,本申请附图中的总线并不限定仅有一根总线或一种类型的总线。The bus can be an industry standard architecture (Industry Standard Architecture, ISA) bus, peripheral device interconnection (Peripheral Component, PCI) bus or extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, the buses in the drawings of this application are not limited to only one bus or one type of bus.
本申请实施例提供的数据存储方法可以应用于智能手机、计算机、平板电脑、笔记本电脑、上网本、个人数字助理(personal digital assistant,PDA)等终端设备上,本申请实施例对终端设备的具体类型不作任何限制。The data storage method provided in the embodiments of this application can be applied to smart phones, computers, tablet computers, notebook computers, netbooks, and personal digital assistants (personal digital assistants). On terminal devices such as digital assistants, PDAs, etc., the embodiments of this application do not impose any restrictions on the specific types of terminal devices.
以所述终端设备为计算机为例。图15示出的是与本申请实施例提供的计算机的部分结构的框图。参考图15,计算机包括:通信电路810、存储器820、输入单元830、显示单元840、音频电路850、无线保真(wireless fidelity,WiFi)模块860、处理器870以及电源880等部件。本领域技术人员可以理解,图15中示出的计算机结构并不构成对计算机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Take the terminal device as a computer as an example. FIG. 15 shows a block diagram of a part of the structure of a computer provided in an embodiment of the present application. 15, the computer includes: a communication circuit 810, a memory 820, an input unit 830, a display unit 840, an audio circuit 850, wireless fidelity (wireless fidelity) fidelity, WiFi) module 860, processor 870, power supply 880 and other components. Those skilled in the art can understand that the computer structure shown in FIG. 15 does not constitute a limitation on the computer, and may include more or less components than those shown in the figure, or a combination of certain components, or different component arrangements.
下面结合图15对计算机的各个构成部件进行具体的介绍:The following is a detailed introduction to the various components of the computer in conjunction with Figure 15:
通信电路810可用于收发信息或通话过程中,信号的接收和发送,给处理器870处理;另外,将图像采集指令发送给图像采集设备。通常,通信电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,通信电路810还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access, WCDMA)、长期演进(Long Term Evolution,LTE)、电子邮件、短消息服务(Short Messaging Service,SMS)等。The communication circuit 810 may be used for receiving and sending signals during information transmission and reception or during a call, and processing them to the processor 870; in addition, sending an image acquisition instruction to the image acquisition device. Generally, the communication circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, and a low noise amplifier (Low Noise Amplifier). Noise Amplifier, LNA), duplexer, etc. In addition, the communication circuit 810 may also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the Global System for Mobile Communications (Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division Multiple Access) Multiple Access, CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), E-mail, Short Message Service (Short Messaging Service, SMS) etc.
存储器820可用于存储软件程序以及模块,处理器870通过运行存储在存储器820的软件程序以及模块,从而执行计算机的各种功能应用以及数据处理。存储器820可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据计算机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器820可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 820 may be used to store software programs and modules. The processor 870 executes various functional applications and data processing of the computer by running the software programs and modules stored in the memory 820. The memory 820 may mainly include a program storage area and a data storage area. The program storage area may store an operating system, an application program required by at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of the computer (such as audio data, phone book, etc.), etc. In addition, the memory 820 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
输入单元830可用于接收输入的数字或字符信息,以及产生与计算机的用户设置以及功能控制有关的键信号输入。具体地,输入单元830可包括触控面板831以及其他输入设备832。触控面板831,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板831上或在触控面板831附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板831可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器870,并能接收处理器870发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板831。除了触控面板831,输入单元830还可以包括其他输入设备832。具体地,其他输入设备832可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。The input unit 830 can be used to receive inputted number or character information, and generate key signal input related to user settings and function control of the computer. Specifically, the input unit 830 may include a touch panel 831 and other input devices 832. The touch panel 831, also known as the touch screen, can collect the user's touch operations on or near it (for example, the user uses any suitable objects or accessories such as fingers, stylus, etc.) on the touch panel 831 or near the touch panel 831. Operation), and drive the corresponding connection device according to the preset program. Optionally, the touch panel 831 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it To the processor 870, and can receive and execute the commands sent by the processor 870. In addition, the touch panel 831 can be implemented in multiple types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 831, the input unit 830 may also include other input devices 832. Specifically, the other input device 832 may include, but is not limited to, one or more of a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick.
显示单元840可用于显示由用户输入的信息或提供给用户的信息以及计算机的各种菜单。显示单元840可包括显示面板841,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode, OLED)等形式来配置显示面板841。进一步的,触控面板831可覆盖显示面板841,当触控面板831检测到在其上或附近的触摸操作后,传送给处理器870以确定触摸事件的类型,随后处理器870根据触摸事件的类型在显示面板841上提供相应的视觉输出。虽然在图15中,触控面板831与显示面板841是作为两个独立的部件来实现计算机的输入和输入功能,但是在某些实施例中,可以将触控面板831与显示面板841集成而实现计算机的输入和输出功能。The display unit 840 may be used to display information input by the user or information provided to the user and various menus of the computer. The display unit 840 may include a display panel 841. Optionally, a liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode (Organic The display panel 841 is configured in the form of Light-Emitting Diode, OLED). Further, the touch panel 831 can cover the display panel 841. When the touch panel 831 detects a touch operation on or near it, it transmits it to the processor 870 to determine the type of the touch event, and then the processor 870 determines the type of the touch event. The type provides corresponding visual output on the display panel 841. Although in FIG. 15, the touch panel 831 and the display panel 841 are used as two independent components to realize the input and input functions of the computer, but in some embodiments, the touch panel 831 and the display panel 841 may be integrated. Realize the computer's input and output functions.
音频电路850可提供用户与计算机之间的音频接口。音频电路850可将接收到的音频数据转换后的电信号,传输到扬声器由扬声器转换为声音信号输出;另一方面,传声器将收集的声音信号转换为电信号,由音频电路850接收后转换为音频数据,再将音频数据输出处理器870处理后,经通信电路810以发送给比如另一计算机,或者将音频数据输出至存储器820以便进一步处理。The audio circuit 850 can provide an audio interface between the user and the computer. The audio circuit 850 can transmit the electric signal after the conversion of the received audio data to the speaker, which is converted into a sound signal for output by the speaker; on the other hand, the microphone converts the collected sound signal into an electric signal, which is converted into an electric signal after being received by the audio circuit 850 The audio data is processed by the audio data output processor 870, and then sent to, for example, another computer through the communication circuit 810, or the audio data is output to the memory 820 for further processing.
WiFi属于短距离无线传输技术,计算机通过WiFi模块860可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图15示出了WiFi模块860,但是可以理解的是,其并不属于计算机的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。WiFi is a short-distance wireless transmission technology. The computer can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 860. It provides users with wireless broadband Internet access. Although FIG. 15 shows the WiFi module 860, it is understandable that it is not a necessary component of the computer and can be omitted as needed without changing the essence of the invention.
处理器870是计算机的控制中心,利用各种接口和线路连接整个计算机的各个部分,通过运行或执行存储在存储器820内的软件程序和/或模块,以及调用存储在存储器820内的数据,执行计算机的各种功能和处理数据,从而对计算机进行整体监控。可选的,处理器870可包括一个或多个处理单元;优选的,处理器870可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器870中。The processor 870 is the control center of the computer. It uses various interfaces and lines to connect various parts of the entire computer. It executes by running or executing software programs and/or modules stored in the memory 820 and calling data stored in the memory 820. Various functions of the computer and processing data, so as to monitor the computer as a whole. Optionally, the processor 870 may include one or more processing units; preferably, the processor 870 may integrate an application processor and a modem processor, where the application processor mainly processes the operating system, user interface, application programs, etc. , The modem processor mainly deals with wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 870.
计算机还包括给各个部件供电的电源880(比如电池),优选的,电源880可以通过电源管理系统与处理器870逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The computer also includes a power supply 880 (such as a battery) for supplying power to various components. Preferably, the power supply 880 can be logically connected to the processor 870 through a power management system, so that functions such as charging, discharging, and power consumption management can be managed through the power management system.
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现可实现上述数据存储方法各个实施例中的步骤。The embodiments of the present application also provide a computer-readable storage medium that stores a computer program, and when the computer program is executed by a processor, the steps in each embodiment of the foregoing data storage method can be realized.
本申请实施例提供了一种计算机程序产品,当计算机程序产品在移动终端上运行时,使得移动终端执行时实现可实现上述数据存储方法各个实施例中的步骤。The embodiments of the present application provide a computer program product. When the computer program product runs on a mobile terminal, the steps in each embodiment of the above data storage method can be realized when the mobile terminal is executed.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质至少可以包括:能够将计算机程序代码携带到拍照装置/终端设备的任何实体或装置、记录介质、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质。例如U盘、移动硬盘、磁碟或者光盘等。在某些司法管辖区,根据立法和专利实践,计算机可读介质不可以是电载波信号和电信信号。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the implementation of all or part of the processes in the above-mentioned embodiment methods in this application can be accomplished by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. The computer program can be stored in a computer-readable storage medium. When executed by the processor, the steps of the foregoing method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file, or some intermediate forms. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the photographing device/terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media. Such as U disk, mobile hard disk, floppy disk or CD-ROM, etc. In some jurisdictions, according to legislation and patent practices, computer-readable media cannot be electrical carrier signals and telecommunication signals.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.

Claims (10)

  1. 一种数据存储方法,其特征在于,包括:A data storage method, characterized in that it comprises:
    接收数据存储请求,所述数据存储请求包括所需存储空间和所需存储速度;Receiving a data storage request, the data storage request including the required storage space and the required storage speed;
    在所述所需存储速度大于阈值,且内部存储空间中存在与所述所需存储空间对应的连续空间的情况下,在所述内部存储空间中为所述数据存储请求分配对应的第一存储空间,并在第一分配表格信息中记录所述第一存储空间已被占用。In the case where the required storage speed is greater than the threshold, and there is a continuous space corresponding to the required storage space in the internal storage space, allocate the corresponding first storage in the internal storage space for the data storage request And record in the first allocation table information that the first storage space has been occupied.
  2. 如权利要求1所述的数据存储方法,其特征在于,所述方法还包括:The data storage method according to claim 1, wherein the method further comprises:
    在所述所需存储速度小于等于阈值,或所述内部存储空间中不存在与所述所需存储空间对应的连续空间的情况下,在外部存储空间中为所述数据存储请求分配对应的第二存储空间,并在第二分配表格信息中记录所述第二存储空间已被占用。In the case that the required storage speed is less than or equal to the threshold, or there is no continuous space corresponding to the required storage space in the internal storage space, the data storage request is allocated a corresponding first in the external storage space. 2. storage space, and record in the second allocation table information that the second storage space has been occupied.
  3. 如权利要求1或2所述的数据存储方法,其特征在于,在所述接收数据存储请求之后,所述方法还包括:3. The data storage method according to claim 1 or 2, wherein after said receiving the data storage request, the method further comprises:
    将接收到的各个所述数据存储请求预存到存储空间申请队列中,在对所述数据存储请求分配存储空间之前,从所述存储空间申请队列中读取所述数据存储请求。Pre-store each of the received data storage requests in a storage space application queue, and before allocating storage space to the data storage request, read the data storage request from the storage space application queue.
  4. 如权利要求1或2所述的数据存储方法,其特征在于,所述方法还包括:The data storage method according to claim 1 or 2, wherein the method further comprises:
    接收数据释放请求,所述数据释放请求包含对应的存储空间;Receiving a data release request, where the data release request includes a corresponding storage space;
    根据所述数据释放请求,将对应的存储空间释放,并在对应的分配表格信息中记录所述存储空间未被占用。According to the data release request, release the corresponding storage space, and record in the corresponding allocation table information that the storage space is not occupied.
  5. 如权利要求4所述的数据存储方法,其特征在于,在所述接收数据释放请求之后,所述方法还包括:The data storage method according to claim 4, wherein after the receiving the data release request, the method further comprises:
    将接收到的各个所述数据释放请求预存到存储空间释放队列中;Pre-store each of the received data release requests in a storage space release queue;
    从所述存储空间申请队列中读取所述数据释放请求,并执行所述根据所述数据释放请求,将对应的存储空间释放,并在对应的分配表格信息中记录所述存储空间未被占用的步骤。Read the data release request from the storage space application queue, and execute the corresponding storage space according to the data release request, and record that the storage space is not occupied in the corresponding allocation table information A step of.
  6. 如权利要求1所述的数据存储方法,其特征在于,所述所需存储空间包括工作存储空间和结果存储空间,所述数据存储请求包括至少一在先数据存储请求和一在后数据存储请求;其中,所述在先数据存储请求的结果存储空间中存储的数据,为所述在后数据存储请求对应的数据存储工作所需的数据;The data storage method according to claim 1, wherein the required storage space includes a working storage space and a result storage space, and the data storage request includes at least one prior data storage request and a subsequent data storage request Wherein, the data stored in the storage space of the result of the previous data storage request is the data required for the data storage work corresponding to the subsequent data storage request;
    所述方法还包括:The method also includes:
    接收请求端在所述在先数据请求对应的数据存储工作完成后发送的第一数据释放请求;Receiving the first data release request sent by the requesting end after the data storage work corresponding to the previous data request is completed;
    根据所述第一数据释放请求,将所述在先数据存储请求对应的工作存储空间释放;According to the first data release request, release the working storage space corresponding to the previous data storage request;
    在所述在后数据请求对应的数据存储工作完成后,接收第二数据释放请求;After the data storage work corresponding to the subsequent data request is completed, receiving a second data release request;
    根据所述第二数据释放请求,将所述在先数据存储请求对应的结果存储空间和所述在后数据存储请求对应的工作存储空间。According to the second data release request, the result storage space corresponding to the previous data storage request and the working storage space corresponding to the subsequent data storage request are combined.
  7. 一种数据存储方法,其特征在于,包括:A data storage method, characterized in that it comprises:
    生成数据存储请求,所述数据存储请求包括所需存储空间和所需存储速度;Generating a data storage request, the data storage request including the required storage space and the required storage speed;
    将所述数据存储请求发送给控制端,所述数据存储请求用于请求所述控制端根据所述所需存储空间和所需存储速度分配目标存储空间;Sending the data storage request to the control terminal, where the data storage request is used to request the control terminal to allocate a target storage space according to the required storage space and the required storage speed;
    生成数据释放请求,所述数据释放请求包括所述目标存储空间;Generating a data release request, where the data release request includes the target storage space;
    将所述数据释放请求发送给所述控制端,所述数据释放请求用于请求所述控制端释放所述目标存储空间。The data release request is sent to the control terminal, and the data release request is used to request the control terminal to release the target storage space.
  8. 一种数据存储装置,其特征在于,包括:A data storage device is characterized in that it comprises:
    存储接收模块,用于接收数据存储请求,所述数据存储请求包括所需存储空间和所需存储速度;The storage receiving module is configured to receive a data storage request, where the data storage request includes the required storage space and the required storage speed;
    第一分配模块,用于在所述所需存储速度大于阈值,且内部存储空间中存在与所述所需存储空间对应的连续空间的情况下,在所述内部存储空间中为所述数据存储请求分配对应的第一存储空间,并在第一分配表格信息中记录所述第一存储空间已被占用。The first allocation module is configured to store the data in the internal storage space when the required storage speed is greater than a threshold and there is a continuous space corresponding to the required storage space in the internal storage space Request to allocate the corresponding first storage space, and record in the first allocation table information that the first storage space is occupied.
  9. 一种数据存储装置,其特征在于,包括:A data storage device is characterized in that it comprises:
    第一生成模块,用于生成数据存储请求,所述数据存储请求包括所需存储空间和所需存储速度;The first generation module is configured to generate a data storage request, where the data storage request includes the required storage space and the required storage speed;
    第一发送模块,用于将所述数据存储请求发送给控制端,所述数据存储请求用于请求所述控制端根据所述所需存储空间和所需存储速度分配目标存储空间;The first sending module is configured to send the data storage request to the control terminal, and the data storage request is used to request the control terminal to allocate a target storage space according to the required storage space and the required storage speed;
    第二生成模块,用于生成数据释放请求,所述数据释放请求包括所述目标存储空间;A second generation module, configured to generate a data release request, where the data release request includes the target storage space;
    第二发送模块,用于将所述数据释放请求发送给所述控制端,所述数据释放请求用于请求所述控制端释放所述目标存储空间。The second sending module is configured to send the data release request to the control terminal, and the data release request is used to request the control terminal to release the target storage space.
  10. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至7任一项所述的方法。A terminal device, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program as claimed in claims 1 to 7. The method of any one.
PCT/CN2020/124093 2019-12-30 2020-10-27 Data storage method and apparatus, and terminal device WO2021135574A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911423231.2A CN111177025B (en) 2019-12-30 2019-12-30 Data storage method and device and terminal equipment
CN201911423231.2 2019-12-30

Publications (1)

Publication Number Publication Date
WO2021135574A1 true WO2021135574A1 (en) 2021-07-08

Family

ID=70650720

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/124093 WO2021135574A1 (en) 2019-12-30 2020-10-27 Data storage method and apparatus, and terminal device

Country Status (2)

Country Link
CN (1) CN111177025B (en)
WO (1) WO2021135574A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111177025B (en) * 2019-12-30 2022-05-17 深圳云天励飞技术股份有限公司 Data storage method and device and terminal equipment
CN111913657B (en) * 2020-07-10 2023-06-09 长沙景嘉微电子股份有限公司 Block data read-write method, device, system and storage medium
CN111782561B (en) * 2020-09-07 2020-12-04 新华三半导体技术有限公司 SRAM storage space allocation method, device and chip
CN112527205A (en) * 2020-12-16 2021-03-19 江苏国科微电子有限公司 Data security protection method, device, equipment and medium
CN112817543B (en) * 2021-02-24 2023-06-02 浙江大华技术股份有限公司 Data storage method, system, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1289121A (en) * 1999-09-16 2001-03-28 三星电子株式会社 Method and apparatus for recording and reproducing multichannel data
CN106547625A (en) * 2016-11-04 2017-03-29 深圳市证通电子股份有限公司 The memory allocation method and device of financial terminal
CN110083307A (en) * 2019-03-29 2019-08-02 华为技术有限公司 Date storage method, memory and server
WO2019217030A1 (en) * 2018-05-07 2019-11-14 Apple Inc. Techniques for managing memory allocation within a storage device to improve operation of a camera application
CN111177025A (en) * 2019-12-30 2020-05-19 深圳云天励飞技术有限公司 Data storage method and device and terminal equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1892720B1 (en) * 2006-08-24 2011-07-27 STMicroelectronics Srl A non-volatile, electrically-programmable memory with a plurality of storage densities and data transfer speeds
CN103092534B (en) * 2013-02-04 2016-01-27 中国科学院微电子研究所 A kind of dispatching method of internal storage structure and device
KR102164617B1 (en) * 2014-03-24 2020-10-12 삼성전자주식회사 Method for operating a data storage device and method for operating a system including the same
CN104239225B (en) * 2014-09-04 2018-02-06 浪潮(北京)电子信息产业有限公司 A kind of method and device for managing isomery mixing internal memory
CN105161135A (en) * 2015-07-23 2015-12-16 柳州易旺科技有限公司 Electronic product test information storage method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1289121A (en) * 1999-09-16 2001-03-28 三星电子株式会社 Method and apparatus for recording and reproducing multichannel data
CN106547625A (en) * 2016-11-04 2017-03-29 深圳市证通电子股份有限公司 The memory allocation method and device of financial terminal
WO2019217030A1 (en) * 2018-05-07 2019-11-14 Apple Inc. Techniques for managing memory allocation within a storage device to improve operation of a camera application
CN110083307A (en) * 2019-03-29 2019-08-02 华为技术有限公司 Date storage method, memory and server
CN111177025A (en) * 2019-12-30 2020-05-19 深圳云天励飞技术有限公司 Data storage method and device and terminal equipment

Also Published As

Publication number Publication date
CN111177025B (en) 2022-05-17
CN111177025A (en) 2020-05-19

Similar Documents

Publication Publication Date Title
WO2021135574A1 (en) Data storage method and apparatus, and terminal device
EP2975528A1 (en) Electronic device and method for managing memory of electronic device
EP3404538B1 (en) Data processing method, and data processing apparatus
CN106776036A (en) A kind of resource allocation methods and device
WO2020119029A1 (en) Distributed task scheduling method and system, and storage medium
CN104102693A (en) Object processing method and device
CN109213596B (en) Method and equipment for allocating terminal memory
WO2021098823A1 (en) Memory isolation apparatus, memory isolation method, and related device
JP2011243142A (en) Communication control device, data communication method and program
CN113032293A (en) Cache manager and control component
AU2019256257A1 (en) Processor core scheduling method and apparatus, terminal, and storage medium
WO2018188278A1 (en) Memory resource allocation method and terminal device
CN115964319A (en) Data processing method for remote direct memory access and related product
WO2012109961A1 (en) Method and device for allocating browser process
WO2023115852A1 (en) Pcie-based communication method and apparatus, and computer device and readable storage medium
WO2020088681A1 (en) Management method for model files and terminal device
CN109144723B (en) Method and terminal for allocating storage space
WO2019128571A1 (en) Resource management method and device, mobile terminal, as well as computer readable storage medium
CN103678573A (en) Method and system for achieving cache acceleration
CN116774933A (en) Virtualization processing method of storage device, bridging device, system and medium
CN114218560A (en) Resource access method, device, electronic equipment and storage medium
CN105074677B (en) The method and system of the method stored data in for accelerator in buffer
WO2020052392A1 (en) Game platform capability invocation method and related product
WO2023030178A1 (en) Communication method based on user-mode protocol stack, and corresponding apparatus
WO2020052354A1 (en) Game loading method and related products

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20909835

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 21.11.2022)

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 21.11.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20909835

Country of ref document: EP

Kind code of ref document: A1