Data stream processing method and device, electronic equipment and storage medium

By distinguishing the shared and exclusive storage space in the storage device and adopting a pre-response mechanism, the problem of limited data transmission efficiency when multiple host devices in the chip data path is solved, and the effect of improving data transmission efficiency is achieved.

CN119718966AActive Publication Date: 2025-03-28HYGON INFORMATION TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411764232.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-28
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

In the chip data path, when multiple host devices share storage space, the data transmission efficiency is limited by the depth of the storage space and the response signal rate, resulting in increasing the memory depth being unable to improve the transmission efficiency.

Method used

By distinguishing the shared storage space from the exclusive storage space in the storage device, a pre-response mechanism is adopted to pre-response the written object data when the conditions are met, reducing the time when the host device waits for the storage device to return the response.

Benefits of technology

It improves data transmission efficiency, solves the problem that the transmission efficiency cannot be improved by increasing the memory depth, saves time by responding in advance, and reduces the waiting time of the host device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718966A_ABST
    Figure CN119718966A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data stream processing method and device, electronic equipment and a storage medium. The method comprises the following steps: receiving written object data by a storage device; in response to the condition of meeting the pre-response, writing the object data into a first address in the storage device and pre-responding to the writing of the object data, and setting a pre-response flag bit of the first address to be true; and in response to the condition that the pre-response is not met, writing the object data into a second address in the storage device and not pre-responding to the writing of the object data, and setting a pre-response flag bit of the second address to be false. The data stream processing method can improve the data transmission efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to a data stream processing method and device, an electronic device, and a storage medium. Background Art

[0002] With the continuous development of chip design technology, on a data path of the chip, there are often multiple host devices (master) sharing the path and sending data to the same storage device (such as memory). The process of the host device transmitting data includes: transmitting data, waiting for a response, transmitting data, waiting for a response, etc., and repeating this cycle, wherein the response is a signal returned by the storage device to the host device when the data in the storage device is read out. In order to improve the efficiency of data transmission, based on the time of data transmission and response return on the data path, the host device has the ability to continuously process data (also known as "outstanding ability"). For example, if the continuous processing capacity of the host device is Y (Y>1), it means that the host device can continuously send Y data without waiting for a response. If the memory does not return a response after the host device continuously sends Y data, the host device needs to wait for the response to return. If the memory returns y responses (y≤Y) to the host device, the host device can continue to send y data to the memory. Summary of the invention

[0003] At least one embodiment of the present disclosure provides a data stream processing method, comprising: receiving object data to be written by a storage device; and in response to satisfying a condition for making a pre-response, writing the object data to a first address in the storage device and making a pre-response to the writing of the object data, and setting a pre-response flag of the first address to true; in response to not satisfying the condition for making a pre-response, writing the object data to a second address in the storage device and not making a pre-response to the writing of the object data, and setting the pre-response flag of the second address to false.

[0004] For example, the method provided by at least one embodiment of the present disclosure also includes: receiving a read request for the object data written to the storage device; and in response to the pre-response having been performed for the writing of the object data, reading the object data from the first address and setting the pre-response flag of the first address to false; in response to the pre-response not being performed for the writing of the object data, reading the object data from the second address, keeping the pre-response flag of the second address to false, and responding to the reading of the object data.

[0005] For example, the method provided by at least one embodiment of the present disclosure further includes: checking a pre-response flag of a storage address of the object data in the storage device to determine whether the pre-response has been performed on the writing of the object data.

[0006] For example, in the method provided by at least one embodiment of the present disclosure, the storage space of the storage device is divided into a shared storage space and multiple exclusive storage spaces, the shared storage space is shared by multiple host devices that perform read and write operations on the storage device, and the multiple exclusive storage spaces are used exclusively by the multiple host devices, respectively, wherein the first address belongs to the shared storage space, a first host device among the multiple host devices issues a write request for the object data, and the second address belongs to an exclusive storage space among the multiple exclusive storage spaces corresponding to the first host device.

[0007] For example, in the method provided by at least one embodiment of the present disclosure, the depth of the shared storage space is determined according to the depth of the storage space of the storage device and the continuous processing capability of the plurality of host devices.

[0008] For example, in the method provided in at least one embodiment of the present disclosure, the condition for performing a pre-response includes: the shared storage space is not full.

[0009] For example, the method provided by at least one embodiment of the present disclosure further includes: real-time counting of a first number of addresses in the storage device whose pre-response flag is true, wherein when the first number is less than the depth of the shared storage space, the shared storage space is not full.

[0010] For example, the method provided by at least one embodiment of the present disclosure includes: respectively allocating host device serial numbers and initial values ​​of continuously transmittable data values ​​to the multiple host devices, wherein the multiple host devices share the same data path to perform read and write operations on the storage device.

