Data transmission method, storage component, storage device and data processing system
By deploying two interfaces and storage modules in the storage component and controlling the computing unit and processor to access the storage module synchronously, the time overhead problem of data transmission between the CPU and the storage component is solved, and the system performance is improved.
Patent Information
- Application Number
- CN202410262362.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-06
- Publication Date
- 2025-09-09
AI Technical Summary
When data is transmitted between the CPU and the computing unit on the storage component, the time overhead caused by switching control rights is high, affecting system performance.
By deploying two interfaces and two storage modules in the storage component, and controlling the computing unit and processor to synchronously write data to different storage modules based on the configured binding relationship, switching the binding relationship to achieve data transmission, time overhead is reduced.
It effectively reduces the time overhead during data transmission and improves system performance.
Smart Images

Figure CN120610652A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of near data processing (NDP), and in particular to a data transmission method, a storage component, a storage device, and a data processing system. Background Art
[0002] Currently, NDP technology can be used to offload some computing tasks originally performed by the central processing unit (CPU) to storage components integrated with computing units (such as microprocessor units (MPUs)), thereby significantly reducing long-distance data transmission between the CPU and storage components and improving system performance.
[0003] In related technologies, the CPU and computing units on a storage component can share memory on the storage component, and data transmission between the CPU and computing units is achieved through this shared memory. During data transmission between the CPU and computing units, the CPU and computing units cannot access the shared memory simultaneously. In other words, the shared memory can only be accessed by the CPU or the computing unit at a given time. Therefore, the CPU and computing unit need to switch control of the shared memory to prevent contention and ensure data integrity.
[0004] However, in the above method, switching control rights will bring about a high time overhead, resulting in low data transmission efficiency and affecting system performance. Summary of the Invention
[0005] The embodiments of the present application provide a data transmission method, a storage component, a storage device, and a data processing system, which can effectively reduce the time overhead of data transmission between the processor and the computing unit on the storage component, and improve system performance.
[0006] In the first aspect, the present application provides a data transmission method that can be applied to scenarios such as general computing, high performance computing (HPC), artificial intelligence (AI), etc. that use NDP technology to perform computing tasks. Among them, the present application does not limit the type of computing task. For example, the computing task is matrix multiplication, matrix addition, matrix subtraction, etc. in the field of AI. Schematically, the method is applied to a storage component, the storage component includes a storage device and a computing unit, the storage component is communicatively connected to the processor, and the storage device has a first interface, a second interface, a first storage module, and a second storage module. The method includes:
[0007] In response to a data transmission request, based on a first binding relationship configured on the storage device, controlling the computing unit to write data to the first storage module through the first interface, and controlling the processor to write data to the second storage module through the second interface, wherein the data transmission request instructs the computing unit to perform data transmission between the computing unit and the processor, and the first binding relationship indicates that the first interface is bound to the first storage module and the second interface is bound to the second storage module;
[0008] If the data in the first storage module and the second storage module meet the conditions of the data transmission request, control the storage device to unbind the first interface from the first storage module and unbind the second interface from the second storage module, so as to configure a second binding relationship on the storage device, where the second binding relationship refers to binding the first interface to the second storage module and binding the second interface to the first storage module;
[0009] Based on the second binding relationship, the computing unit is controlled to read data from the second storage module through the first interface, and the processor is controlled to read data from the first storage module through the second interface.
[0010] By deploying two interfaces and two storage modules on the storage device in the storage component and binding each interface to a storage module, the storage component responds to the data transmission request, and based on the binding relationship between the configured interface and the storage module on the storage device, controls the computing unit and the processor to synchronously write data to different storage modules on the storage device, and when the data in the two storage modules meet the conditions of the data transmission request, changes the binding relationship on the storage device, so that the storage module accessed by the computing unit and the processor is switched. Based on this, the computing unit and the processor can synchronously read the data written by each other from the switched storage module to complete the data transmission, effectively reducing the time overhead during the data transmission process.
[0011] In some embodiments, the method further includes: the computing unit sending a first control signal to the storage device through the first interface; the storage device receiving the first control signal and configuring a first binding relationship on the storage device.
[0012] In some embodiments, if the data in the first storage module and the second storage module meet the conditions of the data transmission request, the storage device is controlled to unbind the first interface from the first storage module and the second interface from the second storage module to configure a second binding relationship on the storage device, including: the computing unit sends a second control signal to the storage device through the first interface; the storage device receives the second control signal, and if the data in the first storage module and the second storage module meet the conditions of the data transmission request, the first interface is unbinded from the first storage module and the second interface is unbinded from the second storage module, and the second binding relationship is configured on the storage device.
[0013] In the above manner, since the computing unit and the storage device are directly connected via a physical link, the latency of the computing unit controlling the storage device configuration binding relationship is low and fixed, thereby effectively reducing the time overhead of the data transmission process.
[0014] In some embodiments, the first storage module and the second storage module each include multiple storage cells, and the data transfer request is conditional on data being written to each storage cell in the first storage module and the second storage module. In this way, the integrity of the data written by both the computing unit and the processor can be ensured.
[0015] In some embodiments, there are a first storage space and a second storage space on the first storage module, the first storage space is used to store data written to the first storage module, and the second storage space is used to store first metadata, and the first metadata is used to describe the data to be written to the first storage space; there are a third storage space and a fourth storage space on the second storage module, the third storage space is used to store data written to the second storage module, and the fourth storage space is used to store second metadata, and the second metadata is used to describe the data to be written to the second storage space; the condition of the data transmission request means that the first metadata and the second metadata have been written to the second storage space and the fourth storage space respectively, and the data in the first storage space conforms to the first metadata, and the data in the third storage space conforms to the second metadata.
[0016] In this way, the storage space in the storage module is divided, with one part of the storage space being used to store metadata and the other part of the storage space being used to store data to be transmitted. In this way, the controller on the storage device can quickly determine whether the data in the storage module meets the conditions of the data transmission request based on the metadata, thereby further reducing the time overhead during the data transmission process.
[0017] In some embodiments, the first metadata includes a first data range and a first flag bit, the first data range indicates the range of data to be written to the first storage space, and the first flag bit indicates the storage status of the first storage space; the second metadata includes a second data range and a second flag bit, the second data range indicates the range of data to be written to the third storage space, and the second flag bit indicates the storage status of the third storage space.
[0018] In some embodiments, the first storage module is any one of the following: a register file, a storage array, or a static random access memory (SRAM); the second storage module is any one of the following: a register file, a storage array, or an SRAM.
[0019] In some embodiments, the first storage module is a first register stack, the second storage module is a second register stack, binding the first interface with the first storage module means mapping the first register stack to the first interface so that the computing unit accesses the first register stack through the register number, and binding the second interface with the second storage module means mapping the second register stack to the second interface so that the processor accesses the second register stack through memory access instructions.
[0020] In some embodiments, a computing unit and a processor share memory on a storage component, and in response to a data transmission request, based on a first binding relationship configured on the storage device, controlling the computing unit to write data to the first storage module through the first interface, and controlling the processor to write data to the second storage module through the second interface, includes:
[0021] In response to the data transmission request, if the amount of data to be transmitted is less than or equal to a first threshold, based on the first binding relationship, controlling the computing unit to write data to the first storage module through the first interface, and controlling the processor to write data to the second storage module through the second interface;
[0022] The method further comprises:
[0023] In response to the data transmission request, if the amount of data to be transmitted is greater than the first threshold, control the computing unit to perform data transmission between the memory and the processor.
[0024] In this way, a storage device that transmits fine-grained data (for example, data volume less than or equal to 1KB) but has a low time overhead and a memory that transmits coarse-grained data (for example, greater than 1KB) but has a high time overhead are combined together, so that the data processing system can select the data transmission path in a targeted manner according to the size of the data to be transmitted, thereby improving the overall performance of the system.
[0025] In a second aspect, the present application provides a data transmission method, which is applied to a storage device on a storage component, wherein the storage component further includes a computing unit, the storage component is communicatively connected to a processor, and the storage device has a first interface, a second interface, a first storage module, and a second storage module, the method comprising:
[0026] receiving a first control signal sent by the computing unit through the first interface, and configuring a first binding relationship on the storage device, where the first binding relationship refers to binding the first interface to the first storage module and binding the second interface to the second storage module;
[0027] Receive a second control signal sent by the computing unit through the first interface. If the data in the first storage module and the second storage module meet the conditions of the data transmission request, unbind the first interface from the first storage module and unbind the second interface from the second storage module, and configure a second binding relationship on the storage device. The data transmission request indicates data transmission between the computing unit and the processor, and the second binding relationship means that the first interface is bound to the second storage module and the second interface is bound to the first storage module.
[0028] In some embodiments, the first storage module and the second storage module each include multiple storage units, and the condition of the data transmission request means that data has been written to each storage unit on the first storage module and the second storage module.
[0029] In some embodiments, the first storage module has a first storage space and a second storage space, the first storage space is used to store data written to the first storage module, and the second storage space is used to store first metadata, and the first metadata is used to describe the data to be written to the first storage space; the second storage module has a third storage space and a fourth storage space, the third storage space is used to store data written to the second storage module, and the fourth storage space is used to store second metadata, and the second metadata is used to describe the data to be written to the second storage space; the condition of the data transmission request is that the first metadata and the second metadata have been written to the second storage space and the fourth storage space respectively, and the data in the first storage space conforms to the first metadata, and the data in the third storage space conforms to the second metadata.
[0030] In some embodiments, the first metadata includes a first data range and a first flag bit, the first data range indicates the range of data to be written to the first storage space, and the first flag bit indicates the storage status of the first storage space; the second metadata includes a second data range and a second flag bit, the second data range indicates the range of data to be written to the third storage space, and the second flag bit indicates the storage status of the third storage space.
[0031] In some embodiments, the first storage module is any one of the following: a register file, a storage array, or a static random access memory (SRAM); the second storage module is any one of the following: a register file, a storage array, or an SRAM.
[0032] In some embodiments, the first storage module is a first register file, the second storage module is a second register file, binding the first interface with the first storage module means mapping the first register file to the first interface so that the computing unit accesses the first register file through a register number, and binding the second interface with the second storage module means mapping the second register file to the second interface so that the processor accesses the second register file through a memory access instruction.
[0033] In a third aspect, the present application provides a data transmission method, applied to a processor, wherein the processor is communicatively connected to a storage component, wherein the storage component includes a storage device and a computing unit, and wherein the storage device has a first interface, a second interface, a first storage module, and a second storage module, wherein the method includes:
[0034] In response to the data transmission request, based on a first binding relationship configured on the storage device, write data to the second storage module through the second interface, wherein the first binding relationship refers to that the first interface is bound to the first storage module and the second interface is bound to the second storage module;
[0035] If the binding relationship configured on the storage device is changed from the first binding relationship to the second binding relationship, data is read from the first storage module through the second interface. The second binding relationship means that the first interface is bound to the second storage module and the second interface is bound to the first storage module. The data in the first storage module is written by the computing unit through the first interface when the first binding relationship is configured on the storage device.
[0036] In some embodiments, the computing unit and the processor share a memory on the storage component, and the step of writing data to the second storage module through the second interface in response to the data transmission request based on the first binding relationship configured on the storage device includes:
[0037] In response to the data transmission request, if the amount of data to be transmitted is less than or equal to a first threshold, writing data to the second storage module through the second interface based on the first binding relationship configured on the storage device;
[0038] The method further comprises:
[0039] In response to the data transmission request, if the amount of data to be transmitted is greater than the first threshold, data is transmitted between the memory and the computing unit.
[0040] In a fourth aspect, the present application provides a storage component, which includes a storage device and a computing unit. The storage component is communicatively connected to the processor, and the storage device has a first interface, a second interface, a first storage module and a second storage module. The storage component is used to implement the data transmission method provided by the aforementioned first aspect or any possible implementation method of the first aspect.
[0041] In the fifth aspect, the present application provides a storage device, which is configured in a storage component, and has a first interface, a second interface, a first storage module and a second storage module. The storage device is used to implement the data transmission method provided by the aforementioned second aspect or any possible implementation method of the second aspect.
[0042] In a sixth aspect, the present application provides a data processing system, comprising a processor and a storage component, wherein the processor is communicatively connected to the storage component, the storage component comprises a storage device and a computing unit, and the storage device has a first interface, a second interface, a first storage module, and a second storage module. The system is used to implement the data transmission method provided by the aforementioned first aspect or any possible implementation of the first aspect, or the data transmission method provided by the aforementioned second aspect or any possible implementation of the second aspect.
[0043] In the seventh aspect, the present application provides an electronic device comprising a processor and a storage component, wherein the processor is communicatively connected to the storage component, the storage component comprises a storage device and a computing unit, the storage device has a first interface, a second interface, a first storage module and a second storage module, and the electronic device is used to implement the data transmission method provided by the aforementioned first aspect or any possible implementation of the first aspect, or the data transmission method provided by the aforementioned second aspect or any possible implementation of the second aspect.
[0044] In an eighth aspect, the present application provides a computer-readable storage medium for storing at least one program code segment. When the at least one program code segment is executed by an electronic device, the electronic device implements the data transmission method provided in the first aspect or any possible implementation of the first aspect, or the data transmission method provided in the second aspect or any possible implementation of the second aspect. The storage medium includes, but is not limited to, volatile memory, such as random access memory, and non-volatile memory, such as flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0045] In a ninth aspect, the present application provides a computer program product that, when executed on an electronic device, enables the electronic device to implement the data transmission method provided in the first aspect or any possible implementation of the first aspect, or the data transmission method provided in the second aspect or any possible implementation of the second aspect. The computer program product may be a software installation package. When the aforementioned data transmission method is to be implemented, the computer program product may be downloaded and executed on a computing device or a cluster of computing devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 This is a schematic diagram of an implementation environment provided by an embodiment of the present application;
[0047] Figure 2 This is a schematic diagram of the structure of a storage component provided in an embodiment of the present application;
[0048] Figure 3 is a structural diagram of a storage device provided in an embodiment of the present application;
[0049] Figure 4 This is a schematic diagram of a data transmission process provided by an embodiment of the present application;
[0050] Figure 5 is a structural diagram of another storage device provided in an embodiment of the present application;
[0051] Figure 6 This is a structural diagram of another storage device provided in an embodiment of the present application;
[0052] Figure 7 This is a process diagram of a data transmission method provided by an embodiment of the present application;
[0053] Figure 8 This is a flow chart of a data transmission method provided by an embodiment of the present application;
[0054] Figure 9 This is a flowchart of another data transmission method provided by an embodiment of the present application;
[0055] Figure 10 This is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings. It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions. For example, the data transmission requests, metadata, etc. involved in this application are all obtained with full authorization.
[0057] For ease of understanding, the key terms and key concepts involved in this application are explained below.
[0058] Near data processing (NDP) is a technology that deploys computing units (such as microprocessing units (MPUs)) near or within storage components (such as memory) to perform related data operations. This technology integrates computing units into storage components via high-bandwidth links, giving them computing power. NDP can offload some computing tasks previously performed by the central processing unit (CPU) to the storage components integrated with the computing units, significantly reducing long-distance data transmission between the CPU and storage components and improving system performance.
[0059] Integrated storage and computing is a computer architecture that integrates data storage and computing units, aiming to reduce data transmission latency between the two, improve data processing efficiency, and reduce overall energy consumption. Schematically, near memory computing and in-memory computing are two implementations of integrated storage and computing. In near-memory computing, the storage and computing units are separate but physically close to each other to reduce data transmission latency. The storage unit primarily provides data access, while the computing unit is located near the storage unit, performing data processing and computation. This design reduces data transmission between the storage and computing units and improves computational efficiency, but the storage unit itself does not participate in computation. In in-memory computing, the storage unit itself has computing power and can participate in data processing and computation. This often requires modifying the storage unit to support computational operations. Generally, compared to near-memory computing, in-memory computing can significantly reduce the energy consumption of data movement (the energy consumption of a single data movement is typically 4-1000 times that of a single computation itself). That is, by reducing the long-distance transmission of data, not only can the computing efficiency be improved, but also the energy consumption introduced thereby can be reduced.
[0060] A register file, also known as a register file, is an array of multiple registers, usually implemented by static random-access memory (SRAM).
[0061] A memory array, also known as a hardware array, consists of a large number of memory cells, each capable of storing a single bit of binary data (0, 1). These cells are typically arranged in a matrix of N rows by M columns (where N and M are both positive integers).
[0062] The following is an introduction to the application scenarios and implementation environment of this application.
[0063] The technical solution provided in this application can be applied to scenarios such as general computing, high-performance computing (HPC), and artificial intelligence (AI) that use NDP technology to perform computing tasks. This application does not limit the type of computing tasks; for example, computing tasks in the AI field include matrix multiplication, matrix addition, and matrix subtraction.
[0064] Reference below Figure 1 , introduce the implementation environment of this application.
[0065] Figure 1 This is a schematic diagram of an implementation environment provided by an embodiment of the present application. Figure 1 As shown, the implementation environment includes a data processing system, which includes a processor 100, a storage component 200 and a bus 300. The processor 100 and the storage component 200 are communicatively connected via the bus 300.
[0066] In an embodiment of the present application, a data processing system is a system with computing power and storage capacity, which can be deployed on various electronic devices so that the electronic devices can realize near data processing (NDP) functions. Electronic devices are, for example, terminals, servers, etc., but the present application is not limited thereto. Among them, the terminal can be at least one of a smart phone, a desktop computer, an augmented reality terminal, a tablet computer, an e-book reader, and a laptop computer. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, etc.
[0067] The processor 100 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or an integrated circuit for controlling the execution of the program of the present application. The processor 100 is capable of accessing the storage component 200 via the bus 300. For example, the processor 100 sends a memory access instruction to the storage component 200 via the bus 300 to perform data read and write operations on the storage component 200. Schematically, the processor 100 includes a processing core, a cache, and a memory controller, etc., wherein the processing core is, for example, a core of a CPU, that is, an arithmetic logic unit (ALU), or a control unit (CU), which is not limited in this application. The memory controller is used to control data read and write operations on the storage component 200. In addition, the processor 100 may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The number of processors 100 may be one or more, which is not limited in this application.
[0068] The storage component 200 may be a storage product with programmable processing capabilities, used to provide near data processing functions and provide storage space for the data processing system. In some embodiments, the storage component 200 is also called NDP memory. For example, the storage component 200 is a general-purpose memory bar, or for another example, the storage component 200 is a memory chip integrated on the motherboard of an electronic device, etc., which is not limited in this application. In the data processing system, the number of storage components 200 can be one or more. Figure 1 It is illustrated by taking multiple storage components 200 as an example, for example, multiple storage components 200 constitute a general memory bar. Schematically, the processor 100 can offload the computing task to the storage component 200 for execution, the storage component 200 obtains data from the memory and executes the computing task, writes the execution result of the computing task into the memory, and the processor 100 reads the execution result from the memory, thereby realizing near data processing, reducing long-distance data transmission between the processor 100 and the storage component 200, and improving system performance. In this process, data transmission (or data exchange) between the processor 100 and the storage component 200 is involved. In order to reduce the time overhead of the data transmission process and improve system performance, the present application deploys a storage device 201 in the storage component 200, and the storage device 201 temporarily stores the data to be transmitted between the processor 100 and the storage component 200. For the implementation of the storage component 200 and the storage device 201, please refer to the following Figure 2 and Figure 3 The content shown.
[0069] In some embodiments, the electronic device can access a wireless network or a wired network, wherein the wireless network or wired network uses standard communication technologies and / or protocols. The network includes, but is not limited to, any combination of a data center network, a storage area network (SAN), a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a dedicated network or a virtual private network. In some implementations, technologies and / or formats including hypertext markup language (HTML), extensible markup language (XML), etc. are used to represent data exchanged over the network. In addition, conventional encryption technologies such as secure sockets layer (SSL), transport layer security (TLS), virtual private network (VPN), and internet protocol security (IPsec) can be used to encrypt all or part of the link. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above-mentioned data communication technologies.
[0070] Reference below Figures 2 to 6 , the structure of the storage component 200 in the above-mentioned data processing system is introduced.
[0071] Figure 2 This is a schematic diagram of the structure of a storage component provided by an embodiment of the present application. Figure 2 As shown, the storage component 200 includes a storage device 201 and a computing unit 202 , and the storage device 201 and the computing unit 202 are communicatively connected.
[0072] The storage device 201 includes a controller 2011 and a storage module 2012. The controller 2011 is used to provide a first interface and a second interface, and the storage module 2012 includes a first storage module and a second storage module.
[0073] In the embodiment of the present application, the interface provided by the controller 2011 refers to a logical interface with data access capability. In some embodiments, the first interface is connected to the computing unit 202, so that the computing unit 202 can access the storage device 201 through the first interface; the second interface is connected to the processor, so that the processor can access the storage device 201 through the second interface. In addition, the two storage modules provided by the storage module 2012 are used to provide two storage spaces on the storage device 201, wherein one storage module is bound to one interface, and the binding relationship between the storage module and the interface can be changed. In other words, the two interfaces are respectively bound to two storage modules, and the storage module bound to each interface can be changed.
[0074] Schematically, two binding relationships can be configured on the storage device 201: a first binding relationship and a second binding relationship, and the storage device 201 can switch between these two binding relationships. The first binding relationship refers to the binding of the first interface to the first storage module and the binding of the second interface to the second storage module. In this way, the computing unit 202 can access the first storage module on the storage device 201 through the first interface, that is, read and write data to the first storage module, and the processor can access the second storage module on the storage device 201 through the second interface, that is, read and write data to the second storage module. The second binding relationship refers to the binding of the first interface to the second storage module and the binding of the second interface to the first storage module. In this way, the computing unit 202 can access the second storage module on the storage device 201 through the first interface, that is, read and write data to the second storage module, and the processor can access the first storage module on the storage device 201 through the second interface, that is, read and write data to the first storage module.
[0075] The computing unit 202 is used to provide computing power for the storage component 200. Schematically, the computing unit 202 refers to a computing core for implementing NDP, such as an arithmetic logic unit ALU, a control unit CU, or a microprocessor unit MCU, etc., but the present application is not limited thereto. In an embodiment of the present application, the computing unit 202 is capable of performing computing tasks and transmitting the execution results of the computing tasks to the processor. Accordingly, the processor is also capable of transmitting relevant data of the computing tasks to the computing unit 202 and obtaining the data transmitted by the computing unit 202 (such as the execution results of the computing tasks).
[0076] In some embodiments, the storage component 200 further includes an access interface 203 , a memory 204 , and a memory controller 205 .
[0077] Access interface 203 serves as the processor's interface for accessing storage component 200, shielding the differences between the two devices. Specifically, access interface 203 receives various data requests from the processor and, depending on the type of data request, forwards the data request, for example, to storage device 201 or to memory 204.
[0078] Memory 204 is used to provide storage space for storage component 200. Schematically, the processor and computing unit 202 can share memory 204. When data is transmitted between the processor and computing unit 202, data transmission is achieved by switching control of memory 204. Schematically, memory 204 is implemented by a memory, such as a random access memory (RAM). Random access memory RAM includes static random access memory (SRAM), dynamic random access memory (DRAM), etc., but the present application is not limited thereto.
[0079] The memory controller 205 is used to control memory access within the storage component 200 , or in other words, data read and write operations on the memory 204 . The memory controller 205 is connected to the computing unit 202 .
[0080] It should be noted that the above Figure 2 What is shown is only a structural diagram of a storage component 200 provided in this application. In some embodiments, the storage component 200 may also include other components to achieve more functions, which is not limited in this application.
[0081] Reference below Figure 3 , the structure of the storage device 201 in the above-mentioned storage component 200 is introduced.
[0082] Figure 3 This is a schematic diagram of the structure of a storage device provided in an embodiment of the present application. Figure 3 As shown, the storage device 201 includes a controller 2011 and a storage module 2012. The controller 2011 is used to provide a first interface and a second interface, and the storage module 2012 includes a first storage module and a second storage module.
[0083] Based on the above Figure 2 As can be seen from the shown content, the first interface is connected to the computing unit 202, so that the computing unit 202 can access the storage device 201 through the first interface; the second interface is connected to the processor 100, so that the processor 100 can access the storage device 201 through the second interface.
[0084] In an embodiment of the present application, the controller 2011 can accept the control of the computing unit 202 and configure the binding relationship between the interface and the storage module on the storage device 201. Schematically, the computing unit 202 can send a control signal to the controller 2011 through the first interface, so that the controller 2011 configures the binding relationship between the interface and the storage module on the storage device 201 based on the received control signal. It should be understood that since the binding relationship configured on the storage device 201 can indicate the storage module accessed by the computing unit 202 and the processor 100, the process in which the controller 2011 configures the binding relationship on the storage device 201 is also the process of controlling the computing unit 202 and the processor 100 to access the storage module 2012. In addition, since the computing unit 202 and the storage device 201 are directly connected via a physical link, the delay of the computing unit 202 controlling the storage device 201 to configure the binding relationship is low and fixed, thereby effectively reducing the time overhead of the data transmission process.
[0085] In some embodiments, the storage module 2012 is any of the following: a register file, a storage array, or an SRAM, which is not limited in this application. Schematically, the data in the storage module 2012 can be accessed through a variety of mechanisms, such as an absolute address, an offset, or a register number that can specify an index of the access object. Taking the storage module 2012 as a register file as an example, the first storage module is the first register file, and the second storage module is the second register file. The controller 2011 configures a first binding relationship on the storage device 201, that is, mapping the first register file to the first interface so that the computing unit 202 can access the first register file through the register number, and mapping the second register file to the second interface so that the processor 100 can access the second register file through memory access instructions. Mapping the second register file to the second interface is to map the second interface to a physical address space, so that the processor 100 can access the second interface using memory access semantics. It should be understood that the processor 100 is not aware of the particularity of the interface, and therefore the processor 100 does not have the ability to control this physical address space.
[0086] In some embodiments, the controller 2011 can also monitor and count the status of the storage module 2012. For example, for any storage module including multiple storage units, the controller 2011 can count the number of data reads and writes for each storage unit, or record whether data has been read or written for each storage unit through a flag bit, etc. The storage units are obtained by logically dividing the storage module 2012. For example, if the storage module is a register file, the storage unit can be a register; if the storage module is an SRAM, the storage unit can be an addressable storage address. This application does not limit this.
[0087] based on Figure 3 As can be seen from the storage device 201 shown, in the storage device 201, the controller 2011 can configure the binding relationship between the interface and the storage module on the storage device 201. Based on the binding relationship, the computing unit 202 and the processor 100 can respectively access different storage modules on the storage device 201, that is, the computing unit 202 and the processor 100 can synchronously access the storage device 201. Based on this, when there is a data transmission demand between the computing unit 202 and the processor 100, the computing unit 202 and the processor 100 can synchronously write data to the storage module on the storage device 201 based on the binding relationship configured on the storage device 201. After the data is written, the controller 2011 changes the binding relationship. In this way, the storage modules accessed by the computing unit 202 and the processor 100 are switched (or the storage modules accessed by the computing unit 202 and the processor 100 are flipped). The computing unit 202 and the processor 100 can read the data written by each other from the switched storage module to complete the data transmission, effectively reducing the time overhead during the data transmission process. Refer to the following Figure 4 , an example is given to illustrate this process.
[0088] Figure 4 This is a schematic diagram of a data transmission process provided by an embodiment of the present application. Figure 4 As shown, the storage device 201 includes a controller 2011 and a storage module 2012. The controller 2011 is used to provide a first interface and a second interface. The storage module 2012 includes a first storage module and a second storage module.
[0089] like Figure 4 As shown in Figure (a), a first binding relationship is configured on the storage device 201, and the first binding relationship means that the first interface is bound to the first storage module and the second interface is bound to the second storage module. When there is a data transmission demand between the computing unit 202 and the processor 100, the computing unit 202 responds to the data transmission request and writes data to the first storage module through the first interface, and the processor 100 responds to the data transmission request and writes data to the second storage module through the second interface. The data transmission request indicates that data is transmitted between the computing unit 202 and the processor 100. For example, the data processing system creates a near data processing (NDP) computing task through the processor 100, generates a data transmission request based on the computing task, and sends the data transmission request to the storage component 200. The access interface 203 in the storage component 200 forwards the data transmission request to the controller 2011 and the computing unit 202 on the storage device 201. The controller 2011 controls the computing unit 202 to write data to the first storage module through the first interface, and controls the processor 100 to write data to the second storage module through the second interface.
[0090] like Figure 4 As shown in Figure (b), if the data in the first storage module and the second storage module meet the conditions of the data transmission request (for example, the data to be transmitted by both the processor 100 and the computing unit 202 have been written into the corresponding storage modules), the controller 2011 unbinds the first interface from the first storage module and unbinds the second interface from the second storage module, and configures a second binding relationship on the storage device 201. The second binding relationship means that the first interface is bound to the second storage module and the second interface is bound to the first storage module. Based on this, the computing unit 202 reads data from the second storage module through the first interface, and the processor 100 reads data from the first storage module through the second interface, thereby realizing data transmission between the computing unit 202 and the processor 100. Since the computing unit 200 and the processor 100 can access the storage device 201 synchronously during this process, the time overhead during data transmission is effectively reduced.
[0091] Based on the above Figure 4 It can be seen from the shown content that when there is a need for data transmission between the computing unit 202 and the processor 100, if the data in the first storage module and the second storage module meet the conditions of the data transmission request, the controller 2011 changes the binding relationship configured on the storage device 201. In some embodiments, the condition of the data transmission request means that each storage unit on the first storage module and the second storage module has written data, wherein writing data means that the data is written at least once (the specific counting process can be counted in an addressable space, and repeated writing to the same location can be counted as one time). In this way, the integrity of the data written by both the computing unit and the processor can be ensured. In other embodiments, by storing metadata for describing the data to be transmitted on the storage device 201, the controller 2011 can determine whether the data in the first storage module and the second storage module meet the conditions of the data transmission request based on the metadata. Refer to the following. Figure 5 , this process is introduced.
[0092] Figure 5 This is a schematic diagram of the structure of another storage device provided in an embodiment of the present application. Figure 5 As shown, the storage device 201 includes a controller 2011 and a storage module 2012 . The controller 2011 is used to provide a first interface and a second interface. The storage module 2012 includes a first storage module 2013 and a second storage module 2014 .
[0093] The first storage module 2013 has a first storage space and a second storage space, the first storage space is used to store data written to the first storage module 2013, and the second storage space is used to store first metadata, and the first metadata is used to describe the data to be written to the first storage space. In some embodiments, the first metadata includes a first data range and a first flag. Schematically, the first data range indicates the range of data to be written to the first storage space, and the range of the data is reflected, for example, by a data length or a mask, wherein the data length is used to indicate the length of valid data in a data segment, and the mask is used to indicate the storage unit to which the data is to be written (or which storage units need to have data written). The first flag indicates the storage status of the first storage space, and the storage status is, for example, whether data has been written to the storage unit, or whether the written data is valid data, etc., which is not limited in this application.
[0094] The second storage module 2014 includes a third storage space and a fourth storage space. The third storage space is used to store data to be written to the second storage module 2014, and the fourth storage space is used to store second metadata, which describes the data to be written to the second storage space. In some embodiments, the second metadata includes a second data range and a second flag. The second data range indicates the range of data to be written to the third storage space, and the second flag indicates the storage status of the third storage space. The second data range and the second flag are similar to the first data range and the first flag described above, and therefore are not further described.
[0095] Illustratively, the values of the first flag bit and the second flag bit can be set according to business requirements. For example, the processor 100 and the computing unit 202 can agree that the values of the first flag bit and the second flag bit are as shown in Table 1 below.
[0096] Table 1
[0097] Flag value meaning 0 Initialization completed 1 The processor has finished writing valid data 2 The processor has written invalid data 3 The computing unit has finished writing valid data 4 The computing unit has completed writing invalid data
[0098] Based on the above-mentioned first storage module 2013 and second storage module 2014, the controller 2011 can determine whether the data in the two storage modules meet the conditions of the data transmission request based on the metadata stored in the two storage modules. Schematically, the conditions of the data transmission request refer to that the first metadata and the second metadata have been written into the second storage space and the fourth storage space, respectively, and the data in the first storage space conforms to the first metadata, and the data in the third storage space conforms to the second metadata. Among them, the first metadata has been written into the second storage space means that the first metadata has been written at least once, and the data in the first storage space conforms to the first metadata means that the data in the first storage space conforms to the data described by the first metadata. For example, the first data range in the first metadata is a data length of XX, and the value of the first flag bit is 3. If the first metadata has been written into the second storage space and the length of the valid data in the first storage space is XX, then it is determined that the data in the first storage module meets the conditions of the data transmission request. For another example, the first data range in the first metadata has a data length of 0, and the value of the first flag is 4. If the first metadata has been written into the second storage space and the length of the valid data in the first storage space is 0, then it is determined that the data in the first storage module meets the conditions of the data transmission request. In this case, invalid data can be written into the first storage space, or no data can be written. This is not limited in this application. Similarly, the second metadata has been written into the fourth storage space, which means that the second metadata has been written at least once, and the data in the third storage space is consistent with the second metadata, which means that the data in the third storage space is consistent with the data described by the second metadata. In this way, the storage space in the storage module is divided, a part of the storage space is used to store metadata, and the other part of the storage space is used to store data to be transmitted. In this way, the controller on the storage device can quickly determine whether the data in the storage module meets the conditions of the data transmission request based on the metadata, thereby further reducing the time overhead during the data transmission process.
[0099] In addition, based on the above introduction to the storage module, it can be seen that the first storage module and the second storage module can both be implemented by register stacks. Schematically, in some embodiments, the two storage spaces on the first storage module are respectively implemented by at least one register. Similarly, the two storage spaces on the second storage module are respectively implemented by at least one register. Figure 6 , taking the example that the first storage module and the second storage module are both register stacks, the structure of the storage device 201 is illustrated.
[0100] Figure 6 This is a structural diagram of another storage device provided in an embodiment of the present application. Figure 6As shown, the storage device 201 includes a controller 2011 and a storage module 2012 . The controller 2011 is used to provide a first interface and a second interface. The storage module 2012 includes a first storage module 2013 and a second storage module 2014 .
[0101] The first storage module 2013 is a first register stack, which is used to provide a first storage space and a second storage space, wherein the first storage space is implemented by multiple registers, and the second storage space is implemented by a first data range register and a first flag register, wherein the first data range register is used to store a first data range, such as data length or mask, and the first flag register is used to store a first flag.
[0102] The second storage module 2014 is a second register stack, which is used to provide a third storage space and a fourth storage space, wherein the third storage space is implemented by multiple registers, and the fourth storage space is implemented by a second data range register and a second flag register, wherein the second data range register is used to store a second data range, such as data length or mask, and the second flag register is used to store a second flag.
[0103] Based on the first storage module 2013 and the second storage module 2014, during data transmission between the computing unit 202 and the processor 100, the computing unit 202 can access a register by register number, and the processor 100 can access a register mapped to the processor 100 by memory access instructions. In addition, the controller 2011 can monitor and count the number of read and write accesses to each register to determine whether the data in the two storage modules meets the conditions of the data transmission request.
[0104] After the aforementioned Figures 1 to 6The content shown introduces the data processing system provided by the present application, and the data transmission method applied to the aforementioned data processing system is introduced below. Based on the aforementioned content, it can be seen that the data processing system includes a processor and a storage component, and the storage component can provide a near data processing function. In the process of the processor offloading the computing task to the storage component for execution, data transmission between the processor and the computing unit on the storage component is usually involved. Schematically, the data processing system uses the processor to create a near data processing NDP computing task, generates a data transmission request based on the computing task, and sends the data transmission request to the storage component. The access interface in the storage component forwards the data transmission request to the storage device and the computing unit, so that the processor and the computing unit can synchronously write data to the storage module on the storage device based on the binding relationship configured on the storage device, and when the data in the storage module meets the conditions of the data transmission request, based on the changed binding relationship on the storage device, synchronously read data from the storage module on the storage device to realize data transmission and reduce the time overhead during data transmission.
[0105] In some embodiments, the data processing system can adopt different data transmission paths based on the amount of data to be transmitted indicated by the data transmission request. If the amount of data to be transmitted is less than or equal to a first threshold, data transmission is achieved through a storage device; if the amount of data to be transmitted is greater than the first threshold, data transmission is achieved through a memory shared by the processor and the computing unit. The first threshold is a preset threshold that can be set according to business needs. For example, the first threshold is 1KB. This is only for illustration and does not constitute a limitation of this application.
[0106] Schematically, refer to Figure 7 , Figure 7 This is a process diagram of a data transmission method provided by an embodiment of the present application. Figure 7 As shown, the data processing system includes a processor 100 and a storage component 200. The storage component 200 includes a storage device 201, a computing unit 202, an access interface 203, a memory 204, and a memory controller 205. When there is a data transmission demand between the processor 100 and the computing unit 202, the data sender responds to the data transmission request. If the amount of data to be transmitted is less than or equal to a first threshold, the data transmission is implemented through the storage device 201. If the amount of data to be transmitted is greater than the first threshold, the data transmission is implemented through the memory 204. In this way, the storage device that transmits fine-grained data (for example, data amount less than or equal to 1KB) but has a low time overhead and the memory that transmits coarse-grained data (for example, greater than 1KB) but has a high time overhead are combined together, so that the data processing system can select a data transmission path in a targeted manner according to the amount of data to be transmitted, thereby improving the overall performance of the system.
[0107] The data transmission method provided by this application is introduced below through several method embodiments.
[0108] Figure 8 This is a flow chart of a data transmission method provided by an embodiment of the present application. Figure 8 As shown, the method is applied to a storage component, which includes a storage device and a computing unit. The storage component is communicatively connected to a processor, and the storage device has a first interface, a second interface, a first storage module, and a second storage module. Schematically, the method includes the following steps 801 to 804.
[0109] 801. A storage component configures a first binding relationship on a storage device, where the first binding relationship refers to binding a first interface to a first storage module and binding a second interface to a second storage module.
[0110] In an embodiment of the present application, based on the aforementioned introduction to the storage component, it can be known that the first interface is connected to the computing unit, so that the controller on the storage device can accept the control of the computing unit and configure the binding relationship between the interface and the storage module on the storage device. Schematically, in this step, the computing unit in the storage component sends a first control signal to the storage device through the first interface, the storage device receives the first control signal, and configures the first binding relationship on the storage device. Among them, the first control signal is received by the controller on the storage device, and the first binding relationship is configured on the storage device. It should be understood that configuring the first binding relationship on the storage device is to map the first storage module and the second storage module to the first interface and the second interface respectively. In this way, after configuring the first binding relationship on the storage device, the computing unit can access the first storage module on the storage device through the first interface, that is, read and write data to the first storage module, and the processor can access the second storage module on the storage device through the second interface, that is, read and write data to the second storage module.
[0111] In some embodiments, during the initialization phase of the data processing system, the storage component configures the first binding relationship on the storage device. In other embodiments, the storage component can configure the first binding relationship on the storage device in response to a configuration request sent by the processor. In still other embodiments, the storage component configures the first binding relationship on the storage device when there is a data transmission requirement between the computing unit and the processor. This application does not limit the timing of the storage component configuring the first binding relationship on the storage device.
[0112] 802. The storage component responds to the data transmission request and, based on the first binding relationship configured on the storage device, controls the computing unit to write data to the first storage module through the first interface and controls the processor to write data to the second storage module through the second interface. The data transmission request instructs the computing unit to perform data transmission between the processor.
[0113] In an embodiment of the present application, the storage component controls the computing unit to write data to the first storage module through the first interface, which means that the controller on the storage device in the storage component responds to the data transmission request and receives the data write instruction of the computing unit through the first interface, so that the computing unit writes the data to the first storage module; the storage component controls the processor to write data to the second storage module through the second interface, which means that the controller on the storage device in the storage component responds to the data transmission request and receives the data write instruction of the processor through the second interface, so that the processor writes the data to the second storage module.
[0114] Schematically, the data transmission between the computing unit and the processor can be unidirectional or bidirectional, which is not limited in this application. In the case where the data transmission between the computing unit and the processor is unidirectional, if the condition of the data transmission request means that each storage unit on the first storage module and the second storage module has been written with data, the party that does not have the data transmission demand supports the condition of the data transmission request by writing invalid data into the storage module; if the condition of the data transmission request means that the second storage space and the fourth storage space on the first storage module and the second storage module have been written with the first metadata and the second metadata respectively, and the data in the first storage space conforms to the first metadata and the data in the third storage space conforms to the second metadata, the party that does not have the data transmission demand supports the condition of the data transmission request by writing the corresponding metadata into the storage module. For the specific content of the conditions for the data transmission request, please refer to the above introduction and will not be repeated here.
[0115] In some embodiments, the storage component responds to a data transmission request. If the amount of data to be transmitted is less than or equal to a first threshold, based on a first binding relationship configured on the storage device, the control computing unit writes data to the first storage module via a first interface, and controls the processor to write data to the second storage module via a second interface. In other embodiments, the storage component responds to a data transmission request. If the amount of data to be transmitted is greater than the first threshold, the control computing unit performs data transmission between the memory and the processor. The implementation method of this process is described above and will not be repeated here.
[0116] In some embodiments, when there are first storage space and second storage space on the first storage module and third storage space and fourth storage space on the second storage module, the computing unit writes the data to be transmitted to the first storage space through the first interface, and writes the first metadata to the second storage space through the first interface, and the processor writes the data to be transmitted to the third storage space through the second interface, and writes the second metadata to the fourth storage space through the second interface. For example, taking the example of metadata including data range and flag bit, and taking the value of the flag bit shown in Table 1 as an example, the storage component sets the value of the first flag bit in the second storage space to 0 and the value of the second flag bit in the fourth storage space to 0 during the initialization phase. If the computing unit has a need to transmit data to the processor, the data to be transmitted is written to the first storage space, the data range of the data to be transmitted is written to the second storage space (such as the length of the valid data), and the value of the first flag bit in the second storage space is set to 3; if the computing unit does not have a need to transmit data to the processor, the data range of the data to be transmitted is written to the second storage space (such as the length of the valid data is 0), and the value of the first flag bit in the second storage space is set to 4. Correspondingly, if the processor has a need to transmit data to the computing unit, the data to be transmitted is written to the third storage space, the data range of the data to be transmitted (such as the length of the valid data) is written to the fourth storage space, and the value of the second flag bit in the fourth storage space is set to 1; if the processor does not have a need to transmit data to the computing unit, the data range of the data to be transmitted is written to the fourth storage space (such as the length of the valid data is 0), and the value of the second flag bit in the fourth storage space is set to 2.
[0117] 803. If the data in the first storage module and the second storage module meet the conditions of the data transmission request, the storage component controls the storage device to unbind the first interface from the first storage module and unbind the second interface from the second storage module to configure a second binding relationship on the storage device. The second binding relationship means that the first interface is bound to the second storage module and the second interface is bound to the first storage module.
[0118] In an embodiment of the present application, the computing unit in the storage component sends a second control signal to the storage device through the first interface, and the storage device receives the second control signal. If the data in the first storage module and the second storage module meet the conditions of the data transmission request, the first interface is untied from the first storage module and the second interface is untied from the second storage module, and a second binding relationship is configured on the storage device. It should be understood that configuring the second binding relationship on the storage device is to map the first storage module and the second storage module to the second interface and the first interface respectively. In this way, after configuring the second binding relationship on the storage device, the computing unit can access the second storage module on the storage device through the first interface, that is, read and write data to the second storage module, and the processor can access the first storage module on the storage device through the second interface, that is, read and write data to the first storage module. That is, the storage modules accessed by the computing unit and the processor have been switched (or the storage modules accessed by the computing unit and the processor have been flipped), and the computing unit and the processor can read the data written by each other from the switched storage module to complete the data transmission, effectively reducing the time overhead during the data transmission process.
[0119] In addition, while the computing unit and the processor are writing data to the corresponding storage modules respectively, the controller on the storage device can monitor and count the status of the storage modules to determine whether the data in the storage modules meet the conditions of the data transmission request.
[0120] 804. Based on the second binding relationship, the storage component controls the computing unit to read data from the second storage module through the first interface, and controls the processor to read data from the first storage module through the second interface.
[0121] In an embodiment of the present application, the storage component controls the computing unit to read data from the second storage module through the first interface, which means that the controller on the storage device in the storage component receives the data read instruction of the computing unit through the first interface, so that the computing unit reads data from the second storage module; the storage component controls the processor to read data from the first storage module through the second interface, which means that the controller on the storage device in the storage component receives the data read instruction of the processor through the second interface, so that the processor reads data from the first storage module.
[0122] In some embodiments, when there are first and second storage spaces on the first storage module and third and fourth storage spaces on the second storage module, the processor determines the change in the binding relationship by reading the value of the flag bit in the storage space it accesses. For example, continuing with the value of the flag bit shown in Table 1, if the binding relationship configured on the storage device is the first binding relationship, then in the aforementioned step 802, the processor will set the value of the second flag bit in the fourth storage space to 1 or 2, and the computing unit will set the value of the first flag bit in the second storage space to 3 or 4. After the binding relationship configured on the storage device is changed from the first binding relationship to the second binding relationship, the storage space accessed by the processor is changed from the fourth storage space to the second storage space. In this case, the processor will read that the value of the first flag bit in the second storage space is 3 or 4. In this way, the processor determines that the binding relationship on the storage device has changed and can access the first storage module through the second interface, that is, read data from the first storage module. Accordingly, in the aforementioned step 802, after the processor writes the second metadata to the fourth storage space, it will first poll the value of the flag bit in the storage space it accesses the next time it reads or writes, until its value is 3 or 4, indicating that the binding relationship has changed, and the processor performs subsequent operations according to the agreement.
[0123] In addition, after this step, the storage component can continue to respond to other data transmission requests, and based on the second binding relationship, control the computing unit to write data to the second storage module through the first interface, and control the processor to write data to the first storage module through the second interface, that is, based on the same process as the aforementioned steps 802 to 804, respond to other data transmission requests. In this process, when the data in the two storage modules on the storage device meet the conditions of the data transmission request, the controller changes the second binding relationship on the storage device to the first binding relationship, which will not be repeated here. It should be understood that based on the above introduction, two binding relationships can be configured on the storage device. These two binding relationships can be changed according to the data transmission requirements between the processor and the computing unit, and are not limited to switching from the first binding relationship to the second binding relationship. It can also continue to switch from the second binding relationship back to the first binding relationship, and then switch from the first binding relationship to the second binding relationship, and so on. This application does not limit this.
[0124] It can be seen that in the data transmission method provided in the present application, by deploying two interfaces and two storage modules on the storage device in the storage component, and binding each interface to a storage module, the storage component responds to the data transmission request, and based on the binding relationship between the configured interface and the storage module on the storage device, controls the computing unit and the processor to synchronously write data to different storage modules on the storage device, and when the data in the two storage modules meet the conditions of the data transmission request, changes the binding relationship on the storage device, so that the storage module accessed by the computing unit and the processor is switched. Based on this, the computing unit and the processor can synchronously read the data written by each other from the switched storage module to complete the data transmission, effectively reducing the time overhead during the data transmission process.
[0125] Figure 9 This is a flow chart of another data transmission method provided by an embodiment of the present application. Figure 9 As shown, the method is applied to a data processing system, which includes a processor and a storage component, wherein the processor is in communication with the storage component, the storage component includes a storage device and a computing unit, and the storage device has a first interface, a second interface, a first storage module, and a second storage module. Schematically, the method includes the following steps 901 to 908.
[0126] 901. A computing unit on a storage component sends a first control signal to a storage device on the storage component through a first interface.
[0127] The first interface is connected to the computing unit, and during the initialization phase of the storage component, the computing unit is used to control the storage device to configure the binding relationship between the interface and the storage module.
[0128] 902. The storage device receives a first control signal and configures a first binding relationship on the storage device. The first binding relationship refers to binding a first interface to a first storage module and binding a second interface to a second storage module.
[0129] The controller on the storage device receives the first control signal, binds the first interface to the first storage module, and binds the second interface to the second storage module.
[0130] The aforementioned steps 901 and 902 are similar to the aforementioned step 801 and will not be described in detail.
[0131] 903. The computing unit writes data to the first storage module through the first interface based on the first binding relationship in response to the data transmission request.
[0132] The data transmission request indicates data transmission between the computing unit and the processor.
[0133] In some embodiments, when there are first storage space and second storage space on the first storage module, the computing unit writes the data to be transmitted to the first storage space through the first interface, and writes the first metadata to the second storage space through the second interface. The first metadata includes a first data range and a first flag. For example, if the computing unit needs to transmit data to the processor, the data to be transmitted is written to the first storage space, the data range of the data to be transmitted is written to the second storage space (such as the length of the valid data), and the value of the first flag in the second storage space is set to 3; if the computing unit does not need to transmit data to the processor, the data range of the data to be transmitted is written to the second storage space (such as the length of the valid data is 0), and the value of the first flag in the second storage space is set to 4.
[0134] 904. The processor writes data to the second storage module through the second interface based on the first binding relationship in response to the data transmission request.
[0135] In some embodiments, when there is a third storage space and a fourth storage space on the second storage module, the processor writes the data to be transmitted to the third storage space through the second interface, and writes the second metadata to the fourth storage space through the second interface. The second metadata includes a second data range and a second flag. For example, if the processor has a need to transmit data to the computing unit, the data to be transmitted is written to the third storage space, the data range of the data to be transmitted is written to the fourth storage space (such as the length of the valid data), and the value of the second flag in the fourth storage space is set to 1; if the processor does not have a need to transmit data to the computing unit, the data range of the data to be transmitted is written to the fourth storage space (such as the length of the valid data is 0), and the value of the second flag in the fourth storage space is set to 2.
[0136] Step 903 and step 904 are similar to the aforementioned step 802, so they will not be described in detail. In addition, this application does not limit the execution order of step 903 and step 904. 903 and 904 can be executed simultaneously, in sequence, or first in step 904 before step 903.
[0137] 905. The computing unit sends a second control signal to the storage device through the first interface.
[0138] The calculation unit may execute step 905 after executing step 903 or after executing step 904, and this application does not limit this.
[0139] 906. The storage device receives a second control signal. If the data in the first storage module and the second storage module meet the conditions of the data transmission request, the first interface is unbound from the first storage module and the second interface is unbound from the second storage module, and a second binding relationship is configured on the storage device. The second binding relationship means that the first interface is bound to the second storage module and the second interface is bound to the first storage module.
[0140] Among them, the controller on the storage device receives the second control signal, determines whether the data in the two storage modules meet the conditions of the data transmission request, and if so, unbinds the first interface from the first storage module and unbinds the second interface from the second storage module, binds the first interface to the second storage module and binds the second interface to the first storage module. For example, in the case where the storage module is capable of storing metadata, the controller determines whether the data in the first storage module meets the conditions through the first metadata in the second storage space on the first storage module, and determines whether the data in the second storage module meets the conditions through the second metadata in the fourth storage space on the second storage module. For the specific content of the conditions for the data transmission request, please refer to the above introduction and will not be repeated here.
[0141] Step 905 and step 906 are similar to the aforementioned step 803, so they are not repeated here.
[0142] 907. The computing unit reads data from the second storage module through the first interface based on the second binding relationship.
[0143] In some embodiments, when there is a third storage space and a fourth storage space on the second storage module, the computing unit reads the second metadata from the fourth storage space through the first interface, and reads the data written by the processor from the third storage space according to the instruction of the second metadata.
[0144] 908. The processor reads data from the first storage module through the second interface based on the second binding relationship.
[0145] In some embodiments, when there are a first storage space and a second storage space on the first storage module, the processor reads the first metadata from the second storage space through the second interface, and reads the data written by the processor from the first storage space according to the instruction of the first metadata.
[0146] The aforementioned steps 907 and 908 are similar to the aforementioned step 804, so they will not be repeated. In addition, this application does not limit the execution order of steps 907 and 908. 907 and 908 can be executed simultaneously, can also be executed in sequence, or can be executed first 908, and then step 907.
[0147] In summary, in the data transmission method provided in the present application, by deploying two interfaces and two storage modules on the storage device in the storage component, and binding each interface to a storage module, the storage component responds to the data transmission request, and based on the binding relationship between the configured interface and the storage module on the storage device, controls the computing unit and the processor to synchronously write data to different storage modules on the storage device, and when the data in the two storage modules meet the conditions of the data transmission request, changes the binding relationship on the storage device, so that the storage module accessed by the computing unit and the processor is switched. Based on this, the computing unit and the processor can synchronously read the data written by each other from the switched storage module to complete the data transmission, effectively reducing the time overhead during the data transmission process.
[0148] In addition, the present application also provides an electronic device, referring to Figure 10 , Figure 10 is a schematic diagram of an electronic device provided in an embodiment of the present application, such as Figure 10 As shown, the electronic device 1000 includes a processor 1001, a storage component 1002, a communication interface 1003 and a bus 1004, wherein the processor 1001, the storage component 1002 and the communication interface 1003 are connected to each other through the bus 1004. The storage component 1002 includes a storage device and a computing unit, and the storage device has a first interface, a second interface, a first storage module and a second storage module. The processor 1001 and the storage component 1002 can be integrated together or separately provided. The communication interface 1003 uses a transceiver module such as a transceiver to realize communication between the electronic device 1000 and other devices or a communication network. For example, data can be obtained through the communication interface 1003. The electronic device 1000 is used to implement the data transmission method described above.
[0149] The present application also provides a computer-readable storage medium for storing at least one section of program code. When the at least one section of program code is executed by an electronic device, the electronic device implements the data transmission method described above.
[0150] The present application also provides a computer program product, which, when executed on an electronic device, enables the electronic device to implement the aforementioned data transmission method.
[0151] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items having substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is the quantity and execution order limited. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of the various described examples, the first interface can be referred to as the second interface, and similarly, the second interface can be referred to as the first interface. The first interface and the second interface can both be interfaces, and in some cases, can be separate and different interfaces.
[0152] In this application, the term "at least one" means one or more, and the term "multiple" means two or more. For example, multiple interfaces refer to two or more interfaces.
[0153] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
[0154] In the above embodiments, all or part of the embodiments may be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of program structure information. The program structure information includes one or more program instructions. When the program instructions are loaded and executed on a computing device, all or part of the processes or functions described in the embodiments of the present application are generated.
[0155] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0156] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A data transmission method, characterized in that: Applied to a storage component, the storage component includes a storage device and a computing unit, the storage component is communicatively connected to a processor, the storage device has a first interface, a second interface, a first storage module, and a second storage module, the method includes: In response to a data transmission request, based on a first binding relationship configured on the storage device, controlling the computing unit to write data to the first storage module through the first interface, and controlling the processor to write data to the second storage module through the second interface, wherein the data transmission request indicates data transmission between the computing unit and the processor, and the first binding relationship indicates that the first interface is bound to the first storage module and the second interface is bound to the second storage module; If the data in the first storage module and the second storage module meet the conditions of the data transmission request, control the storage device to unbind the first interface from the first storage module and unbind the second interface from the second storage module, so as to configure a second binding relationship on the storage device, where the second binding relationship refers to binding the first interface to the second storage module and binding the second interface to the first storage module; Based on the second binding relationship, the computing unit is controlled to read data from the second storage module through the first interface, and the processor is controlled to read data from the first storage module through the second interface.
2. The method according to claim 1, characterized in that The method further comprises: The computing unit sends a first control signal to the storage device through the first interface; The storage device receives the first control signal and configures the first binding relationship on the storage device.
3. The method according to claim 1 or 2, characterized in that If the data in the first storage module and the second storage module meet the conditions of the data transmission request, controlling the storage device to unbind the first interface from the first storage module and unbind the second interface from the second storage module to configure a second binding relationship on the storage device includes: The computing unit sends a second control signal to the storage device through the first interface; The storage device receives the second control signal, and if the data in the first storage module and the second storage module meet the conditions of the data transmission request, the first interface is unbound from the first storage module and the second interface is unbound from the second storage module, and the second binding relationship is configured on the storage device.
4. The method according to any one of claims 1 to 3, characterized in that The first storage module and the second storage module each include a plurality of storage units, and the condition of the data transmission request is that data has been written into each storage unit on the first storage module and the second storage module.
5. The method according to any one of claims 1 to 3, characterized in that The first storage module has a first storage space and a second storage space, the first storage space is used to store data written to the first storage module, and the second storage space is used to store first metadata, and the first metadata is used to describe the data to be written to the first storage space; The second storage module has a third storage space and a fourth storage space, the third storage space is used to store data written into the second storage module, and the fourth storage space is used to store second metadata, and the second metadata is used to describe the data to be written into the third storage space; The condition of the data transmission request is that the first metadata and the second metadata have been written into the second storage space and the fourth storage space respectively, and the data in the first storage space conforms to the first metadata, and the data in the third storage space conforms to the second metadata.
6. The method according to claim 5, characterized in that The first metadata includes a first data range and a first flag, the first data range indicating a range of data to be written into the first storage space, and the first flag indicating a storage status of the first storage space; The second metadata includes a second data range and a second flag bit, the second data range indicates a range of data to be written into the third storage space, and the second flag bit indicates a storage status of the third storage space.
7. The method according to any one of claims 1 to 6, characterized in that The first storage module is any one of the following: a register file, a storage array or a static random access memory SRAM; The second storage module is any one of the following: a register file, a storage array or an SRAM.
8. The method according to claim 7, characterized in that The first storage module is a first register file, the second storage module is a second register file, binding the first interface with the first storage module means mapping the first register file to the first interface so that the computing unit accesses the first register file through a register number, and binding the second interface with the second storage module means mapping the second register file to the second interface so that the processor accesses the second register file through a memory access instruction.
9. The method according to any one of claims 1 to 8, characterized in that The computing unit and the processor share a memory on the storage component, and the step of controlling, in response to a data transmission request and based on a first binding relationship configured on the storage device, controlling the computing unit to write data to the first storage module through the first interface, and controlling the processor to write data to the second storage module through the second interface comprises: In response to the data transmission request, if the amount of data to be transmitted is less than or equal to a first threshold, based on the first binding relationship, controlling the computing unit to write data to the first storage module through the first interface, and controlling the processor to write data to the second storage module through the second interface; The method further comprises: In response to the data transmission request, if the amount of data to be transmitted is greater than the first threshold, control the computing unit to perform data transmission between the memory and the processor.
10. A data transmission method, characterized in that: A storage device applied to a storage component, the storage component further comprising a computing unit, the storage component being communicatively connected to a processor, the storage device having a first interface, a second interface, a first storage module, and a second storage module, the method comprising: receiving a first control signal sent by the computing unit through the first interface, and configuring a first binding relationship on the storage device, where the first binding relationship refers to binding the first interface to the first storage module and binding the second interface to the second storage module; Receive a second control signal sent by the computing unit through the first interface. If the data in the first storage module and the second storage module meet the conditions of the data transmission request, unbind the first interface from the first storage module and unbind the second interface from the second storage module, and configure a second binding relationship on the storage device. The data transmission request indicates data transmission between the computing unit and the processor, and the second binding relationship means that the first interface is bound to the second storage module and the second interface is bound to the first storage module.
11. The method according to claim 10, characterized in that The first storage module and the second storage module each include a plurality of storage units, and the condition of the data transmission request is that data has been written into each storage unit on the first storage module and the second storage module.
12. The method according to claim 10, characterized in that The first storage module has a first storage space and a second storage space, the first storage space is used to store data written to the first storage module, and the second storage space is used to store first metadata, and the first metadata is used to describe the data to be written to the first storage space; The second storage module has a third storage space and a fourth storage space, the third storage space is used to store data written into the second storage module, and the fourth storage space is used to store second metadata, and the second metadata is used to describe the data to be written into the third storage space; The condition of the data transmission request is that the first metadata and the second metadata have been written into the second storage space and the fourth storage space respectively, and the data in the first storage space conforms to the first metadata, and the data in the third storage space conforms to the second metadata.
13. The method according to claim 12, characterized in that The first metadata includes a first data range and a first flag, the first data range indicating a range of data to be written into the first storage space, and the first flag indicating a storage status of the first storage space; The second metadata includes a second data range and a second flag bit, the second data range indicates a range of data to be written into the third storage space, and the second flag bit indicates a storage status of the third storage space.
14. The method according to any one of claims 10 to 13, characterized in that The first storage module is any one of the following: a register file, a storage array or an SRAM; The second storage module is any one of the following: a register file, a storage array or an SRAM.
15. The method according to claim 14, characterized in that The first storage module is a first register file, the second storage module is a second register file, binding the first interface with the first storage module means mapping the first register file to the first interface so that the computing unit accesses the first register file through a register number, and binding the second interface with the second storage module means mapping the second register file to the second interface so that the processor accesses the second register file through a memory access instruction.
16. A data transmission method, characterized in that: Applied to a processor, the processor being communicatively connected to a storage component, the storage component including a storage device and a computing unit, the storage device having a first interface, a second interface, a first storage module, and a second storage module, the method comprising: In response to the data transmission request, based on a first binding relationship configured on the storage device, write data to the second storage module through the second interface, wherein the first binding relationship refers to that the first interface is bound to the first storage module and the second interface is bound to the second storage module; If the binding relationship configured on the storage device is changed from the first binding relationship to the second binding relationship, data is read from the first storage module through the second interface. The second binding relationship means that the first interface is bound to the second storage module and the second interface is bound to the first storage module. The data in the first storage module is written by the computing unit through the first interface when the first binding relationship is configured on the storage device.
17. The method according to claim 16, characterized in that The computing unit and the processor share a memory on the storage component, and the responding to the data transmission request, based on the first binding relationship configured on the storage device, writing data to the second storage module through the second interface, includes: In response to the data transmission request, if the amount of data to be transmitted is less than or equal to a first threshold, writing data to the second storage module through the second interface based on the first binding relationship configured on the storage device; The method further comprises: In response to the data transmission request, if the amount of data to be transmitted is greater than the first threshold, data is transmitted between the memory and the computing unit.
18. A storage component, characterized in that: The storage component includes a storage device and a computing unit. The storage component is communicatively connected to the processor. The storage device has a first interface, a second interface, a first storage module and a second storage module. The storage component is used to implement the data transmission method as described in any one of claims 1 to 9.
19. A storage device, characterized in that: The storage device is configured in a storage component. The storage device has a first interface, a second interface, a first storage module and a second storage module. The storage device is used to implement the data transmission method as described in any one of claims 10 to 15.
20. A data processing system, characterized in that: The system includes a processor and a storage component, the processor is communicatively connected to the storage component, the storage component includes a storage device and a computing unit, the storage device has a first interface, a second interface, a first storage module and a second storage module, and the system is used to implement the data transmission method as described in any one of claims 1 to 17.
21. An electronic device, characterized in that: The electronic device includes a processor and a storage component, the processor is communicatively connected to the storage component, the storage component includes a storage device and a computing unit, the storage device has a first interface, a second interface, a first storage module and a second storage module, and is used to implement the data transmission method as described in any one of claims 1 to 17.
22. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store at least one section of program code. When the at least one section of program code is executed by an electronic device, the electronic device implements the data transmission method according to any one of claims 1 to 17.
23. A computer program product, characterized in that When the computer program product is run on an electronic device, the electronic device is enabled to implement the data transmission method according to any one of claims 1 to 17.