Data acquisition method and device, electronic equipment and readable storage medium
By obtaining the load signal of the target node when the data acquisition requirements is required in a multi-core processor system, and sending a request when the load is not greater than the threshold, the resource waste caused by network blockage is solved and data acquisition efficiency is improved.
Patent Information
- Application Number
- CN202510330254.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-08-01
AI Technical Summary
In multi-core processor systems, the data interaction between the processor and the memory is often caused by network blockage, resulting in too long interaction waiting time, resulting in waste of resources.
When obtaining data, the load signal of the target node is first obtained, and the data acquisition request is sent only when the load signal characterizes that the current load is not greater than the preset threshold to avoid network blockage.
Reduces resource waste when the network is busy, improves data acquisition efficiency, and avoids the situation where interaction wait time is too long.
Smart Images

Figure CN120407499A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular, to a data acquisition method, apparatus, electronic device, and readable storage medium. Background Art
[0002] With the development of computer technology, current computer systems are usually distributed systems or multi-core processor systems. On this basis, in order to improve system performance, each processor in a multi-core processor system is usually equipped with an independent cache. To ensure cache consistency, a large amount of data interaction is often required between each processor and the memory.
[0003] Currently, when interacting between processors and memories, data acquisition operations need to be continuously performed, but there are often situations where network congestion causes a long interaction waiting time, and continuous retries are required, resulting in waste of ineffective resources. Summary of the Invention
[0004] The purpose of the embodiments of the present invention is to provide a data acquisition method, apparatus, electronic device, and readable storage medium to solve the problem of how to avoid waste of ineffective resources. The specific technical solutions are as follows:
[0005] In the first aspect of the present invention, a data acquisition method is first provided, which is applied to a request node in a data processing system. The data processing system further includes a data storage node and at least one data processing node. The method includes:
[0006] In response to a data acquisition requirement, determining the data storage node, and / or, the data processing node indicated by the data acquisition requirement, as a target node;
[0007] Obtaining a load signal of the target node;
[0008] When the load signal indicates that the current load of the target node is not greater than a preset load threshold, sending a data acquisition request to the target node.
[0009] In the second aspect of the present invention, a data acquisition apparatus is further provided, which is applied to a request node in a data processing system. The data processing system further includes a data storage node and at least one data processing node. The apparatus includes:
[0010] A first determination module, configured to determine the data storage node, and / or, the data processing node indicated by the data acquisition requirement, as a target node in response to a data acquisition requirement;
[0011] A first acquisition module, configured to obtain a load signal of the target node;
[0012] A first sending module, configured to send a data acquisition request to the target node when the load signal indicates that the current load of the target node is not greater than a preset load threshold.
[0013] In a third aspect of the embodiments of the present invention, an electronic device is further provided, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0014] The memory is used to store a computer program;
[0015] The processor is configured to implement the method described in the first aspect above when executing the program stored on the memory.
[0016] In a fourth aspect of the embodiments of the present invention, a computer-readable storage medium is further provided. Instructions are stored in the computer-readable storage medium, and when it runs on a computer, it causes the computer to execute the method described in the first aspect above.
[0017] In a fifth aspect of the embodiments of the present invention, a computer program product containing instructions is further provided. When it runs on a computer, it causes the computer to execute the method described in the first aspect above.
[0018] The data acquisition method provided by the embodiments of the present invention is applied to a requesting node in a data processing system. The data processing system further includes a data storage node and at least one data processing node. By responding to a data acquisition requirement, the data storage node, and / or, the data processing node indicated by the data acquisition requirement, is determined as the target node; the load signal of the target node is acquired; when the load signal indicates that the current load of the target node is not greater than a preset load threshold, a data acquisition request is sent to the target node. In this way, by setting the load signal in the embodiments of the present invention, when there is a data acquisition requirement, the load signal of the target node can be acquired first, and when the load signal indicates that the current load of the target node is not greater than the load threshold, a data acquisition request is sent to the target node, and data is acquired through the target node. This can reduce the congestion on the target node, avoid the situation where the interaction waiting time is long due to network congestion, reduce the resource waste when the network is busy, and improve the data acquisition efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art.
[0020] Figure 1 It is a step flowchart of a data acquisition method in an embodiment of the present invention;
[0021] Figure 2 Schematic diagram of a data processing system in an embodiment of the present invention;
[0022] Figure 3 Flowchart of a data acquisition method in an embodiment of the present invention;
[0023] Figure 4 Flowchart of another data acquisition method in an embodiment of the present invention;
[0024] Figure 5 Flowchart of yet another data acquisition method in an embodiment of the present invention;
[0025] Figure 6 Schematic diagram of a data acquisition device in an embodiment of the present invention;
[0026] Figure 7 Schematic diagram of an electronic device in an embodiment of the present invention. Detailed implementation manners
[0027] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without making creative efforts shall fall within the protection scope of the present invention.
[0028] The terms "first", "second", etc. in the specification and claims of the present invention are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention can be implemented in an order different from those illustrated or described herein, and the objects distinguished by "first", "second", etc. are usually of the same category, and the number of objects is not limited. For example, the first object can be one or more. In addition, the term "and / or" in the specification and claims is used to describe the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after. The term "plurality" in the embodiments of the present invention refers to two or more, and other quantifiers are similar.
[0029] Figure 1 Step flowchart of a data acquisition method in an embodiment of the present invention. This method can be applied to a request node in a data processing system, and the data processing system may further include a data storage node and at least one data processing node, as Figure 1 shown, this method includes:
[0030] Step 101: In response to a data acquisition requirement, determine the data storage node and / or the data processing node indicated by the data acquisition requirement as the target node.
[0031] Step 102: Obtain the load signal of the target node;
[0032] Step 103: When the load signal indicates that the current load of the target node is not greater than a preset load threshold, send a data acquisition request to the target node.
[0033] Regarding the above steps 101 to 103, the embodiments of the present invention can be applied to any data processing system. This data processing system can be a multi-core processor system or a distributed cluster, and the embodiments of the present invention do not limit this. Correspondingly, the above data storage node can be a memory, and the above data processing node can be a processor core or a processor group composed of multiple processor cores, which can be set according to the actual data processing system, and the embodiments of the present invention do not limit this. The above request node refers to the node that responds to the data acquisition requirement, which can be the above data processing node or other nodes in the system, and the embodiments of the present invention do not limit this.
[0034] Exemplarily, Figure 2 is a schematic structural diagram of a data processing system in an embodiment of the present invention. As Figure 2 shown, Figure 2 shows a 2*2 interconnection network framework, which includes data processing nodes (cores), data storage nodes (Memories), and control nodes. Each node is connected through a routing module (router), and through the routing module, request transmission and data interaction between nodes can be realized. The above control node can be a module in the data processing system for executing control logic, and it can serve as an intermediate node between the data processing node and the data storage node. Correspondingly, the above control node can also be a request node.
[0035] Among them, the above data acquisition requirement can be triggered by any data processing node. When any data processing node has a data acquisition requirement, it can generate a trigger signal. Correspondingly, after the embodiments of the present invention recognize the trigger signal, it can determine that there is a data acquisition requirement, and can determine the data storage node and / or the data processing node indicated by the data processing operation as the target node. Or, the above data acquisition requirement can also be triggered by the control node, and the embodiments of the present invention do not limit this.
[0036] Specifically, according to different data acquisition requirements, the determined target nodes are also different. Exemplarily, if the data acquisition requirement indicates that the data processing node requests to directly interact with the data storage node and obtain data from the data storage node, the data storage node can be determined as the target node at this time. Correspondingly, if the data acquisition requirement indicates that the data processing node requests to obtain data from other data processing nodes, the other data processing node pointed to can be determined as the target node.
[0037] Among them, the above load signal is used to represent the load state of the node, that is, it is used to represent whether there is currently resource to respond to the data acquisition requirement at the node. Correspondingly, the above preset load threshold can be set in advance according to the actual resources of each node. On this basis, the load state of each node can be determined according to the signal value of the load signal. For example, the load signal can be set to busy. When busy = 0, it indicates that the node is in an idle state and the current load of the node is not greater than the preset load threshold. Correspondingly, when busy = 1, it indicates that the node is in a busy state and the current load of the node is greater than the above preset load threshold.
[0038] Specifically, the above data processing node and data storage node can generate the load signal by themselves according to the actual load situation. Of course, the above load signal can also be generated by an external detection device according to the actual load of each data processing node and data storage node. The embodiments of the present invention do not limit this.
[0039] Specifically, the above load signal can be obtained in real time, or can be actively output by each data processing node and data storage node at a certain period. The embodiments of the present invention do not limit this. Further, after obtaining the load signal of the target node, the current load of the target node can be judged through the signal value of the load signal of the target node. If the load signal indicates that the current load of the target node is not greater than the preset load threshold, it indicates that there are idle resources at the target node that can respond to the data acquisition requirement. At this time, data can be obtained through the target node, and a data acquisition request can be sent to the target node.
[0040] Optionally, in the case where the load signal indicates that the current load of the target node is greater than the preset load threshold, it indicates that there are no idle resources at the target node to respond to the data acquisition requirement. At this time, it can be waited until the current load of the target node is not greater than the preset load threshold, and then the data acquisition requirement can be responded through the target node to obtain data.
[0041] In summary, the data acquisition method provided by the embodiments of the present invention is applied to a request node in a data processing system. The data processing system further includes a data storage node and at least one data processing node. By responding to a data acquisition requirement, the data storage node, and / or the data processing node indicated by the data acquisition requirement is determined as a target node; a load signal of the target node is acquired; and when the load signal indicates that the current load of the target node is not greater than a preset load threshold, a data acquisition request is sent to the target node. In this way, by setting the load signal, the embodiments of the present invention can, when there is a data acquisition requirement, first acquire the load signal of the target node, and when the load signal indicates that the current load of the target node is not greater than the load threshold, then send a data acquisition request to the target node, which can reduce the congestion on the target node, avoid the situation where the interaction waiting time is relatively long due to network congestion, reduce the resource waste when the network is busy, and improve the data acquisition efficiency.
[0042] Optionally, for the operation of determining the data storage node, and / or the data processing node indicated by the data acquisition requirement as the target node, the embodiments of the present invention may specifically include:
[0043] S21. When the data acquisition requirement indicates acquiring target data from the data storage node, the data storage node is determined as the target node.
[0044] Specifically, both the data processing node or the control node can choose to directly interact with the data storage node. At this time, the embodiments of the present invention can determine the data storage node as the target node. When the load of the target node is not greater than the preset load threshold, it indicates that the data storage node can respond to the data acquisition request in a short time. Thus, the data processing node with a data acquisition requirement can send a data acquisition request to the target node to acquire data through the target node, realizing direct memory transfer (DMT) between the data processing node and the target node. Or, realizing direct data transmission between the control node and the target node.
[0045] Correspondingly, the data acquisition requirement at this time can be a ReadFromNonCache transaction for reading the data storage node.
[0046] In the embodiments of the present invention, by determining the data storage node as the target node when the data acquisition requirement indicates acquiring target data from the data storage node. In this way, it is convenient to directly acquire data through the data storage node, the frequency of request resending can be reduced, and the waiting duration of the data storage node during data transmission can be reduced.
[0047] Optionally, the above data processing system further includes a control node, and the request node is any one of the data processing nodes in the data processing system. Specifically, the embodiments of the present invention may further include:
[0048] S31. When the load signal indicates that the current load of the target node is greater than the preset load threshold, send a data acquisition request to the control node.
[0049] Wherein, the control node is configured to transmit the data acquisition request to the target node when the load signal of the target node indicates that the current load of the target node is not greater than the preset load threshold.
[0050] Wherein, the above control node may be an intermediate node between the data processing node and the data storage node. On this basis, when the load signal indicates that the current load of the target node is greater than the preset load threshold, it indicates that the current load of the target node is too large and there are no idle resources to respond to the data acquisition requirement. At this time, the embodiments of the present invention may send a data acquisition request to the control node, and the control node will forward the data acquisition request to the target node when the current load of the target node is not greater than the load threshold. Further, the control node may also send the returned data to the request node after receiving the returned data from the data storage node.
[0051] This can reduce the frequency of the data storage node returning a busy signal and causing the request node to resend the request, and reduce the waiting time of the data storage node during the direct memory transfer process.
[0052] Optionally, the data processing system further includes a control node, and the control node includes the last-level cache of the data processing system. The above control node contains multiple table entries, and one table entry corresponds to one cache block in the last-level cache. Each table entry includes a first parameter and a second parameter; the first parameter represents the data processing node that contains the cached data of the cache block corresponding to the table entry; the second parameter represents the data processing node that last processed the cached data of the cache block corresponding to the table entry. Specifically, the embodiments of the present invention may further include:
[0053] S41. Based on the multiple table entries in the control node, determine the data processing node indicated by the data acquisition requirement.
[0054] Wherein, the above last-level cache (LLC) refers to the last-level cache in the multi-level cache, and its next-level storage area is the memory. Correspondingly, the next level of the LLC in the embodiments of the present invention is the data storage node, and the previous level is the higher-level cache in the data processing node.
[0055] It should be noted that in a cache system, data access often proceeds according to the cache hierarchy, that is, from the high-level cache to the next lower-level cache in sequence until the required data is accessed. On this basis, when a data processing node accesses a data storage node, it often needs to go through the LLC.
[0056] On this basis, the control node in the embodiment of the present invention can include the LLC, and at the same time, multiple entries can be set in the control node. Different entries correspond to different cache blocks (cachelines) in the last-level cache. An entry includes a first parameter and a second parameter. The first parameter represents the data processing node that contains the cached data of the cache block corresponding to the entry, and the second parameter represents the data processing node that last processed the cached data of the cache block corresponding to the entry.
[0057] Exemplarily, the embodiment of the present invention can represent the first parameter in a vector form. Further, the first parameter can be represented by cn_vector. For example, if there are three data processing nodes, the first data processing node and the second data processing node contain the cached data of a cache block corresponding to a certain entry, and the third one does not, then the first parameter corresponding to this entry can be (cn_vector = 110). Another exemplarily, the third data processing node contains the cached data corresponding to this entry, and the first and second data processing nodes do not, then the first parameter corresponding to this entry can be (cn_vector = 001).
[0058] Among them, the above-mentioned second parameter can be represented by cn_id, which can be the identifier of the data processing node that last processed the cached data of the cache block corresponding to the entry.
[0059] Specifically, the embodiment of the present invention can determine the data processing node indicated by the data acquisition requirement based on multiple entries in the control node. Specifically, the data acquisition requirement can include the target cache block where the data to be acquired is located and the responder of the data acquisition requirement. Correspondingly, when there is a data acquisition requirement, the embodiment of the present invention can determine the data processing node indicated by the data acquisition requirement based on multiple entries in the control node and the responder of the data acquisition requirement. On this basis, through the first parameter and the second parameter in multiple entries, the embodiment of the present invention can determine in which data processing nodes the cached data of each cache block exists, and at the same time, can determine in which data processing nodes the latest data of this cache block exists, facilitating subsequent data acquisition operations.
[0060] In an embodiment of the present invention, the data processing system further includes a control node. The control node includes the last-level cache of the data processing system. The control node contains a plurality of table entries. One table entry corresponds to one cache block in the last-level cache. Each table entry includes a first parameter and a second parameter. The first parameter represents the data processing node that contains the cache data of the cache block corresponding to the table entry. The second parameter represents the data processing node that last processed the cache data of the cache block corresponding to the table entry. Based on the plurality of table entries in the control node, the data processing node indicated by the data acquisition requirement is determined. In this way, the existence status of different cache blocks can be recorded through the table entries in the control node, so that the data processing node indicated by the data acquisition requirement can be directly determined based on the plurality of table entries, which improves the data acquisition efficiency to a certain extent.
[0061] Optionally, the requesting node is the control node, and the data acquisition requirement is triggered by any one of the data processing nodes. When the data acquisition requirement indicates to obtain the cache data corresponding to the target cache block from the last-level cache, if there is no corresponding cache data for the target cache block in the last-level cache, the operation of determining the data processing node indicated by the data acquisition requirement based on the plurality of table entries in the control node in the embodiment of the present invention may specifically include:
[0062] S51. Based on the table entry corresponding to the target cache block in the control node, determine the data processing node indicated by the data acquisition requirement from the data processing nodes that contain the cache data of the target cache block;
[0063] The operation of determining the data storage node and / or the data processing node indicated by the data acquisition requirement as the target node in the embodiment of the present invention may specifically include:
[0064] S52. Determine the data processing node indicated by the data acquisition requirement as the target node.
[0065] After sending the data acquisition request to the target node as described above, the embodiment of the present invention may further specifically include:
[0066] S53. Send the return data of the target node to the data processing node that triggered the data acquisition requirement.
[0067] Among them, the above-mentioned target cache block refers to the cache block indicated by the data acquisition requirement. Specifically, when there is no corresponding cached data in the target cache block of the LLC, it indicates that the data in the target cache block has been cleared in the LLC, and at this time, the corresponding cached data cannot be directly obtained from the LLC. In this case, the embodiment of the present invention can determine the data processing node indicated by the data acquisition requirement from the data processing node containing the cached data of the target cache block based on the entry corresponding to the target cache block in the control node. Correspondingly, the data acquisition requirement at this time can be a read-not-modify transaction.
[0068] Optionally, the above operation may specifically include:
[0069] S511. Take the entry of the target cache block in the control node as the target entry. When there is a parameter value in the second parameter of the target entry, determine the data processing node characterized by the parameter value of the second parameter as the data processing node indicated by the data acquisition requirement.
[0070] Or, S512. When there is no parameter value in the second parameter of the target entry, select any data processing node from the data processing nodes characterized by the parameter value of the first parameter of the target entry as the data processing node indicated by the data acquisition requirement.
[0071] Specifically, when there is a parameter value in the second parameter of the target entry, it indicates that the data processing node that last processed the target cache block is recorded in the second parameter. At this time, the data processing node characterized by the parameter value of the second parameter can be directly determined as the data processing node indicated by the data acquisition requirement.
[0072] Correspondingly, when there is no parameter value in the second parameter of the target entry, one can be selected from the data processing nodes characterized by the parameter value of the first parameter of the target entry as the data processing node indicated by the data acquisition requirement.
[0073] Further, after determining that the data processing node indicated by the data acquisition requirement is the target node, a data acquisition request can be sent to the target node, and the return data of the target node can be sent to the data processing node that triggered the data acquisition requirement.
[0074] In an embodiment of the present invention, the requesting node is the control node, and the data acquisition requirement is triggered by any one of the data processing nodes. When the data acquisition requirement indicates to obtain the cache data corresponding to the target cache block from the last-level cache, if there is no corresponding cache data for the target cache block in the last-level cache, based on the entry corresponding to the target cache block in the control node, determine the data processing node indicated by the data acquisition requirement from the data processing nodes containing the cache data of the target cache block; determine the data processing node indicated by the data acquisition requirement as the target node; and send the return data of the target node to the data processing node that triggers the data acquisition requirement. In this way, data can be obtained from other data processing nodes when data cannot be obtained from the data storage node.
[0075] Optionally, when the data acquisition requirement indicates to obtain the cache data corresponding to the target cache block from the last-level cache and process the cache data, after the operation of sending a data acquisition request to the target node, the embodiment of the present invention may further specifically include:
[0076] S61. Send a data clearing request to the target node, so that the target node clears the cache data corresponding to the target cache block based on the data clearing request.
[0077] When the data acquisition requirement indicates to obtain target data from the LLC and process the cache data corresponding to the target cache block, at this time, since the node that initiates the data acquisition requirement processes the target data, there is a cache inconsistency in other data processing nodes. At this time, a data clearing request can be sent to the target node, and the target node clears the cache data corresponding to the target cache block in its own cache based on the data clearing request to ensure the cache consistency of the system. Correspondingly, the data acquisition requirement at this time may be a read-to-modify transaction.
[0078] In an embodiment of the present invention, send a data clearing request to the target node, so that the target node clears the target data based on the data clearing request. Cache consistency maintenance can be achieved for the data processing system.
[0079] Optionally, the embodiment of the present invention may further update the first parameter and the second parameter corresponding to the target cache block in the entry after obtaining the return data and sending it to the data processing node that triggers the data acquisition requirement.
[0080] It should be noted that the above control node may be composed of an LLC and a snoop filter (SF), and correspondingly, the above control node may be referred to as an LLCSF. The embodiments of the present invention can be applied to scenarios where the control node adopts the Modified, Owned, Exclusive, Shared, Invalid (MOESI) protocol and the Core node follows the Modified, Exclusive, Shared, Invalid (MESI) protocol. Since the coherence protocol states followed by the Core node and the control node are different, the cacheline in the SharedDirty state must be recorded in the control node. For a cacheline in the LLC node, after entering the Shared state from the Unique state, it will not return to the Unique state unless the data in the cacheline is evicted and rewritten.
[0081] At the same time, the embodiments of the present invention can record the coherence state of the cacheline (which can be represented by 00, 01, etc.) in the LLC tag of the control node. At the same time, there is no need to record the coherence state in the SF tag, and only the above first parameter and the second parameter need to be recorded.
[0082] At the same time, the embodiments of the present invention can allow the Core node to silently delete clean data. At the same time, since there is no need to record the coherence state in the SF tag, the control node can update the first parameter and the second parameter in the SF every time all broadcast results are received to ensure the update speed of the entries in the control node, thereby reducing the invalid traffic in the network.
[0083] Exemplarily, Figure 3 is a flowchart of a data acquisition method in the embodiments of the present invention. Figure 4 is a flowchart of another data acquisition method in the embodiments of the present invention. Figure 5 is a flowchart of yet another data acquisition method in the embodiments of the present invention. As Figure 3 、 4 、5 show, Figure 3 corresponds to the ReadFromNonCache transaction, that is, obtaining data from the data storage node. Figure 4 corresponds to the ReadNotModify transaction, Figure 5 corresponds to the ReadToModify transaction.
[0084] Specifically, as Figure 3As shown, when executing a transaction to read a data storage node, if the requester is a data processing node, the load signal of the data storage node is obtained. When the load signal is 0 (the current load is not greater than the preset load threshold), a data acquisition request is sent to the data storage node to achieve direct memory transfer. Correspondingly, when the load signal is 1, a data acquisition request is sent to the control node. The control node can obtain the load signal of the data storage node again, wait until the load signal is 0, then send the data acquisition request to the data storage node, and after the data storage node returns the data, forward the data to the data processing node.
[0085] Correspondingly, when the requester is the control node, the control node, according to the load signal of the data storage node, when the load signal is 0, sends the data acquisition request to the data storage node and receives the data returned by the data storage node.
[0086] Specifically, as Figure 4 shown, when executing a transaction to acquire data without modification, first query the hit result in the control node. Specifically, it is possible to query in the LLC of the control node whether the cache is hit, that is, whether there is data in the cache block indicated by the data acquisition requirement in the LLC. If there is, the cache is hit; if not, the cache is not hit. At the same time, it is possible to query in the SF of the control node whether the table entry is hit, that is, whether there are a first parameter and a second parameter in the corresponding table entry of the SF for the target cache block indicated by the data acquisition requirement. If there are, the table entry is hit; if not, the table entry is not hit.
[0087] Further, in the case where the cache is not hit and the table entry is not hit, at this time, the data required to be acquired does not exist in the LLC and other data processing nodes. At this time, a data acquisition request can be directly sent to the data storage node, and the data storage node directly returns the data to the requester.
[0088] Further, in the case where the cache is not hit and the table entry is hit, it indicates that the data required to be acquired is stored in other data processing nodes. At this time, the data processing node indicated by the data can be determined as the target node according to the first parameter and the second parameter of the hit table entry. Obtain the load signal of the target node, and when the load signal is 0, send a data acquisition request to the target node and receive the data returned by the target node. If the target node does not return the data, send a data acquisition request to the data storage node again. After returning the returned data to the requester, update the table entries in the LLC and the control node, that is, update the consistency state of the LLC, and update the first parameter and the second parameter according to the existence state of the data of this cache block in each data processing node.
[0089] Further, in the case of a cache hit, it indicates that the data required to be retrieved exists in the LLC. At this time, the corresponding data in the LLC can be directly returned to the requester, and the entries in the LLC and the control node are updated.
[0090] Specifically, as Figure 5 shown, when executing a data acquisition transaction with modified data, first query the hit result in the control node. Specifically, it is possible to query whether the cache is hit in the LLC of the control node, that is, whether there is data in the cache block indicated by the data acquisition requirement in the LLC. If there is, the cache is hit; if not, the cache is not hit. At the same time, it is possible to query whether the entry is hit in the SF of the control node, that is, whether the first parameter and the second parameter exist in the corresponding entry of the SF for the cache block indicated by the data acquisition requirement. If they exist, the entry is hit; if not, the entry is not hit.
[0091] Further, in the case of a cache miss and an entry miss, at this time, the data required to be retrieved does not exist in either the LLC or other data processing nodes. At this time, a data acquisition request can be directly sent to the data storage node, and the data storage node directly returns the data to the requester.
[0092] Further, in the case of a cache miss and an entry hit, it indicates that the data required to be retrieved is stored in other data processing nodes. At this time, the indicated data processing node can be determined as the target node according to the first parameter and the second parameter of the hit entry. Obtain the load signal of the target node, and when the load signal is 0, send a data acquisition request and a data clearing request to the target node. The target node returns the data based on the data acquisition request, and at the same time, the target node clears the data itself. Further, receive the data returned by the target node. If the target node does not return the data, send a data acquisition request to the data storage node. After returning the returned data to the requester, update the entries in the LLC and the control node, that is, update the consistency state of the LLC, and update the first parameter and the second parameter according to the existence state of the data of this cache block in each data processing node.
[0093] Further, in the case of a cache hit, it indicates that the data required to be retrieved exists in the LLC. At this time, the corresponding data in the LLC can be directly returned to the requester, and the entries in the LLC and the control node are updated.
[0094] It should be noted that since multiple caches may store copies of the same data, when a certain processor modifies the data, how to ensure the consistency of the copy data in all caches becomes a key issue. The existing mainstream cache coherence protocols define various operation types for cache - to - cache communication. With the continuous development of the protocol, in order to adapt to different application scenarios and optimize performance, the types and the number of fields of the coherence transfer instructions are constantly increasing, making the protocol implementation complex and difficult to apply flexibly. At the same time, the complex instruction sets of the existing mainstream coherence protocols significantly increase the debugging and verification costs for application parties. In a multi - core system, potential errors are increasingly difficult to discover and fix.
[0095] In the embodiment of the present invention, it is applied to a request node in a data processing system. The data processing system further includes a data storage node and at least one data processing node. By responding to a data acquisition requirement, the data storage node, and / or the data processing node indicated by the data acquisition requirement is determined as a target node; the load signal of the target node is acquired; and when the load signal indicates that the current load of the target node is not greater than a preset load threshold, a data acquisition request is sent to the target node. In this way, in the embodiment of the present invention, by setting the load signal, when there is a data acquisition requirement, the load signal of the target node can be acquired first. When the load signal indicates that the current load of the target node is not greater than the load threshold, the data is acquired through the target node. This can reduce the congestion on the target node, avoid the situation where the interaction waiting time is long due to network congestion, reduce the resource waste when the network is busy, and improve the data acquisition efficiency.
[0096] At the same time, this method requires fewer resources in the early - stage development and debugging, and thus can reduce the development and debugging costs.
[0097] Figure 6 It is a schematic structural diagram of a data acquisition device in the embodiment of the present invention. The device is applied to a request node in a data processing system. The data processing system further includes a data storage node and at least one data processing node. As Figure 6 shown, the device 20 may include:
[0098] A first determination module 201, configured to determine the data storage node, and / or the data processing node indicated by the data acquisition requirement as a target node in response to the data acquisition requirement;
[0099] A first acquisition module 202, configured to acquire the load signal of the target node;
[0100] A first sending module 203, configured to send a data acquisition request to the target node when the load signal indicates that the current load of the target node is not greater than a preset load threshold.
[0101] Optionally, the first determination module is specifically configured to:
[0102] When the data acquisition requirement indicates to acquire target data from the data storage node, determine the data storage node as the target node.
[0103] Optionally, the data processing system further includes a control node, the request node is any one of the data processing nodes in the data processing system, and the device further includes:
[0104] A second sending module, configured to send a data acquisition request to the control node when the load signal indicates that the current load of the target node is greater than the preset load threshold;
[0105] Wherein, the control node is configured to transmit the data acquisition request to the target node when the load signal of the target node indicates that the current load of the target node is not greater than the preset load threshold.
[0106] Optionally, the data processing system further includes a control node, the control node includes the last-level cache of the data processing system, the control node contains a plurality of table entries, one table entry corresponds to one cache block in the last-level cache, and each table entry includes a first parameter and a second parameter; the first parameter represents the data processing node containing the cached data of the cache block corresponding to the table entry; the second parameter represents the data processing node that last processed the cached data of the cache block corresponding to the table entry;
[0107] The device further includes:
[0108] A second determination module, configured to determine the data processing node indicated by the data acquisition requirement based on the plurality of table entries in the control node.
[0109] Optionally, the request node is the control node, the data acquisition requirement is triggered by any one of the data processing nodes, and when the data acquisition requirement indicates to acquire the cached data corresponding to the target cache block from the last-level cache, if there is no corresponding cached data for the target cache block in the last-level cache, the second determination module is specifically configured to:
[0110] Based on the table entry corresponding to the target cache block in the control node, determine the data processing node indicated by the data acquisition requirement from the data processing nodes containing the cached data of the target cache block;
[0111] The first determination module is specifically further configured to: determine the data processing node indicated by the data acquisition requirement as the target node;
[0112] The device further includes:
[0113] A third sending module, configured to, after the first sending module sends a data acquisition request to the target node, send the return data of the target node to the data processing node that triggers the data acquisition requirement.
[0114] Optionally, when the data acquisition requirement indicates acquiring cache data corresponding to a target cache block from the last-level cache and processing the cache data, the device further includes:
[0115] A fourth sending module, configured to, after the first sending module sends a data acquisition request to the target node, send a data clearing request to the target node, so that the target node clears the cache data corresponding to the target cache block based on the data clearing request.
[0116] Optionally, the second determination module includes:
[0117] A third determination sub-module, configured to use the entry of the target cache block in the control node as a target entry, and when there is a parameter value in the second parameter of the target entry, determine the data processing node characterized by the parameter value of the second parameter as the data processing node indicated by the data acquisition requirement;
[0118] Or, a fourth determination sub-module, configured to, when there is no parameter value in the second parameter of the target entry, select any one of the data processing nodes characterized by the parameter value of the first parameter of the target entry as the data processing node indicated by the data acquisition requirement.
[0119] In summary, the data acquisition device provided by the embodiment of the present invention is applied to a requesting node in a data processing system. The data processing system further includes a data storage node and at least one data processing node. By responding to a data acquisition requirement, the data storage node, and / or, the data processing node indicated by the data acquisition requirement is determined as the target node; the load signal of the target node is acquired; when the load signal indicates that the current load of the target node is not greater than a preset load threshold, a data acquisition request is sent to the target node. In this way, by setting the load signal, when there is a data acquisition requirement, the load signal of the target node can be acquired first, and when the load signal indicates that the current load of the target node is not greater than the load threshold, a data acquisition request is sent to the target node, and data is acquired through the target node, which can reduce the congestion on the target node, avoid the situation where the interaction waiting time is long due to network congestion, reduce the resource waste when the network is busy, and improve the data acquisition efficiency.
[0120] For the apparatus embodiments, since they are basically similar to the method embodiments, their descriptions are relatively simple. For related parts, please refer to the descriptions in the corresponding parts of the method embodiments.
[0121] The embodiments in this specification are all described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other.
[0122] Regarding the request processing apparatus in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here.
[0123] An embodiment of the present invention further provides an electronic device, including: a processor and a memory for storing processor-executable instructions, wherein the processor is configured to execute the above data acquisition method.
[0124] Refer to Figure 7 , which is a schematic structural diagram of the electronic device provided by the embodiment of the present invention. As Figure 7 shown, the electronic device includes: a processor, a memory, a communication interface, and a communication bus. The processor, the memory, and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction causes the processor to execute the data acquisition method in the foregoing embodiments.
[0125] It should be noted that the electronic devices in the embodiments of the present application include mobile electronic devices and non-mobile electronic devices.
[0126] The processor may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable devices, transistor logic devices, hardware components, or any combination thereof. The processor may also be a combination that realizes computing functions, such as a combination including one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0127] The communication bus may include a path for transmitting information between a memory and a communication interface. The communication bus may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 only one line is shown in Figure 3 , but it does not mean that there is only one bus or one type of bus.
[0128] The memory may be a ROM (Read Only Memory), or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory), or other types of dynamic storage devices that can store information and instructions. It may also be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disa Read Only Memory), magnetic tape, a floppy disk, and optical data storage devices, etc.
[0129] An embodiment of the present invention also provides a non-transitory computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device (server or terminal), the processor is enabled to execute Figure 1 the data acquisition method shown.
[0130] An embodiment of the present invention also provides a computer program product containing instructions. When it runs on a computer, the computer is enabled to execute Figure 1 the data acquisition method shown.
[0131] An embodiment of the present application also provides a chip. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement each process of the above data acquisition method embodiment and can achieve the same technical effect. To avoid repetition, it will not be elaborated here.
[0132] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0133] Each embodiment in this specification is described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other.
[0134] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, an apparatus, or a computer program product. Therefore, the embodiments of the present invention can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that integrates one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)).
[0135] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing terminal devices generate a device for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0136] These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing terminal devices to work in a predictive manner, such that the instructions stored in the computer-readable memory generate a manufactured product including an instruction device, and the instruction device implements the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0137] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, so that a series of operation steps are executed on the computer or other programmable terminal device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one process or multiple processes and / or boxes. Figure 1 One process or multiple processes and / or boxes Figure 1 Steps for implementing the functions specified in one box or multiple boxes.
[0138] Although the preferred embodiments of the embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they know the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present invention.
[0139] Each embodiment in this specification is described in a related manner. For the same or similar parts among the embodiments, reference can be made to each other. The key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the related parts, reference can be made to the partial description of the method embodiment.
[0140] It should be noted that in the embodiments of this application, the processes of obtaining various data are all carried out on the premise of complying with the corresponding data protection regulations and policies of the country where the location is located and obtaining the authorization given by the owner of the corresponding device.
[0141] Finally, it should also be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or terminal device including the said element.
[0142] The above has made a detailed introduction to a data acquisition method, device, electronic device and readable storage medium provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A data acquisition method, characterized in that, The method is applied to a request node in a data processing system, which further includes a data storage node and at least one data processing node. The method includes: In response to a data acquisition requirement, determining the data storage node, and / or, the data processing node indicated by the data acquisition requirement, as a target node; Obtaining a load signal of the target node; When the load signal indicates that the current load of the target node is not greater than a preset load threshold, sending a data acquisition request to the target node.
2. The method according to claim 1, wherein The determining the data storage node, and / or, the data processing node indicated by the data acquisition requirement, as a target node, includes: When the data acquisition requirement indicates obtaining target data from the data storage node, determining the data storage node as the target node.
3. The method according to claim 2, characterized in that, The data processing system further includes a control node, and the request node is any one of the data processing nodes in the data processing system. The method further includes: When the load signal indicates that the current load of the target node is greater than the preset load threshold, sending a data acquisition request to the control node; Wherein, the control node is configured to, when the load signal of the target node indicates that the current load of the target node is not greater than the preset load threshold, transmit the data acquisition request to the target node.
4. The method according to claim 1, wherein The data processing system further includes a control node, the control node includes the last-level cache of the data processing system, the control node contains a plurality of table entries, one table entry corresponds to one cache block in the last-level cache, and each table entry includes a first parameter and a second parameter; the first parameter indicates the data processing node containing the cached data of the cache block corresponding to the table entry; The second parameter indicates the data processing node that last processed the cached data of the cache block corresponding to the table entry; The method further includes: Based on the plurality of table entries in the control node, determining the data processing node indicated by the data acquisition requirement.
5. The method according to claim 4, wherein The request node is the control node, and the data acquisition requirement is triggered by any one of the data processing nodes. When the data acquisition requirement indicates obtaining the cached data corresponding to a target cache block from the last-level cache, and if there is no corresponding cached data for the target cache block in the last-level cache, the determining the data processing node indicated by the data acquisition requirement based on the plurality of table entries in the control node, includes: Based on the table entry corresponding to the target cache block in the control node, determining the data processing node indicated by the data acquisition requirement from the data processing nodes containing the cached data of the target cache block; The determining the data storage node, and / or, the data processing node indicated by the data acquisition requirement, as a target node, includes: determining the data processing node indicated by the data acquisition requirement as the target node; After sending the data acquisition request to the target node, the method further includes: sending the return data of the target node to the data processing node that triggered the data acquisition requirement.
6. The method according to claim 5, wherein In the case where the data acquisition requirement indicates acquiring cache data corresponding to a target cache block from the last-level cache and processing the cache data, after sending a data acquisition request to the target node, the method further includes: Sending a data clearing request to the target node, so that the target node clears the cache data corresponding to the target cache block based on the data clearing request.
7. The method according to claim 5, wherein The determining, based on an entry corresponding to the target cache block in the control node, a data processing node indicated by the data acquisition requirement from data processing nodes including the cache data of the target cache block includes: Taking the entry of the target cache block in the control node as a target entry, and when there is a parameter value in a second parameter of the target entry, determining the data processing node characterized by the parameter value of the second parameter as the data processing node indicated by the data acquisition requirement; Or, when there is no parameter value in the second parameter of the target entry, selecting any one of the data processing nodes characterized by the parameter value of the first parameter of the target entry as the data processing node indicated by the data acquisition requirement.
8. A data acquisition device, characterized in that, The apparatus is applied to a requesting node in a data processing system, the data processing system further includes a data storage node and at least one data processing node, and the apparatus includes: A first determination module, configured to, in response to a data acquisition requirement, determine the data storage node, and / or, the data processing node indicated by the data acquisition requirement, as a target node; A first acquisition module, configured to acquire a load signal of the target node; A first sending module, configured to, when the load signal indicates that the current load of the target node is not greater than a preset load threshold, send a data acquisition request to the target node.
9. An electronic device, characterized in that, Including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete mutual communication through the communication bus; The memory is used for storing a computer program; The processor is configured to, when executing the program stored on the memory, implement the method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method according to any one of claims 1-7.