[0011] For example, in the method provided by at least one embodiment of the present disclosure, before the storage device receives the written object data, the method also includes: in response to the continuously transmittable data value of the first host device being not 0, allowing the first host device to continue to send the object data, and reducing the continuously transmittable data value of the first host device by 1 each time the first host device writes the object data to the storage device; or, in response to the continuously transmittable data value of the first host device being 0, pausing the first host device from sending the object data.

[0012] For example, in the method provided by at least one embodiment of the present disclosure, the pre-response to the writing of the object data includes: adding 1 to a value of continuously transmittable data of the first host device that writes the object data.

[0013] For example, in the method provided by at least one embodiment of the present disclosure, the responding to the reading of the object data includes: adding 1 to a value of continuously transmittable data of the first host device that writes the object data.

[0014] At least one embodiment of the present disclosure also provides a data stream processing device, comprising: a receiving module, configured to receive object data for writing; a control module, configured to, in response to satisfying a condition for making a pre-response, write the object data to a first address in the storage device and make a pre-response to the writing of the object data, and set a pre-response flag of the first address to true; in response to not satisfying the condition for making a pre-response, write the object data to a second address in the storage device and do not make a pre-response to the writing of the object data, and set the pre-response flag of the second address to false.

[0015] At least one embodiment of the present disclosure further provides a data stream processing device, comprising: a memory and at least one processor; wherein the memory is used to store program code, and the at least one processor is used to call the program code stored in the memory so that the processor executes the data stream processing method provided in any of the above embodiments.

[0016] At least one embodiment of the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium stores program code, and when the program code is executed by a computer device, the computer device executes the data stream processing method provided by any of the above embodiments.

[0017] At least one embodiment of the present disclosure further provides an electronic device, comprising a plurality of host devices and a storage device, wherein the storage device is coupled to the plurality of host devices via a data path, and comprises a data stream processing device according to any embodiment of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly introduced below. Obviously, the drawings in the following description only relate to some embodiments of the present disclosure, but are not intended to limit the present disclosure.

[0019] Figure 1 A flow chart of a data stream processing method provided by at least one embodiment of the present disclosure is shown;

[0020] Figure 2 A schematic diagram showing a response to the reading of object data provided by at least one embodiment of the present disclosure is shown;

[0021] Figure 3 A schematic diagram showing a storage space of a storage device provided by at least one embodiment of the present disclosure;

[0022] Figure 4 A schematic diagram showing a pre-response to writing of object data provided by at least one embodiment of the present disclosure is shown;

[0023] Figure 5 A structural block diagram of an electronic device provided by at least one embodiment of the present disclosure is shown; and

[0024] Figure 6 A structural block diagram of another electronic device provided by at least one embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings of the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0026] Unless otherwise defined, the technical terms or scientific terms used in the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, similar words such as "one", "one" or "the" do not indicate quantity restrictions, but indicate that there is at least one. Similar words such as "include" or "comprise" mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Similar words such as "connect" or "connected" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0027] As mentioned above, on a data path of a chip, there are often multiple host devices that share the path and transmit data to the same storage device (e.g., memory). When the data stored in the storage device is read out, the storage device generates a response signal and returns the response signal to the corresponding host device (i.e., the host device that writes the read data to the storage device), thereby ensuring the reliability of the data in the storage device and preventing memory overflow or memory leakage.

[0028] The inventors of the present disclosure have noticed that when the depth (N) of the storage space of the storage device is less than the sum of the continuous processing capabilities of the plurality of host devices, that is, When the depth of the storage space is greater than the sum of the continuous processing capabilities of multiple host devices, the data transmission efficiency is mainly affected by the depth of the storage space. In this case, the data transmission efficiency can be improved by increasing the depth of the storage space. However, when the depth of the storage space (N) is greater than the sum of the continuous processing capabilities of multiple host devices, that is, When the storage space is larger than 100, the data transmission efficiency is mainly limited by the rate at which the storage device returns a response signal. At this time, even if the depth of the storage space is further increased, the data transmission efficiency cannot be further improved.

[0029] In view of the above shortcomings, one or more embodiments of the present disclosure provide a data stream processing method and device, an electronic device, and a storage medium.

[0030] The data stream processing method includes: receiving object data to be written by a storage device; in response to satisfying a condition for performing a pre-response, writing the object data to a first address in the storage device and performing a pre-response to the writing of the object data, and setting the pre-response flag of the first address to true; in response to not satisfying the condition for performing a pre-response, writing the object data to a second address in the storage device and not performing a pre-response to the writing of the object data, and setting the pre-response flag of the second address to false. The data stream processing method saves the time required for responding after the object data is read out from the storage device by performing a pre-response (or responding in advance) to the object data written to the first address in the storage device when writing, that is, reducing the time for the host device to wait for the storage device to return a response, thereby improving the data transmission efficiency, and further solving the problem that the transmission efficiency cannot be improved by increasing the memory depth.

[0031] The present disclosure is described below through several specific embodiments. In order to keep the following description of the embodiments of the present disclosure clear and concise, detailed descriptions of known functions and known components may be omitted. When any component of the embodiments of the present disclosure appears in more than one figure, the component is represented by the same or similar reference numeral in each figure.

