Data stream processing method and apparatus, electronic device, and storage medium
By dividing the storage device into shared and exclusive storage spaces and adopting a pre-response mechanism, the bottleneck of data transmission efficiency when multiple host devices share the storage device is solved, and the response rate and data transmission efficiency of the storage device are improved.
Patent Information
- Application Number
- CN202411764232.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-12-03
AI Technical Summary
In the chip data path, when multiple host devices share a storage device, existing technologies cannot improve data transmission efficiency by increasing the storage space depth, and the storage device's response signal return rate is limited, resulting in a bottleneck in data transmission efficiency.
By dividing the storage device into shared and exclusive storage spaces and employing a pre-response mechanism, the response rate of the storage device is improved by responding in advance to data written to the shared storage space and responding normally when reading data from the exclusive storage space.
It improves data transmission efficiency, reduces the time the host device waits for the storage device to return a response, and optimizes the data transmission process.
Smart Images

Figure CN119718966B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present disclosure relate to a data stream processing method and apparatus, an electronic device and a storage medium. BACKGROUND
[0002] With the continuous development of chip design technology, on a data path of a chip, multiple master devices often share the path and send data to the same storage device (for example, a memory). The process of data transmission by the master device includes: transmitting data, waiting for a response to be returned, transmitting data, waiting for a response to be returned, and so on, and the like, wherein the response is a signal returned by the storage device to the master device when 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 master device has a continuous processing capability (also referred to as "outstanding capability") for data. For example, if the continuous processing capability of the master device is Y (Y>1), it means that the master device can continuously send Y data without waiting for a response. If the master device continuously sends Y data and the memory does not return a response, the master device needs to wait for the return of the response. If the memory returns y responses (y≤Y) to the master device, the master device can continuously send y data to the memory. SUMMARY
[0003] At least one embodiment of the present disclosure provides a data stream processing method, comprising: receiving, by a storage device, object data written; and in response to a condition for performing a pre-response being met, 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 true; in response to the condition for performing the pre-response not being 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 false.
[0004] For example, the method provided by at least one embodiment of the present disclosure further comprises: receiving a read request for the object data written into the storage device; and in response to the writing of the object data having performed the pre-response, reading out the object data from the first address, and setting the pre-response flag bit of the first address to false; in response to the writing of the object data not having performed the pre-response, reading out the object data from the second address, and keeping the pre-response flag bit of the second address to false, and responding to the reading out of the object data.
[0005] For example, the method provided by at least one embodiment of the present disclosure further comprises: checking the pre-response flag bit of the storage address of the object data in the storage device to determine whether the writing of the object data has performed the pre-response.
[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 a plurality of exclusive storage spaces, the shared storage space is shared by a plurality of host devices performing read and write operations on the storage device, and the plurality of exclusive storage spaces are respectively exclusively used by the plurality of host devices, wherein the first address belongs to the shared storage space, a first host device of the plurality of host devices sends a write request for the object data, and the second address belongs to an exclusive storage space corresponding to the first host device in the plurality of exclusive storage spaces.
[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 sustained processing capability of the plurality of host devices.
[0008] For example, in the method provided by at least one embodiment of the present disclosure, the condition for performing the pre-response includes that the shared storage space is not full.
[0009] For example, the method provided by at least one embodiment of the present disclosure further includes: counting in real time a first number of addresses in the storage device for which the 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: allocating an initial value of a host device serial number and a sustained transmittable data value to each of the plurality of host devices, wherein the plurality of host devices share the same data channel 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 object data is received by the storage device, the method further includes: in response to the sustained transmittable data value of the first host device being other than 0, allowing the first host device to continue transmitting the object data, and each time the first host device writes the object data to the storage device, reducing the sustained transmittable data value of the first host device by 1; or, in response to the sustained transmittable data value of the first host device being 0, pausing the first host device from transmitting 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: increasing the sustained transmittable data value of the first host device that writes the object data by 1.
[0013] For example, in the method provided by at least one embodiment of the present disclosure, the response to the read of the object data comprises: increasing a continuously transmittable data value of a first host device writing the object data by 1.
[0014] At least one embodiment of the present disclosure further provides a data stream processing apparatus, comprising: a receiving module configured to receive written object data; a control module configured to, in response to a condition for pre-response being met, write the object data into a first address in the storage device and pre-respond to the writing of the object data, and set a pre-response flag bit of the first address to true; and in response to the condition for pre-response not being met, write the object data into a second address in the storage device and not pre-respond to the writing of the object data, and set a pre-response flag bit of the second address to false.
[0015] At least one embodiment of the present disclosure further provides a data stream processing apparatus, comprising: a memory and at least one processor; wherein the memory is configured to store program code, and the at least one processor is configured to invoke the program code stored in the memory to cause the processor to execute the data stream processing method provided by 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 the program code, when executed by a computer device, causes the computer device to execute 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 with the plurality of host devices through a data path, and the electronic device comprises the data stream processing apparatus of any of the embodiments of the present disclosure. BRIEF DESCRIPTION OF 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 are merely related to some embodiments of the present disclosure, but not limit the present disclosure.
[0019] Figure 1 A flowchart of a data stream processing method provided by at least one embodiment of the present disclosure is shown;
[0020] Figure 2 A schematic diagram of a response to the read of object data provided by at least one embodiment of the present disclosure is shown;
[0021] Figure 3 A schematic diagram of a storage space of a storage device provided by at least one embodiment of the present disclosure is shown;
[0022] Figure 4 FIG. 1 shows a schematic diagram of pre-responding to writing of object data according to at least one embodiment of the present disclosure;
[0023] Figure 5 FIG. 2 shows a structural block diagram of an electronic device according to at least one embodiment of the present disclosure; and
[0024] Figure 6 FIG. 3 shows another structural block diagram of an electronic device according to at least one embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] In order to make the objects, technical solutions, and advantages of the embodiments of the present disclosure clearer, the following will be combined with the accompanying drawings for the embodiments of the present disclosure to clearly and completely describe the technical solutions of the embodiments of the present disclosure. Obviously, the described embodiments are only a part but not all of the embodiments of the present disclosure. Based on the described embodiments of the present disclosure, all other embodiments obtained by a person of ordinary skill in the art without creative effort belong to the scope of protection of the present disclosure.
[0026] Unless otherwise defined, technical terms or scientific terms used in the present disclosure shall have the ordinary meaning understood by a person of ordinary skill in the art to which the present disclosure belongs. The terms "first", "second", and similar terms used in the present disclosure do not denote any order, quantity, or importance, but are used to distinguish different components. Similarly, the terms "one", "a", or "the" and similar terms do not denote a quantity restriction, but mean that there is at least one. The terms "include", "contain", and similar terms mean that the elements or objects before the terms encompass the elements or objects listed after the terms and their equivalents, and do not exclude other elements or objects. The terms "connect" or "connected" and similar terms are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. The terms "upper", "lower", "left", "right", and the like are only used to represent relative positional relationships, and when the absolute positions of the described objects change, the relative positional relationships can also change accordingly.
[0027] As described previously, on a data path of a chip, multiple host devices often share the path and transmit data to the same storage device (for example, a 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 (that is, the host device that writes the data to be read out into 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 respective sustained processing capabilities of the multiple host devices, that is, At this point, data transfer efficiency is primarily affected by the depth of the storage space; therefore, increasing the storage space depth can improve data transfer efficiency. However, when the storage space depth (N) exceeds the sum of the individual continuous processing capabilities of multiple host devices, i.e. At this point, data transmission efficiency is mainly limited by the rate at which the storage device returns a response signal. Even if the depth of the storage space is further increased, the data transmission efficiency cannot be further improved.
[0029] To address the above shortcomings, this disclosure provides one or more embodiments of a data stream processing method, apparatus, electronic device, and storage medium.
[0030] The data stream processing method includes: receiving object data to be written from a storage device; in response to meeting the condition for pre-responding, writing the object data to a first address in the storage device and pre-responding to the writing of the object data, and setting the pre-responding flag of the first address to true; in response to not meeting the condition for pre-responding, writing the object data to a second address in the storage device and not pre-responding to the writing of the object data, and setting the pre-responding flag of the second address to false. This data stream processing method, by pre-responding (or responding in advance) to the object data written to the first address in the storage device, saves the time required for a response after the object data has been read from the storage device, thus reducing the time the host device waits for a response from the storage device, thereby improving data transmission efficiency and further solving the problem that increasing memory depth does not necessarily improve transmission efficiency.
[0031] The present disclosure will now be described through several specific embodiments. To keep the following description of the embodiments of the present disclosure clear and concise, detailed descriptions of known functions and components may be omitted. When any component of the embodiments of the present disclosure appears in more than one drawing, the component is represented by the same or similar reference numerals in each drawing.
[0032] The data stream processing method provided in at least one embodiment of this disclosure is applicable to scenarios where multiple host devices with continuous data processing capabilities share the same data path to perform read and write operations on storage devices.
[0033] like Figure 1 The diagram shown is a flowchart of a data stream processing method provided in at least one embodiment of the present disclosure, the method including steps S101-S102.
[0034] Step S101: The object data to be written is received by the storage device.
[0035] It should be noted that the storage device in the embodiments of the present disclosure can simultaneously perform read and write operations. For example, the storage device can include a random access memory (RAM), a dynamic random access memory (DRAM), a static random access memory (SRAM), a non-volatile random access memory (NVRAM), a flash memory, a cache, a dual-port memory, etc., and the present disclosure does not limit the same, for example, which can be used for memory.
[0036] Here, the "object data" is used to refer to data describing an object, which can be any data processed by the above method.
[0037] Step S102: In response to the condition for performing pre-response being met, 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 true; in response to the condition for performing pre-response not being 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 false.
[0038] For example, when the storage device receives the written object data, in response to the condition for performing pre-response being met, the object data is written into a first address in the storage device, and pre-response to the writing of the object data is performed, that is, a pre-response signal is returned to the device (for example, 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 bit of the first address is set to true (for example, set to 1), indicating that the writing of the object data has been pre-responded. In response to the condition for performing pre-response not being met, the object data is written into 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 bit of the second address is set to false (for example, set to 0), indicating that the writing of the object data has not been pre-responded. For example, the first address and the second address are any two addresses in the storage device, for example, belonging to different regions set.
[0039] For example, the condition for performing pre-response can be that the number of addresses in the storage device for which the pre-response flag bit is true is less than a preset first threshold, wherein the first threshold can be set by a user according to the depth of the storage device.
[0040] In at least one embodiment of the present disclosure, the above data flow processing method further includes steps S103-S104.
[0041] Step S103: Receiving a read request for object data written into the storage device.
[0042] Step S104: in response to the write of the object data having been pre-responded, reading out the object data from the first address and setting the pre-response flag bit of the first address to false; in response to the write of the object data not having been pre-responded, reading out the object data from the second address and keeping the pre-response flag bit of the second address to false, and responding to the read of the object data.
[0043] For step S104, if the write of the object data by the storage device has been pre-responded, it is equivalent to responding to the read of the object data in advance, so when actually reading out the object data, the storage device will not respond to the read of the object data again to return a response signal. On the other hand, if it is determined that the write of the object data is not pre-responded, the object data is read out from the second address and a response is given to the read of the object data (such a response can be referred to as a normal response, hereinafter also referred to simply as "response"), and such a response when reading out data is later than the aforementioned response when writing data in terms of operation timing, and in addition, the pre-response flag bit of the second address is kept to false when responding.
[0044] For example, it can be determined whether the write of the object data has been pre-responded by checking the pre-response flag bit of the storage address of the object data in the storage device, and whether the read of the object data is responded to is determined accordingly.
[0045] As described above, in one or more embodiments of the present disclosure, the "pre-response" and the "normal response" are different types of response modes, the former is different from the latter in terms of operation timing, earlier than the latter, for example, the former is a response when writing the object data by the storage device under the condition of satisfying the pre-response condition, while the latter is a response when reading the object data under the condition of not satisfying the pre-response condition.
[0046] Figure 2 An example of responding to the read of the object data provided by at least one embodiment of the present disclosure is shown.
[0047] As Figure 2 As shown, when receiving a read request for first object data written into the storage device, first check the pre-response flag bit of the storage address of the first object data in the storage device, and determine whether to respond based on the pre-response flag bit, here, "first object data" is any data stored in the storage device as a description object.
[0048] For example, if the pre-response flag corresponding to the first object data is false, it indicates that the storage device does not pre-respond to the write of the first object data, and the storage device needs to respond to the read of the first object data to generate a response signal post_credit_return and return to the host device that writes the first object data. If the pre-response flag corresponding to the first object data is true, it indicates that the storage device has pre-responded to the write of the first object data, which is equivalent to having responded to the read of the first object data in advance. At this time, the first object data can be directly read out, 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 the storage device can perform read and write operations at the same time. For example, for the write of object data that meets the pre-response condition, the storage device can return a pre-response signal in advance. For the write 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 a pre-response signal and a normal response signal), which overall improves the rate of returning response signals by the storage device and further improves data transmission efficiency.
[0050] It should be noted that the pre-response signal generated by pre-response and the response signal generated by normal response can be the same type of signal. At this time, 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 into the storage device, and the response signal is a signal normally returned 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 a plurality of exclusive storage spaces. The shared storage space is shared by a plurality of host devices performing read and write operations on the storage device, and the plurality of exclusive storage spaces are respectively used exclusively by a plurality of host devices, i.e., the plurality of exclusive storage spaces respectively correspond to the plurality of 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 in the plurality of exclusive storage spaces, and the first host device in the plurality of host devices issues a write request for object data. 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 sustained processing capability of the plurality of host devices; the depth of the exclusive storage space is determined according to the sustained processing capability of the corresponding host device.
[0052] For example, a host device with an outstanding capability of Y can continuously send Y object data to the storage device without receiving a returned response signal or a pre-response signal, where the outstanding capability of the host device can be determined according to factors such as memory access latency and bandwidth, for example, preset in advance and kept unchanged, or adjusted after the system runs for a predetermined 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] As shown in Figure 3 , host device 0 to host device 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 according to the respective outstanding processing capabilities of host device 0 to host device 4, the storage space of the storage device is divided into a shared storage space and exclusive storage spaces 0 to 4, where the depths of exclusive storage spaces 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 The depth X of the shared storage space is When the shared storage space is not full, host device 0 to host device 4 preferentially write object data into the shared storage space. When the shared storage space is full, host device 0 to host device 4 write object data into the exclusive storage spaces that are exclusively used by them, respectively. For example, when the shared storage space is full, host device 0 writes object data into the corresponding exclusive storage space 0. When the exclusive storage space corresponding to a host device is also full, the data write 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 relationship The storage space of the storage device is divided into n exclusive storage spaces, and there is no shared storage space in the storage space of the storage device at this time. For example, when any one of the plurality of host devices writes object data to the storage device, the condition for pre-response can be that the shared storage space is not full.
[0056] Figure 4 A schematic diagram of pre-response to writing of object data provided for at least one embodiment of the present disclosure.
[0057] As shown in Figure 4As shown, when receiving the first object data written into the storage device, it is first determined whether the condition for pre-responding is met, i.e., whether the shared storage space is full. If it is determined that the shared storage space is full, the writing of the object data is not pre-responded, i.e., no pre-responding signal is generated, the received object data is directly written into the exclusive storage space exclusively used by the host device that sends the object data, and the pre-responding flag bit 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 into the shared storage space, and then the writing of the object data is pre-responded, i.e., a pre-responding signal pre_credit_return is generated and returned to the host device that writes the object data, and the pre-responding flag bit of the address where the object data is written is set to true.
[0058] For example, in at least one embodiment, the method of determining whether the shared storage space is not full can include: counting in real time the first number of addresses with the pre-responding flag bit being true in the storage device, 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 can also be used to determine whether the shared storage space is not full, which are not limited by the present disclosure.
[0059] In at least one embodiment, the host device 0 writes the object data 0 into the storage device. At the current time, if the first number of addresses with the pre-responding flag bit being 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-responding flag bit of the first address to true, and the storage device pre-responds to the writing of the object data 0 and returns a pre-responding 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-responding flag bit of the second address to false, and the storage device does not pre-respond to the writing of the object data 0, until receiving a read request for the object data 0, and 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 reading and writing process of the data, and the reading and writing operation is terminated.
[0060] It should be noted that in the embodiments of the present disclosure, the division of the shared storage space and the plurality of exclusive storage spaces is not fixed, i.e., 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 for which the 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 into the shared storage space, i.e., the address in the storage space storing the object data is an address belonging to the shared storage space. When the shared storage space is full (for example, the number of addresses in the storage device for which the 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 into 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 the storage device, by using the way of dividing the shared storage space and the exclusive storage space provided in 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 above-mentioned data flow processing method further comprises: respectively assigning a host device serial number (id) and an initial value of a continuous transmittable data value to a plurality of host devices, wherein the plurality of host devices share the same data channel to perform read-write operations on the storage device. The initial value of the continuous transmittable data value of the plurality of host devices is determined based on the respective continuous processing capabilities or based on the respective depths of the exclusive storage spaces corresponding thereto. For example, in order to improve the data transmission efficiency, the initial value of the continuous transmittable data value of the host device can be set to be equal to the continuous processing capability of the host device (for example, Y), i.e., the maximum value of the initial value. The initial value of the continuous 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 continuous transmittable data value of the host device can be understood as the current empty address number of the exclusive storage space corresponding to the host device, i.e., the number of addresses that have not been written with object data.
[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 flow processing method further comprises: in response to the continuous transmittable data value of the first host device being not 0, allowing the first host device to transmit object data, and each time the first host device writes object data to the storage device, reducing the continuous transmittable data value of the first host device by 1; or in response to the continuous transmittable data value of the first host device being 0, suspending the first host device from transmitting object data.
[0064] For example, the "pre-responding to the write of the object data" in the step S102 includes: adding 1 to the persistent sendable data value of the first host device which writes the object data.
[0065] For example, the "responding to the read of the object data" in the step S104 includes: adding 1 to the persistent sendable data value of the first host device which writes the object data.
[0066] In the above example, the host device serial number is used to return the pre-response signal or the response signal to the corresponding host device. When pre-responding to the write of the object data, the pre-response signal pre_credit_return[i] can be returned to the first host device which writes the object data, so as to make the persistent sendable data value of the first host device add 1; when responding to the read of the object data, the response signal post_credit_return[i] can be returned to the first host device which writes the object data, so as to make the persistent sendable data value of the first host device add 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] For the convenience of understanding the principle of calculating the persistent credit value of the host device, the following describes the read and write operations of the host device 0 and the host device 1 to the storage device. The initial values of the persistent credit values of the host device 0 and the host device 1 are set as credit0=4 and credit1=3, respectively, that is, the exclusive storage space depth corresponding to the host device 0 is 4 and the host device 0 can store a maximum of 4 object data issued by the host device 0, and the exclusive storage space depth corresponding to the host device 1 is 3 and the host device 1 can store a maximum of 3 object data issued by the host device 1. In the first cycle, the host device 0 writes object data 0 to the storage device, so that the persistent credit value credit0 of the host device 0 is reduced by 1 (i.e., credit0=4-1=3). If the writing of the object data 0 satisfies the condition for pre-responding (for example, the shared storage space is not full), the object data 0 is written to the shared storage space (i.e., the object data 0 is written to the storage device, and the address of the storage device storing the object data 0 is divided into an address belonging to the shared storage space), the storage device pre-responds and returns a pre-response signal pre_credit_return[0], so that the persistent credit value credit0 of the host device 0 is increased by 1, at this time, the persistent credit value credit0 of the host device 0 is credit0=3+1=4. If the writing of the object data 0 does not satisfy the condition for pre-responding (for example, the shared storage space is full), the object data 0 is written to the exclusive storage space 0 corresponding to the host device 0 (i.e., the object data 0 is written to the storage device, and the address of the storage device storing the object data 0 is divided into an address belonging to the exclusive storage space 0 corresponding to the host device 0), and the storage device does not pre-respond, at this time, the current persistent credit value credit0 of the host device 0 is 3. Subsequently, in the case where the shared storage space is full, the host device 0 can continuously write (or send) a maximum of 3 object data to the storage device, the addresses of the storage device storing the 3 object data are also divided into addresses belonging to the exclusive storage space 0 corresponding to the host device 0, and after writing the 3 object data, the persistent credit value credit0 of the host device 0 becomes 0, and the host device 0 pauses writing object data to the storage device. Therefore, in the case where the host device writes object data to the shared storage space, the persistent credit value of the host device remains unchanged; in the case where the host device writes object data to the corresponding exclusive storage space, the persistent credit value of the host device is reduced by 1 each time 1 object data is written to the corresponding exclusive storage space.
[0068] For example, after several cycles, the current values of the sustained credit values of the host device 0 and the host device 1 are credit0=3 and credit1=1, respectively. While the host device 0 is writing object data 0 into the shared storage space, a read operation on object data 1 in the storage device can also be performed. If object data 1 is written into the storage device by the host device 0 and the write of object data 1 is not pre-responded (i.e., the pre-response flag bit of the address of object data 1 is false and the address of object data 1 belongs to the exclusive storage space corresponding to the host device 0), the storage device responds to the read of object data 1 and returns a response signal post_credit_return[0], i.e., in the current operation cycle, the storage device returns the pre-response signal pre_credit_return[0] to the host device 0 and the response signal post_credit_return[0] to the host device 0, so that the sustained credit value credit0 of the host device 0 is increased by 2, and at this time, credit0 of the host device 0 becomes 4 and credit1 of the host device 1 remains 1. If object data 1 is written into the storage device by the host device 1 and the write of object data 1 is not pre-responded (i.e., the pre-response flag bit of the address of object data 1 is false and the address of object data 1 belongs to the exclusive storage space corresponding to the host device 1), the storage device responds to the read of object data 1 and returns a response signal post_credit_return[1], i.e., in the current operation cycle, the storage device returns the pre-response signal pre_credit_return[0] to the host device 0 and the response signal post_credit_return[1] to the host device 1, so that the sustained credit values of the host device 0 and the host device 1 are increased by 1, respectively, and at this time, credit0=3 and credit1=2. At least one embodiment of the present disclosure also provides a data flow processing device corresponding to the data flow processing method and an electronic device comprising the data flow processing device. Since the principle of solving problems of the electronic device in the embodiment of the present disclosure is similar to the above-mentioned data flow processing method, in the following description, the implementation of the electronic device of the data flow processing device can also be referred to the implementation of the method, and the repeated parts will not be described here.
[0069] As Figure 5As shown, a structural block diagram of an electronic device provided in at least one embodiment of the present disclosure is shown, which includes a plurality of 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 with the plurality of host devices through a data path, and the storage device 510 includes a data stream processing device 511 provided in any embodiment of the present disclosure and a storage array (not shown in the figure) providing a storage space, for example, the storage array includes a plurality of storage units arranged as an array and a driving circuit for driving the storage units, which can include a row driving circuit, a column driving circuit, an address resolution circuit, etc., for example, the storage array can also include a plurality of sub-arrays, etc., and embodiments of the present disclosure do not limit this.
[0070] For example, in at least one embodiment of the present disclosure, the plurality of host devices described above can include one or more processor cores; for example, the data path can be a system bus, and embodiments of the present disclosure do not limit this.
[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 the object data written. The control module 5112 is configured to, in response to a condition for performing a pre-response being met, write the object data into a first address in the storage device and pre-respond to the writing of the object data, and set a pre-response flag bit of the first address to true; in response to the condition for performing a pre-response not being met, write the object data into a second address in the storage device and not pre-respond to the writing of the object data, and set a pre-response flag bit 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 object data written; for example, the receiving circuit includes a transceiver and a buffer 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 the object data written into the storage device. The control module 5112 is further configured to, in response to the writing of the object data having been pre-responded, read out the object data from the first address and set the pre-response flag bit of the first address to false; and in response to the writing of the object data not having been pre-responded, read out the object data from the second address and keep the pre-response flag bit of the second address to false, and respond to the readout of the object data.
[0074] In a possible implementation, the control module 5112 includes a detection module configured to check the pre-response flag bit of the storage address of the object data in the storage device to determine whether the write of the object data has been pre-responded.
[0075] In a possible implementation, the storage space of the storage device 510 is divided into a shared storage space and a plurality of exclusive storage spaces, the shared storage space is shared by a plurality of host devices performing read and write operations on the storage device 510, and the plurality of exclusive storage spaces are respectively exclusively used by the plurality of host devices, wherein the first address belongs to the shared storage space, and a first host device of the plurality of host devices sends a write request for the object data, and the second address belongs to an exclusive storage space corresponding to the first host device in the plurality of exclusive storage spaces.
[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 sustained processing capability of the plurality of host devices.
[0077] In a possible implementation, the condition for pre-responding includes that the shared storage space is not full.
[0078] In a possible implementation, the data flow processing device 511 further includes a counting module configured to count a first number of addresses in the storage device for which the pre-response flag bit is true 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.
[0079] In a possible implementation, the data flow processing device 511 further includes an allocation module configured to respectively allocate a host device serial number and an initial value of a sustained transmittable data value to the plurality of host devices, wherein the plurality of host devices share the same data channel to perform read and write operations on the storage device.
[0080] In a possible implementation, before the receiving module 5110 receives the written object data, the control module 5112 is further configured to, in response to the sustained transmittable data value of the first host device being other than 0, allow the first host device to continue transmitting the object data, and in response to the first host device writing the object data to the storage device once, decrease the sustained transmittable data value of the first host device by 1; or in response to the sustained transmittable data value of the first host device being 0, suspend the first host device from transmitting the object data.
[0081] In a possible implementation, when pre-responding to the write of the object data, the control module 5112 is configured to increase the sustained transmittable data value of the first host device that writes the object data by 1.
[0082] In one possible implementation, when responding to the reading of object data, the control module 5112 is configured to increment the continuously transmittable data value of the first host device that wrote the object data by 1.
[0083] The description of the processing flow of each module in the above-mentioned electronic device 500 and the interaction flow between each module can be found in the relevant description in the embodiment of the above-mentioned data flow processing method, and will not be described in detail here.
[0084] At least one embodiment of this disclosure also provides another data stream processing apparatus. The data stream processing apparatus includes a memory and at least one processor. The memory, for example, is dedicated to the data stream processing apparatus itself and is used to store program code. The processor is used to invoke the program code stored in the memory to enable the processor to implement the data stream processing method provided in any embodiment of this disclosure.
[0085] At least one embodiment of this disclosure also provides a computer-readable storage medium storing program code. When the program code is executed by a computer device, the computer device implements the data stream processing method provided in any embodiment of this disclosure. The storage medium may be a volatile or non-volatile computer-readable storage medium.
[0086] Figure 6 A structural block diagram of another electronic device provided in at least one embodiment of the present disclosure is shown.
[0087] The electronic devices in the embodiments of this disclosure can be implemented as, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (e.g., vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device 600 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.
[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 into a random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the computer system. The processors 601, ROM 602, and RAM 603 are connected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604. For example, the RAM 603 includes data stream processing means according to at least one embodiment of the present disclosure for processing its storage space.
[0089] For example, the following components can be connected to the I / O interface 605: input devices 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, and the like; output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, and the like; storage devices 608 including, for example, a magnetic tape, a hard disk, and the like; and communication devices 609 including, for example, a LAN card, a modem, and the like. The communication devices 609 can allow the electronic device 600 to perform wireless or wired communication with other devices to exchange data, perform communication processing via a network such as the Internet. Drivers 610 are also connected to the I / O interface 605 as necessary. Removable media 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like are mounted on the drivers 610 as necessary, so that computer programs read out therefrom are installed in the storage devices 608 as necessary. Although Figure 6 The electronic device 600 is shown to include various devices, but it is understood that all of the shown devices are not required to be implemented or included. More or fewer devices can alternatively be implemented or included.
[0090] For example, the electronic device 600 can further include a peripheral interface (not shown) and the like. The peripheral interface can be various types of interfaces, such as a USB interface, a lighting interface, and the like. The communication devices 609 can communicate with networks and other devices through wireless communication, the networks being, for example, the Internet, an intranet, and / or a wireless network such as a cellular telephone network, a wireless local area network (LAN), and / or a metropolitan area network (MAN). The wireless communication can use any of a plurality of communication standards, protocols, and technologies, 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 explanations, the following points need to be explained:
[0092] (1) The drawings of the embodiments of the present disclosure only relate to the structures involved in the embodiments of the present disclosure, and other structures can be referred to the general design.
[0093] (2) In the case of no conflict, embodiments and features of the embodiments can be combined with each other to form new embodiments.
[0094] The above-described exemplary embodiments of the present disclosure are merely given as examples, and the present disclosure is not limited thereto, and the scope of the present disclosure is determined by the appended claims.
Claims
1. A data stream processing method, comprising: The object data written is received by the storage device; as well as In response to 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 on the writing of the object data, and the pre-response flag bit of the first address is set to true; In response to the failure to meet the conditions for pre-response, the object data is written to the second address in the storage device without pre-response to the writing of the object data, and the pre-response flag bit of the second address is set to false; 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 each of the multiple host devices. Wherein, the first address belongs to the shared storage space, the first host device among the plurality of host devices issues a write request for the object data, and the second address belongs to the exclusive storage space among the plurality of exclusive storage spaces corresponding to the first host device. The conditions for conducting a pre-response include: the shared storage space is not full.
2. The method of claim 1, further comprising: Receive a read request for the object data to be written to the storage device; as well as In response to the pre-response being 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 and the pre-response flag of the second address is kept false, and a response is performed on the reading of the object data.
3. The method of claim 2, further comprising: The pre-response flag bit of the storage address of the object data in the storage device is checked to determine whether the write to the object data has been pre-responded.
4. The method of claim 1, wherein, The depth of the shared storage space is determined based on the depth of the storage space of the storage device and the continuous processing capacity of the multiple host devices.
5. The method of claim 1, further comprising: The first number of addresses in the storage device where the pre-response flag is true is counted in real time, wherein the shared storage space is not full when the first number is less than the depth of the shared storage space.
6. The method of claim 2 or 3, further comprising: Each of the multiple host devices is assigned a host device serial number and an initial value for continuously transmittable data, wherein the multiple host devices share the same data path to perform read and write operations on the storage device.
7. The method of claim 6, further comprising, before the object data to be written is received by the storage device: In response to the first host device having a continuously transmittable data value that is not 0, the first host device is allowed to continue transmitting the object data, and the first host device decrements the continuously transmittable data value by 1 each time it writes the object data to the storage device. or In response to the first host device having a continuously transmittable data value of 0, the first host device is suspended from transmitting the object data.
8. The method of claim 6, wherein, The pre-response to the writing of the object data includes: Increment the continuously transmittable data value of the first host device that writes the object data by 1.
9. The method of claim 6, wherein, The response to reading the object data includes: Increment the continuously transmittable data value of the first host device that writes the object data by 1.
10. A data stream processing apparatus, comprising: The receiving module is configured to receive written object data; as well as The control module is configured to, in response to the condition of 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 bit of the first address to true; In response to the failure to meet the conditions for pre-response, the object data is written to the second address in the storage device without pre-response to the writing of the object data, and the pre-response flag bit of the second address is set to false; 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 each of the multiple host devices. Wherein, the first address belongs to the shared storage space, the first host device among the plurality of host devices issues a write request for the object data, and the second address belongs to the exclusive storage space among the plurality of exclusive storage spaces corresponding to the first host device. The conditions for conducting a pre-response include: the shared storage space is not full.
11. A data stream processing apparatus, comprising: Memory; as well as At least one processor; 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 to cause the processor to execute the method as described in any one of claims 1-9.
12. A computer-readable storage medium, wherein, The computer-readable storage medium stores program code that, when executed by a computer device, causes the computer device to perform the method as described in any one of claims 1-9.
13. An electronic device, comprising: Multiple host devices; A storage device, coupled to the plurality of host devices via a data path, including the data stream processing device according to claim 10 or 11.
Citation Information
Patent Citations
Avoiding livelock using intervention messages in multiple core processors
CN101802798A
Apparatus, system, and method for allocating storage
CN102598019A