CN115114042A - Storage data access method and device, electronic equipment and storage medium - Google Patents

Storage data access method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115114042A
CN115114042A CN202110308805.2A CN202110308805A CN115114042A CN 115114042 A CN115114042 A CN 115114042A CN 202110308805 A CN202110308805 A CN 202110308805A CN 115114042 A CN115114042 A CN 115114042A
Authority
CN
China
Prior art keywords
data
storage space
target
core
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110308805.2A
Other languages
Chinese (zh)
Inventor
吴臻志
丁瑞强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Lynxi Technology Co Ltd
Original Assignee
Beijing Lynxi Technology Co Ltd
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 Beijing Lynxi Technology Co Ltd filed Critical Beijing Lynxi Technology Co Ltd
Priority to CN202110308805.2A priority Critical patent/CN115114042A/en
Priority to PCT/CN2022/079235 priority patent/WO2022199357A1/en
Publication of CN115114042A publication Critical patent/CN115114042A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/173Interprocessor communication using an interconnection network, e.g. matrix, shuffle, pyramid, star, snowflake
    • G06F15/17306Intercommunication techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • 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)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Human Computer Interaction (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a storage data access method, a storage data access device, electronic equipment and a storage medium, and belongs to the technical field of computers. The storage data access method is applied to a first functional core in a many-core system, the many-core system comprises a plurality of functional cores, and the method comprises the following steps: receiving a first write-back request, wherein the first write-back request carries a first target global address of data to be written back; determining a target storage space pointed to by the first target global address; when the target storage space is in an unlocked state, setting the target storage space to be in a locked state until the data to be written back is successfully written back; wherein the target storage space is located in the first functional core, and in the locked state, access requests other than the first writeback request to the target storage space are denied. The method and the device can improve the operating efficiency of the many-core system.

Description

存储数据访问方法、装置、电子设备和存储介质Storage data access method, device, electronic device and storage medium

技术领域technical field

本申请属于计算机技术领域,具体涉及一种存储数据访问方法、装置、电子设备和存储介质。The present application belongs to the field of computer technology, and specifically relates to a method, apparatus, electronic device and storage medium for accessing stored data.

背景技术Background technique

众核系统中具有多个功能核。在相关技术中,在众核系统中的多个功能核需要访问同一存储数据的情况下,存在数据延迟的问题,从而使众核系统的运行效率低。Many-core systems have multiple functional cores. In the related art, when multiple functional cores in a many-core system need to access the same stored data, there is a problem of data delay, so that the operation efficiency of the many-core system is low.

发明内容SUMMARY OF THE INVENTION

本申请实施例的目的是提供一种存储数据访问方法、装置、电子设备和存储介质,能够解决相关技术中的存储数据访问方法存在的数据延迟而造成众核系统的运行效率低的问题。The purpose of the embodiments of the present application is to provide a storage data access method, apparatus, electronic device and storage medium, which can solve the problem of low operation efficiency of many-core systems caused by data delay in the storage data access method in the related art.

为了解决上述技术问题,本申请是这样实现的:In order to solve the above technical problems, this application is implemented as follows:

第一方面,本申请实施例提供了一种存储数据访问方法,应用于众核系统中的第一功能核,该方法包括:In a first aspect, an embodiment of the present application provides a method for accessing stored data, which is applied to a first functional core in a many-core system, and the method includes:

接收第一写回请求,其中,所述第一写回请求携带有待写回数据的第一目标全局地址;receiving a first write-back request, wherein the first write-back request carries the first target global address of the data to be written back;

确定所述第一目标全局地址指向的目标存储空间;determining the target storage space pointed to by the first target global address;

在所述目标存储空间处于未锁定状态时,将所述目标存储空间设置为锁定状态,直至所述待写回数据成功写回;When the target storage space is in an unlocked state, set the target storage space to a locked state until the data to be written back is successfully written back;

其中,所述目标存储空间位于所述第一功能核内,在所述锁定状态,拒绝对所述目标存储空间的除所述第一写回请求以外的访问请求。The target storage space is located in the first functional core, and in the locked state, access requests to the target storage space other than the first write-back request are rejected.

第二方面,本申请实施例提供了一种存储数据访问装置,应用于众核系统中的第一功能核,所述装置包括:In a second aspect, an embodiment of the present application provides a storage data access device, which is applied to a first functional core in a many-core system, and the device includes:

第一接收模块,用于接收第一写回请求,其中,所述第一写回请求携带有待写回数据的第一目标全局地址;a first receiving module, configured to receive a first write-back request, wherein the first write-back request carries the first target global address of the data to be written back;

第一确定模块,用于确定所述第一目标全局地址指向的目标存储空间;a first determining module, configured to determine the target storage space pointed to by the first target global address;

设置模块,用于在所述目标存储空间处于未锁定状态时,将所述目标存储空间设置为锁定状态,直至所述待写回数据成功写回;a setting module, configured to set the target storage space to a locked state when the target storage space is in an unlocked state, until the data to be written back is successfully written back;

其中,所述目标存储空间位于所述第一功能核内,在所述锁定状态,拒绝对所述目标存储空间的除所述第一写回请求以外的访问请求。The target storage space is located in the first functional core, and in the locked state, access requests to the target storage space other than the first write-back request are rejected.

第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的方法的步骤。In a third aspect, embodiments of the present application provide an electronic device, the electronic device includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor, the program or instruction being The processor implements the steps of the method according to the first aspect when executed.

第四方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法的步骤。In a fourth aspect, an embodiment of the present application provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, the steps of the method according to the first aspect are implemented .

第五方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法。In a fifth aspect, an embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction, and implement the first aspect the method described.

在本申请实施例中,第一功能核接收第一写回请求,其中,所述第一写回请求携带有待写回数据的第一目标全局地址;确定所述第一目标全局地址指向的目标存储空间;在所述目标存储空间处于未锁定状态时,将所述目标存储空间设置为锁定状态,直至所述待写回数据成功写回;其中,所述目标存储空间位于所述第一功能核内,在所述锁定状态,拒绝对所述目标存储空间的除所述第一写回请求以外的访问请求。这样,可以使第一功能核内的私有存储空间,能够作为共享存储空间,以被第二功能核访问,并写入数据,进而可以将不同的共享数据分散存储在不同功能核的私有存储空间内,从而避免了在全局共享存储空间内存储大量的共享数据,而造成的多个功能核分别访问全局共享存储空间时的等待时间长且等待时间不确定的问题,提升了所述众核系统的运行效率。In this embodiment of the present application, the first functional core receives a first write-back request, wherein the first write-back request carries a first target global address of data to be written back; and the target pointed to by the first target global address is determined storage space; when the target storage space is in an unlocked state, set the target storage space to a locked state until the data to be written back is successfully written back; wherein, the target storage space is located in the first function In the core, in the locked state, access requests to the target storage space other than the first writeback request are denied. In this way, the private storage space in the first functional core can be used as a shared storage space to be accessed by the second functional core and write data, and then different shared data can be scattered and stored in the private storage space of different functional cores In this way, the problem of long waiting time and uncertain waiting time when multiple functional cores access the global shared storage space caused by storing a large amount of shared data in the global shared storage space is avoided, which improves the many-core system. operating efficiency.

附图说明Description of drawings

图1是本申请实施例提供的一种存储数据访问方法的流程图;1 is a flowchart of a method for accessing stored data provided by an embodiment of the present application;

图2是能够应用本申请实施例提供的一种存储数据访问方法的远程访问写回处理单元的数据交互示意图;2 is a schematic diagram of data interaction of a remote access write-back processing unit capable of applying a method for accessing stored data provided by an embodiment of the present application;

图3是本申请实施例提供的一种存储数据访问方法中第一功能核和第二功能核之间的数据交互示意图;3 is a schematic diagram of data interaction between a first functional core and a second functional core in a method for accessing stored data provided by an embodiment of the present application;

图4是本申请实施例提供的一种存储数据访问方法中第一功能核内的数据交互示意图;4 is a schematic diagram of data interaction in a first functional core in a method for accessing stored data provided by an embodiment of the present application;

图5是能够应用本申请实施例提供的一种存储数据访问方法的双模内存接口的数据交互示意图;5 is a schematic diagram of data interaction of a dual-mode memory interface to which a storage data access method provided by an embodiment of the present application can be applied;

图6是本申请实施例提供的一种存储数据访问装置的结构图;6 is a structural diagram of a storage data access device provided by an embodiment of the present application;

图7是本申请实施例提供的一种电子设备的结构图。FIG. 7 is a structural diagram of an electronic device provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second" and the like in the description and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in sequences other than those illustrated or described herein, and distinguish between "first", "second", etc. The objects are usually of one type, and the number of objects is not limited. For example, the first object may be one or more than one. In addition, "and/or" in the description and claims indicates at least one of the connected objects, and the character "/" generally indicates that the associated objects are in an "or" relationship.

有众核系统中可独立调度拥有完整计算能力的最小单元称为功能核(简称“核”),且每一个功能核具有各自的存储计算资源,在同一众核系统中包括多个功能核,且各个功能核之间可能需要基于共享数据进行计算。在相关技术中,可以采用以下两种方式实现多个功能核获取相同的共享数据:In a many-core system, the smallest unit with complete computing power that can be independently scheduled is called a functional core (referred to as "core"), and each functional core has its own storage and computing resources. Multiple functional cores are included in the same many-core system. And each functional core may need to perform calculations based on shared data. In the related art, the following two ways can be used to realize that multiple functional cores obtain the same shared data:

方式一,设置全局共享存储空间,该全局共享存储空间设置于功能核外,且可以设置在功能核所在的芯片外,在应用中,当功能核需要从该全局共享存储空间内获取目标数据时,通过共享的内存总线向全局共享存储空间发送读取请求,并通过共享的内存总线传输目标数据,该过程中,若有其他功能核也需要访问该全局共享存储空间,则需要等待本功能核成功获取上述目标数据之后,才能够对其他功能核的读取请求进行响应。The first method is to set a global shared storage space. The global shared storage space is set outside the functional core, and can be set outside the chip where the functional core is located. In applications, when the functional core needs to obtain target data from the global shared storage space , send a read request to the global shared storage space through the shared memory bus, and transmit the target data through the shared memory bus. During this process, if other functional cores also need to access the global shared storage space, they need to wait for this functional core. After successfully acquiring the above target data, it can respond to the read requests of other functional cores.

同理,在多个功能核需要对全局共享存储空间内的数据新型更新时,也需要通过共享的内存总线向全局共享存储空间发送写回请求,并通过共享的内存总线传输待更新的数据,这个过程中,在同一时间,全局共享存储空间仅能够响应一个功能核的写回请求,其他功能核同样需要等待。Similarly, when multiple functional cores need to update the data in the global shared storage space, they also need to send a write-back request to the global shared storage space through the shared memory bus, and transmit the data to be updated through the shared memory bus. In this process, at the same time, the global shared storage space can only respond to the write-back request of one functional core, and other functional cores also need to wait.

由上可知,在多个功能核同时访问全局共享存储空间的应用场景下,需要通过竞争仲裁确定一个核心获得使用权,以使获得使用权的一个核心通过共享的内存总线从全局共享存储空间进获取存储数据,其他没有获得使用权的核心将需要继续等待,这样,造成了核心对全局共享存储空间进行访问时,需要进行较长时间的。另外,数据需要通过共享的内存总线在功能核与全局共享存储空间之间进行传输,其数据延迟时间不固定,甚至不可预测,从而容易造成该共享的内存总线拥塞,显著的降低了众核系统运行效率。It can be seen from the above that in the application scenario where multiple functional cores access the global shared storage space at the same time, it is necessary to determine a core to obtain the right to use through competition arbitration, so that a core that has obtained the right to use the global shared storage space through the shared memory bus. To obtain storage data, other cores that have not obtained the right to use will need to continue to wait, so that it takes a long time for the core to access the global shared storage space. In addition, data needs to be transmitted between the functional core and the global shared storage space through the shared memory bus, and the data delay time is not fixed or even unpredictable, which easily causes congestion of the shared memory bus and significantly reduces the many-core system. operation efficiency.

方式二,将共享数据分别复制到每一个需要使用该共享数据的功能核的私有存储空间内,由于私有存储空间仅供本功能核使用,外部功能核不能够访问其他功能核的私有空间,在实施中,当需要更新共享数据时,需要将待更新的共享数据分别写入至存储有该数据的各个私有存储空间,即多个功能核分别对本地私有存储执行写回操作。Method 2: Copy the shared data into the private storage space of each functional core that needs to use the shared data. Since the private storage space is only used by this functional core, external functional cores cannot access the private space of other functional cores. In implementation, when the shared data needs to be updated, the shared data to be updated needs to be written to each private storage space where the data is stored, that is, multiple functional cores respectively perform write-back operations to the local private storage.

由上可知,本实施方式下,当运行具有共享数据的算法(如大型神经网络)时,需要对共享数据分别复制到每个功能核的私有内存中,并分别进行更新,十分浪费资源。在大型数组或大型共享数据的应用场景下,私有内存无法满足存储和运行效率的要求,从而限制了众核系统的应用范围。As can be seen from the above, in this embodiment, when running an algorithm with shared data (such as a large neural network), the shared data needs to be copied to the private memory of each functional core and updated respectively, which is a waste of resources. In the application scenarios of large arrays or large shared data, private memory cannot meet the requirements of storage and operation efficiency, thus limiting the application scope of many-core systems.

为了解决上述技术问题,本申请实施例通过将全局地址与对应的私有地址进行转换,以使外部功能核能够通过全局地址访问其他功能核的私有存储空间,并对该私有存储空间进行数据写回,以更新该私有存储空间中存储的数据。这样,一方面,能够避免将共享数据复制到每个核的私有内存中,以减少资源浪费并提升众核系统的应用范围;另一方面,可以不在功能核外增设全局共享存储空间,以提升众核系统运行效率。In order to solve the above technical problems, the embodiment of the present application converts the global address and the corresponding private address, so that the external functional core can access the private storage space of other functional cores through the global address, and write data back to the private storage space. , to update the data stored in this private storage space. In this way, on the one hand, it can avoid copying the shared data into the private memory of each core, so as to reduce the waste of resources and improve the application scope of the many-core system; Many-core system operating efficiency.

下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的存储数据访问方法、存储数据访问装置、电子设备以及可读存储介质进行详细地说明。The storage data access method, storage data access device, electronic device, and readable storage medium provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.

请参阅图1,是本申请实施例提供的一种存储数据访问方法的流程图,该存储数据访问方法能够应用于众核系统中的第一功能核,如图1所示,存储数据访问方法可以包括以下步骤:Please refer to FIG. 1 , which is a flowchart of a method for accessing stored data provided by an embodiment of the present application. The method for accessing stored data can be applied to the first functional core in a many-core system. As shown in FIG. 1 , the method for accessing stored data The following steps can be included:

步骤101、接收第一写回请求,其中,所述第一写回请求携带有待写回数据的第一目标全局地址。Step 101: Receive a first write-back request, wherein the first write-back request carries a first target global address of data to be written back.

步骤102、确定所述第一目标全局地址指向的目标存储空间。Step 102: Determine the target storage space pointed to by the first target global address.

步骤103、在所述目标存储空间处于未锁定状态时,将所述目标存储空间设置为锁定状态,直至所述待写回数据成功写回;其中,所述目标存储空间位于所述第一功能核内,在所述锁定状态,拒绝对所述目标存储空间的除所述第一写回请求以外的访问请求。Step 103: When the target storage space is in an unlocked state, set the target storage space to a locked state until the data to be written back is successfully written back; wherein, the target storage space is located in the first function. In the core, in the locked state, access requests to the target storage space other than the first writeback request are denied.

在实施中,上述功能核又可以称之为“核心”或者“核”,该功能核为,所述众核系统中可独立调度,且拥有完整计算能力的最小单元,且每一个功能核具有各自的存储计算资源,且每一个功能核中的私有存储空间分别具有相同的私有地址,例如:第一功能核的私有存储空间为N个,且第一功能核中的N个存储空间标识分别为0~N-1,第二功能核的私有存储空间也为N个,且第二功能核中N个存储空间标识也分别为0~N-1。In implementation, the above-mentioned functional cores may also be referred to as "cores" or "cores". The functional cores are the smallest units in the many-core system that can be independently scheduled and have complete computing capabilities, and each functional core has respective storage computing resources, and the private storage spaces in each functional core have the same private address, for example: the number of private storage spaces of the first functional core is N, and the N storage space identifiers in the first functional core are respectively is 0 to N-1, the number of private storage spaces of the second functional core is also N, and the identifiers of the N storage spaces in the second functional core are also respectively 0 to N-1.

上述全局地址在所述众核系统中唯一,其能够指向所述众核系统中位于目标功能核内的目标私有存储空间,例如:全局地址为第一功能核的核标识与所述第一功能核中的目标存储空间的存储空间标识的结合。The above-mentioned global address is unique in the many-core system, and it can point to the target private storage space located in the target functional core in the many-core system, for example: the global address is the core identifier of the first functional core and the first functional core. A combination of storage space identifiers for the target storage space in the core.

在实际应用中,一个功能核可能包括多个存储空间,这样,该功能核中的多个存储空间可以处于不同的状态,例如:部分处于锁定状态,另一部分处于未锁定状态,这样,处于未锁定状态下的这一部分存储空间仍然可以被访问。In practical applications, a functional core may include multiple storage spaces, so that the multiple storage spaces in the functional core can be in different states, for example, part of the storage space is in a locked state, and another part is in an unlocked state. This part of the storage space in the locked state can still be accessed.

作为一种可选的实施方式,所述第一写回请求包括以下至少一种:As an optional implementation manner, the first writeback request includes at least one of the following:

所述第一功能核的第一数据通路发送的写回请求;a write-back request sent by the first data path of the first functional core;

第二功能核发送的写回请求;A writeback request sent by the second functional core;

其中,所述第二功能核为所述众核系统中不同于所述第一功能核的功能核。Wherein, the second functional core is a functional core different from the first functional core in the many-core system.

上述第二功能核可以理解为所述众核系统中除了所述第一功能核以外的任一功能核,即所述第一功能核的外部功能核,该第二功能核的数量可以是一个也可以是多个。The above-mentioned second functional core can be understood as any functional core other than the first functional core in the many-core system, that is, an external functional core of the first functional core, and the number of the second functional core can be one Can also be more than one.

上述所述第一功能核的第一数据通路发送的写回请求,可以理解为:第一功能核采用全局地址对存储于第一功能核内的数据进行更新。The write-back request sent by the first data path of the first functional core can be understood as: the first functional core uses the global address to update the data stored in the first functional core.

需要说明的是,在实际应用中,第一功能核还可以直接采用私有地址对存储于第一功能核内的数据进行私有访问,以更新第一功能核内存储于该私有地址的数据,在此不作具体限定。It should be noted that, in practical applications, the first functional core can also directly use the private address to privately access the data stored in the first functional core to update the data stored in the private address in the first functional core. This is not specifically limited.

另外,上述第二功能核发送的写回请求,可以理解为:外部功能核采用全局地址对存储于第一功能核内的数据进行全局访问,以更新存储于第一功能核内与该全局地址对应的私有地址的数据。In addition, the write-back request sent by the second functional core can be understood as: the external functional core uses the global address to globally access the data stored in the first functional core, so as to update the data stored in the first functional core and the global address The data of the corresponding private address.

在实施中,第一功能核内的同一存储空间在同一时间可以仅对全局访问和私有访问中的一项进行响应,例如:可以通过模式切换,以目标切换存储空间处于第一工作模式(其又可以称之为“全局模式”)和/或处于第二工作模式(其又可以称之为“私有模式”)。其中,在所述第一工作模式下,将接收到的访问请求中的全局地址转化为私有地址,以基于所述私有地址访问所述目标存储空间中的数据(即此工作模式下仅响应对目标存储空间的全局访问,对于私有访问则可以拒绝响应);在所述第二工作模式下,基于收到的访问请求中的私有地址访问所述目标存储空间中的数据(即此工作模式下仅响应对目标存储空间的私有访问,对于全局访问则可以拒绝响应)。In implementation, the same storage space in the first functional core can only respond to one of global access and private access at the same time, for example, the storage space can be switched to be in the first working mode (which Also referred to as "global mode") and/or in a second working mode (which may also be referred to as "private mode"). Wherein, in the first working mode, the global address in the received access request is converted into a private address, so as to access the data in the target storage space based on the private address (that is, in this working mode, only responding to The global access to the target storage space, and the response can be refused for private access); in the second working mode, the data in the target storage space is accessed based on the private address in the received access request (that is, in this working mode Respond only to private access to the target storage space, and can deny the response for global access).

另外,第一功能核的私有存储空间(即内存片)可以包括一个或者多个,其中,在所述第一功能核的私有存储空间(即内存片)有多个的情况下,可以是一部分私有存储空间工作于私有模式下,另一部分工作在全局模式下,其中,在所述私有模式下的私有存储空间仅供第一功能核访问,在所述全局模式下的私有存储空间仅供第二功能核访问。In addition, the private storage space (that is, the memory slice) of the first functional core may include one or more, wherein, if there are multiple private storage spaces (that is, the memory slice) of the first functional core, it may be a part of the private storage space (that is, the memory slice). The private storage space works in the private mode, and the other part works in the global mode, wherein the private storage space in the private mode is only accessible by the first functional core, and the private storage space in the global mode is only accessible by the first functional core. Two functional core access.

上述将目标存储空间设置为锁定状态,直至所述待写回数据成功写回,具体可以是:将目标存储空间设置为锁定状态,以拒绝后续接收到的对该目标存储空间的访问,并且开始将所述待写回数据写入所述目标存储空间,当所述待写回数据完成写入所述目标存储空间时,解除所述目标存储空间的锁定状态,以使功能核能够从该目标存储空间获取到更新后的数据。The above-mentioned setting the target storage space to a locked state until the data to be written back is successfully written back can be specifically: setting the target storage space to a locked state to deny subsequent received accesses to the target storage space, and to start Write the data to be written back into the target storage space, and when the data to be written back has been written to the target storage space, release the locked state of the target storage space, so that the function core can access the target storage space from the The storage space obtains the updated data.

其中,拒绝后续接收到的对该目标存储空间的访问,可以是:本功能核以及第一功能核以外的外部功能核,对目标存储空间中与第一目标全局地址对应的内存区域的访问都回被驳回;或者,拒绝后续接收到的对该目标存储空间的访问,还可以是:在上锁期间,本功能核以及第一功能核以外的外部功能核,对目标存储空间中与第一目标全局地址对应的内存区域的访问,会被存入请求消息队列,等待写回操作完成后再处理该请求消息队列中的请求,即将访问请求推迟到所述目标存储空间的锁定状态解除时再执行。The refusal of subsequent received access to the target storage space may be: the function core and external function cores other than the first function core, access the memory area corresponding to the first target global address in the target storage space. Otherwise, the subsequent received access to the target storage space is rejected, and it can also be: during the lock-up period, the function core and the external function core other than the first function core, the target storage space and the first function core The access to the memory area corresponding to the target global address will be stored in the request message queue, and the request in the request message queue will be processed after the write-back operation is completed, that is, the access request will be postponed until the lock state of the target storage space is released. implement.

作为一种可选的实施方式,所述方法还包括:As an optional embodiment, the method further includes:

在所述目标存储空间处于锁定状态时,执行以下操作中的至少一项:When the target storage space is locked, perform at least one of the following operations:

拒绝所述第一写回请求;rejecting the first writeback request;

将所述第一写回请求加入消息队列,以在所述目标存储空间切换至未锁定状态时,响应所述第一写回请求。The first write-back request is added to a message queue to respond to the first write-back request when the target storage space is switched to an unlocked state.

其中,上述响应所述第一写回请求,即可以与步骤103具有相同含义,在此不再赘述。The above-mentioned response to the first write-back request may have the same meaning as step 103, which is not repeated here.

另外,上述目标存储空间处于锁定状态,可以理解为:有其他待写回数据正在写入目标存储空间,即目标存储空间内的数据正在更新中。In addition, the above-mentioned target storage space is in a locked state, which can be understood as: other data to be written back is being written into the target storage space, that is, the data in the target storage space is being updated.

本实施方式中,在目标存储空间内的数据正在更新的过程中,拒绝所述第一写回请求或等待目标存储空间切换至未锁定状态时,再对第一写回请求进行响应,可以避免目标存储空间同时对多个功能核的写回请求或读取请求进行响应,而造成的数据混乱的问题,能够提升所述存储数据访问方法的数据可靠性。In this implementation manner, when the data in the target storage space is being updated, rejecting the first write-back request or waiting for the target storage space to switch to the unlocked state, and then responding to the first write-back request, can avoid The problem of data confusion caused by the target storage space responding to write-back requests or read requests of multiple functional cores at the same time can improve the data reliability of the storage data access method.

作为一种可选的实施方式,所述将所述目标存储空间设置为锁定状态,直至所述待写回数据成功写回,包括:As an optional implementation manner, setting the target storage space to a locked state until the data to be written back is successfully written back includes:

将所述目标存储空间设置为锁定状态,并接收所述待写回数据;Setting the target storage space to a locked state, and receiving the data to be written back;

根据所述待写回数据对所述目标存储空间中的数据进行更新;updating the data in the target storage space according to the data to be written back;

在所述更新完成之后,解除所述目标存储空间的锁定状态。After the update is completed, the locked state of the target storage space is released.

作为一种可选的实施方式,所述确定所述第一目标全局地址指向的目标存储空间,包括:As an optional implementation manner, the determining of the target storage space pointed to by the first target global address includes:

根据全局地址与私有地址的映射关系,确定所述第一目标全局地址对应的第三私有地址;According to the mapping relationship between the global address and the private address, determine the third private address corresponding to the first target global address;

确定所述第一功能核内与所述第三私有地址对应的目标存储空间。A target storage space corresponding to the third private address in the first functional core is determined.

其中,上述第三私有地址指示第一功能核的私有内存中待写回数据的起始写入地址,以从该起始地址开始写回上述待写回数据。另外,上述将所述第三私有地址对应的目标存储空间设置为锁定状态可以理解为:将所述第三私有地址所在的内存片设置为锁定状态。Wherein, the above-mentioned third private address indicates a start write address of the data to be written back in the private memory of the first functional core, so that the above-mentioned data to be written back is written back from the start address. In addition, setting the target storage space corresponding to the third private address to the locked state can be understood as setting the memory slice where the third private address is located to the locked state.

本实施方式中,通过将全局地址转化为私有地址之后,利用私有地址访问第一功能核的私有内存,以更新该私有内存中的数据。其中,在将全局地址转化为私有地址后,以利用私有地址访问第一功能核的私有内存的方式,与现有技术中本功能核对其私有内存进行本地访问的过程相同,在此不再赘述;不同之处在于,本申请实施例中,为外部功能核通过全局地址对本功能核的私有内存进行全局访问。In this implementation manner, after converting the global address into a private address, the private memory of the first functional core is accessed by using the private address, so as to update the data in the private memory. Wherein, after converting the global address into a private address, using the private address to access the private memory of the first functional core is the same as the process of locally accessing the private memory of the functional core in the prior art, which will not be repeated here. The difference lies in that, in the embodiment of the present application, the external function core performs global access to the private memory of the function core through the global address.

需要说明的是,在实际应用中,可能存在多个写回操作,需要分别对每一个写回操作所针对的内存区域分别设置资源锁,以使该内存区域在完成数据更新之前分别处于锁定状态下。此时,可以设置上锁地址空间记录区,以在该上锁地址空间记录区中记录处于锁定状态下的内存区域。It should be noted that in practical applications, there may be multiple write-back operations, and it is necessary to set resource locks on the memory areas targeted by each write-back operation, so that the memory areas are locked before the data update is completed. Down. At this time, a locked address space recording area may be set to record the memory area in a locked state in the locked address space recording area.

例如:上述上锁地址空间记录区中的一条记录的格式可以是如下表1所示的格式:For example, the format of a record in the above-mentioned locked address space record area can be the format shown in Table 1 below:

表1Table 1

内存起始地址memory start address 内存长度memory length 请求核核号Request a verification number 已更新数量Quantity updated 其它信息Other Information

其中,上述内存起始地址可以表示待写回数据在所述目标存储空间内的起始写入地址,上述内存长度可以表示待写回数据的数据长度,上述请求核核号可以表示请求向目的核的目标存储空间写入上述待写回数据的功能核的标识,上述已更新数量可以表示上述待写回数据中已经完成写入至目标存储空间内的数据长度,上述其他信息可以用于添加附加信息等。Wherein, the above-mentioned memory start address may indicate the start address of the data to be written back in the target storage space, the above-mentioned memory length may indicate the data length of the data to be written back, and the above-mentioned request core number may indicate the request to the destination The target storage space of the core writes the identifier of the functional core of the data to be written back, the above-mentioned updated quantity can indicate the length of the data that has been written into the target storage space in the above-mentioned data to be written back, and the above-mentioned other information can be used to add Additional information, etc.

在实施中,上述上锁地址空间记录区可以位于第一功能核内。在第二功能核向第一目标全局地址指向的目标存储空间写入数据的过程中,待写回数据可以以数据包的形式分时发送至第一功能核,此数据包中的数据被成功写回到目标存储空间内后,上锁地址空间记录区中的待写回数据的已更新数量(以byte(即字节)为单位)会被更新。这样,在更新数量与待写回数据的数据长度一致时,确定待写回数据完成写入,此时可以解除该目标存储空间的锁定状态,并在上锁地址空间记录区中删除该目标存储空间的上锁记录。In an implementation, the above-mentioned locked address space recording area may be located in the first functional core. During the process of writing data by the second functional core to the target storage space pointed to by the first target global address, the data to be written back can be sent to the first functional core in a time-sharing manner in the form of a data packet, and the data in the data packet is successfully After writing back to the target storage space, the updated quantity (in bytes (ie, bytes) as a unit) of the data to be written back in the record area of the locked address space will be updated. In this way, when the number of updates is consistent with the data length of the data to be written back, it is determined that the data to be written back has been written, and at this time, the locked state of the target storage space can be released, and the target storage space can be deleted in the locked address space recording area. The lock record of the space.

需要说明的是,第一功能核中可能还包括未处于锁定状态下的内存区域,该未处于锁定状态下的内存区域能够被第一功能核或其他功能核访问。It should be noted that the first functional core may further include a memory area that is not in a locked state, and the memory area not in a locked state can be accessed by the first functional core or other functional cores.

进一步地,所述第一写回请求还携带有所述待写回数据的存储长度,所述根据所述待写回数据对所述目标存储空间中的数据进行更新,包括:Further, the first write-back request also carries the storage length of the data to be written back, and the updating of the data in the target storage space according to the data to be written back includes:

在将所述待写回数据写入所述目标存储空间的过程中,获取所述目标存储空间内已完成更新的数据长度;In the process of writing the data to be written back into the target storage space, obtain the length of the updated data in the target storage space;

在所述目标存储空间内已完成更新的数据长度与所述待写回数据的存储长度匹配时,确定所述更新完成。When the length of the updated data in the target storage space matches the storage length of the data to be written back, it is determined that the update is completed.

在实施中,所述第一目标全局地址可以指示待写回数据的起始写入地址,或者,将第一目标全局地址转化为对应的第一私有地址后,通过该第一私有地址表示待写回数据在目标存储空间内的起始写入地址。此时,可以根据待写回数据的数据长度与第一私有地址计算得到该待写回数据的终止地址,并实时的获取目标存储空间内正在被写入数据的写入地址,在该实施方式下,所述目标存储空间中完成更新的数据长度与所述待写回数据的存储长度匹配,可以理解为:当该写入地址与待写回数据的终止地址一致时,可以确定该待写回数据完成写回,即确定所述更新完成。In implementation, the first target global address may indicate the starting write address of the data to be written back, or, after the first target global address is converted into a corresponding first private address, the first private address indicates the data to be written back. Write back the starting write address of the data in the target memory space. At this time, the termination address of the data to be written back can be calculated according to the data length of the data to be written back and the first private address, and the write address of the data being written in the target storage space can be obtained in real time. Then, the length of the updated data in the target storage space matches the storage length of the data to be written back, which can be understood as: when the write address is consistent with the termination address of the data to be written back, it can be determined that the write address is to be written back. When the write-back of the data is completed, it is determined that the update is completed.

当然,在实际使用中,还可以通过计数器实时的获取目标存储空间内已经被写入数据的数据量,在该实施方式下,所述目标存储空间中完成更新的数据长度与所述待写回数据的存储长度匹配,可以理解为:在上述已经被写入数据的数据量与待写回数据的数据量相同时,可以确定该待写回数据完成写回,即确定所述更新完成。Of course, in actual use, the amount of data that has been written in the target storage space can also be obtained in real time through the counter. The matching of the storage lengths of the data can be understood as: when the data volume of the written data is the same as the data volume of the data to be written back, it can be determined that the data to be written back has been written back, that is, it is determined that the update is completed.

本实施方式中,可以通过比对目标存储空间中完成更新的数据长度与所述待写回数据的存储长度是否匹配,以定所述更新是否完成,从而在完成更新时,能够尽快解除上述目标存储空间的锁定状态。In this embodiment, whether the update is completed can be determined by comparing whether the length of the updated data in the target storage space matches the storage length of the data to be written back, so that the above target can be released as soon as possible when the update is completed. The lock status of the storage space.

作为一种可选的实施方式,所述第一写回请求为所述众核系统中第二功能核发起的访问请求,所述方法还包括:As an optional implementation manner, the first writeback request is an access request initiated by a second functional core in the many-core system, and the method further includes:

向所述第二功能核发送通知信令,其中,所述通知信令用于通知所述第二功能核,所述待写回数据写回成功。Send notification signaling to the second functional core, where the notification signaling is used to notify the second functional core that the data to be written back is successfully written back.

在实际应用中,第二功能核在未接收到上述通知信令的情况下,该第二功能核可以通过重发写回请求等方式,避免待写回数据写入失败、写入时延过长或者写入请求被驳回等造成待写回数据未能及时完成写回的情况下,使该第二功能核误认为待写回数据已经完成写回,从而能够提升存储数据访问方法的可靠性。In practical applications, when the second functional core does not receive the above notification signaling, the second functional core can re-send the write-back request to avoid the failure to write the data to be written back and the excessive writing delay. If the data to be written back fails to be written back in time due to the long or the write request being rejected, the second function check will mistakenly believe that the data to be written back has been written back, thereby improving the reliability of the stored data access method. .

下面以能够应用本申请实施例提供的存储数据访问方法的远程访问写回处理单元为例,对本申请实施例提供的存储数据访问方法进行举例说明:The following takes the remote access write-back processing unit capable of applying the stored data access method provided by the embodiment of the present application as an example to illustrate the stored data access method provided by the embodiment of the present application:

如图2所示,第一功能核包括:路由模块21、信令缓冲区22、数据包缓冲区23、远程访问写回处理单元24以及内存区25,其中,远程访问写回处理单元24包括:上锁地址空间记录区241以及控制逻辑器242。As shown in FIG. 2 , the first functional core includes: a routing module 21 , a signaling buffer 22 , a data packet buffer 23 , a remote access writeback processing unit 24 and a memory area 25 , wherein the remote access writeback processing unit 24 includes : Lock the address space recording area 241 and the control logic 242 .

具体的,远程访问写回处理单元24分别通过信令缓冲区22和数据包缓冲区23与路由模块21连接,该路由模块21用于通过片上网络与其他功能核建立通信连接,远程访问写回处理单元24中的DMA与内存区25连接,远程访问写回处理单元24中的控制逻辑器242分别与上锁地址空间记录区241和内存区25连接。Specifically, the remote access write-back processing unit 24 is connected to the routing module 21 through the signaling buffer 22 and the data packet buffer 23 respectively. The DMA in the processing unit 24 is connected to the memory area 25 , and the control logic 242 in the remote access write-back processing unit 24 is connected to the locked address space recording area 241 and the memory area 25 respectively.

在具体实施中,控制逻辑器242用于控制上锁地址空间记录区241的上锁记录的查询、更新、增加以及删除等操作,另外,在控制逻辑器242接收到外部功能核的全局访问请求时,能够解析得到该全局访问请求的目的地址,并从上锁地址空间记录区241中查询到该目的地址对应的内存空间是否处于锁定状态,若是处于锁定状态,则驳回该条全局访问请求。In a specific implementation, the control logic 242 is used to control operations such as query, update, addition and deletion of lock records in the lock address space record area 241. In addition, the control logic 242 receives a global access request from an external function core. When the destination address of the global access request is obtained by analysis, and whether the memory space corresponding to the destination address is in a locked state is queried from the locked address space recording area 241, if it is in a locked state, the global access request is rejected.

在实施中,路由模块21通过片上网络接收外部功能核发送的写回请求信令,该写回请求信令通过信令缓冲区传输至控制逻辑器242,控制逻辑器242将该写回请求信令中携带的全局地址转换为私有地址,并根据该写回请求信令中携带的信息以及该私有地址对应的存储空间的使用情况等,判断是否驳回该写回请求信令,当判断为不驳回该写回请求信令的情况下,可以将该写回请求信令中携带的全局地址转化为私有地址,并将内存区25中与上述私有地址对应的内存空间设为锁定状态,然后允许将经路由模块21和数据包缓冲区23从片上网络上接收到的数据包写入至内存区25中与上述私有地址对应的存储空间内。In implementation, the routing module 21 receives the write-back request signaling sent by the external functional core through the on-chip network, and the write-back request signaling is transmitted to the control logic 242 through the signaling buffer, and the control logic 242 sends the write-back request signal. The global address carried in the command is converted into a private address, and according to the information carried in the write-back request signaling and the usage of the storage space corresponding to the private address, it is judged whether to reject the write-back request signaling. In the case of rejecting the write-back request signaling, the global address carried in the write-back request signaling can be converted into a private address, and the memory space corresponding to the above-mentioned private address in the memory area 25 is set to a locked state, and then allow The data packets received from the on-chip network via the routing module 21 and the data packet buffer 23 are written into the storage space corresponding to the above-mentioned private address in the memory area 25 .

需要说明的是,在实施中可以在数据包缓冲区23与内存区25之间设置存储器访问(Direct Memory Access,DMA)子单元,且该DMA子单元受控制逻辑器242的控制,以在控制逻辑器242基于上锁地址空间记录区241确定待访问数据的存储空间处于未锁定状态时,控制DMA子单元处于正常工作状态下,即允许功能核访问位于内存区25内且处于未锁定状态的存储空间;另外,在控制逻辑器242基于上锁地址空间记录区241确定待写回数据的存储空间处于锁定状态时,控制DMA子单元处于禁止访问工作状态下,即拒绝功能核访问位于内存区25内且处于锁定状态的存储空间。It should be noted that, in the implementation, a memory access (Direct Memory Access, DMA) subunit may be set between the data packet buffer 23 and the memory area 25, and the DMA subunit is controlled by the control logic 242 to control the When the logic unit 242 determines that the storage space of the data to be accessed is in an unlocked state based on the locked address space recording area 241, it controls the DMA subunit to be in a normal working state, that is, allows the functional core to access the memory area 25 and is in an unlocked state. Storage space; in addition, when the control logic 242 determines that the storage space of the data to be written back is in a locked state based on the locked address space recording area 241, the control DMA subunit is in a prohibited access working state, that is, the functional core is denied access to the memory area. 25 and locked storage space.

需要说明的是,图2所示实施例中的箭头方向表示请求功能核请求将待写回数据写入至第一功能核内的过程中,信令或者待写回数据的传输方向。It should be noted that the direction of the arrow in the embodiment shown in FIG. 2 indicates the transmission direction of signaling or the data to be written back in the process of requesting the functional core to write the data to be written back into the first functional core.

作为一种可选的实施方式,在所述接收第一写回请求之前,所述方法还包括:As an optional implementation manner, before the receiving the first writeback request, the method further includes:

接收第一读取请求,其中,所述第一读取请求携带有第二目标全局地址;receiving a first read request, wherein the first read request carries a second target global address;

在确定所述第二目标全局地址指示的目标存储空间位于所述第一功能核内,且所述目标存储空间未处于锁定状态时,根据全局地址与私有地址的映射关系,确定所述第二目标全局地址对应的第一私有地址,以及,传输所述目标存储空间内与所述第一私有地址对应的第一目标数据。When it is determined that the target storage space indicated by the second target global address is located in the first functional core and the target storage space is not in a locked state, the second target storage space is determined according to the mapping relationship between the global address and the private address. The first private address corresponding to the target global address, and the first target data corresponding to the first private address in the target storage space is transmitted.

在应用中,众核系统中的任意功能核能够基于全局地址与私有地址之间的转换,以从第一功能核的私有内存(包括上述目标存储空间)中获取数据,并根据这些数据进行计算,以得到计算结果后,可以根据计算结果对第一功能核的私有内存中的数据进行更新。In application, any functional core in the many-core system can obtain data from the private memory (including the above-mentioned target storage space) of the first functional core based on the conversion between the global address and the private address, and perform calculation according to the data , so that after the calculation result is obtained, the data in the private memory of the first functional core can be updated according to the calculation result.

换而言之,本实施方式中,众核系统中的任意功能核能够基于全局地址与私有地址之间的转换,以读取并更新第一功能核的私有内存上存储的数据,并且可以在第一功能核的私有内存处于锁定状态时,可以拒绝其他访问该私有内存的访问请求,以避免在第一功能核的私有内存中的数据被更新的过程中,传输更新之前或者未完成更新的数据,从而提升了数据可靠性。In other words, in this implementation manner, any functional core in the many-core system can read and update the data stored in the private memory of the first functional core based on the conversion between the global address and the private address, and can When the private memory of the first functional core is in a locked state, other access requests for accessing the private memory can be rejected, so as to avoid transmitting the data before the update or not completing the update during the process of updating the data in the private memory of the first functional core. data, thereby improving data reliability.

本申请实施例中,在第一功能核的私有内存中的数据进行更新的过程中,将第一功能核的私有内存设置为锁定状态,以避免该私有内存中的数据更新过程中,部分功能核从该私有内存中获取更新前或者未完全更新的数据,从而造成众核系统中的数据不统一的问题,因此,本申请实施例提供的存储数据访问方法,在提升众核系统的运行效率的同时,还能够提升众核系统的数据可靠性。In the embodiment of the present application, in the process of updating the data in the private memory of the first functional core, the private memory of the first functional core is set to a locked state, so as to avoid some functions of the private memory in the process of updating the data in the private memory. The core obtains the data before the update or not completely updated from the private memory, thereby causing the problem of inconsistent data in the many-core system. Therefore, the storage data access method provided by the embodiment of the present application improves the operation efficiency of the many-core system. At the same time, it can also improve the data reliability of the many-core system.

作为一种可选的实施方式,所述第一读取请求、所述第一目标数据、所述第一写回请求以及所述待写回数据通过片上网络或片上总线传输,所述众核系统中的任意两个功能核通过所述片上网络或片上总线连接。As an optional implementation manner, the first read request, the first target data, the first write back request, and the data to be written back are transmitted through an on-chip network or an on-chip bus, and the many-core Any two functional cores in the system are connected through the on-chip network or on-chip bus.

例如:如图3所示,请求核31(即第二功能核)与目的核32(即第一功能核)之间通过片上/片间网络33建立通信连接,其中,请求核31具体包括:第一私有内存311、第一双模内存接口312、第一路由313以及数据通路314,目的核32具体包括:第二私有内存321、第二双模内存接口322以及第二路由323。在请求核31需要读取目的核32的私有内存324中存储的目标数据时,请求核31中的数据通路314通过第二双模内存接口322和第一路由313向片上/片间网络33发送读取请求,该读取请求中携带有请求核31的核标识和请求读取数据的全局地址,目的核32通过第二路由323从片上/片间网络33接收该读取请求,第二双模内存接口322在识别到读取请求中的核标识与目的核32的核标识不一致时,将读取请求中的全局地址转换为私有地址,并将第二私有内存321中存储于所述私有地址的目的数据通过第二路由323传输至片上/片间网络33,以使请求核31通过第一路由313从片上/片间网络33获取该目标数据,从而实现了请求核31从目的核32的私有内存获取目标数据。For example, as shown in FIG. 3 , a communication connection is established between the requesting core 31 (ie the second functional core) and the destination core 32 (ie the first functional core) through the on-chip/inter-chip network 33, wherein the requesting core 31 specifically includes: The first private memory 311 , the first dual-mode memory interface 312 , the first route 313 and the data path 314 , and the destination core 32 specifically includes: the second private memory 321 , the second dual-mode memory interface 322 and the second route 323 . When the requesting core 31 needs to read the target data stored in the private memory 324 of the destination core 32, the data path 314 in the requesting core 31 sends the data to the on-chip/inter-chip network 33 through the second dual-mode memory interface 322 and the first route 313 The read request carries the core identifier of the requesting core 31 and the global address of the request to read the data, and the destination core 32 receives the read request from the on-chip/inter-chip network 33 through the second route 323. When recognizing that the core identifier in the read request is inconsistent with the core identifier of the destination core 32, the modulo memory interface 322 converts the global address in the read request into a private address, and stores the second private memory 321 in the private address. The destination data of the address is transmitted to the on-chip/inter-chip network 33 through the second route 323, so that the request core 31 obtains the target data from the on-chip/inter-chip network 33 through the first route 313, thereby realizing the request core 31 from the destination core 32. The private memory of the fetch target data.

需要说明的是,如图3所示实施例中的箭头方向表示上述请求核31从目的核32的私有内存324中获取目标数据的过程中,信令或者目标数据的传输方向。It should be noted that the direction of the arrow in the embodiment shown in FIG. 3 represents the signaling or the transmission direction of the target data in the process that the request core 31 obtains the target data from the private memory 324 of the destination core 32 .

本实施方式中,通过片上网络或者片上总线传输第一功能核之间的请求信令和数据包,能够避免在多个第二功能核同时访问第一功能核的私有内存时,能够减少等待时间。In this embodiment, the request signaling and data packets between the first functional cores are transmitted through the on-chip network or the on-chip bus, which can avoid waiting time when multiple second functional cores access the private memory of the first functional core at the same time. .

当然,在具体实施中,所述众核系统中的任意两个功能核之间还可以通过其他网络连接,例如:近距离通信网络等,在此不作具体限定。Of course, in specific implementation, any two functional cores in the many-core system may also be connected through other networks, such as a short-range communication network, etc., which are not specifically limited here.

另外,在一种可选的实施方式中,在所述第二功能核的数量为多个,即多个外部功能核分别访问所述第一功能核的私有存储空间的情况下,所述第一功能核还可以对多个第二功能核的读取请求逐个响应。In addition, in an optional implementation manner, when the number of the second functional cores is multiple, that is, when multiple external functional cores access the private storage space of the first functional core respectively, the first functional core A functional core may also respond to read requests of a plurality of second functional cores one by one.

另外,上述全局地址与私有地址的映射关系,可以是:私有地址与全局地址的映射表,在运行中,在所述映射表中查询全局地址对应的私有地址。当然,其还可以是预先存储私有地址与全局地址之间的转化关系,以在运行过程中,动态的将全局地址转化为对应的私有地址。In addition, the above-mentioned mapping relationship between the global address and the private address may be: a mapping table between the private address and the global address, and during operation, the private address corresponding to the global address is queried in the mapping table. Of course, the conversion relationship between the private address and the global address may also be pre-stored, so as to dynamically convert the global address into the corresponding private address during the running process.

当然,上述全局地址与所述私有地址的映射关系,还可以包括:根据全局地址与所述私有地址之间的转化关系确定的映射关系。Certainly, the above-mentioned mapping relationship between the global address and the private address may further include: a mapping relationship determined according to the conversion relationship between the global address and the private address.

作为一种可选的实施方式,所述全局地址与私有地址的映射关系,通过以下方式确定:As an optional implementation manner, the mapping relationship between the global address and the private address is determined in the following manner:

在所述众核系统包括S个芯片的情况下,基于每个全局地址指示对应的私有地址所在的目标功能核,以及所述目标功能核所在的目标芯片,以根据每个私有地址对应的全局地址,确定所述映射关系;In the case where the many-core system includes S chips, the target functional core where the corresponding private address is located and the target chip where the target functional core is located are indicated based on each global address, so that the global address corresponding to each private address is address, to determine the mapping relationship;

或者,or,

在所述众核系统包括1个芯片,且所述芯片包括呈J行P列排列的功能核阵列的情况下,基于每个全局地址指对应的私有地址所在的目标功能核,以及所述目标功能核在所述功能核整列中的位置,以根据每个私有地址对应的全局地址,确定所述映射关系。When the many-core system includes one chip, and the chip includes a functional core array arranged in J rows and P columns, each global address refers to the target functional core where the corresponding private address is located, and the target functional core. The position of the function core in the entire column of the function core is used to determine the mapping relationship according to the global address corresponding to each private address.

在一种可选的实施方式中,所述基于每个全局地址指示对应的私有地址所在的目标功能核,以及所述目标功能核所在的目标芯片,以根据每个私有地址对应的全局地址,确定所述映射关系,可以理解为:所述映射关系包括全局地址与私有地址之间的转化关系,且该转化关系是基于私有地址所在的目标功能核,以及所述目标功能核所在的目标芯片来实现与全局地址对应的。换而言之,其还可以理解为:全局地址中携带有对应的私有地址、该私有地址所在的功能核的标识,以及该功能核所在的芯片的标识。In an optional implementation manner, the target functional core where the corresponding private address is indicated based on each global address, and the target chip where the target functional core is located, so that according to the global address corresponding to each private address, Determining the mapping relationship can be understood as: the mapping relationship includes the conversion relationship between the global address and the private address, and the conversion relationship is based on the target function core where the private address is located, and the target chip where the target function core is located. to achieve the corresponding global address. In other words, it can also be understood as: the global address carries the corresponding private address, the identity of the functional core where the private address is located, and the identity of the chip where the functional core is located.

例如:在所述众核系统包括S个芯片的情况下,全局地址与私有地址之间的映射关系,采用以下公式确定:For example: when the many-core system includes S chips, the mapping relationship between the global address and the private address is determined by the following formula:

p=(qV+c)×N+kp=(qV+c)×N+k

其中,所述p表示全局地址,所述k表示私有地址,所述c表示所述k对应的功能核的标识,所述q表示所述c对应的功能核所在芯片的标识,所述N表示所述k对应的功能核中的私有地址的总数,所述V表示每一个芯片中的功能核的总数。Wherein, the p represents the global address, the k represents the private address, the c represents the identity of the functional core corresponding to the k, the q represents the identity of the chip where the functional core corresponding to the c is located, and the N represents The total number of private addresses in the functional cores corresponding to the k, and the V represents the total number of functional cores in each chip.

当然,在具体实施中,除了通过上述公式表达全局地址与私有地址之间的映射关系之外,还可以通过将私有地址、芯片标识以及功能核标识进行组合排列的方式,以共同组成全局地址的方式表达全局地址与私有地址之间的映射关系。Of course, in the specific implementation, in addition to expressing the mapping relationship between the global address and the private address through the above formula, the private address, the chip identification and the function core identification can also be combined and arranged to form the global address. way to express the mapping relationship between global addresses and private addresses.

在另一种可选的实施方式中,所述基于每个全局地址指对应的私有地址所在的目标功能核,以及所述目标功能核在所述功能核整列中的位置,以根据每个私有地址对应的全局地址,确定所述映射关系,可以理解为:全局地址中携带有对应的私有地址该私有地址所在的功能核的标识,以及该功能核在所述功能核阵列中的排列位置。In another optional implementation manner, the based on each global address refers to the target function core where the corresponding private address is located, and the position of the target function core in the entire column of The global address corresponding to the address, and determining the mapping relationship, can be understood as: the global address carries the identifier of the function core where the corresponding private address is located, and the arrangement position of the function core in the function core array.

例如:在所述众核系统包括1个芯片,且所述芯片包括呈J行P列排列的功能核阵列的情况下,全局地址与私有地址之间的映射关系,采用以下公式确定:For example: when the many-core system includes one chip, and the chip includes a functional core array arranged in J rows and P columns, the mapping relationship between the global address and the private address is determined by the following formula:

p=(Px+y)×N+kp=(Px+y)×N+k

其中,所述p表示全局地址,所述k表示私有地址,所述x表示所述k对应的功能核在所述功能核阵列中的行标识,所述y表示所述k对应的功能核在所述功能核阵列中的列标识,所述N表示所述k对应的功能核中的私有地址的总数。Wherein, the p represents the global address, the k represents the private address, the x represents the row identifier of the functional core corresponding to the k in the functional core array, and the y represents the functional core corresponding to the k in the The column identifier in the functional core array, and the N represents the total number of private addresses in the functional cores corresponding to the k.

当然,在具体实施中,除了通过上述公式表达全局地址与私有地址之间的映射关系之外,还可以通过将私有地址、芯片位置进行组合排列的方式,以共同组成全局地址的方式表达全局地址与私有地址之间的映射关系。Of course, in the specific implementation, in addition to expressing the mapping relationship between the global address and the private address through the above formula, the global address can also be expressed in a way of jointly forming the global address by arranging the private address and the chip location in combination. Mapping relationship with private addresses.

本实施方式中,通过芯片标识、功能核标识以及功能核位置等实现将预设地址与全局地址关联,从而在应用中能够根据芯片标识、功能核标识以及功能核位置等将全局地址与私有地址进行相互转化,从而简化了确定所述第二目标全局地址对应的第一私有地址的过程。In this embodiment, the preset address is associated with the global address through the chip ID, the functional core ID, and the functional core location, etc., so that the global address can be associated with the private address in the application according to the chip ID, the functional core ID, and the functional core location. The mutual conversion is performed, thereby simplifying the process of determining the first private address corresponding to the second target global address.

作为一种可选的实施方式,所述方法还包括:As an optional embodiment, the method further includes:

接收第一数据通路发送的第二读取请求,其中,所述第一数据通路位于所述第一功能核内,所述第二读取请求携带有第二私有地址,所述第二私有地址位于所述目标存储空间内;Receive a second read request sent by a first data path, wherein the first data path is located in the first functional core, the second read request carries a second private address, and the second private address is located in the target storage space;

在确定所述目标存储空间未处于锁定状态时,将所述目标存储空间内与所述第二私有地址对应的第二目标数据传输至所述第一数据通路。When it is determined that the target storage space is not in a locked state, second target data corresponding to the second private address in the target storage space is transmitted to the first data path.

本实施方式应用于:第一功能核从本地私有内存中读取数据的应用场景,此时,只要第二私有地址指示的目标存储空间未处于锁定状态,则第一功能核可以直接向本地私有内存发送私有地址,以访问其私有内存,而无需发送与该私有地址对应的全局地址,在实施中,第二读取请求中还可以携带第一功能核的标识,这样,目标存储空间能够基于该第一功能核的标识确定该第二读取请求为本地访问请求,从而对该第二私有地址进行识别,而不是将该第二私有地址误认为是全局地址。This embodiment is applicable to an application scenario in which the first functional core reads data from the local private memory. At this time, as long as the target storage space indicated by the second private address is not in a locked state, the first functional core can directly send data to the local private memory. The memory sends a private address to access its private memory without sending the global address corresponding to the private address. In implementation, the second read request may also carry the identifier of the first functional core, so that the target storage space can be based on The identification of the first functional core determines that the second read request is a local access request, so as to identify the second private address instead of mistakenly considering the second private address as a global address.

例如:如图4所示,第一功能核41中的计算模块可以通过数据通路411通过双模内存接口412向第一功能核的私有内存413发送读取请求,该读取请求中携带有目标数据的私有地址,以使该私有内存413将存储于该私有地址的目标数据通过双模内存接口412核数据通路411反馈至计算模块。For example, as shown in FIG. 4, the computing module in the first functional core 41 can send a read request to the private memory 413 of the first functional core through the dual-mode memory interface 412 through the data path 411, and the read request carries the target The private address of the data, so that the private memory 413 feeds back the target data stored in the private address to the computing module through the dual-mode memory interface 412 and the core data path 411 .

需要说明的是,如图4所示实施例中的箭头方向表示上述第一功能核41从本功能核的私有内存413中获取目标数据的过程中,信令或者目标数据的传输方向。It should be noted that the direction of the arrow in the embodiment shown in FIG. 4 indicates the direction of signaling or the transmission of the target data in the process that the first functional core 41 obtains the target data from the private memory 413 of the functional core.

需要说明的是,本实施方式中,第一功能核中的第一数据通路向第一功能核的目标存储空间发送携带有私有地址的第二读取请求,以从该目标存储空间内读取数据的实现过程与现有技术中功能核从本地私有内存读取数据的过程相同,在此不作具体阐述。It should be noted that, in this embodiment, the first data path in the first functional core sends a second read request carrying a private address to the target storage space of the first functional core, so as to read from the target storage space The realization process of the data is the same as the process of reading data from the local private memory by the functional core in the prior art, and will not be described in detail here.

需要说明的是,在实际应用中,第一功能核可以包括多个内存片,从而可能存在第一功能核中的部分内存片被本功能核访问,另一些内存片被外部功能核访问的情况。但是,同一内存片在同一时间仅能够对本地访问请求和全局访问请求(即第一读取请求)中的一种进行响应。It should be noted that, in practical applications, the first functional core may include multiple memory slices, so that some memory slices in the first functional core may be accessed by this functional core, and other memory slices may be accessed by external functional cores. . However, the same memory slice can only respond to one of the local access request and the global access request (ie, the first read request) at the same time.

作为一种可选的实施方式,所述目标存储空间的工作模式包括第一工作模式和第二工作模式;As an optional implementation manner, the working mode of the target storage space includes a first working mode and a second working mode;

其中,在所述第一工作模式下,拒绝对所述目标存储空间的第二读取请求,直至所述第一读取请求完成响应;在所述第二工作模式下,拒绝对所述目标存储空间的第一读取请求,直至所述第二读取请求完成响应;Wherein, in the first working mode, reject the second read request to the target storage space until the first read request completes a response; in the second working mode, reject the target storage space the first read request of the storage space until the second read request completes the response;

所述方法还包括以下至少一项:The method also includes at least one of the following:

根据控制指令,确定所述目标存储空间的工作模式;According to the control instruction, determine the working mode of the target storage space;

响应于所述第一读取请求,确定所述工作模式为所述第一工作模式;In response to the first read request, determining that the working mode is the first working mode;

响应于所述第二读取请求,确定所述工作模式为所述第二工作模式。In response to the second read request, it is determined that the operating mode is the second operating mode.

在一种实施方式中,上述根据控制指令,确定所述目标存储空间的工作模式,可以理解为:目标存储空间的工作模式是根据预设控制指令的指示而确定的,并不受接收到的访问请求的影响。In one embodiment, the above-mentioned determination of the working mode of the target storage space according to the control instruction can be understood as: the working mode of the target storage space is determined according to the instruction of the preset control instruction, and is not affected by the received Impact of Access Requests.

本实施方式下,可以通过预设控制指令调整目标存储空间的工作模式,以控制目标存储空间内的数据仅能够被本功能核访问还是可以被其他功能核访问。In this implementation manner, the working mode of the target storage space can be adjusted through a preset control instruction, so as to control whether the data in the target storage space can be accessed only by this functional core or by other functional cores.

情况一Case 1

在功能核的内存工作于全局模式(即第一工作模式)的情况下,该内存仅能够被外部的功能核进行全局访问,本功能核的访问将会被拒绝。在该全局模式下,接收到的读取请求中携带有全局地址,由全局地址映射表记录并负责转译全局地址到私有地址,并最终采用私有地址访问内存。When the memory of the functional core works in the global mode (ie, the first working mode), the memory can only be accessed globally by the external functional core, and the access of the functional core will be denied. In this global mode, the received read request carries the global address, which is recorded by the global address mapping table and is responsible for translating the global address to the private address, and finally uses the private address to access the memory.

需要说明的是,在上述全局模式下,所有功能核的内存组成一个大容量的逻辑内存,在进行全局访问时,无需指明访问的内存位于哪个芯片的哪个核,只需用全局地址即可访问。It should be noted that, in the above global mode, the memory of all functional cores forms a large-capacity logical memory. When performing global access, there is no need to specify which core of which chip the accessed memory is located, and only the global address can be used to access. .

情况二Case 2

在功能核的内存工作于私有模式(即上述第二工作模式)的情况下,该内存仅能够被本功能核进行本地访问,外部功能核的全局访问将会被拒绝。在该私有模式下,内存仅能够被本功能核访问,因此,访问的延时固定且可预测。In the case that the memory of the functional core works in the private mode (ie, the above-mentioned second working mode), the memory can only be accessed locally by the functional core, and the global access of the external functional core will be denied. In this private mode, the memory can only be accessed by the functional core, so the access latency is fixed and predictable.

在另一种实施方式中,上述响应于所述第一读取请求,确定所述工作模式为所述第一工作模式;响应于所述第二读取请求,确定所述工作模式为所述第二工作模式,可以理解为:根据接收到的访问请求是私有请求还是全局请求,来判断是工作在第一工作模式下还是工作在第二工作模式下。In another implementation manner, in response to the first read request, it is determined that the working mode is the first working mode; in response to the second read request, it is determined that the working mode is the The second working mode can be understood as: whether to work in the first working mode or the second working mode is determined according to whether the received access request is a private request or a global request.

具体的,拒绝对所述目标存储空间的第二读取请求,直至所述第一读取请求完成响应,可以理解为:在第一工作模式下,仅对目标存储空间的全局访问进行响应,且当全部的全局访问响应完成后,可以切换至第二工作模式,以在所述第二工作模式下,对目标存储空间的私有访问进行响应;或者,当全部的全局访问响应完成后,可以不经过模式切换,而直接对目标存储空间的私有访问进行响应。Specifically, rejecting the second read request to the target storage space until the first read request completes the response can be understood as: in the first working mode, only responding to the global access to the target storage space, And when all the global access responses are completed, you can switch to the second working mode to respond to the private access to the target storage space in the second working mode; or, when all the global access responses are completed, you can Respond directly to private access to the target storage space without going through a mode switch.

相应地,上述拒绝对所述目标存储空间的第一读取请求,直至所述第二读取请求完成响应,也可以理解为:在第二工作模式下,仅对目标存储空间的私有访问进行响应,且当全部的私有访问响应完成后,可以切换至第一工作模式,以在所述第一工作模式下,对目标存储空间的全局访问进行响应;或者,当全部的私有访问响应完成后,可以不经过模式切换,而直接对目标存储空间的全局访问进行响应。Correspondingly, the above-mentioned rejection of the first read request to the target storage space until the second read request completes the response can also be understood as: in the second working mode, only private access to the target storage space is performed. response, and when all the private access responses are completed, you can switch to the first working mode to respond to the global access to the target storage space in the first working mode; or, when all the private access responses are completed , you can directly respond to the global access of the target storage space without going through the mode switch.

本实施方式中,目标存储空间的工作模式可以根据接收到的读取请求的类型来确定,从而便于根据不同的读取请求来切换目标存储空间的工作模式,以使该目标存储空间与接收到的读取请求相匹配。In this implementation manner, the working mode of the target storage space can be determined according to the type of the received read request, so that it is convenient to switch the working mode of the target storage space according to different read requests, so that the target storage space and the received match the read request.

例如:E.g:

在所述接收到携带全局地址的第一读取请求之后,所述方法还包括:After receiving the first read request carrying the global address, the method further includes:

响应于所述第一读取请求,将所述目标存储空间设为第一工作模式,其中,在所述第一工作模式下,所述目标存储空间拒绝所述第一功能核的访问请求,直至所述第二读取请求完成响应;In response to the first read request, the target storage space is set to a first working mode, wherein, in the first working mode, the target storage space rejects the access request of the first functional core, until the second read request completes the response;

在所述接收到携带私有地址的第二读取请求之后,所述方法还包括:After receiving the second read request carrying the private address, the method further includes:

响应于所述第二读取请求,将所述目标存储空间设为第二工作模式,其中,在所述第二工作模式下,所述目标存储空间拒绝外部功能核的访问请求,直至所述第二读取请求完成响应。In response to the second read request, the target storage space is set to a second working mode, wherein, in the second working mode, the target storage space rejects an access request from an external functional core until the The second read request completes the response.

需要说明的是,若在同一时间目标存储空间即接收到携带私有地址的本地访问请求也接收到携带全局地址的全局访问请求时,还可以通过仲裁,以优先选择对本地访问请求核全局访问请求中的一种进行响应。It should be noted that if the target storage space receives both a local access request carrying a private address and a global access request carrying a global address at the same time, arbitration can also be used to give priority to the local access request and the global access request. one of the responses.

换而言之,若众核系统中除了第一功能核以外的其他功能核需要向第一功能核的私有内存获取或者写入数据的话,需要满足的条件包括:其他功能核发送的读取请求或写回请求中携带有指示待访问存储空间的全局地址,第一功能核中的待访问存储空间处于第一工作模式下,且该待访问存储空间处于未锁定状态下,该待访问存储空间表示存储有待获取数据或待更新数据的存储空间。In other words, if other functional cores other than the first functional core in the many-core system need to acquire or write data to the private memory of the first functional core, the conditions that need to be met include: read requests sent by other functional cores. Or the write-back request carries a global address indicating the storage space to be accessed, the storage space to be accessed in the first functional core is in the first working mode, and the storage space to be accessed is in an unlocked state, the storage space to be accessed Indicates the storage space for data to be acquired or data to be updated.

而当第一功能核需要向本功能核的私有内存获取或者写入数据的话,需要满足的条件包括:待访问存储空间处于未锁定状态下,该待访问存储空间表示存储有待获取数据或待更新数据的存储空间;而且,在第一工作模式下,第一功能核发送的读取请求或写回请求中携带有指示待访问存储空间的全局地址,或者,在第二工作模式下,第一功能核发送的读取请求或写回请求中携带有指示待访问存储空间的私有地址。When the first functional core needs to acquire or write data to the private memory of the functional core, the conditions to be satisfied include: the storage space to be accessed is in an unlocked state, and the storage space to be accessed indicates that the storage is to be acquired or updated. storage space for data; and, in the first working mode, the read request or write-back request sent by the first functional core carries a global address indicating the storage space to be accessed, or, in the second working mode, the first The read request or write back request sent by the functional core carries the private address indicating the storage space to be accessed.

作为一种可选的实施方式,在所述第一读取请求与所述第二读取请求的接收时间差小于预设时间的情况下,通过仲裁或者预设优先权确定对所述第一读取请求和所述第二读取请求中的至少一个进行响应。As an optional implementation manner, when the time difference between the reception of the first read request and the second read request is less than a preset time, the first read request is determined through arbitration or a preset priority. At least one of the fetch request and the second read request is responded to.

其中,所述预设时间可以是0.1s(秒)、1秒等任意时间长度,在此不作具体限定。Wherein, the preset time may be any length of time such as 0.1s (second), 1 second, etc., which is not specifically limited herein.

其中,上述通过所述预设时间确定对所述第一读取请求和所述第二读取请求中的至少一个进行响应,可以理解为:在预先将所述第一读取请求的优先级设置为大于所述第二读取请求的优先级的情况下,优先对所述第一读取请求进行响应,对于第二读取请求可以拒绝,或者等待第一读取请求响应完成后再对所述第二读取请求进行响应;在预先将所述第二读取请求的优先级设置为大于所述第一读取请求的优先级的情况下,优先对所述第二读取请求进行响应,对于第一读取请求可以拒绝,或者等待第二读取请求响应完成后再对所述第一取请求进行响应。Wherein, determining the response to at least one of the first read request and the second read request based on the preset time can be understood as: pre-setting the priority of the first read request If it is set to be higher than the priority of the second read request, the first read request will be responded to first, and the second read request can be rejected, or the response to the first read request can be completed after the response of the first read request is completed. The second read request responds; in the case where the priority of the second read request is set to be greater than the priority of the first read request in advance, the second read request is given priority. In response, the first read request may be rejected, or the first read request may be responded to after the second read request response is completed.

下面以所述目标存储空间包括用于将目标存储空间在私有模式和全局模式之间进行切换的双模内存接口为例,对上述本地访问请求和上述全局访问请求的响应过程进行举例说明:Taking the target storage space including a dual-mode memory interface for switching the target storage space between the private mode and the global mode as an example, the response process of the above-mentioned local access request and the above-mentioned global access request is exemplified below:

本实施例中,众核系统包括:第一功能核、第二功能核以及连接所述第一功能核和所述第二功能核的片上网络50。In this embodiment, the many-core system includes: a first functional core, a second functional core, and an on-chip network 50 connecting the first functional core and the second functional core.

其中,如图5所示,第一功能核包括:数据通路51、内存52、路由模块53以及双模内存接口54,路由模块53与片上网络50连接;双模内存接口54包括目标位置解析器541、模式切换器542、地址映射表存储模块543、请求信令组包器544、请求信令解包器545、数据组包器546以及数据解包器547。Wherein, as shown in FIG. 5 , the first functional core includes: a data path 51, a memory 52, a routing module 53 and a dual-mode memory interface 54, the routing module 53 is connected to the on-chip network 50; the dual-mode memory interface 54 includes a target location resolver 541 , a mode switcher 542 , an address mapping table storage module 543 , a request signaling packetizer 544 , a request signaling depacketizer 545 , a data packetizer 546 and a data depacketizer 547 .

具体的,目标位置解析器541与数据通路51、内存52模式切换器542、地址映射表存储模块543、请求信令组包器544、请求信令解包器545、数据组包器546以及数据解包器547分别连接,且模式切换器542、地址映射表存储模块543、请求信令组包器544、请求信令解包器545、数据组包器546以及数据解包器547分别与路由模块53连接。Specifically, the target location parser 541 is connected to the data path 51, the memory 52 mode switch 542, the address mapping table storage module 543, the request signaling packetizer 544, the request signaling unpacker 545, the data packetizer 546 and the data packetizer 546. The depacketizers 547 are respectively connected, and the mode switcher 542, the address mapping table storage module 543, the request signaling packetizer 544, the request signaling depacketizer 545, the data packetizer 546, and the data depacketizer 547 are respectively connected to the router Module 53 is connected.

需要说明的是,第二功能核的结构与第一功能核的结构可以相同,在此不再赘述。另外,如图5所示实施例中的箭头方向表示上述第一功能核的内存52被本地访问或者被全局访问的过程中,信令或者目标数据的传输方向。It should be noted that the structure of the second functional core may be the same as the structure of the first functional core, and details are not described herein again. In addition, the direction of the arrow in the embodiment shown in FIG. 5 indicates the transmission direction of signaling or target data in the process that the memory 52 of the first functional core is accessed locally or globally.

在一种情况下,若双模内存接口54处于私有模式下,则目标位置解析器541根据数据通路51中的数据产生单元提供的私有地址直接访问内存52,即第二读取请求中携带有目标数据的私有地址,且内存52将反回的目标数据的数据包直接输出至数据通路51。In one case, if the dual-mode memory interface 54 is in the private mode, the target location parser 541 directly accesses the memory 52 according to the private address provided by the data generating unit in the data path 51, that is, the second read request carries The private address of the target data, and the memory 52 directly outputs the returned data packet of the target data to the data path 51 .

在另一种情况下,若双模内存接口54处于全局模式,则在数据通路51向目标位置解析器541发送读取请求时,目标位置解析器541用于根据根据地址映射表存储模块543中存储的地址映射表判断数据通路51发出的读取请求中的目的地址位于本功能核内还是位于外部的其他功能核内,以判断需要生成读取请求是本地访问请求还是全局访问请求。In another case, if the dual-mode memory interface 54 is in the global mode, when the data path 51 sends a read request to the target location parser 541, the target location parser 541 is used to store the memory in the module 543 according to the address mapping table. The stored address mapping table determines whether the destination address in the read request sent by the data path 51 is located in this functional core or in other external functional cores, so as to determine whether the read request to be generated is a local access request or a global access request.

其中,如果该读取请求中的目的地址位于本功能核内,则判断该读取请求是本地访问请求,从而根据该本地访问请求中的私有地址直接访问内存52。Wherein, if the destination address in the read request is located in the functional core, it is determined that the read request is a local access request, so that the memory 52 is directly accessed according to the private address in the local access request.

另外,如果该读取请求中的目的地址位于外部的其他功能核内,则判断该读取请求是全局访问请求,此时,目标位置解析器541将该全局访问请求中的请求位置发送给请求信令组包器544,由请求信令组包器544组包形成全局访问请求信令包,并将该全局访问请求信令包发送到路由模块53,且路由模块53将从请求信令组包器544接收到的全局访问请求信令包发往片上网络50,以通过该片上网络50将全局访问请求信令包发送至需要读取的数据的存储地,从而在该存储地所在的目标功能核响应于该全局访问请求信令包返回数据包时,路由模块53从片上网络50接收该返回数据包,并由数据解包器547对该数据包进行解包,以得到目标数据(即本功能核需要读取的数据),然后目标位置解析器541还对目标数据进行解析,并根据解析后的信息将该目标数据发送至内存52或者数据通路51。In addition, if the destination address in the read request is located in other external functional cores, it is determined that the read request is a global access request, and at this time, the target location resolver 541 sends the request location in the global access request to the requester The signaling packager 544 forms a global access request signaling package by the request signaling packager 544, and sends the global access request signaling package to the routing module 53, and the routing module 53 will send the request signaling package from the request signaling package. The global access request signaling packet received by the packetizer 544 is sent to the on-chip network 50, so as to send the global access request signaling packet to the storage location of the data to be read through the on-chip network 50, so that the destination of the storage location is located. When the function core returns a data packet in response to the global access request signaling packet, the routing module 53 receives the returned data packet from the network-on-chip 50, and the data unpacker 547 unpacks the data packet to obtain the target data (ie The data to be read by this functional core), and then the target location parser 541 also parses the target data, and sends the target data to the memory 52 or the data path 51 according to the parsed information.

同时,路由模块53还负责从片上网络50接收外部功能核发送到本功能核的全局访问请求信令包,并由请求信令解包器545对该全局访问请求信令包进行解包,以得到该全局访问请求信令包的全局地址、数据长度等信息。并将这些信息发送给目标位置解析器541。这样,目标位置解析器541便会将全局访问请求的全局地址转译为私有地址,以通过该私有地址访问内存52,并将内存52的访问结果(即目标数据)返回给数据组包器546,以通过数据组包器546将目标数据组建成数据包后,通过路由模块53发送到片上网络50,此时,目标数据的请求方将从片上网络50接收该目标数据的数据包,具体的,在目标数据的请求方中,将路由模块接收到的数据包在数据解包器中进行解包,并将相关数据包发送给目标位置解析器,目标位置解析器通过解析数据包信息,以根据解析后的信息将数据包中的数据发送给内存或数据通路,该目标数据的请求方对接收到的目标数据的处理过程与本功能核在接收到数据包之后的处理过程相同,在此不再赘述。At the same time, the routing module 53 is also responsible for receiving the global access request signaling packet sent by the external functional core to the functional core from the network-on-chip 50, and the request signaling unpacker 545 unpacks the global access request signaling packet, so as to Obtain information such as the global address and data length of the global access request signaling packet. And send this information to the target location parser 541 . In this way, the target location resolver 541 will translate the global address of the global access request into a private address, so as to access the memory 52 through the private address, and return the access result (ie, target data) of the memory 52 to the data packetizer 546, After the target data is formed into a data packet by the data packetizer 546, it is sent to the on-chip network 50 through the routing module 53. At this time, the requester of the target data will receive the data packet of the target data from the on-chip network 50. Specifically, In the requester of the target data, the data packets received by the routing module are unpacked in the data unpacker, and the relevant data packets are sent to the target location parser. The parsed information sends the data in the data packet to the memory or data path. The requester of the target data processes the received target data the same as the processing process of this functional core after receiving the data packet. Repeat.

在实施中,上述请求信令包的格式可以如下表2所示:In implementation, the format of the above request signaling packet may be as shown in Table 2 below:

表2Table 2

Figure BDA0002988710490000221
Figure BDA0002988710490000221

其中,信令标识符用于区分不同的信令;目标功能核地址用于指示存储有待访问数据的内存所在的功能核的地址;数据起始全局地址表示待访问数据的起始全局地址,该起始全局地址加上上述数据长度可以表示待访问数据的的终止全局地址;在待访问数据所在的存储空间有多个功能核同时访问的情况下,目标位置解析器可以基于上述优先级进行仲裁,以确定对优先级最高的一条访问请求信令进行响应;可以通过上述附加信息域添加附加信息。Wherein, the signaling identifier is used to distinguish different signaling; the target functional core address is used to indicate the address of the functional core where the memory storing the data to be accessed is located; the data starting global address represents the starting global address of the data to be accessed, the The starting global address plus the above data length can represent the ending global address of the data to be accessed; in the case where the storage space where the data to be accessed is accessed by multiple functional cores at the same time, the target location parser can arbitrate based on the above priority , to determine the response to the access request signaling with the highest priority; additional information can be added through the above additional information field.

需要说明的是,上述请求信令包中各个子信号的排列位置可以交换,且还可以包括除了上述信令标识符、目标功能核地址、数据起始全局地址、优先级以及附加信息域以外的其他子信息,在此并不穷举。It should be noted that the arrangement position of each sub-signal in the above-mentioned request signaling packet can be exchanged, and may also include other than the above-mentioned signaling identifier, target function core address, data starting global address, priority and additional information fields. Other sub-information is not exhaustive here.

另外,在实施中,上述数据包的格式可以如下表3所示:In addition, in implementation, the format of the above data packet may be as shown in Table 3 below:

表3table 3

Figure BDA0002988710490000222
Figure BDA0002988710490000222

其中,上述数据包标识符用于区分不同的数据包;上述数据体表示数据包中的具体数据(即待访问数据);另外,上述目标功能核地址、数据起始全局地址、数据长度以及附加信息域的具体含义分别可以参照上述表2所示请求信令包格式中的目标功能核地址、数据起始全局地址、数据长度以及附加信息域的具体含义,在此不再赘述。Wherein, the above-mentioned data packet identifier is used to distinguish different data packets; the above-mentioned data body represents the specific data (that is, the data to be accessed) in the data packet; in addition, the above-mentioned target function core address, data starting global address, data length and additional For the specific meanings of the information fields, refer to the specific meanings of the target function core address, data starting global address, data length and additional information fields in the request signaling packet format shown in Table 2 above, which will not be repeated here.

在相关技术中,当有一套权重,要给很多个图片用时,将该多个图片分别输入至多个功能核,以分别进行处理,在应用中,由于这一套权重需要给很多功能核用,而各功能核的私有内存仅能够被本功能核访问,所以要整套权重都存在所有需要用到该权重的各个功能核里,以便于一层一层的处理图片。In the related art, when there is a set of weights to be used for many pictures, the pictures are respectively input into multiple function cores for processing respectively. In application, since this set of weights needs to be used for many function cores, The private memory of each functional core can only be accessed by this functional core, so the entire set of weights must be stored in all functional cores that need to use the weights, so as to process pictures layer by layer.

而本申请实施例中,可以仅1个或者少数的几个功能核内存储这一套权重(例如:仅将该套权重中的各个权重值分别存储于需要用到该权重值的功能核里,而不需要使功能核存储整套权重),当一个功能核需要使用未存储的权重值时,可以通过全局访问的方式,从存储有该权重值的其他功能核内获取。In the embodiment of the present application, the set of weights may be stored in only one or a few functional cores (for example, only each weight value in the set of weights is stored in the functional cores that need to use the weight value respectively. , instead of having the function core store the entire set of weights), when a function core needs to use an unstored weight value, it can obtain it from other function cores that store the weight value through global access.

由上可知,通过本申请实施例提供的存储数据访问方法,当运行具有共享数据的算法(如大型神经网络)时,无需要对共享的数据进行复制到每个功能核的私有内存中,可以减少资源浪费,以及使具有大型数组以及共享数据的众核系统的应用范围更广,可同时支持高速模式以及稀疏模式。另外,不同于现有技术中的共享数据需要通过共享的内存中线进行传输,本申请实施例中,全局访问的信令和数据通过片上网络、片上总线或者片间网络传输,能够减少信令和数据传输的等待时间,从而能够提升众核系统的运行效率。As can be seen from the above, through the storage data access method provided by the embodiments of the present application, when running an algorithm with shared data (such as a large-scale neural network), there is no need to copy the shared data into the private memory of each functional core, and it is possible to Reduce resource waste and make many-core systems with large arrays and shared data more widely applicable, supporting both high-speed and sparse modes. In addition, unlike the shared data in the prior art, which needs to be transmitted through a shared memory center line, in the embodiment of the present application, the signaling and data of global access are transmitted through the on-chip network, on-chip bus or inter-chip network, which can reduce signaling and data. The waiting time of data transmission can improve the operation efficiency of the many-core system.

在本申请实施例中,第一功能核接收接收第二功能核发送的第一写回请求,其中,所述第一写回请求携带有待写回数据的第一目标全局地址;响应于所述第一写回请求,将所述第一目标全局地址指向的目标存储空间设置为锁定状态,直至所述待写回数据成功写回,其中,所述目标存储空间位于所述第一功能核内,在所述锁定状态,所述目标存储空间拒绝除了所述第二功能核以外的功能核的访问,且在未锁定状态,所述目标存储空间能够被所述众核系统中的任一功能核访问。这样,可以使第一功能核内的私有存储空间,能够作为共享存储空间,以被第二功能核访问,并写入数据,进而可以将不同的共享数据分散存储在不同功能核的私有存储空间内,从而避免了在全局共享存储空间内存储大量的共享数据,而造成的多个功能核分别访问全局共享存储空间时的等待时间长且等待时间不确定的问题,提升了所述众核系统的运行效率。In this embodiment of the present application, the first functional core receives a first write-back request sent by the second functional core, where the first write-back request carries the first target global address of the data to be written back; in response to the The first write-back request sets the target storage space pointed to by the first target global address to a locked state until the data to be written back is successfully written back, wherein the target storage space is located in the first functional core , in the locked state, the target storage space denies access by functional cores other than the second functional core, and in the unlocked state, the target storage space can be accessed by any function in the many-core system nuclear access. In this way, the private storage space in the first functional core can be used as a shared storage space to be accessed by the second functional core and write data, and then different shared data can be scattered and stored in the private storage space of different functional cores In this way, the problem of long waiting time and uncertain waiting time when multiple functional cores access the global shared storage space caused by storing a large amount of shared data in the global shared storage space is avoided, which improves the many-core system. operating efficiency.

需要说明的是,本申请实施例提供的存储数据访问方法,执行主体可以为存储数据访问装置,或者该存储数据访问装置中的用于执行存储数据访问方法的控制模块。本申请实施例中以存储数据访问装置执行加载存储数据访问方法为例,说明本申请实施例提供的存储数据访问装置。It should be noted that, in the stored data access method provided by the embodiments of the present application, the execution subject may be a stored data access device, or a control module in the stored data access device for executing the stored data access method. In the embodiment of the present application, the storage data access device provided by the embodiment of the present application is described by taking the storage data access device executing the load storage data access method as an example.

请参阅图6,是本申请实施例提供的一种存储数据访问装置的结构图,该存储数据访问装置600应用于众核系统中的第一功能核,如图6所示,该存储数据访问装置600包括:Please refer to FIG. 6 , which is a structural diagram of a storage data access device provided by an embodiment of the present application. The storage data access device 600 is applied to the first functional core in a many-core system. As shown in FIG. 6 , the storage data access device 600 Apparatus 600 includes:

第一接收模块601,用于接收第一写回请求,其中,所述第一写回请求携带有待写回数据的第一目标全局地址;a first receiving module 601, configured to receive a first write-back request, wherein the first write-back request carries a first target global address of data to be written back;

第一确定模块602,用于确定所述第一目标全局地址指向的目标存储空间;a first determining module 602, configured to determine the target storage space pointed to by the first target global address;

设置模块603,用于在所述目标存储空间处于未锁定状态时,将所述目标存储空间设置为锁定状态,直至所述待写回数据成功写回;其中,所述目标存储空间位于所述第一功能核内,在所述锁定状态,拒绝对所述目标存储空间的除所述第一写回请求以外的访问请求。A setting module 603, configured to set the target storage space to a locked state when the target storage space is in an unlocked state, until the data to be written back is successfully written back; wherein, the target storage space is located in the In the first functional core, in the locked state, access requests to the target storage space other than the first write-back request are rejected.

可选的,该存储数据访问装置600还包括:Optionally, the storage data access device 600 further includes:

第二接收模块,用于接收第一读取请求,其中,所述第一读取请求携带有第二目标全局地址;a second receiving module, configured to receive a first read request, wherein the first read request carries a second target global address;

第一传输模块,用于在确定所述第二目标全局地址指示的目标存储空间位于所述第一功能核内,且所述目标存储空间未处于锁定状态时,根据全局地址与私有地址的映射关系,确定所述第二目标全局地址对应的第一私有地址,以及,传输所述目标存储空间内与所述第一私有地址对应的第一目标数据。The first transmission module is configured to, when it is determined that the target storage space indicated by the second target global address is located in the first functional core and the target storage space is not in a locked state, according to the mapping between the global address and the private address relationship, determining the first private address corresponding to the second target global address, and transmitting the first target data corresponding to the first private address in the target storage space.

可选的,所述第一读取请求、所述第一目标数据、所述第一写回请求以及所述待写回数据通过片上网络或片上总线传输,所述众核系统中的任意两个功能核通过所述片上网络或片上总线连接。Optionally, the first read request, the first target data, the first write-back request, and the data to be written back are transmitted through an on-chip network or an on-chip bus, and any two in the many-core system are transmitted. The functional cores are connected through the on-chip network or on-chip bus.

可选的,该存储数据访问装置600还包括:Optionally, the storage data access device 600 further includes:

第三接收模块,用于接收第一数据通路发送的第二读取请求,其中,所述第一数据通路位于所述第一功能核内,所述第二读取请求携带有第二私有地址;A third receiving module, configured to receive a second read request sent by a first data path, wherein the first data path is located in the first functional core, and the second read request carries a second private address ;

第二传输模块,用于在确定所述目标存储空间未处于锁定状态时,将所述目标存储空间内与所述第二私有地址对应的第二目标数据传输至所述第一数据通路。A second transmission module, configured to transmit the second target data corresponding to the second private address in the target storage space to the first data path when it is determined that the target storage space is not in a locked state.

可选的,所述设置模块603,包括:Optionally, the setting module 603 includes:

锁定单元,用于将所述目标存储空间设置为锁定状态,并接收所述待写回数据;a locking unit, configured to set the target storage space to a locked state and receive the data to be written back;

更新单元,用于根据所述待写回数据对所述目标存储空间中的数据进行更新;an update unit, configured to update the data in the target storage space according to the data to be written back;

解锁单元,用于在所述更新完成之后,解除所述目标存储空间的锁定状态。An unlocking unit, configured to release the locked state of the target storage space after the update is completed.

进一步的,所述第一写回请求还携带有所述待写回数据的存储长度,所述更新单元,包括:Further, the first write-back request also carries the storage length of the data to be written back, and the update unit includes:

写入子单元,用于在将所述待写回数据写入所述目标存储空间的过程中,获取所述目标存储空间内已完成更新的数据长度;a writing subunit, configured to acquire the data length that has been updated in the target storage space in the process of writing the data to be written back into the target storage space;

确定子单元,用于在所述目标存储空间内已完成更新的数据长度与所述待写回数据的存储长度匹配时,确定所述更新完成。A determination subunit, configured to determine that the update is completed when the length of the data that has been updated in the target storage space matches the storage length of the data to be written back.

可选的,第一确定模块602包括:Optionally, the first determining module 602 includes:

第一确定单元,用于根据全局地址与私有地址的映射关系,确定所述第一目标全局地址对应的第三私有地址;a first determining unit, configured to determine a third private address corresponding to the first target global address according to the mapping relationship between the global address and the private address;

第二确定单元,用于确定所述第一功能核内与所述第三私有地址对应的目标存储空间。The second determining unit is configured to determine the target storage space corresponding to the third private address in the first functional core.

可选的,所述第一写回请求为所述众核系统中第二功能核发起的访问请求,该存储数据访问装置600还包括:Optionally, the first write-back request is an access request initiated by a second functional core in the many-core system, and the storage data access device 600 further includes:

发送模块,用于向所述第二功能核发送通知信令,其中,所述通知信令用于通知所述第二功能核,所述待写回数据写回成功。A sending module, configured to send notification signaling to the second functional core, wherein the notification signaling is used to notify the second functional core that the data to be written back is successfully written back.

可选的,存储数据访问装置600还包括:Optionally, the storage data access device 600 further includes:

执行模块,用于在所述目标存储空间处于锁定状态时,执行以下操作中的至少一项:An execution module, configured to perform at least one of the following operations when the target storage space is in a locked state:

拒绝所述第一写回请求;rejecting the first writeback request;

将所述第一写回请求加入消息队列,以在所述目标存储空间切换至未锁定状态时,响应所述第一写回请求。The first write-back request is added to a message queue to respond to the first write-back request when the target storage space is switched to an unlocked state.

可选的,所述第一写回请求包括以下至少一种:Optionally, the first writeback request includes at least one of the following:

所述第一功能核的第一数据通路发送的写回请求;a write-back request sent by the first data path of the first functional core;

第二功能核发送的写回请求;A writeback request sent by the second functional core;

其中,所述第二功能核为所述众核系统中不同于所述第一功能核的功能核。Wherein, the second functional core is a functional core different from the first functional core in the many-core system.

可选的,所述全局地址与私有地址的映射关系,通过以下方式确定:Optionally, the mapping relationship between the global address and the private address is determined in the following manner:

在所述众核系统包括S个芯片的情况下,基于每个全局地址指示对应的私有地址所在的目标功能核,以及所述目标功能核所在的目标芯片,以根据每个私有地址对应的全局地址,确定所述映射关系;In the case where the many-core system includes S chips, the target functional core where the corresponding private address is located and the target chip where the target functional core is located are indicated based on each global address, so that the global address corresponding to each private address is address, to determine the mapping relationship;

或者,or,

在所述众核系统包括1个芯片,且所述芯片包括呈J行P列排列的功能核阵列的情况下,基于每个全局地址指对应的私有地址所在的目标功能核,以及所述目标功能核在所述功能核整列中的位置,以根据每个私有地址对应的全局地址,确定所述映射关系。When the many-core system includes one chip, and the chip includes a functional core array arranged in J rows and P columns, each global address refers to the target functional core where the corresponding private address is located, and the target functional core. The position of the function core in the entire column of the function core is used to determine the mapping relationship according to the global address corresponding to each private address.

可选的,所述目标存储空间的工作模式包括第一工作模式和第二工作模式;Optionally, the working mode of the target storage space includes a first working mode and a second working mode;

其中,在所述第一工作模式下,拒绝对所述目标存储空间的第二读取请求,直至所述第一读取请求完成响应;在所述第二工作模式下,拒绝对所述目标存储空间的第一读取请求,直至所述第二读取请求完成响应;Wherein, in the first working mode, reject the second read request to the target storage space until the first read request completes a response; in the second working mode, reject the target storage space the first read request of the storage space until the second read request completes the response;

存储数据访问装置600还包括以下至少一项:The storage data access device 600 further includes at least one of the following:

第二确定模块,用于根据控制指令,确定所述目标存储空间的工作模式;a second determining module, configured to determine the working mode of the target storage space according to the control instruction;

第三确定模块,用于响应于所述第一读取请求,确定所述工作模式为所述第一工作模式;a third determining module, configured to, in response to the first read request, determine that the working mode is the first working mode;

第四确定模块,用于响应于所述第二读取请求,确定所述工作模式为所述第二工作模式。A fourth determining module, configured to determine that the working mode is the second working mode in response to the second read request.

可选的,在所述第一读取请求与所述第二读取请求的接收时间差小于预设时间的情况下,通过仲裁或者预设优先权确定对所述第一读取请求和所述第二读取请求中的至少一个进行响应。Optionally, in the case that the receiving time difference between the first read request and the second read request is less than a preset time, determine whether the first read request and the At least one of the second read requests responds.

本申请实施例提供的存储数据访问装置600能够执行如图1所示方法实施例中第一功能核执行的各个过程,且能够提升众核系统的运行效率并节约存储资源,具有与如图1所示方法实施例相同的有益效果,为避免重复,在此不再赘述。The storage data access device 600 provided in this embodiment of the present application can perform each process performed by the first functional core in the method embodiment shown in FIG. 1 , and can improve the operation efficiency of the many-core system and save storage resources. The beneficial effects of the illustrated method embodiments are the same, and are not repeated here in order to avoid repetition.

本申请实施例中的存储数据访问装置可以是装置,也可以是终端中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,非移动电子设备可以为个人计算机(personalcomputer,PC)、柜员机或者自助机等,本申请实施例不作具体限定。The device for accessing stored data in this embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The apparatus may be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (personal digital assistant). assistant, PDA), etc., the non-mobile electronic device may be a personal computer (personal computer, PC), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