[0032] The data stream processing method provided by at least one embodiment of the present disclosure is applicable to a scenario in which multiple host devices with continuous data processing capabilities share the same data path to perform read and write operations on a storage device.

[0033] like Figure 1 , which is a flowchart of a data stream processing method provided by at least one embodiment of the present disclosure, the method includes steps S101 - S102 .

[0034] Step S101: The storage device receives the object data to be written.

[0035] It should be noted that the storage device in the embodiments of the present disclosure can perform read and write operations at the same time. For example, the storage device may include random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), non-volatile random access memory (NVRAM), flash memory, cache, dual-port memory, etc. The present disclosure does not limit this, for example, it can be used for internal memory.

[0036] Here, "object data" is used to refer to data that describes an object and can be arbitrarily processed by the above-mentioned method.

[0037] Step S102: In response to the condition for performing a pre-response being met, the object data is written to a first address in the storage device and a pre-response is performed on the writing of the object data, and the pre-response flag of the first address is set to true; in response to the condition for performing a pre-response not being met, the object data is written to a second address in the storage device and no pre-response is performed on the writing of the object data, and the pre-response flag of the second address is set to false.

[0038] For example, when the storage device receives object data to be written, in response to satisfying the condition for performing a pre-response, the object data is written to a first address in the storage device, and a pre-response is performed to the writing of the object data, that is, a pre-response signal is returned to the device (e.g., a host device) that writes the object data, so that the device can continue to write a new object data to the storage device, and the pre-response flag of the first address is set to true (e.g., set to 1), indicating that a pre-response has been performed to the writing of the object data. In response to not satisfying the condition for performing a pre-response, the object data is written to a second address (different from the aforementioned first address) in the storage device, and no pre-response is performed, that is, no pre-response signal is returned to the device that writes the object data, and the pre-response flag of the second address is set to false (e.g., set to 0), indicating that a pre-response has not been performed to the writing of the object data. For example, the first address and the second address are any two addresses in the storage device, for example, belonging to different set areas.

[0039] For example, the condition for performing a pre-response may be that the number of addresses in the storage device whose pre-response flag is true is less than a preset first threshold, wherein the first threshold may be set by a user according to the depth of the storage device.

[0040] In at least one embodiment of the present disclosure, the data stream processing method further includes steps S103 - S104 .

[0041] Step S103: receiving a read request for target data to be written into the storage device.

[0042] Step S104: In response to a pre-response to the writing of the object data, the object data is read from the first address, and the pre-response flag of the first address is set to false; in response to no pre-response to the writing of the object data, the object data is read from the second address, and the pre-response flag of the second address is kept false, and a response is made to the reading of the object data.

[0043] With respect to step S104, if the storage device has pre-responded to the writing of the object data, it is equivalent to responding to the reading of the object data in advance, so when the object data is actually read, the storage device will no longer respond to the reading of the object data to return a response signal. On the other hand, if it is determined that no pre-response is performed when the object data is written, the object data is read from the second address and a response is made to the reading of the object data (this response can be referred to as a normal response, hereinafter referred to as a "response"). This response made when the data is read is later in operation timing than the aforementioned response made when the data is written. In addition, the pre-response flag of the second address is still kept false when responding.

[0044] For example, it is possible to determine whether a pre-response has been made to the writing of the object data by checking the pre-response flag of the storage address of the object data in the storage device, and thereby determine whether a response has been made to the reading of the object data.

[0045] As described above, in one or more embodiments of the present disclosure, "pre-response" and "normal response" are different types of response modes, and the former is different from the latter in operation timing and is earlier than the latter. For example, the former is a response performed when the storage device writes object data when the conditions for performing a pre-response are met, while the latter is a response performed when the object data is read when the conditions for performing a pre-response are not met.

[0046] Figure 2 A schematic diagram of responding to the reading of object data provided by at least one embodiment of the present disclosure.

[0047] like Figure 2 As shown, when receiving a read request for first object data written to a storage device, a pre-response flag of a storage address of the first object data in the storage device is first checked, and based on the pre-response flag, it is determined whether to respond, where "first object data" is any data stored in the storage device that describes an object.

[0048] For example, if the pre-response flag corresponding to the first object data is false, it means that the storage device has not pre-responded to the writing of the first object data. When reading the first object data, the storage device needs to respond to the reading of the first object data, generate a response signal post_credit_return and return it to the host device that wrote the first object data. If the pre-response flag corresponding to the first object data is true, it means that the storage device has pre-responded to the writing of the first object data, which is equivalent to having responded to the reading of the first object data in advance. At this time, the first object data can be directly read, and the pre-response flag corresponding to the first object data is set to false.

