Label management method, data reading and writing method, system, device, medium and product
By using the mechanism of tag queue and preset addresses in the data processor, transaction tags are efficiently allocated and recycled, and the problem of low transaction tag allocation efficiency in the prior art is solved, and more efficient data processing performance is achieved.
Patent Information
- Application Number
- CN202510001192.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-01-02
AI Technical Summary
In scenarios where large amounts of data are processed, it is difficult for the prior art to effectively improve the allocation efficiency of transaction tags.
By maintaining a tag queue and a preset address in the data processor, and using the tag allocation pointer to read and write transaction tags in sequence, efficient allocation and recycling of transaction tags is achieved.
This method improves the allocation efficiency of transaction tags, avoids performance bottlenecks caused by label allocation delay in high-frequency data processing, and ensures the stability and reliability of data processing.
Smart Images

Figure CN119376659B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a tag management method, a data reading and writing method, a system, a device, a medium and a product. Background Art
[0002] Data transmission can occur in different components of the same device or in different devices on different networks. Before data transmission and processing, a transaction tag can be assigned to the data. When data transmission and processing are completed, the assigned transaction tag can be recycled. By using the characteristic that transaction tags can uniquely identify data, data traceability can be achieved by assigning transaction tags to data.
[0003] In practice, for scenarios that require processing of large amounts of data, higher requirements are placed on the efficiency of transaction tag allocation. Therefore, how to improve the efficiency of transaction tag allocation has become an urgent problem to be solved. Summary of the invention
[0004] In view of this, multiple aspects of the present application provide a tag management method, a data reading and writing method, a system, a device, a medium and a product to improve the efficiency of tag allocation.
[0005] The embodiment of the present application provides a tag management method, which is applied to a first data processor, including:
[0006] In response to an acquisition signal of data to be processed, reading a first transaction tag pointed to by a tag allocation pointer in a tag queue from a preset address of a first storage space, wherein unused transaction tags in the tag queue are stored in the first storage space of the first data processor, and the tag allocation pointer points to a transaction tag in the tag queue that is stored earliest in the first storage space;
[0007] Writing a next transaction tag in the tag queue that is in an unused state after the first transaction tag into the preset address, wherein the tag allocation pointer points to the next transaction tag;
[0008] The first transaction tag is set to be in used state.
[0009] The embodiment of the present application provides a label management system, wherein the label allocation system is deployed in a first data processor, and the system comprises: a label management module, a label status monitoring module, and a first storage space, wherein the first storage space stores transaction labels in an unused state in a label queue;
[0010] The tag management module is configured to receive an acquisition signal of data to be processed; in response to the acquisition signal, read a first transaction tag pointed to by a tag allocation pointer in the tag queue from a preset address of the first storage space, wherein the tag allocation pointer points to a transaction tag in the tag queue that is stored earliest in the first storage space;
[0011] Writing a next transaction tag in the tag queue that is in an unused state after the first transaction tag into the preset address, wherein the tag allocation pointer points to the next transaction tag;
[0012] Setting the first transaction tag to a used state;
[0013] The tag status monitoring module is used to record the usage status of the first transaction tag.
[0014] The present application provides a data reading and writing method, including:
[0015] In response to an acquisition signal of a read / write request, reading a first transaction tag pointed to by a tag allocation pointer in a tag queue from a preset address of a first storage space, wherein the read / write request includes a read request or a write request generated by the first data processor for a second data processor, unused transaction tags in the tag queue are stored in the first storage space of the first data processor, and the tag allocation pointer points to a transaction tag in the tag queue that is earliest stored in the first storage space;
[0016] Writing a next transaction tag in the tag queue that is in an unused state after the first transaction tag into the preset address, wherein the tag allocation pointer points to the next transaction tag;
[0017] Setting the first transaction tag to a used state;
[0018] The read / write request associated with the first transaction tag is sent to the second data processor for responding to the request.
[0019] The embodiment of the present application provides a data reading and writing system, including: a first data processor and a second data processor, the first data processor including a tag management module, a tag status monitoring module and a first storage space for storing transaction tags in an unused state, the first storage space being provided by the first data processor;
[0020] The tag management module is configured to receive an acquisition signal of a read / write request; in response to the acquisition signal, read a first transaction tag pointed to by a tag allocation pointer in a tag queue from a preset address of the first storage space, wherein the read / write request includes a read request or a write request generated by the first data processor for the second data processor, and the tag allocation pointer points to a transaction tag in the tag queue that is earliest stored in the first storage space;
[0021] The next unused transaction tag after the first transaction tag in the tag queue is written into the preset address, and the tag allocation pointer points to the next transaction tag
[0022] Setting the first transaction tag to a used state;
[0023] The tag status monitoring module is used to record the used status of the first transaction tag;
[0024] The second data processor is configured to receive the read / write request associated with the first transaction tag; and send a request response result associated with the first transaction tag to the first data processor.
[0025] The embodiment of the present application provides an electronic device, including a processor and a memory, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the above-mentioned tag management method or the above-mentioned data reading and writing method. The electronic device may also include a communication interface for communicating with other devices or communication networks.
[0026] An embodiment of the present application provides a non-temporary machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor can at least implement the above-mentioned tag management method or the above-mentioned data reading and writing method.
[0027] An embodiment of the present application provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the processor is enabled to implement the above-mentioned tag management method or the above-mentioned data reading and writing method.
[0028] The tag management method provided by the embodiment of the present application includes: when the first data processor receives the data to be processed, the first transaction tag in the tag queue pointed to by the tag allocation pointer and stored in the preset address of the first storage space can be allocated to the data to be processed according to the order of the transaction tags in the tag queue. The first storage space is provided by the first data processor, and the first transaction tag is the earliest transaction tag currently stored in the first storage space and is in an unused state. At this time, the allocation of the transaction tag is completed. And the first transaction tag can be set to a used state.
[0029] In addition, when the label allocation is completed, the next transaction label after the first transaction label in the label queue can also be rolled and stored in the preset address, and the label allocation pointer can also be moved to the next transaction label to perform the next label allocation.
[0030] In the above method, the transaction tag pointed to by the tag allocation pointer is always stored in a fixed address, that is, a preset address. Therefore, when the data to be processed is obtained, the data processor can directly read the transaction tag from the fixed address and allocate it to the data to be processed. Using the above method, the data processor does not need to select the transaction tag to be allocated to the data to be processed from the tag queue. The default of this selection process can improve the efficiency of tag allocation. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0032] Figure 1 A schematic diagram of the structure of a label management system provided in an embodiment of the present application;
[0033] Figure 2 A schematic diagram of the structure of another tag management system provided in an embodiment of the present application;
[0034] Figure 3 A schematic diagram of the structure of a label queue in a label allocation process provided by an embodiment of the present application;
[0035] Figure 4 A schematic diagram of the structure of a label queue in a label recycling process provided by an embodiment of the present application;
[0036] Figure 5 A flowchart of a tag management method provided in an embodiment of the present application;
[0037] Figure 6 A structural diagram of a data reading and writing system provided in an embodiment of the present application;
[0038] Figure 7 A schematic diagram of the structure of another data reading and writing system provided in an embodiment of the present application;
[0039] Figure 8 A flowchart of a data reading and writing method provided in an embodiment of the present application;
[0040] Fig. 9 A schematic diagram of the structure of a label distribution device provided in an embodiment of the present application;
[0041] Fig.10 A schematic diagram of the structure of a data reading and writing device provided in an embodiment of the present application;
[0042] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0043] Fig.12 A schematic diagram of the structure of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0045] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms of "a", "said", and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two, but does not exclude the inclusion of at least one.
[0046] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0047] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to identifying", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is identified" may be interpreted as "when determining" or "in response to determining" or "when identifying (stated condition or event)" or "in response to identifying (stated condition or event)", depending on the context.
[0048] It should be noted that, in the case where the embodiments of the present application involve user information, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0049] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a product or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such a product or system. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the product or system including the elements.
[0050] Some embodiments of the present application may be described in detail below in conjunction with the accompanying drawings. In the case where there is no conflict between the embodiments, the following embodiments and the features in the embodiments may be combined with each other. In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.
[0051] To facilitate understanding of the solution, the following describes the process of assigning transaction tags in conjunction with the internal structure of the tag management system. Figure 1~Figure 4 A detailed description of the illustrated embodiments.
[0052] Figure 1 This is a schematic diagram of the structure of a label management system provided in an embodiment of the present application. Figure 1 As shown, the system may include: a tag management module, a tag status monitoring module and a first storage space.
[0053] Since the tag management system is deployed in the first data processor, the first storage space can also be provided by the first data processor, and the first storage space can store unused transaction tags in the tag queue. Optionally, the transaction tags in the tag queue can be in the form of numbers, serial numbers, timestamps, etc., which reflect the order of precedence.
[0054] For the initially created tag queue, the transaction tags in the queue may all be in an unused state, and these transaction tags may be written into the first storage space in sequence. The tag management system provided by the embodiment of the present application may sequentially allocate the unused transaction tags in the tag queue to the to-be-processed data received at different times. After allocation, some of the transaction tags in the tag queue are in a used state, and another part of the transaction tags in the tag queue are in an unused state, and this other part of the transaction tags may still be stored in the first storage space.
[0055] Since the label management system performs the same process for each round of label allocation, we can take any round of label allocation as an example to describe the working process of the label management system in detail:
[0056] The first data processor can generate an acquisition signal of the data to be processed to indicate that it currently has data to be processed. After receiving the acquisition signal, the tag management module can directly read out the first transaction tag pointed to by the tag allocation pointer and stored in the preset address of the first storage space, and allocate the first transaction tag to the data to be processed. It is easy to understand that since the first transaction tag is stored in the first storage space, the first transaction tag is obviously in an unused state. So far, a round of tag allocation has been completed. And since the above-mentioned tag allocation process involves a simple reading action, the above-mentioned tag allocation can be completed within one clock cycle of the first data processor.
[0057] After the first transaction tag is assigned to the data to be processed, the tag management module can further set the first transaction tag to be in a used state. The tag status monitoring module can detect the change in the use state of the first transaction tag and record the used state of the first transaction tag. At the same time, the tag management module can also delete the first transaction tag from the preset address, and the tag allocation pointer can slide to point to the next transaction tag in the tag queue that is in an unused state after the first transaction tag. The tag management module can also store the next transaction tag in the preset address of the first storage space, and the next transaction tag can be used for the next round of tag allocation.
[0058] It can be seen that, since the label allocation pointer can slide backward after each round of label allocation, and combined with the mechanism of reading and deleting the transaction label, the label allocation pointer always points to a fixed address, namely the preset address, which can be used as a fixed label reading window, and the label allocation module can complete the label allocation by directly reading. And since the transaction labels are sequentially composed of the label queue, the address pointed to by the label allocation pointer always stores the transaction label that was first written into the first storage space in the label queue and is in an unused state, which can also ensure the correct allocation of transaction labels.
[0059] Optionally, the data to be processed mentioned in each embodiment of the present application may be any data generated by the first data processing device that needs to be tracked or data that needs to be processed in sequence. Optionally, the data to be processed may be data that needs to be calculated and analyzed in the first data processor. Tracking such data to be processed by assigning tags can provide support for performance analysis and troubleshooting of the data processor. Optionally, the data to be processed may also be a read and write request generated by reading and writing between the first data processor and the second data processor. Tracking such data to be processed by assigning tags can ensure the sequential reading and writing of data. And the first data processor and the second data processor may be located in the same or different devices. The first data processor may be used as a cloud gateway, more specifically, the first processor may be used as a network card in a cloud gateway. The data read and written between the two data processors may be data transmitted through network communication in a data center.
[0060] Optionally, the two data processors that perform data reading and writing can use the high-speed communication path provided by the Peripheral Component Interconnect Express (PCIe) technology to read and write data. Optionally, the specific form of the data processor may include any one of a central processing unit (CPU), a graphics processing unit (GPU), a programmable chip, etc. Optionally, the programmable chip may specifically include: a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC), a complex programmable logic device (CPLD), etc.
[0061] In this embodiment, after the first data processor receives the data to be processed, the label allocation module in the first data processor can allocate the first transaction label in the label queue, which is pointed to by the label allocation pointer, stored in the preset address of the first storage space, and stored in the first storage space earliest, to the data to be processed according to the order of the transaction labels in the label queue. At this time, the allocation of transaction labels is completed. Afterwards, the label allocation module can also set the first transaction label to a used state, and the used state can be synchronized to the label status monitoring module. And after the label allocation is completed, the next transaction label after the first transaction label in the label queue can be scrolled and stored in the preset address, and the label allocation pointer can also be moved to the next transaction label for the next label allocation.
[0062] In the above method, the transaction tag pointed to by the tag allocation pointer is always stored in a fixed address, i.e., a preset address. Therefore, when the data to be processed is obtained, the data processor can directly read the transaction tag from the fixed address and allocate it to the data to be processed. By using the above method, the data processor does not need to select the transaction tag to be allocated to the data to be processed from the tag queue. The default of the selection process can improve the efficiency of tag allocation.
[0063] It is easy to understand that the first data processor often needs to use its own memory resources in the process of processing the data to be processed. Figure 2 A schematic diagram of the structure of another tag management system provided in an embodiment of the present application. Figure 1 Based on the system shown, Figure 2 As shown, the system may include: a storage space management module.
[0064] After reading the first transaction tag from the preset address, the tag management module may further generate a notification signal to send the signal to the storage space management module. In response to the notification signal, the storage space management module may allocate a second storage space required for processing the data to be processed in the first data processor.
[0065] In this embodiment, the collaborative work of the tag management module, the tag status recording module and the storage space management module in the tag management system can achieve rapid allocation of tags and normal processing of data to be processed.
[0066] The process of allocating transaction tags and storage space may be described below with a specific example.
[0067] When the transaction tag is in the form of a number, the initially established tag queue can be as follows: Figure 3 As shown in (a) in Figure 1, the tag queue contains 256 transaction tags, numbered 0 to 255. Figure 3As shown in (a), the transaction tags in the initially established tag queue are all in an unused state, and are stored in the first storage space, and the tag allocation pointer points to the transaction tag numbered 0, and the remaining transaction tags numbered 1 to 255 can be stored in order in other addresses after the preset address. Optionally, the addresses storing the transaction tags in the first storage space can be continuous or discontinuous.
[0068] When the first data processor receives the data 1 to be processed at time T1, the tag management module can assign the transaction tag numbered 0 read from the preset address to the data 1. At this time, the tag status monitoring module can detect that the transaction tag numbered 0 is in the used state. At the same time, the tag management module can also delete the transaction tag numbered 0 from the preset address, and the preset address can be written to the transaction tag numbered 1, and the tag allocation pointer of the tag queue also points to the transaction tag numbered 1. At this time, the tag queue can be as follows Figure 3 As shown in (b) in the figure. That is to say, after the transaction tag numbered 0 is assigned to data 1, the storage locations of all unused transaction tags in the tag queue can also be rolled forward. At the same time, the storage space management module can also allocate a portion of storage space to data 1 for use in the data processing process.
[0069] When the first data processor receives the data 2 to be processed at time T2 after time T1, the tag management module can assign the transaction tag numbered 1 read from the preset address to the data 2. At this time, the tag status monitoring module can detect that the transaction tag numbered 1 is in the used state. At the same time, the tag management module can also delete the transaction tag numbered 2 from the preset address, and the preset address can be written to the transaction tag numbered 2, and the tag allocation pointer of the tag queue also points to the transaction tag numbered 2. In one case, if the first data processor has processed data 1 at time T2, the tag queue can be as follows Figure 3 At the same time, the storage space management module can also allocate a portion of storage space for data 2 for use in the data processing process. And the storage space allocated for data 2 can be the same as the storage space allocated for data 1. In another case, if the first data processor has not finished processing data 1 at time T2, the tag queue can be as follows Figure 3 As shown in (d) in FIG. 1 , the storage space allocated by the storage space management module for data 2 may be different from the storage space allocated for data 1.
[0070] As can be seen from the above examples, the sliding of the label allocation pointer can also enable the label queue to achieve the effect of a circular queue, thereby realizing convenient allocation of transaction labels.
[0071] The above embodiments have fully introduced the process of label allocation. It is easy to understand that, considering the limited number of transaction labels, the label management system can also recycle the allocated transaction labels and storage space after the processing of the pending data is completed. Figure 1 and Figure 2 In the figure, the process involving label allocation is shown by a solid line, and the process involving label recycling is shown by a dotted line.
[0072] Based on the tag management system provided by the above embodiments, the transaction tag recycling process can be described as follows:
[0073] After the processing of the data to be processed is completed, the tag status monitoring module can receive a processing completion signal of the data to be processed. Optionally, the data processing module in the first data processor can process the data to be processed and generate a processing completion signal, and the data processing module is not shown in the accompanying drawings. Afterwards, the tag status monitoring module can also obtain the second transaction tag pointed to by the tag recycling pointer in the tag queue. The tag recycling pointer points to the transaction tag in the tag queue that is stored in the first storage space at the latest and is in an unused state.
[0074] In one case, if the first transaction tag and the second transaction tag are continuous, it indicates that the data to be processed using the second transaction tag allocated before the first transaction tag has been processed, indicating that the second transaction tag has been recycled into the first storage space, then the tag status monitoring module can store the first transaction tag into the first storage space, and simultaneously update the first transaction tag to an unused state, thus completing the recycling of the transaction tag. And the tag recycling pointer will also point to the first transaction tag that has been newly recycled into the first storage space.
[0075] In another case, if the first transaction tag and the second transaction tag are not continuous, indicating that the data to be processed using the second transaction tag allocated before the first transaction tag has not been processed, indicating that the second transaction tag has not been completely recycled, and there is a third transaction tag in a used state between the first transaction tag and the second transaction tag, then the tag status monitoring module can first store the first transaction tag in the third storage space, and after the third transaction tag is completely recycled, that is, the third transaction tag is set to an unused state and stored in the first storage space, the first transaction tag is migrated from the third storage space to the first storage space. This means that the recycling of the transaction tag is completed. After the first transaction tag is stored in the first storage space, the tag status monitoring module can also update the first transaction tag to an unused state. At this time, the tag recycling pointer will also point to the newly recycled first transaction tag.
[0076] In addition, while reclaiming the first transaction tag, the storage space management module may also reclaim the second storage space required for processing the device to be processed.
[0077] In this embodiment, the tag management system can be used to realize the recycling of transaction tags and storage space. In addition, the recycling order of transaction tags is the same as the distribution order, that is, transaction tags are sent and recycled in order, so that data can be processed in order, ensuring the stability and reliability of data processing.
[0078] The process of reclaiming the transaction tag and storage space may be described below with a specific example.
[0079] based on Figure 2 As shown in the tag queue, as the first data processor continuously receives different data to be processed at different times, for data 3 received at time T3 and data 4 received at time T4, the tag allocation tag can allocate transaction tags numbered 052 and 053 to data 3 and data 4 respectively.
[0080] When the first data processor receives the data 5 to be processed at time T5, based on the scrolling of the tag allocation pointer and the reading and deleting mechanism of the tag in the preset address, the tag management module can assign the transaction tag numbered 054 read from the preset address to the data 5. After the data 5 is processed, the tag status monitoring module can also obtain the transaction tag pointed to by the tag recycling pointer in the tag queue.
[0081] In one case, if the tag recycling pointer points to the transaction tag numbered 053, it indicates that the transaction tag numbered 053 has been recycled. At this time, the tag queue can be combined with Figure 4 According to (a) in the figure, the tag status monitoring module can recycle the transaction tag numbered 054, that is, move the transaction tag numbered 054 to the first storage space, and update the transaction tag numbered 054 to an unused state. After recycling, the tag recycling pointer can also point to the transaction tag numbered 054.
[0082] In another case, if the tag recycling pointer points to the transaction tag numbered 052, it means that the transaction tag numbered 052 has been recycled, but the transaction tag numbered 053 has not been recycled, indicating that the data using the transaction tag numbered 053 has not been processed. At this time, the tag queue can be combined with Figure 4 According to (b) in the above description, the tag status monitoring module can first write the transaction tag numbered 054 into the third storage space, and after the data processing using the transaction tag numbered 053 is completed, the transaction tag numbered 053 is first recycled, and then the transaction tag numbered 054 is recycled, that is, the transaction tag numbered 054 is written into the first storage space. At the same time, the tag status monitoring module can also update the transaction tag numbered 054 to an unused state.
[0083] Besides, while reclaiming the transaction tag, the storage space management module may also reclaim the second storage space required for processing the device to be processed after receiving a signal indicating that the processing of the data to be processed is completed.
[0084] From the above embodiments, it can be seen that the first storage space in the first data processor can store unused transaction tags, the third storage space can store used transaction tags, and the second storage space is the storage space used in the data processing process.
[0085] When data can be received and processed normally, the allocation and recycling of tags and storage space can be performed according to the schemes provided in the above embodiments. After completing a round of tag allocation, the tag allocation pointer will scroll to the next adjacent transaction tag. Similarly, after completing a round of tag recycling, the tag recycling pointer can also scroll to the latest recycled transaction tag.
[0086] However, during the data processing process, data processing exceptions may occur. At this time, optionally, the data processing component in the first data processor may generate a processing exception signal for the data to be processed. The tag state monitoring module may receive the processing exception signal and set the first transaction tag to an abnormal state. In addition, the tag allocation pointer and the tag recycling pointer may skip the transaction tag in the abnormal state during the scrolling process, so that the transaction tag in the abnormal state will not participate in the subsequent data processing process.
[0087] In this embodiment, the ability of the tag status monitoring module to record abnormal transaction tags can promptly identify data processing failures, and further adjust the abnormal transaction tags and / or data processors to improve the problem of data processing failures.
[0088] In addition, the technical effects that can be achieved by the tag management system provided by each embodiment of the present application can also be understood in combination with the following contents:
[0089] In practice, with the continuous development of information technology, the amount of data that data processors need to process has also increased exponentially. Especially when the data processor acts as a cloud gateway, the cloud gateway, as a data convergence point in the data communication process, needs to increase the data processing speed. To adapt to this environment, the data processing speed can be increased from the perspective of increasing the operating frequency of the data processor. For example, when the data processor is specifically an FPGA, the operating frequency of the existing FPGA is 200MHz~250 MHz, then the operating speed of the FPGA can be increased to higher than 250 MHz, for example, the operating frequency of the FPGA can reach 500 MHz. And for the FPGA on the PCIe bus, the operating frequency of the FPGA can match the operating frequency of the PCIe bus.
[0090] Since increasing the operating frequency also means that the clock cycle of the data processor becomes shorter, if the data processor uses the method of searching and allocating transaction tags from a large number of transaction tags, it is easy to fail to complete the tag allocation within one clock cycle of the data processor. However, using the system or method provided by each embodiment of the present application, the tag allocation can be completed by directly reading the transaction tag in the preset address, eliminating the process of searching for unused transaction tags from a large number of transaction tags, ensuring that the tag allocation can be completed within one clock cycle even after the operating frequency is increased, that is, improving the efficiency of tag allocation.
[0091] Optionally, the data processing speed may be increased by increasing the tag queue length to reduce the transaction tag recycling frequency.
[0092] When the length of the tag queue increases, if the data processor uses the method of searching and allocating transaction tags from a large number of transaction tags, the increase in the length of the tag queue will obviously reduce the efficiency of transaction tag allocation, which is contrary to the original intention of "increasing the data processing speed by increasing the length of the tag queue to reduce the frequency of transaction tag recycling". However, using the system or method provided by each embodiment of the present application, the tag allocation can be completed by directly reading the transaction tag in the preset address, which is not affected by the length of the tag queue. And the process of searching for unused transaction tags from a large number of transaction tags is omitted, which can also improve the efficiency of tag allocation.
[0093] Above Figure 1~Figure 4 The illustrated embodiment has described the working process of the tag management system during data processing from the perspective of system structure. The working process of the tag management system can also be introduced from the perspective of process.
[0094] Figure 5 Flow chart of a tag management method provided in an embodiment of the present application. The method provided in an embodiment of the present application can be executed by the first data processor in each of the above system embodiments. Figure 5 As shown, the method may include the following steps:
[0095] S101, in response to an acquisition signal of data to be processed, read a first transaction tag pointed to by a tag allocation pointer in a tag queue from a preset address of a first storage space, wherein unused transaction tags in the tag queue are stored in a first storage space of a first data processor, and the tag allocation pointer points to a transaction tag in the tag queue that is earliest stored in the first storage space.
[0096] S102: Write the next transaction tag in the tag queue that is in an unused state after the first transaction tag into a preset address, and the tag allocation pointer points to the next transaction tag.
[0097] S103: Set the first transaction tag to a used state.
[0098] After receiving the acquisition signal of the data to be processed, the first data processor can directly assign the first transaction tag read from the preset address to the data to be processed. At the same time, the first transaction tag can be set to a used state, and the tag allocation pointer can point to the next transaction tag in the tag queue that is in an unused state after the first transaction tag, and the next transaction tag can also be stored at the preset address.
[0099] Each step in this embodiment can be specifically executed by the label management module in the first data processor.
[0100] In this embodiment, when the first data processor receives the data to be processed, the first transaction tag in the tag queue pointed to by the tag allocation pointer and stored in the preset address of the first storage space can be allocated to the data to be processed according to the order of the transaction tags in the tag queue. The first storage space is provided by the first data processor, and the first transaction tag is the earliest transaction tag currently stored in the first storage space and is in an unused state. At this time, the allocation of the transaction tag is completed. And the first transaction tag can be set to a used state. In addition, when the tag allocation is completed, the next transaction tag after the first transaction tag in the tag queue can also be scrolled and stored in the preset address, and the tag allocation pointer can also be moved to the next transaction tag for the next tag allocation.
[0101] In the above method, the transaction tag pointed to by the tag allocation pointer is always stored in a fixed address, that is, a preset address. Therefore, when the data to be processed is obtained, the data processor can directly read the transaction tag from the fixed address and allocate it to the data to be processed. Using the above method, the data processor does not need to select the transaction tag to be allocated to the data to be processed from the tag queue. The default of this selection process can improve the efficiency of tag allocation.
[0102] In addition, the contents not described in detail in this embodiment and the beneficial effects that can be achieved can be found in Figure 1 The relevant description in the illustrated embodiment will not be repeated here.
[0103] Optionally, in the process of processing data, in addition to allocating transaction tags, a second storage space required for processing the data to be processed may also be allocated in the first data processor.
[0104] Optionally, after the processing of the pending data is completed, the allocated transaction tags may be recycled according to the allocation order of the transaction tags, and the allocated second storage space may also be recycled at the same time as the transaction tags are recycled.
[0105] In addition, the specific process of label and storage space allocation and recycling can be found in the above Figure 1~Figure 4 The description in the illustrated embodiment. And the storage space allocation and recovery process can be specifically executed by the storage space allocation module in the first data processor.
[0106] Optionally, when data processing exception occurs, the transaction tag assigned to the data processed abnormally may be recorded, and the transaction tag may be set to an abnormal state. And the transaction tag in the abnormal state will not participate in the allocation and recycling process of subsequent rounds.
[0107] As Figure 1 In the illustrated embodiment, the data to be processed may specifically include a read / write request generated by data reading / writing between the first data processor and the second data processor. Figure 6 A schematic diagram of the structure of a data reading and writing system provided in an embodiment of the present application. The system may include: a first data processor and a second data processor.
[0108] The first data processor may include a tag management system, which may include: Figure 1 The tag management module, the tag status monitoring module and the first storage space for storing unused transaction tags are shown, and the first storage space can be provided by a first data processor.
[0109] After the first data processor generates a read / write request for the second data processor, the tag management system inside the first data processor may allocate a first transaction tag to the read / write request. The request associated with the first transaction tag may be further sent to the second data processor. After the second data processor receives the read / write request associated with the first transaction tag, it may respond to the read / write request, and finally, feed back the request response result associated with the first transaction tag to the first data processor.
[0110] In addition, the specific allocation process of the transaction tag can refer to the description in the above-mentioned related embodiments. And other contents not described in detail in this embodiment and the beneficial effects that can be achieved can refer to the relevant description in the above-mentioned embodiments, which will not be repeated here.
[0111] Figure 7 A schematic diagram of the structure of another data reading and writing system provided in an embodiment of the present application. Figure 6 Based on the system shown, Figure 6 As shown, the first data processor may further include: a storage space management module and a data processing module.
[0112] for Figure 6The read / write request mentioned in the illustrated embodiment may be generated by a data processing module in the first data processor. The tag management module may also obtain an acquisition signal of the read / write request to further generate a notification signal. The storage space management module may respond to the notification signal to allocate a second storage space required for processing the read / write request in the first data processor.
[0113] and Figure 6 As mentioned in the illustrated embodiment, the read / write request associated with the first transaction tag may also be sent by the data processing module to the second data processor. Similarly, the request response result associated with the first transaction tag may also be received by the data processing module.
[0114] Specifically, optionally, the storage space management module may allocate the corresponding second storage space for the read request according to the length of the data to be read corresponding to the read request. Optionally, the storage space management module may also allocate the second storage space required for processing the data to be processed in the first data processor according to the length of the data to be written corresponding to the write request.
[0115] When the data processing module in the first data processor receives the request response result fed back by the second data processor, it can further generate a processing completion signal of the read / write request and send the signal to the tag status monitoring module, so that the tag status monitoring module executes the subsequent transaction tag and storage space recycling process. The specific recycling process and the contents not described in detail in this embodiment and the beneficial effects that can be achieved can be referred to the relevant description in the above-mentioned related embodiments, which will not be repeated here.
[0116] Above Figure 6~Figure 7 The illustrated embodiment has described the working process of the data reading and writing system from the perspective of system structure. The working process of the data reading and writing system can also be introduced from the perspective of process flow.
[0117] Figure 8 Flow chart of a data reading and writing method provided in an embodiment of the present application. The method provided in an embodiment of the present application can be executed by the first data processor in each of the above system embodiments. Figure 8 As shown, the method may include the following steps:
[0118] S201, in response to an acquisition signal of a read / write request, reading a first transaction tag pointed to by a tag allocation pointer in a tag queue from a preset address of a first storage space, wherein the read / write request includes a read request or a write request generated by a first data processor for a second data processor, unused transaction tags in the tag queue are stored in a first storage space of the first data processor, and the tag allocation pointer points to a transaction tag in the tag queue that is earliest stored in the first storage space.
[0119] S202: Write the next transaction tag in the tag queue that is in an unused state after the first transaction tag into a preset address, and the tag allocation pointer points to the next transaction tag.
[0120] S203: Set the first transaction tag to a used state.
[0121] S204: Send a read / write request associated with the first transaction tag to the second data processor.
[0122] After the first data processor generates a read / write request for the second data processor, the tag management system inside the first data processor may allocate a first transaction tag to the read / write request. The request associated with the first transaction tag may be further sent to the second data processor. After the second data processor receives the read / write request associated with the first transaction tag, it may respond to the read / write request, and finally, feed back the request response result associated with the first transaction tag to the first data processor.
[0123] The specific allocation process of the transaction tag can refer to the description in the above-mentioned related embodiments. In addition, other contents not described in detail in this embodiment and the technical effects that can be achieved can also refer to the description in the above-mentioned related embodiments, which will not be repeated here.
[0124] Optionally, in order to ensure normal processing of read and write requests, after generating a read and write request, the first data processor may also allocate a second storage space required for processing the data to be processed in the first data processor to the read request according to the length of the data to be read corresponding to the read request; or, allocate a second storage space required for processing the data to be processed in the first data processor to the write request according to the length of the data to be written corresponding to the write request.
[0125] Optionally, after the read / write request is executed, the transaction tag and storage space allocated to the read / write request may be correspondingly reclaimed. The specific reclaiming process may refer to the description in the above-mentioned related embodiments, and will not be described in detail in this step.
[0126] The tag management device of one or more embodiments of the present application will be described in detail below. Those skilled in the art will appreciate that the device can be configured using commercially available hardware components through the steps taught in this solution.
[0127] Fig. 9 This is a schematic diagram of the structure of a label management device provided in an embodiment of the present application. Fig. 9 As shown, the device may include:
[0128] A first tag management module 11 is configured to read, in response to an acquisition signal of data to be processed, a first transaction tag pointed to by a tag allocation pointer in a tag queue from a preset address of a first storage space, wherein unused transaction tags in the tag queue are stored in the first storage space of the first data processor, and the tag allocation pointer points to a transaction tag in the tag queue that is earliest stored in the first storage space;
[0129] Writing a next transaction tag in the tag queue that is in an unused state after the first transaction tag into the preset address, wherein the tag allocation pointer points to the next transaction tag;
[0130] The first transaction tag is set to be in used state.
[0131] Optionally, the device further comprises a first storage space management module 12, configured to allocate a second storage space required for processing the data to be processed in the first data processor.
[0132] Optionally, the transaction tags in the tag queue include a numbering format. The device further includes: a tag status monitoring module 13, configured to obtain a second transaction tag pointed to by a tag recycling pointer in the tag queue in response to a processing completion signal of the to-be-processed data, wherein the tag recycling pointer points to the transaction tag in the tag queue that is stored in the first storage space at the latest;
[0133] If the first transaction tag and the second transaction tag are continuous, storing the first transaction tag in the first storage space;
[0134] The first transaction tag is updated to an unused state, so that the tag reclaiming pointer points to the first transaction tag.
[0135] Optionally, the transaction tags in the tag queue that are in a used state are stored in a third storage space of the first data processor.
[0136] The tag state monitoring module 13 is configured to store the first transaction tag in the third storage space if the first transaction tag and the second transaction tag are not continuous, and the first transaction tag and the second transaction tag are separated by a third transaction tag in a used state;
[0137] In response to the third transaction tag being stored in the first storage space, migrating the first transaction tag from the third storage space to the first storage space;
[0138] The first transaction tag is updated to an unused state, so that the tag reclaiming pointer points to the first transaction tag.
[0139] Optionally, the first storage space management module 12 is used to reclaim the second storage space required for processing the to-be-processed data in the first data processor in response to the processing completion signal.
[0140] Optionally, the tag status monitoring module 13 is configured to set the first transaction tag to an abnormal state in response to a processing abnormality signal of the data to be processed.
[0141] The first data processor includes a programmable chip, and the first data processor includes a cloud gateway.
[0142] Fig. 9 The device shown can perform Figure 5 For the method of the embodiment shown in the figure, the part not described in detail in this embodiment can be referred to Figure 5 The implementation process and technical effects of this technical solution refer to Figure 5 The description in the illustrated embodiment will not be repeated here.
[0143] In a possible design, the tag management method provided in the above embodiments can be applied in an electronic device, such as Fig.10 As shown, the electronic device may include: a first processor 21 and a first memory 22. The first memory 22 is used to store data that supports the electronic device to execute the above Figure 5 The program of the tag management method provided in the illustrated embodiment, the first processor 21 is configured to execute the program stored in the first memory 22 .
[0144] The program includes one or more computer instructions, wherein the one or more computer instructions can implement the following steps when executed by the first processor 21:
[0145] In response to an acquisition signal of data to be processed, reading a first transaction tag pointed to by a tag allocation pointer in a tag queue from a preset address of a first storage space, wherein unused transaction tags in the tag queue are stored in the first storage space of the first data processor, and the tag allocation pointer points to a transaction tag in the tag queue that is stored earliest in the first storage space;
[0146] Writing a next transaction tag in the tag queue that is in an unused state after the first transaction tag into the preset address, wherein the tag allocation pointer points to the next transaction tag;
[0147] The first transaction tag is set to be in used state.
[0148] Optionally, the first processor 21 is further configured to execute the aforementioned Figure 5 All or part of the steps in the illustrated embodiments.
[0149] The structure of the electronic device may also include other components such as a first communication component 23, a first display 24, a first power component 25, and a first audio component 26.
[0150] Fig.10 Only some components are shown schematically, which does not mean that the electronic device only includes Fig.10 In addition, Fig.10 The components in are optional components, not mandatory components, and may depend on the product form of the electronic device. The electronic device of this embodiment may be implemented as a terminal device such as a desktop computer, a laptop computer, a smart phone or an IOT device, or may be a server device such as a conventional server, a cloud server or a server array.
[0151] The above-mentioned first memory 22 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable programmable read only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0152] The above-mentioned first communication component 23 is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0153] The first display 24 includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.
[0154] The first power supply assembly 25 provides power to various components of the device where the power supply assembly is located. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing and distributing power to the device where the power supply assembly is located.
[0155] The first audio component 26 described above can be configured to output and / or input audio signals. For example, the audio component includes a microphone (Microphone, MIC), and when the device where the audio component is located is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in a memory or sent via a communication component. In some embodiments, the audio component also includes a speaker for outputting an audio signal.
[0156] Fig.11 This is a schematic diagram of the structure of a data reading and writing device provided in an embodiment of the present application. Fig.11 As shown, the device may include:
[0157] A second tag management module 31 is configured to read, in response to an acquisition signal of a read / write request, a first transaction tag pointed to by a tag allocation pointer in a tag queue from a preset address of a first storage space, wherein the read / write request includes a read request or a write request generated by the first data processor for a second data processor, unused transaction tags in the tag queue are stored in the first storage space of the first data processor, and the tag allocation pointer points to a transaction tag in the tag queue that is earliest stored in the first storage space;
[0158] Writing a next transaction tag in the tag queue that is in an unused state after the first transaction tag into the preset address, wherein the tag allocation pointer points to the next transaction tag;
[0159] Setting the first transaction tag to a used state;
[0160] The sending module 32 is used to send the read / write request associated with the first transaction tag to the second data processor for responding to the request.
[0161] Optionally, the device may further include: a second storage space management module 33, configured to allocate, for the read request, a second storage space required for processing the data to be processed in the first data processor according to the length of the data to be read corresponding to the read request; or
[0162] According to the length of the to-be-written data corresponding to the write request, a second storage space required for processing the to-be-processed data in the first data processor is allocated to the write request.
[0163] The first data processor includes a network card implemented by a programmable chip, and the first data processor and the second data processor perform data transmission via a data bus.
[0164] Fig.11 The device shown can perform Figure 8 For the method of the embodiment shown in the figure, the part not described in detail in this embodiment can be referred to Figure 8 The implementation process and technical effects of this technical solution refer to Figure 8 The description in the illustrated embodiment will not be repeated here.
[0165] In a possible design, the data reading and writing methods provided in the above embodiments may be applied in an electronic device, such as Fig.12 As shown, the electronic device may include: a second processor 41 and a second memory 42. The second memory 42 is used to store the electronic device to perform the above Figure 8The program of the data reading and writing method provided in the illustrated embodiment, the second processor 41 is configured to execute the program stored in the second memory 42 .
[0166] The program includes one or more computer instructions, wherein the one or more computer instructions can implement the following steps when executed by the second processor 41:
[0167] In response to an acquisition signal of a read / write request, reading a first transaction tag pointed to by a tag allocation pointer in a tag queue from a preset address of a first storage space, wherein the read / write request includes a read request or a write request generated by the first data processor for a second data processor, unused transaction tags in the tag queue are stored in the first storage space of the first data processor, and the tag allocation pointer points to a transaction tag in the tag queue that is earliest stored in the first storage space;
[0168] Writing a next transaction tag in the tag queue that is in an unused state after the first transaction tag into the preset address, wherein the tag allocation pointer points to the next transaction tag;
[0169] Setting the first transaction tag to a used state;
[0170] The read / write request associated with the first transaction tag is sent to the second data processor for responding to the request.
[0171] Optionally, the second processor 41 is further configured to execute the aforementioned Figure 8 All or part of the steps in the illustrated embodiments.
[0172] The structure of the electronic device may also include other components such as a second communication component 43, a second display 44, a second power component 45, and a second audio component 46.
[0173] In addition, the specific forms and deployment methods of the second memory 42, the second communication component 43, the second display 44, the second power component 45, and the second audio component 46 in this embodiment are similar to those in the embodiment of the present invention. Figure 8 The contents in the illustrated embodiments are the same and will not be described again in detail.
[0174] Accordingly, the embodiment of the present application also provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the processor is enabled to implement each step in the above method embodiment. Among them, the computer-readable storage medium includes volatile or non-volatile or a combination thereof, and can be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic cassette, tape disk storage or other magnetic storage device or any other non-transmission medium
[0175] Accordingly, the present application embodiment also provides a computer program product, the computer program product includes a computer program or an instruction, when the computer program or the instruction is executed by the processor, the processor is enabled to implement each step in the above method embodiment. It should be understood that each process or a combination of multiple processes in the above method flow can be implemented by a computer program or an instruction. In addition, these computer programs or instructions can be applied to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device, so that the processor of the general-purpose computer, the special-purpose computer, the embedded processor or other programmable data processing device can be implemented as a device for implementing the corresponding functions in the above method embodiment.
[0176] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A tag management method, characterized in that: Applied to a first data processor, the method comprises: In response to an acquisition signal of data to be processed, read, from a fixed address of a first storage space, a first transaction tag pointed to by a tag allocation pointer in a tag queue, wherein unused transaction tags in the tag queue are stored in the first storage space of the first data processor, and the tag allocation pointer points to a transaction tag in the tag queue that is earliest stored in the first storage space; writing a next transaction tag in the tag queue that is in an unused state after the first transaction tag into the fixed address, wherein the tag allocation pointer points to the next transaction tag; The first transaction tag is set to be in used state.
2. The method according to claim 1, characterized in that: The read tag allocation pointer is after the first transaction tag pointed to by the tag queue, and the method further comprises: A second storage space required for processing the data to be processed is allocated in the first data processor.
3. The method according to claim 1, characterized in that The transaction tags in the tag queue include a numbered form; the method further includes: In response to a processing completion signal of the to-be-processed data, acquiring a second transaction tag pointed to by a tag recycling pointer in the tag queue, wherein the tag recycling pointer points to a transaction tag in the tag queue that is stored in the first storage space at the latest; If the first transaction tag and the second transaction tag are continuous, storing the first transaction tag in the first storage space; The first transaction tag is updated to an unused state, so that the tag reclaiming pointer points to the first transaction tag.
4. The method according to claim 3, characterized in that The transaction tags in the tag queue that are in a used state are stored in a third storage space of the first data processor, and the method further includes: If the first transaction tag and the second transaction tag are not continuous, the first transaction tag is stored in the third storage space, and the first transaction tag and the second transaction tag are separated by a third transaction tag in a used state; In response to the third transaction tag being stored in the first storage space, migrating the first transaction tag from the third storage space to the first storage space; The first transaction tag is updated to an unused state, so that the tag reclaiming pointer points to the first transaction tag.
5. The method according to claim 3, characterized in that: The method further comprises: In response to the processing completion signal, reclaiming the second storage space required by the first data processor for processing the to-be-processed data.
6. The method according to claim 1, characterized in that The method further comprises: In response to a processing exception signal of the data to be processed, the first transaction tag is set to an abnormal state.
7. According to the method according to any one of claims 1 to 6, the first data processor comprises a cloud gateway implemented using a programmable chip.
8. A label distribution system, characterized in that: The label distribution system is deployed in a first data processor, and the system includes: a label management module, a label status monitoring module, and a first storage space, wherein the first storage space stores transaction labels in an unused state in a label queue; The tag management module is configured to receive an acquisition signal of data to be processed; in response to the acquisition signal, read a first transaction tag pointed to by a tag allocation pointer in the tag queue from a fixed address of the first storage space, wherein the tag allocation pointer points to a transaction tag in the tag queue that is stored earliest in the first storage space; writing a next transaction tag in the tag queue that is in an unused state after the first transaction tag into the fixed address, wherein the tag allocation pointer points to the next transaction tag; Setting the first transaction tag to a used state; The tag status monitoring module is used to record the usage status of the first transaction tag.
9. The system according to claim 8, characterized in that The system further comprises: a storage space management module; The tag management module is used to generate a notification signal after reading the first transaction tag; The storage space management module is used to respond to the notification signal to allocate a second storage space required for processing the data to be processed in the first data processor.
10. The system according to claim 8, characterized in that The transaction tags in the tag queue include a numbering form; the system further includes: a third storage space storing transaction tags in a used state; The tag status monitoring module is used to receive a processing completion signal of the data to be processed; In response to the processing completion signal, acquiring a second transaction tag pointed to by a tag recycling pointer in the tag queue, wherein the tag recycling pointer points to a transaction tag in the tag queue that is stored in the first storage space at the latest; If the first transaction tag and the second transaction tag are not continuous, the first transaction tag is stored in the third storage space, and the first transaction tag and the second transaction tag are separated by a third transaction tag in a used state; In response to the third transaction tag being stored in the first storage space, migrating the first transaction tag from the third storage space to the first storage space; The unused state of the first transaction tag is recorded.
11. A data reading and writing method, characterized in that: Applied to a first data processor, the method comprises: In response to an acquisition signal of a read / write request, reading a first transaction tag pointed to by a tag allocation pointer in a tag queue from a fixed address of a first storage space, wherein the read / write request comprises a read request or a write request generated by the first data processor for a second data processor, unused transaction tags in the tag queue are stored in the first storage space of the first data processor, and the tag allocation pointer points to a transaction tag in the tag queue that is earliest stored in the first storage space; writing a next transaction tag in the tag queue that is in an unused state after the first transaction tag into the fixed address, wherein the tag allocation pointer points to the next transaction tag; Setting the first transaction tag to a used state; The read / write request associated with the first transaction tag is sent to the second data processor.
12. The method according to claim 11, characterized in that The read tag allocation pointer is after the first transaction tag pointed to by the tag queue, and the method further comprises: Allocate, for the read request, a second storage space required for processing the data to be read in the first data processor according to the length of the data to be read corresponding to the read request; or According to the length of the data to be written corresponding to the write request, a second storage space required for processing the data to be written in the first data processor is allocated to the write request.
13. The method according to claim 11 or 12, characterized in that: The first data processor includes a cloud gateway implemented using a programmable chip, and the first data processor and the second data processor perform data transmission via a data bus.
14. A data processing system, characterized in that: It includes a first data processor and a second data processor, wherein the first data processor includes a tag management module, a tag status monitoring module and a first storage space for storing transaction tags in an unused state; The tag management module is configured to receive an acquisition signal of a read / write request; in response to the acquisition signal, read a first transaction tag pointed to by a tag allocation pointer in a tag queue from a fixed address of the first storage space, wherein the read / write request includes a read request or a write request generated by the first data processor for the second data processor, and the tag allocation pointer points to a transaction tag in the tag queue that is earliest stored in the first storage space; The next unused transaction tag after the first transaction tag in the tag queue is written into the fixed address, and the tag allocation pointer points to the next transaction tag. Setting the first transaction tag to a used state; The tag status monitoring module is used to record the used status of the first transaction tag; The second data processor is configured to receive the read / write request associated with the first transaction tag; and send a request response result associated with the first transaction tag to the first data processor.
15. The system according to claim 14, characterized in that The first data processor further includes: a storage space management module and a data processing module; The tag management module is configured to generate a notification signal after reading the first transaction tag; The storage space management module is used to respond to the notification signal to allocate a second storage space required for processing the read and write request in the first data processor; The data processing module is used to utilize the to-be-read data corresponding to the read request or the to-be-written data corresponding to the write request stored in the second storage space.
16. The system according to claim 15, characterized in that The data processing module is used to generate the read / write request; and send an acquisition signal of the read / write request to the tag management module.
17. The system according to claim 15, characterized in that The data processing module is configured to generate a processing completion signal of the read / write request in response to receiving a request response result associated with the first transaction tag; and send the processing completion signal of the read / write request to the tag status monitoring module; The tag management module is configured to obtain, in response to the processing completion signal, a second transaction tag pointed to by a tag recycling pointer in the tag queue, wherein the tag recycling pointer points to a transaction tag in the tag queue that is stored in the first storage space at the latest; If the first transaction tag and the second transaction tag are continuous, storing the first transaction tag in the first storage space; The first transaction tag is updated to an unused state.
18. An electronic device, characterized in that: include: A memory and a processor; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the tag management method as described in any one of claims 1 to 7, or the data reading and writing method as described in any one of claims 11 to 13.
19. A non-transitory machine-readable storage medium, characterized in that The non-temporary machine-readable storage medium stores executable code, and when the executable code is executed by a processor of an electronic device, the processor executes the tag management method as described in any one of claims 1 to 7, or the data reading and writing method as described in any one of claims 11 to 13.
20. A computer program product, characterized in that The computer program product includes a computer program or instructions, so that the computer program or instructions can implement the steps in the tag management method described in any one of claims 1 to 7, or the steps in the data reading and writing method described in any one of claims 11 to 13.
Citation Information
Patent Citations
A technique for managing a cache structure in a system employing transactional memory
CN110471617A
Transaction request processing method and device and storage medium
CN118708302A