本申请实施例中的存储数据访问装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The device for accessing stored data in this embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.

本申请实施例提供的存储数据访问装置能够实现图1所示的方法实施例实现的各个过程,为避免重复,这里不再赘述。The storage data access device provided in the embodiment of the present application can implement each process implemented by the method embodiment shown in FIG. 1 , and to avoid repetition, details are not repeated here.

可选的,如图7所示,本申请实施例还提供一种电子设备700,包括处理器701,存储器702,存储在存储器702上并可在所述处理器701上运行的程序或指令,该程序或指令被处理器701执行时实现上述存储数据访问方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, as shown in FIG. 7 , an embodiment of the present application further provides an electronic device 700, including a processor 701, a memory 702, a program or instruction stored in the memory 702 and executable on the processor 701, When the program or instruction is executed by the processor 701, each process of the above-mentioned storage data access method embodiment can be realized, and the same technical effect can be achieved. In order to avoid repetition, details are not repeated here.

需要注意的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include the aforementioned mobile electronic devices and non-mobile electronic devices.

本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述存储数据访问方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiments of the present application further provide a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, each process of the above embodiment of the stored data access method is implemented, and can achieve The same technical effect, in order to avoid repetition, will not be repeated here.

其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device described in the foregoing embodiments. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.

本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述存储数据访问方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement the above embodiment of the method for accessing stored data and can achieve the same technical effect, in order to avoid repetition, it will not be repeated here.