[0049] At least one embodiment of the present disclosure provides a data stream processing method in which a storage device can perform read and write operations simultaneously. For example, for the writing of object data that meets the pre-response condition, the storage device can return a pre-response signal in advance, and for the writing of object data that does not meet the pre-response condition, the storage device returns a response signal when the object data is read from the storage device. Therefore, the storage device can perform two types of responses (returning the pre-response signal and the usual response signal), which improves the rate at which the storage device returns the response signal as a whole, thereby improving data transmission efficiency.

[0050] It should be noted that the pre-response signal generated by a pre-response and the response signal generated by a normal response can be the same signal. In this case, the difference between the pre-response signal and the normal response signal is that the pre-response signal is a signal returned in advance when the object data is written to the storage device, and the response signal is a signal returned normally when the object data is read from the storage device.

[0051] For example, in at least one embodiment, the storage space of the storage device can be divided into a shared storage space and multiple exclusive storage spaces, the shared storage space is shared by multiple host devices that perform read and write operations on the storage device, and the multiple exclusive storage spaces are used exclusively by multiple host devices, that is, the multiple exclusive storage spaces correspond to multiple host devices one by one. For example, the controller (control circuit) of the storage device divides and manages the shared storage space and the exclusive storage space. For example, the first address in the above embodiment belongs to the shared storage space, the second address belongs to the exclusive storage space corresponding to the first host device among the multiple exclusive storage spaces, and the first host device among the multiple host devices issues a write request for the object data, wherein the first host device is any one of the multiple host devices. For example, the depth of the shared storage space is determined according to the depth of the storage space of the storage device and the continuous processing capability of the multiple host devices; the depth of the exclusive storage space is determined according to the continuous processing capability of the corresponding host device.

[0052] For example, a host device with an outstanding processing capability of Y can continue to send Y object data to the storage device without receiving a returned response signal or a pre-response signal, wherein the outstanding processing capability of the host device can be determined based on factors such as memory access latency and bandwidth, for example, and can be preset in advance and remain unchanged, or adjusted after the system has been running for a predetermined period of time.

[0053] Figure 3 A schematic diagram of a storage space of a storage device provided for at least one embodiment of the present disclosure.

[0054] like Figure 3 As shown, host devices 0 to 4 share the same data path to perform read and write operations on the storage device. Based on the depth N of the storage space of the storage device and the continuous processing capabilities of host devices 0 to 4, the storage space of the storage device is divided into shared storage space and exclusive storage space 0 to 4, wherein the depths of exclusive storage space 0 to 4 are Y0, Y1, Y2, Y3 and Y4 respectively, and the depth N of the storage space of the storage device satisfies the relationship Then the depth X of the shared storage space is When the shared storage space is not full, host devices 0 to 4 will give priority to writing the object data into the shared storage space. When the shared storage space is full, host devices 0 to 4 will write the object data into their own exclusive storage spaces. For example, when the shared storage space is full, host device 0 will write the object data into the corresponding exclusive storage space 0. When the exclusive storage space corresponding to a host device is also full, the data writing operation from the host device is suspended.

[0055] It should be noted that if the depth N of the storage space of the storage device satisfies the relation The storage space of the storage device is divided into n exclusive storage spaces, and no shared storage space exists in the storage space of the storage device. For example, when any host device among the plurality of host devices writes object data to the storage device, the condition for performing a pre-response may be that the shared storage space is not full.

[0056] Figure 4 A schematic diagram of pre-responding to writing of object data is provided for at least one embodiment of the present disclosure.

[0057] like Figure 4As shown, when the first object data written into the storage device is received, it is first determined whether the condition for pre-response is met, that is, whether the shared storage space is full. If it is determined that the shared storage space is full, no pre-response is made to the writing of the object data, that is, no pre-response signal is generated, and the received object data is directly written to the exclusive storage space exclusively used by the host device that sent the object data, and the pre-response flag of the address where the object data is written is set to false. If it is determined that the shared storage space is not full, the received object data is written to the shared storage space, and then a pre-response is made to the writing of the object data, that is, a pre-response signal pre_credit_return is generated and returned to the host device that wrote the object data, and the pre-response flag of the address where the object data is written is set to true.

[0058] For example, in at least one embodiment, the method for determining whether the shared storage space is not full may include: real-time counting of a first number of addresses in the storage device whose pre-response flag is true, and in response to the first number being less than the depth of the shared storage space, determining that the shared storage space is not full. In other embodiments, other methods may be used to determine whether the shared storage space is not full, and the present disclosure does not limit this.

[0059] In at least one embodiment, the host device 0 writes the object data 0 into the storage device. At the current moment, if the first number of addresses whose pre-response flag is true in the storage device is less than the depth X of the shared storage space, it indicates that the shared storage space is not full, the host device 0 preferentially writes the object data 0 into the first address of the shared storage space, sets the pre-response flag of the first address to true, and the storage device pre-responds to the writing of the object data 0, and returns a pre-response signal to the host device 0. If the first number is equal to the depth X of the shared storage space, it indicates that the shared storage space is full, the host device 0 writes the object data 0 into the second address of the exclusive storage space 0 corresponding to the host device 0, sets the pre-response flag of the second address to false, and the storage device does not pre-respond to the writing of the object data 0 until a read request for the object data 0 is received, then responds to the reading of the object data 0, and returns a response signal to the host device 0. If the first number is greater than the depth X of the shared storage space, it indicates that there is an error in the data reading and writing process, and the reading and writing operations are terminated.

