Data processing method and system, storage device and electronic device
The storage device receives the data to be processed on the host side and performs operation and processing, which solves the problem of excessive load on the host side processor chip, and achieves the effect of maximizing performance.
Patent Information
- Application Number
- CN202310595692.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-23
- Publication Date
- 2024-11-26
AI Technical Summary
When the host-side processor chip is running at the limit, its performance will be reduced due to temperature and other factors, resulting in the inability to maximize the utilization of its computing power, and the hardware conditions cannot be changed. How to reduce the load on the processor chip to improve performance.
The storage device communicating with the host side shares data processing tasks, receives the pending data and performs operation processing, sends operation results, and reduces the load of the host side processor.
Use storage devices to share data processing tasks on the host side, reduce the load on the processor chip, and maximize its performance.
Smart Images

Figure CN119025013A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, in particular to data processing methods, systems, storage devices, and electronic devices. Background Art
[0002] With the development of communication technology and artificial intelligence, the requirements for host computing power are getting higher and higher. Since the computing power of the processor chip corresponding to the host has been determined at the factory, the performance of the chip cannot be changed later. When the processor chip runs to a certain limit, due to factors such as temperature, the performance of the chip will be reduced to a certain extent for safety reasons.
[0003] How to reduce the load of the host-side processor chip and maximize its performance without affecting the hardware conditions of the processor chip is an urgent problem to be solved. Summary of the invention
[0004] The present application provides a data processing method, system, storage device, and electronic device, which can use a storage device that is communicatively connected to a host side to share the data processing tasks of the host side and reduce the load of a processor chip on the host side.
[0005] In order to solve the above technical problems, a technical solution adopted in the present application is: to provide a data processing method, applied to a storage device, which is communicatively connected to a host side, including: receiving the data to be processed sent by the host side and storing it in a cache; responding to an operation instruction sent by the host side, performing corresponding operation processing based on the data to be processed to obtain an operation result; responding to a first acquisition instruction sent by the host side, sending the operation result to the host side.
[0006] Before receiving the data to be processed sent by the host end, it also includes: in response to a second acquisition instruction sent by the host end, sending a function status mark to the host end, so that the host end sends the data to be processed when the function status mark is a target mark.
[0007] The data to be processed at least includes the data to be operated and the corresponding operation symbols; in response to the operation instructions sent by the host side, the corresponding operation processing is performed based on the data to be processed to obtain the operation result, including: after the data to be processed is received, the operation instructions sent by the host side are received; according to the requirements of the operation instructions, the operation symbols are used to operate the data to be operated to obtain the operation result.
[0008] Among them, the operation result includes the operation result and the operation progress; during the operation process, the error code when each operation symbol participates in the operation and the corresponding operation progress are recorded; in response to the third acquisition instruction sent by the host side, the error code and the operation progress are sent to the host side, so that the host side decides whether the storage device continues to operate based on the error code and the operation progress.
[0009] Among them, the address of the buffer includes a data address segment, a status address segment and a result address segment; among them, the data address segment is used to store the data to be processed sent by the host end, the status address segment is used to store the operation progress, and the result address segment is used to store the operation result.
[0010] The method further includes: in the process of performing corresponding operation processing based on the data to be processed, in response to receiving new data to be processed and new operation instructions, adding the new data to be processed and the new operation instructions to the task queue.
[0011] The step of receiving the data to be processed sent by the host and storing the data in a buffer includes: receiving the data to be processed sent by the host and storing the data in a buffer in a controller in a storage device.
[0012] In order to solve the above technical problems, another technical solution adopted in the present application is: to provide a data processing method, applied to a host side, which is communicatively connected to a storage device, including: sending data to be processed to the storage device so that the storage device stores the data to be processed in a cache; sending an operation instruction to the storage device so that the storage device performs corresponding operation processing based on the data to be processed to obtain an operation result; sending a first acquisition instruction to the storage device so that the storage device feeds back the operation result.
[0013] In order to solve the above technical problems, another technical solution adopted by the present application is: to provide a storage device, which includes a controller and a storage unit. The controller is configured to be communicatively connected to a host end, and the storage unit is coupled to the controller. When the controller is communicatively connected to the host end, it cooperates with the host end to implement the above data processing method.
[0014] In order to solve the above technical problem, another technical solution adopted by the present application is: to provide an electronic device, the electronic device includes a storage device and a processor, wherein the storage device is the above storage device.
[0015] In order to solve the above technical problems, another technical solution adopted in the present application is: to provide a data processing system, which includes a host side and a storage device, wherein the storage device is communicatively connected to the host side, and the host side and the storage device are configured to implement the above data processing method.
[0016] The beneficial effects of the present application are as follows: Different from the prior art, the data processing method provided by the present application is respectively applied to the host side and the storage device, the host side and the storage device are in communication connection, when applied to the storage device, the storage device can receive the data to be processed sent by the host side and store it in the buffer, respond to the operation instruction sent by the host side, perform corresponding operation processing based on the data to be processed, obtain the operation result, and respond to the first acquisition instruction sent by the host side, send the operation result to the host side. By using the storage device to share the data processing task of the host side, the load of the host side processing chip can be reduced, so that the performance of the host side is maximized. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them:
[0018] Figure 1 It is a flowchart of the first embodiment of the data processing method provided by the present application;
[0019] Figure 2 is a schematic diagram of the structure of an embodiment of a buffer address provided by the present application;
[0020] Figure 3 It is a flowchart of the second embodiment of the data processing method provided by the present application;
[0021] Figure 4 It is a structural schematic diagram of an embodiment of a data processing system provided by the present application;
[0022] Figure 5 is a structural schematic diagram of an embodiment of a storage device provided by the present application;
[0023] Figure 6 It is a structural schematic diagram of an embodiment of an electronic device provided by the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0025] See also Figure 1 , Figure 11 is a flow chart of a first embodiment of a data processing method provided by the present application. The data processing method is applied to a storage device, the storage device is communicatively connected to a host end, and the data processing method includes:
[0026] Step 11: Receive the data to be processed sent by the host and store it in the buffer.
[0027] The data to be processed may be a function code, operation data and / or other data, which are not limited here. Among them, the function function may be an abnormal termination process, determination of file access rights, allocation of document storage segments, parity judgment function, absolute value calculation function or others. When the data to be processed is a function code, the data involved in the operation may be processed according to the function. For example, when the function function is an abnormal termination process, the host end may abnormally terminate a process according to the function of the function function. For example, when the function function is a parity judgment function, the host end may perform a parity judgment on the value to determine whether the corresponding value is an odd number or an even number.
[0028] The storage device may be an SSD (Solid State Disk, or Solid State Drive) device, a floppy disk, a hard disk, a tape, a CD (Compact Disc) or a DVD (Digital Video Disc), etc., without limitation here.
[0029] After receiving the data to be processed, the storage device may store the received data to be processed in a buffer in a controller in the storage device.
[0030] Among them, the cache can be a volatile memory, such as static RAM (Static Random-Access Memory, SRAM), dynamic RAM (Dynamic Random Access Memory, DRAM) or synchronous DRAM (Synchronous Dynamic Random-Access Memory, SDRAM), or a non-volatile memory, such as magnetic RAM (Magnetic Random Access Memory, MRAM), resistance RAM (Resistance Random Access Memory, RRAM) or ferroelectric RAM (Ferroelectric Random Access Memory, FRAM), without limitation here.
[0031] In some embodiments, before the storage device receives the data to be processed sent by the host, it sends a functional status mark to the host in response to a second acquisition instruction sent by the host, so that the host sends the data to be processed when the functional status mark is the target mark.
[0032] Specifically, after the host end is connected to the storage device, the CMB (Controller memory buffer) function of the NVME2.0 (NonVolatile Memory Express) of the storage device can be used to store the received data to be processed sent by the host end and perform subsequent operations such as calculations. Among them, NVME2.0 is an interface communication protocol that provides an interface for data processing using a storage device.
[0033] The host side can send a second acquisition instruction to the storage device according to the NVME2.0 protocol to obtain confirmation information and confirm whether the storage device supports processing the data to be processed. The confirmation information is an offset value, and the offset is the 57th bit of the first eight bytes of 00h. If the 57th bit is 1, it means that the storage device supports data processing. If the 57th bit is not 1, it means that the storage device does not support data processing on the host side. When the 57th bit is not 1, you can check whether the CMBSTS bit at offset 58h is valid, and obtain CMB Elasticity Buffer Size Base, CMB ElasticityBuffer Size Units and other data at offset 5Ch for secondary confirmation to determine whether the storage device supports processing the data to be processed.
[0034] In some embodiments, before the storage device receives the data to be processed sent by the host, the host needs to be in a standby state or the transaction being processed has a data processing requirement, and the storage device is in a standby state and supports data processing. When both the host and the storage device meet the conditions, the host can read the address information and capacity information of the cache in the storage device to send the data to be processed that is less than or equal to the cache capacity to the storage device.
[0035] Step 12: In response to the operation instruction sent by the host, corresponding operation processing is performed based on the data to be processed to obtain the operation result.
[0036] In some embodiments, the data to be processed includes at least the data to be operated and the corresponding operation symbol. After the data to be processed is received, the storage device receives the operation instruction sent by the host. Then, the storage device uses the operation symbol to operate on the data to be operated according to the requirements of the operation instruction to obtain the operation result.
[0037] For example, the host side requires the storage device to calculate the sum of the three numbers 1, 2 and 3. At this time, the data to be processed sent by the host side at least includes the numbers "1, 2, 3" and the symbol "+". After the storage device receives the data to be processed, it calculates according to the operation instruction of "calculating the sum of the three numbers 1, 2 and 3" sent by the host side, and obtains the calculation result "6".
[0038] It can be understood that when there are multiple operation methods corresponding to a certain operation instruction, an appropriate operation method can be selected from the multiple operation methods to process the data to be processed according to the requirements of the operation instruction. For example, if the operation instruction is "calculate the sum of the three numbers 1, 2 and 3", the corresponding operation method can be to first calculate the sum between 1 and 2 and then calculate the sum between the sum of the two and 3 (1+2=3, 3+3=6), first calculate the sum between 1 and 3 and then calculate the sum between the sum of the two and 2 (1+3=4, 4+2=6), first calculate the sum between 2 and 3 and then calculate the sum between the sum of the two and 1 (2+3=5, 5+1=6).
[0039] It can be understood that when the host side needs the storage device to perform multiple data processing, different operation instructions correspond to different operation requirements. At this time, the different operation instructions can be sorted according to the order in which they are sent, so as to perform operation processing corresponding to the different operation instructions. For example, the host side sends the two operation instructions "find the sum of the three numbers 1, 2 and 3" and "find the product of the three numbers 1, 2 and 3" in sequence. At this time, it can be determined which operation processing to perform first according to the order in which these two operation instructions are sent or received. The sequence number used for sorting can be customized.
[0040] In some embodiments, the operation result includes the operation result and the operation progress. During the operation process, the error code when each operation symbol participates in the operation and the corresponding operation progress can be recorded. At this time, the storage device can respond to the third acquisition instruction sent by the host end and send the error code and the operation progress to the host end, so that the host end decides whether the storage device continues to operate according to the error code and the operation progress. The error code can be a custom setting, such as 0x00~0xFF, where 0x00 indicates normal operation and 0x01 indicates an operation error.
[0041] For example, the data to be processed includes at least the numbers "1, 2, 3" and the symbol "+", and the operation instruction is "find the sum of the three numbers 1, 2 and 3". At this time, if you choose to calculate the sum of 1 and 2 first and then calculate the sum of the sum of the two and 3 (1+2=3, 3+3=6) to operate on the data to be processed, in the process of processing the data to be processed according to the operation instruction, the error code when each operation symbol participates in the operation and the corresponding operation progress can be recorded. The host side can send a third acquisition instruction at a certain time interval to query the operation progress and the corresponding error code of the storage device. For example, after the calculation of 1+2=3 is completed, the operation status is updated to 50% and the error code is 00h (i.e., 0x00), indicating that there is no error. After the calculation of 3+3=6 is completed, the operation status is updated to 100% and the error code is 00h, indicating that there is no error.
[0042] When calculating 1+2 or 3+3, if the error code is 01h, the host side can send a command to the storage device when it is determined that an operation error occurs to end the storage device's operation; if the operation status is 100% and the error code is 00h, the host side can send a command to the storage device to read the operation result and end the storage device's operation.
[0043] In addition, the operation instructions used in this application can be customized, such as 0x00~0xFF, where 0x00 represents accumulation and 0x01 represents statistics. The way of customizing the operation instructions is more flexible.
[0044] In some embodiments, during the process of performing corresponding operation processing based on the data to be processed, in response to receiving new data to be processed and new operation instructions, the new data to be processed and the new operation instructions are added to the task queue.
[0045] It can be understood that each time the storage device receives data to be processed and an operation instruction, it can add the data to be processed and the operation instruction to the task queue, so as to process the data to be processed in sequence according to the number of the task queue and the requirements corresponding to the operation instruction to obtain the operation result.
[0046] Step 13: In response to the first acquisition instruction sent by the host, the operation result is sent to the host.
[0047] It can be understood that the host side sends the third acquisition instruction to the storage device. When confirming that the operation progress is 100% and there is no error in the operation result, the host side can send the first acquisition instruction to the storage device. The storage device responds to the first acquisition instruction and sends the operation result to the host side.
[0048] In some embodiments, see Figure 2The address of the buffer includes a data address segment, a status address segment, and a result address segment. The data address segment is used to store the data to be processed sent by the host, the status address segment is used to store the operation progress, and the result address segment is used to store the operation result. Moreover, the length of the address segment can be customized according to the actual situation, such as the bytes occupied by the status address segment and the result address segment are smaller than the data address segment.
[0049] In addition, the result address segment can also store a portion of data that has not been completed, such as solving the sum of the three numbers 1, 2 and 3. At this time, the result address segment can store data in the intermediate stages such as 1+2=3, 1+3=4 or 2+3=5.
[0050] Different from the prior art, the data processing method provided by the present application is applied to a storage device, the storage device is connected to the host end in communication, the storage device can receive the data to be processed sent by the host end and store it in a buffer, respond to the operation instruction sent by the host end, perform corresponding operation processing based on the data to be processed, obtain the operation result, and respond to the first acquisition instruction sent by the host end to send the operation result to the host end. By using the storage device to share the data processing task of the host end, the load of the host end processing chip can be reduced to maximize the performance of the host end.
[0051] See also Figure 3 , Figure 3 1 is a flow chart of a second embodiment of a data processing method provided by the present application. The data processing method is applied to a host end, and the host end is communicatively connected with a storage device. The data processing method includes:
[0052] Step 31: Send the data to be processed to the storage device, so that the storage device stores the data to be processed in a buffer.
[0053] In some embodiments, before the host sends the data to be processed to the storage device, the host sends a second acquisition instruction to the storage device, and the storage device sends a functional status mark to the host in response to the second acquisition instruction. When the functional status mark is a target mark, the host sends the data to be processed to the storage device.
[0054] In some embodiments, before the host sends the data to be processed to the storage device, the host needs to be in a standby state or the transaction being processed has a data processing requirement, and the storage device is in a standby state and supports data processing. When both the host and the storage device meet the conditions, the host can read the address information and capacity information of the cache in the storage device to send the data to be processed that is less than or equal to the cache capacity to the storage device.
[0055] Step 32: Send an operation instruction to the storage device so that the storage device performs corresponding operation processing based on the data to be processed to obtain an operation result.
[0056] In some embodiments, the data to be processed includes at least the data to be operated and the corresponding operation symbols. When the host side sends the data to be processed to the storage device, the sent data to be processed can be marked / identified so that after the data to be processed is sent, the operation instruction can be sent to the storage device so that the storage device can operate on the data to be operated according to the requirements of the operation instruction using the operation symbol to obtain the operation result.
[0057] In some embodiments, the operation result includes the operation result and the operation progress. During the operation process, the storage device can record the error code when each operation symbol participates in the operation, as well as the corresponding operation progress. When the host side sends a third acquisition instruction, the storage device can respond to the third acquisition instruction sent by the host side and send the error code and operation progress to the host side, so that the host side decides whether the storage device continues the operation based on the error code and the operation progress.
[0058] Step 33: Send a first acquisition instruction to the storage device, so that the storage device feeds back the operation result.
[0059] It can be understood that when the operation progress of the storage device is 100% and no operation error occurs, the operation result obtained at this time is correct, and the host end can send a first acquisition instruction to the storage device to obtain the operation result.
[0060] Different from the prior art, the data processing method provided by the present application is applied to a storage device, the storage device is connected to the host end in communication, and the storage device is sent to the storage device so that the storage device stores the data to be processed in a buffer, and an operation instruction is sent to the storage device so that the storage device performs corresponding operation processing based on the data to be processed to obtain the operation result, and then a first acquisition instruction can be sent to the storage device so that the storage device feeds back the operation result. In the above manner, the storage device can be used to share the data processing task of the host end, and the load of the host end processing chip can be reduced to maximize the performance of the host end.
[0061] See also Figure 4 , Figure 4 It is a structural diagram of an embodiment of a data processing system provided in the present application. The data processing system 40 includes a host end 401 and a storage device 402. The storage device 402 is communicatively connected to the host end 401. The host end 401 and the storage device 402 cooperate to implement the above-mentioned data processing method, which will not be repeated here.
[0062] See also Figure 5 , Figure 5It is a structural diagram of an embodiment of a storage device 402 provided in the present application, wherein the storage device 402 includes a controller 501 and a storage unit 502, wherein the controller 501 is configured to be communicatively connected to the host end 401, and the storage unit 502 is coupled to the controller 501. When the controller 501 is communicatively connected to the host end 401, the controller 501 cooperates with the host end 401 to implement the above-mentioned data processing method, which will not be repeated here.
[0063] See also Figure 6 , Figure 6 It is a structural diagram of an embodiment of an electronic device provided in the present application. The electronic device 60 includes a storage device 402 and a processor 601. The electronic device 60 can implement the above-mentioned data processing method, which will not be described in detail here.
[0064] To sum up, the data processing method provided in the present application is applied to the host side 401 and the storage device 402. The host side 401 and the storage device 402 are communicatively connected, and the storage device 402 can be used to share the data processing tasks of the host side 401 to reduce the load of the processing chip of the host side 401, so as to maximize the performance of the host side 401.
[0065] The processor involved in this application may be called a CPU (Central Processing Unit), which may be an integrated circuit chip, or a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0066] The storage media used in this application include various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), or a CD.
[0067] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A data processing method, characterized in that: Applied to a storage device, the storage device is communicatively connected to a host end, and the method comprises: Receiving the data to be processed sent by the host and storing it in a buffer; In response to the operation instruction sent by the host end, corresponding operation processing is performed based on the data to be processed to obtain an operation result; In response to a first acquisition instruction sent by the host, the operation result is sent to the host.
2. The method according to claim 1, characterized in that Before receiving the data to be processed sent by the host end, the method further includes: In response to a second acquisition instruction sent by the host end, a function status mark is sent to the host end, so that the host end sends the data to be processed when the function status mark is a target mark.
3. The method according to claim 1, characterized in that The data to be processed at least includes the data to be operated and the corresponding operation symbol; The step of responding to the operation instruction sent by the host end and performing corresponding operation processing based on the data to be processed to obtain the operation result includes: After receiving the data to be processed, receiving the operation instruction sent by the host end; According to the requirements of the operation instruction, the operation symbol is used to operate the data to be operated to obtain the operation result.
4. The method according to claim 3, characterized in that The operation result includes the operation result and the operation progress; During the operation, the error code when each operation symbol is involved in the operation and the corresponding operation progress are recorded; In response to the third acquisition instruction sent by the host, the error code and the operation progress are sent to the host, so that the host determines whether the storage device continues to operate according to the error code and the operation progress.
5. The method according to claim 4, characterized in that The address of the buffer includes a data address segment, a status address segment and a result address segment; The data address segment is used to store the data to be processed sent by the host, the status address segment is used to store the operation progress, and the result address segment is used to store the operation result.
6. The method according to claim 1, characterized in that The method further comprises: In the process of performing corresponding operation processing based on the data to be processed, in response to receiving new data to be processed and new operation instructions, the new data to be processed and the new operation instructions are added to the task queue.
7. The method according to claim 1, characterized in that The receiving the data to be processed sent by the host end and storing it in a buffer includes: The data to be processed sent by the host end is received and stored in a buffer in the controller in the storage device.
8. A data processing method, characterized in that: Applied to a host side, the host side is communicatively connected with a storage device, the method comprises: Sending the data to be processed to the storage device, so that the storage device stores the data to be processed in a buffer; Sending an operation instruction to the storage device so that the storage device performs corresponding operation processing based on the data to be processed to obtain an operation result; A first acquisition instruction is sent to the storage device, so that the storage device feeds back the operation result.
9. A storage device, characterized in that: The storage device comprises: A controller is configured to communicate with a host end; a storage unit, coupled to the controller; Wherein, when the controller is communicatively connected to the host end, it cooperates with the host end to implement the method as described in any one of claims 1-8.
10. An electronic device, characterized in that: The electronic device comprises a storage device and a processor, and the storage device is the storage device according to claim 9.
11. A data processing system, characterized in that: The data processing system comprises: Host side; A storage device is communicatively connected to the host end, and the host end and the storage device cooperate to implement the method according to any one of claims 1-8.