应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, a system-on-chip, a system-on-a-chip, or a system-on-a-chip, or the like.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in the reverse order depending on the functions involved. To perform functions, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to some examples may be combined in other examples.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in a part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of this application.

上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific embodiments, which are merely illustrative rather than restrictive. Under the inspiration of this application, without departing from the scope of protection of the purpose of this application and the claims, many forms can be made, which all fall within the protection of this application.

Claims (10)

1.一种存储数据访问方法,应用于众核系统中的第一功能核,其特征在于,所述方法包括:1. a storage data access method, applied to the first functional core in the many-core system, is characterized in that, the method comprises: 接收第一写回请求,其中,所述第一写回请求携带有待写回数据的第一目标全局地址;receiving a first write-back request, wherein the first write-back request carries the first target global address of the data to be written back; 确定所述第一目标全局地址指向的目标存储空间;determining the target storage space pointed to by the first target global address; 在所述目标存储空间处于未锁定状态时,将所述目标存储空间设置为锁定状态,直至所述待写回数据成功写回;When the target storage space is in an unlocked state, set the target storage space to a locked state until the data to be written back is successfully written back; 其中,所述目标存储空间位于所述第一功能核内,在所述锁定状态,拒绝对所述目标存储空间的除所述第一写回请求以外的访问请求。The target storage space is located in the first functional core, and in the locked state, access requests to the target storage space other than the first write-back request are rejected. 2.根据权利要求1所述的存储数据访问方法,其特征在于,在所述接收第一写回请求之前,所述方法还包括:2. The storage data access method according to claim 1, wherein before the receiving the first write-back request, the method further comprises: 接收第一读取请求,其中,所述第一读取请求携带有第二目标全局地址;receiving a first read request, wherein the first read request carries a second target global address; 在确定所述第二目标全局地址指示的目标存储空间位于所述第一功能核内,且所述目标存储空间未处于锁定状态时,根据全局地址与私有地址的映射关系,确定所述第二目标全局地址对应的第一私有地址,以及,传输所述目标存储空间内与所述第一私有地址对应的第一目标数据。When it is determined that the target storage space indicated by the second target global address is located in the first functional core and the target storage space is not in a locked state, the second target storage space is determined according to the mapping relationship between the global address and the private address. The first private address corresponding to the target global address, and the first target data corresponding to the first private address in the target storage space is transmitted. 3.根据权利要求2所述的存储数据访问方法,其特征在于,所述方法还包括:3. The storage data access method according to claim 2, wherein the method further comprises: 接收第一数据通路发送的第二读取请求,其中,所述第一数据通路位于所述第一功能核内,所述第二读取请求携带有第二私有地址;receiving a second read request sent by a first data path, wherein the first data path is located in the first functional core, and the second read request carries a second private address; 在确定所述目标存储空间未处于锁定状态时,将所述目标存储空间内与所述第二私有地址对应的第二目标数据传输至所述第一数据通路。When it is determined that the target storage space is not in a locked state, second target data corresponding to the second private address in the target storage space is transmitted to the first data path. 4.根据权利要求1所述的方法,其特征在于,所述将所述目标存储空间设置为锁定状态,直至所述待写回数据成功写回,包括:4. The method according to claim 1, wherein the setting the target storage space to a locked state until the data to be written back is successfully written back comprises: 将所述目标存储空间设置为锁定状态,并接收所述待写回数据;Setting the target storage space to a locked state, and receiving the data to be written back; 根据所述待写回数据对所述目标存储空间中的数据进行更新;updating the data in the target storage space according to the data to be written back; 在所述更新完成之后,解除所述目标存储空间的锁定状态。After the update is completed, the locked state of the target storage space is released. 5.根据权利要求4所述的方法,其特征在于,所述第一写回请求携带有所述待写回数据的存储长度,所述根据所述待写回数据对所述目标存储空间中的数据进行更新,包括:5 . The method according to claim 4 , wherein the first write-back request carries the storage length of the data to be written back, and the storage length of the data to be written back is stored in the target storage space according to the data to be written back. 6 . updated data, including: 在将所述待写回数据写入所述目标存储空间的过程中,获取所述目标存储空间内已完成更新的数据长度;In the process of writing the data to be written back into the target storage space, obtain the length of the updated data in the target storage space; 在所述目标存储空间内已完成更新的数据长度与所述待写回数据的存储长度匹配时,确定所述更新完成。When the length of the updated data in the target storage space matches the storage length of the data to be written back, it is determined that the update is completed. 6.根据权利要求2或5所述的存储数据访问方法,其特征在于,所述全局地址与私有地址的映射关系,通过以下方式确定:6. storage data access method according to claim 2 or 5, is characterized in that, the mapping relation of described global address and private address, is determined by the following way: 在所述众核系统包括S个芯片的情况下,基于每个全局地址指示对应的私有地址所在的目标功能核,以及所述目标功能核所在的目标芯片,以根据每个私有地址对应的全局地址,确定所述映射关系;In the case where the many-core system includes S chips, the target functional core where the corresponding private address is located and the target chip where the target functional core is located are indicated based on each global address, so that the global address corresponding to each private address is address, to determine the mapping relationship; 或者,or, 在所述众核系统包括1个芯片,且所述芯片包括呈J行P列排列的功能核阵列的情况下,基于每个全局地址指对应的私有地址所在的目标功能核,以及所述目标功能核在所述功能核整列中的位置,以根据每个私有地址对应的全局地址,确定所述映射关系。When the many-core system includes one chip, and the chip includes a functional core array arranged in J rows and P columns, each global address refers to the target functional core where the corresponding private address is located, and the target functional core. The position of the function core in the entire column of the function core is used to determine the mapping relationship according to the global address corresponding to each private address. 7.根据权利要求3所述的存储数据访问方法,其特征在于,所述目标存储空间的工作模式包括第一工作模式和第二工作模式;7. The storage data access method according to claim 3, wherein the working mode of the target storage space comprises a first working mode and a second working mode; 其中,在所述第一工作模式下,拒绝对所述目标存储空间的第二读取请求,直至所述第一读取请求完成响应;在所述第二工作模式下,拒绝对所述目标存储空间的第一读取请求,直至所述第二读取请求完成响应;Wherein, in the first working mode, reject the second read request to the target storage space until the first read request completes a response; in the second working mode, reject the target storage space the first read request of the storage space until the second read request completes the response; 所述方法还包括以下至少一项:The method also includes at least one of the following: 根据控制指令,确定所述目标存储空间的工作模式;According to the control instruction, determine the working mode of the target storage space; 响应于所述第一读取请求,确定所述工作模式为所述第一工作模式;In response to the first read request, determining that the working mode is the first working mode; 响应于所述第二读取请求,确定所述工作模式为所述第二工作模式。In response to the second read request, it is determined that the operating mode is the second operating mode. 8.一种存储数据访问装置,应用于众核系统中的第一功能核,其特征在于,所述装置包括:8. A storage data access device, applied to the first functional core in a many-core system, wherein the device comprises: 第一接收模块,用于接收第一写回请求,其中,所述第一写回请求携带有待写回数据的第一目标全局地址;a first receiving module, configured to receive a first write-back request, wherein the first write-back request carries the first target global address of the data to be written back; 第一确定模块,用于确定所述第一目标全局地址指向的目标存储空间;a first determining module, configured to determine the target storage space pointed to by the first target global address; 设置模块,用于在所述目标存储空间处于未锁定状态时,将所述目标存储空间设置为锁定状态,直至所述待写回数据成功写回;a setting module, configured to set the target storage space to a locked state when the target storage space is in an unlocked state, until the data to be written back is successfully written back; 其中,所述目标存储空间位于所述第一功能核内,在所述锁定状态,拒绝对所述目标存储空间的除所述第一写回请求以外的访问请求。The target storage space is located in the first functional core, and in the locked state, access requests to the target storage space other than the first write-back request are rejected. 9.一种电子设备,其特征在于,包括处理器,存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1-7中任一项所述的存储数据访问方法的步骤。9. An electronic device, characterized in that it comprises a processor, a memory, and a program or instruction that is stored on the memory and can be run on the processor, and the program or instruction is implemented when the processor is executed. The steps of the storage data access method according to any one of claims 1-7. 10.一种可读存储介质,其特征在于,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1-7中任一项所述的存储数据访问方法的步骤。10. A readable storage medium, wherein a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, the storage according to any one of claims 1-7 is implemented The steps of the data access method.
CN202110308805.2A 2021-03-23 2021-03-23 Storage data access method and device, electronic equipment and storage medium Pending CN115114042A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110308805.2A CN115114042A (en) 2021-03-23 2021-03-23 Storage data access method and device, electronic equipment and storage medium
PCT/CN2022/079235 WO2022199357A1 (en) 2021-03-23 2022-03-04 Data processing method and apparatus, electronic device, and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110308805.2A CN115114042A (en) 2021-03-23 2021-03-23 Storage data access method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115114042A true CN115114042A (en) 2022-09-27