[0060] It should be noted that in the embodiments of the present disclosure, the division of the shared storage space and the multiple exclusive storage spaces is not fixed, that is, the addresses included in the shared storage space and the addresses included in each exclusive storage space are not fixed addresses. For example, when the shared storage space is not full (for example, the number of addresses in the storage device whose pre-response flag is true is less than the depth of the shared storage space, or the storage space of the current storage device is empty), the default object data is written to the shared storage space, that is, the address storing the object data in the storage space is the address belonging to the shared storage space. When the shared storage space is full (for example, the number of addresses in the storage device whose pre-response flag is true is equal to the depth of the shared storage space), if the first host device writes the first object data to the first address in the storage space, at this time, the first address is defaulted to belong to the exclusive storage space corresponding to the first host device.

[0061] Compared with using fixed addresses to divide the storage space of a storage device, by using the method of dividing shared storage space and exclusive storage space provided by the embodiments of the present disclosure, the data flow processing method can only use normal synchronous first-in-first-out (FIFO) read-write pointer control logic, effectively reducing the control logic for the read-write pointer.

[0062] For example, in at least one embodiment of the present disclosure, the data stream processing method further includes: assigning host device serial numbers (IDs) and initial values ​​of continuously transmittable data values ​​to multiple host devices respectively, wherein multiple host devices share the same data path to perform read and write operations on the storage device. The initial values ​​of the continuously transmittable data values ​​of the multiple host devices are determined based on their respective continuous processing capabilities, or based on the depth of their corresponding exclusive storage spaces. For example, in order to improve data transmission efficiency, the initial value of the continuously transmittable data value of the host device can be set to be equal to the continuous processing capability of the host device (e.g., Y), that is, the maximum value of the initial value. The initial value of the continuously transmittable data value of the host device can be understood as the depth of the exclusive storage space corresponding to the host device, and the current continuously transmittable data value of the host device can be understood as the number of currently empty addresses of the exclusive storage space corresponding to the host device, that is, the number of addresses to which the object data has not yet been written.

[0063] For example, in at least one embodiment of the present disclosure, before the storage device receives the written object data, the above-mentioned data stream processing method also includes: in response to the continuously transmittable data value of the first host device being not 0, allowing the first host device to send the object data, and reducing the continuously transmittable data value of the first host device by 1 each time the first host device writes the object data to the storage device; or in response to the continuously transmittable data value of the first host device being 0, pausing the first host device from sending the object data.

[0064] For example, the “preliminary response to the writing of the object data” in the above step S102 includes: adding 1 to the value of the continuous transmittable data of the first host device that writes the object data.

[0065] For example, in the above step S104, "responding to the reading of the target data" includes: adding 1 to the value of the continuously transmittable data of the first host device that writes the target data.

[0066] In the above example, the host device serial number is used to return a pre-response signal or a response signal to the corresponding host device. When pre-responding to the writing of the object data, a pre-response signal pre_credit_return[i] can be returned to the first host device that wrote the object data, so that the first host device's continuously transmittable data value is increased by 1; when responding to the reading of the object data, a response signal post_credit_return[i] can be returned to the first host device that wrote the object data, so that the first host device's continuously transmittable data value is increased by 1, wherein "i" in the pre-response signal pre_credit_return[i] and the response signal post_credit_return[i] represents the serial number of the first host device.

[0067] In order to facilitate understanding of the calculation principle of the continuously transmittable data value of the host device, the following description is made by taking the host device 0 and the host device 1 performing read and write operations on the storage device as an example. The initial values ​​of the continuously transmittable data value (credit) of the host device 0 and the host device 1 are set to credit0=4 and credit1=3 respectively, that is, the exclusive storage space depth corresponding to the host device 0 is 4 and can store at most 4 object data sent by the host device 0, and the exclusive storage space depth corresponding to the host device 1 is 3 and can store at most 3 object data sent by the host device 1. In the first cycle, the host device 0 writes the object data 0 to the storage device, so that the continuously transmittable data value credit0 of the host device 0 is reduced by 1 (that is, credit0=4-1=3). If the writing of object data 0 satisfies the condition for making a pre-response (for example, the shared storage space is not full), object data 0 is written into the shared storage space (that is, object data 0 is written into the storage device, and the address storing object data 0 in the storage device is divided into the address belonging to the shared storage space), the storage device makes a pre-response and returns a pre-response signal pre_credit_return[0], so that the continuously transmittable data value credit0 of host device 0 is increased by 1, at which time, the continuously transmittable data value credit0 of host device 0=3+1=4. If the writing of object data 0 does not satisfy the condition for making a pre-response (for example, the shared storage space is full), object data 0 is written into the exclusive storage space 0 corresponding to host device 0 (that is, object data 0 is written into the storage device, and the address storing object data 0 in the storage device is divided into the address belonging to the exclusive storage space 0 corresponding to host device 0), and the storage device does not make a pre-response, at which time, the current continuously transmittable data value credit0 of host device 0 is 3. Afterwards, when the shared storage space is full, the host device 0 can continuously write (or send) up to 3 object data to the storage device, and the addresses storing these 3 object data in the storage device are also divided into the addresses belonging to the exclusive storage space 0 corresponding to the host device 0, and after writing these 3 object data, the continuous sendable data value credit0 of the host device 0 becomes 0, and the host device 0 stops writing object data to the storage device. Therefore, when the host device writes object data to the shared storage space, the continuous sendable data value of the host device remains unchanged; when the host device writes object data to the corresponding exclusive storage space, each time 1 object data is written to the corresponding exclusive storage space, the continuous sendable data value of the host device decreases by 1.

[0068] For another example, after several cycles, the current values ​​of the continuously transmittable data values ​​(credit) of the host device 0 and the host device 1 are credit0=3 and credit1=1 respectively. When the host device 0 writes the object data 0 into the shared storage space, the object data 1 in the storage device can also be read. If the object data 1 is written into the storage device by the host device 0, and no pre-response is made to the writing of the object data 1 (i.e., the pre-response flag of the address storing the object data 1 is false, and the address storing the object data 1 belongs to the exclusive storage space corresponding to the host device 0), the storage device responds to the reading of the object data 1 and returns a response signal post_credit_return[0]. That is, in the current operation cycle, the storage device returns the pre-response signal pre_credit_return[0] and the response signal post_credit_return[0] to the host device 0, so that the continuously transmittable data value credit0 of the host device 0 increases by 2. At this time, the credit0 of the host device 0 becomes 4, and the credit1 of the host device 1 is still 1. If the object data 1 is written to the storage device by the host device 1, and no pre-response is made to the writing of the object data 1 (i.e., the pre-response flag of the address storing the object data 1 is false, and the address storing the object data 1 belongs to the exclusive storage space corresponding to the host device 1), the storage device responds to the reading of the object data 1 and returns a response signal post_credit_return[1], that is, in the current operation cycle, the storage device returns a pre-response signal pre_credit_return[0] to the host device 0 and a response signal pre_credit_return[1] to the host device 1, so that the continuously transmittable data values ​​of the host device 0 and the host device 1 are respectively increased by 1, and at this time, credit0=3 and credit1=2. At least one embodiment of the present disclosure also provides a data stream processing device corresponding to the data stream processing method and an electronic device including the data stream processing device. Since the principle of solving the problem by the electronic device in the embodiment of the present disclosure is similar to the above-mentioned data stream processing method in the embodiment of the present disclosure, in the following description, the implementation of the electronic device of the data stream processing device can also refer to the implementation of the method, and the repeated parts will not be repeated.

[0069] like Figure 5As shown, it is a structural block diagram of an electronic device provided by at least one embodiment of the present disclosure, and the electronic device includes multiple host devices (host device 0 to host device N, N is an integer greater than 0) and a storage device 510. The storage device 510 is coupled to the multiple host devices through a data path, and the storage device 510 includes a data stream processing device 511 provided by any embodiment of the present disclosure and a storage array (not shown in the figure) that provides storage space. For example, the storage array includes multiple storage units arranged in an array and a driving circuit for driving these storage units. The driving circuit may include a row driving circuit, a column driving circuit, an address resolution circuit, etc. For example, the storage array may also include multiple sub-arrays, etc., and the embodiments of the present disclosure are not limited to this.

[0070] For example, in at least one embodiment of the present disclosure, the above-mentioned multiple host devices may include one or more processor cores; for example, the data path may be a system bus, which is not limited in the embodiments of the present disclosure.

[0071] The data stream processing device 511 includes a receiving module 5110 and a control module 5112. The receiving module 5110 is configured to receive written object data. The control module 5112 is configured to, in response to satisfying the condition for performing a pre-response, write the object data to a first address in the storage device and perform a pre-response to the writing of the object data, and set the pre-response flag of the first address to true; in response to not satisfying the condition for performing a pre-response, write the object data to a second address in the storage device and do not perform a pre-response to the writing of the object data, and set the pre-response flag of the second address to false.

[0072] For example, the receiving module 5110 can be implemented as a receiving circuit, coupled with the data path to receive the written object data; for example, the receiving circuit includes a transceiver and a cache circuit. For example, the control module 5112 can be implemented as a control circuit (or controller) for dividing and managing the storage space.