Family

ID=83322921

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110308805.2A Pending CN115114042A (en) 2021-03-23 2021-03-23 Storage data access method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115114042A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115525583A (en) * 2022-11-29 2022-12-27 太初(无锡)电子科技有限公司 Memory data access method of many-core processor
CN117573583A (en) * 2024-01-12 2024-02-20 上海励驰半导体有限公司 Data processing method, device, chip and traffic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120137075A1 (en) * 2009-06-09 2012-05-31 Hyperion Core, Inc. System and Method for a Cache in a Multi-Core Processor
CN104699631A (en) * 2015-03-26 2015-06-10 中国人民解放军国防科学技术大学 Storage device and fetching method for multilayered cooperation and sharing in GPDSP (General-Purpose Digital Signal Processor)
CN105677580A (en) * 2015-12-30 2016-06-15 杭州华为数字技术有限公司 Method and device for accessing cache
CN105740164A (en) * 2014-12-10 2016-07-06 阿里巴巴集团控股有限公司 Multi-core processor supporting cache consistency, reading and writing methods and apparatuses as well as device
CN110704362A (en) * 2019-09-12 2020-01-17 无锡江南计算技术研究所 Processor array local storage hybrid management technology

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120137075A1 (en) * 2009-06-09 2012-05-31 Hyperion Core, Inc. System and Method for a Cache in a Multi-Core Processor
CN105740164A (en) * 2014-12-10 2016-07-06 阿里巴巴集团控股有限公司 Multi-core processor supporting cache consistency, reading and writing methods and apparatuses as well as device
CN104699631A (en) * 2015-03-26 2015-06-10 中国人民解放军国防科学技术大学 Storage device and fetching method for multilayered cooperation and sharing in GPDSP (General-Purpose Digital Signal Processor)
CN105677580A (en) * 2015-12-30 2016-06-15 杭州华为数字技术有限公司 Method and device for accessing cache
CN110704362A (en) * 2019-09-12 2020-01-17 无锡江南计算技术研究所 Processor array local storage hybrid management technology

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115525583A (en) * 2022-11-29 2022-12-27 太初(无锡)电子科技有限公司 Memory data access method of many-core processor
CN117573583A (en) * 2024-01-12 2024-02-20 上海励驰半导体有限公司 Data processing method, device, chip and traffic equipment