[0073] In a possible implementation, the receiving module 5110 is further configured to receive a read request for object data written into the storage device. The control module 5112 is further configured to, in response to a pre-response to the writing of the object data, read the object data from the first address and set the pre-response flag of the first address to false; and in response to no pre-response to the writing of the object data, read the object data from the second address and keep the pre-response flag of the second address to false, and respond to the reading of the object data.

[0074] In a possible implementation, the control module 5112 includes a detection module configured to check a pre-response flag of a storage address of the object data in the storage device to determine whether a pre-response has been made to the writing of the object data.

[0075] In one possible implementation, the storage space of the storage device 510 is divided into a shared storage space and multiple exclusive storage spaces, the shared storage space is shared by multiple host devices that perform read and write operations on the storage device 510, and the multiple exclusive storage spaces are used exclusively by the multiple host devices, respectively, wherein a first address belongs to the shared storage space, a first host device among the multiple host devices issues a write request for object data, and a second address belongs to an exclusive storage space among the multiple exclusive storage spaces corresponding to the first host device.

[0076] In a possible implementation, the depth of the shared storage space is determined according to the depth of the storage space of the storage device 510 and the continuous processing capabilities of the plurality of host devices.

[0077] In a possible implementation, the condition for making a pre-response includes: the shared storage space is not full.

[0078] In a possible implementation, the data stream processing device 511 further includes a counting module, which is configured to count in real time a first number of addresses in the storage device whose pre-response flag is true, wherein when the first number is less than the depth of the shared storage space, the shared storage space is not full.

[0079] In a possible implementation, the data stream processing device 511 further includes an allocation module, which is configured to respectively allocate host device serial numbers and initial values ​​of continuously transmittable data values ​​to multiple host devices, wherein the multiple host devices share the same data path to perform read and write operations on the storage device.

[0080] In one possible embodiment, before the receiving module 5110 receives the written object data, the control module 5112 is also configured to, in response to the continuously transmittable data value of the first host device being not 0, allow the first host device to continue to send the object data, and reduce the continuously transmittable data value of the first host device by 1 each time the first host device writes object data to the storage device; or, in response to the continuously transmittable data value of the first host device being 0, suspend the first host device from sending the object data.

[0081] In a possible implementation, when making a pre-response to the writing of the object data, the control module 5112 is configured to increase by 1 the value of the continuous transmittable data of the first host device that writes the object data.

[0082] In a possible implementation, in response to the reading of the object data, the control module 5112 is configured to increase by 1 the value of the continuous transmittable data of the first host device that writes the object data.

[0083] For the description of the processing flow of each module in the above-mentioned electronic device 500 and the interaction flow between each module, reference can be made to the relevant description in the embodiment of the above-mentioned data stream processing method, which will not be described in detail here.

[0084] At least one embodiment of the present disclosure also provides another data stream processing device. The data stream processing device includes a memory and at least one processor. The memory is, for example, dedicated to the data stream processing device itself, and is used to store program codes, and the processor is used to call the program codes stored in the memory so that the processor implements the data stream processing method provided by any embodiment of the present disclosure.

[0085] At least one embodiment of the present disclosure further provides a computer-readable storage medium, which stores a program code, and when the program code is executed by a computer device, the computer device implements the data stream processing method provided by any embodiment of the present disclosure. The storage medium can be a volatile or non-volatile computer-readable storage medium.

[0086] Figure 6 A structural block diagram of another electronic device provided by at least one embodiment of the present disclosure is shown.

[0087] The electronic devices in the embodiments of the present disclosure can be implemented as but not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0088] like Figure 6 As shown, the electronic device 600 may include one or more processors 601 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 to a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the computer system are also stored. The processor 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604. For example, the RAM 603 includes a data stream processing device according to at least one embodiment of the present disclosure to process its storage space.

[0089] For example, the following components may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609 which may also include, for example, a network interface card such as a LAN card, a modem, etc. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data, and perform communication processing via a network such as the Internet. The drive 610 is also connected to the I / O interface 605 as needed. Removable media 611, such as magnetic disks, optical disks, magneto-optical disks, semiconductor memories, etc., are installed on the drive 610 as needed, so that the computer programs read therefrom are installed into the storage device 608 as needed. Although Figure 6 The electronic device 600 is shown to include various devices, but it should be understood that it is not required to implement or include all of the devices shown. More or fewer devices may be implemented or included instead.

[0090] For example, the electronic device 600 may further include a peripheral interface (not shown in the figure), etc. The peripheral interface may be various types of interfaces, such as a USB interface, a lightning interface, etc. The communication device 609 may communicate with a network and other devices through wireless communication, such as the Internet, an intranet and / or a wireless network such as a cellular phone network, a wireless local area network (LAN) and / or a metropolitan area network (MAN). Wireless communication may use any of a variety of communication standards, protocols, and techniques, including, but not limited to, Global System for Mobile Communications (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (W-CDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Bluetooth, Wi-Fi (e.g., based on IEEE 802.11a, IEEE 802.11b, IEEE 802.11g and / or IEEE 802.11n standards), Voice over Internet Protocol (VoIP), Wi-MAX, protocols for email, instant messaging and / or Short Message Service (SMS), or any other suitable communication protocol.

[0091] In addition to the above exemplary descriptions, there are a few points that need to be explained:

[0092] (1) The drawings of the embodiments of the present disclosure only relate to the structures related to the embodiments of the present disclosure, and other structures may refer to the general design.

[0093] (2) In the absence of conflict, the embodiments of the present disclosure and the features therein may be combined with each other to obtain new embodiments.

[0094] The above description is merely an exemplary embodiment of the present disclosure and is not intended to limit the protection scope of the present disclosure. The protection scope of the present disclosure is determined by the appended claims.

Claims

1. A data stream processing method, comprising: receiving, by the storage device, object data to be written; as well as In response to a condition for performing a pre-response being met, writing the object data to a first address in the storage device and performing a pre-response to the writing of the object data, and setting a pre-response flag bit of the first address to true; In response to the condition for performing a pre-response not being met, the object data is written to a second address in the storage device without performing a pre-response to the writing of the object data, and a pre-response flag bit of the second address is set to false.

2. The method of claim 1, further comprising: receiving a read request for the object data written to the storage device; as well as In response to the pre-response having been performed on the writing of the object data, the object data is read from the first address and the pre-response flag of the first address is set to false; in response to the pre-response not being performed on the writing of the object data, the object data is read from the second address, the pre-response flag of the second address is kept false, and the reading of the object data is responded to.

3. The method of claim 2, further comprising: A pre-response flag of a storage address of the object data in the storage device is checked to determine whether the pre-response has been performed for writing of the object data.

4. The method according to any one of claims 2 or 3, wherein: The storage space of the storage device is divided into a shared storage space and a plurality of exclusive storage spaces, wherein the shared storage space is shared by a plurality of host devices that perform read and write operations on the storage device, and the plurality of exclusive storage spaces are used exclusively by the plurality of host devices respectively. The first address belongs to the shared storage space, a first host device among the multiple host devices issues a write request for the object data, and the second address belongs to an exclusive storage space among the multiple exclusive storage spaces corresponding to the first host device.

5. The method of claim 4, wherein: The depth of the shared storage space is determined according to the depth of the storage space of the storage device and the continuous processing capabilities of the plurality of host devices.

6. The method of claim 4, wherein: The condition for performing the pre-response includes: the shared storage space is not full.

7. The method of claim 6, further comprising: A first number of addresses in the storage device whose pre-response flag is true is counted in real time, wherein when the first number is less than the depth of the shared storage space, the shared storage space is not full.

8. The method of claim 4, comprising: Host device serial numbers and initial values ​​of continuously transmittable data values ​​are respectively allocated to the plurality of host devices, wherein the plurality of host devices share a same data path to perform read and write operations on the storage device.

9. The method according to claim 8, before the storage device receives the written object data, further comprising: In response to the value of the continuously transmittable data of the first host device being not 0, allowing the first host device to continue to transmit the object data, and reducing the value of the continuously transmittable data of the first host device by 1 each time the first host device writes the object data to the storage device; or In response to the value of the continuous transmittable data of the first host device being 0, the first host device is suspended from transmitting the object data.

10. The method of claim 8, wherein: The pre-response to the writing of the object data includes: The continuously transmittable data value of the first host device that writes the object data is increased by 1.

11. The method of claim 8, wherein: The responding to the reading of the object data includes: The continuously transmittable data value of the first host device that writes the object data is increased by 1.

12. A data stream processing device, comprising: A receiving module configured to receive written object data; as well as a control module configured to, in response to satisfying a condition for performing a pre-response, write the object data to a first address in the storage device and perform a pre-response to the writing of the object data, and set a pre-response flag bit of the first address to be true; In response to the condition for performing a pre-response not being met, the object data is written to a second address in the storage device without performing a pre-response to the writing of the object data, and a pre-response flag bit of the second address is set to false.

13. A data stream processing device, comprising: Memory; as well as at least one processor; The memory is used to store program codes, and the at least one processor is used to call the program codes stored in the memory so that the processor executes the method according to any one of claims 1 to 11.

14. A computer-readable storage medium, wherein: The computer-readable storage medium stores a program code, and when the program code is executed by a computer device, the computer device executes the method according to any one of claims 1 to 11.

15. An electronic device, comprising: Multiple host devices; A storage device, coupled to the plurality of host devices via a data path, comprising the data stream processing device according to claim 12 or 13.

Citation Information

Patent Citations

  • Avoiding livelock using intervention messages in multiple core processors

    CN101802798A

  • Apparatus, system, and method for allocating storage

    CN102598019A

  • Data processing method and device, electronic equipment and storage medium

    CN118760625A

  • Cathe coherency protocol with independent implementation of optimized cathe operations

    CN1226705A

  • Network distributed site cache RAM claimed as up / down stream request / reply channel for storing anticipated data and meta data

    US6026452A