Similar Documents

Publication Publication Date Title
US11755527B2 (en) Techniques for command validation for access to a storage device by a remote client
US11929927B2 (en) Network interface for data transport in heterogeneous computing environments
US7617376B2 (en) Method and apparatus for accessing a memory
US11036669B2 (en) Scalable direct inter-node communication over peripheral component interconnect-express (PCIe)
TWI239187B (en) System and method for managing and validating remote keys which correspond to outstanding data transactions
US7404190B2 (en) Method and apparatus for providing notification via multiple completion queue handlers
JP6880402B2 (en) Memory access control device and its control method
US10331499B2 (en) Method, apparatus, and chip for implementing mutually-exclusive operation of multiple threads
WO2014173364A1 (en) Shared resource access method and device
CN118093468B (en) PCIe exchange chip with RDMA acceleration function and PCIe switch
CN106662895B (en) Computer equipment and method for reading and writing computer equipment data
JP2013512519A (en) Controller directly accessing memory for direct transfer of data between memories of several peripheral devices, method and computer program enabling such controller
CN103092798A (en) On-chip system and method for accessing to equipment under bus
CN113971138A (en) Data access method and related equipment
TWI872239B (en) Storage device and method for processing commands
CN115114042A (en) Storage data access method and device, electronic equipment and storage medium
JP2022510803A (en) Memory request chain on the bus
TW460787B (en) Apparatus and method for fabric ordering load/store to input/output device and direct memory access peer-to-peer transactions
CN115174673B (en) Data processing device, data processing method and apparatus having low-latency processor
CN104252416B (en) A kind of accelerator and data processing method
CN114238156B (en) Processing system and method of operating a processing system
JP5904948B2 (en) The system that allows direct data transfer between memories of several components of the system
CN115168256A (en) Interrupt control method, interrupt controller, electronic device, medium and chip
WO2022199357A1 (en) Data processing method and apparatus, electronic device, and computer-readable storage medium
JP2018142084A (en) Information processing unit

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination