Write response management method and device, electronic equipment and storage medium

By splitting cacheable commands into subcommands and configuring calculation associated parameters, the problem of low write response management in Cache is solved, the efficiency and accuracy of obtaining write response results is improved, and the use of chip resources is reduced.

CN119248191APending Publication Date: 2025-01-03SHANGHAI SUIYUAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411318098.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

In the prior art, when processing write commands, the write response management efficiency is low, the recycling management effect is poor, and the chip resources are occupied.

Method used

By splitting cacheable commands into subcommands and calculating associated parameters according to the grouping attribute configuration of the subcommand, including the maximum forwarding multiple and response weight coefficient, the write response results of different types of subcommands are reduced, and write response management is reduced to chip resources occupancy.

Benefits of technology

It improves the efficiency and accuracy of obtaining write response results, realizes the classification management of different types of subcommands, and reduces the use of chip resources by write response management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248191A_ABST
    Figure CN119248191A_ABST
Patent Text Reader

Abstract

The invention discloses a write response management method and device, electronic equipment and a storage medium, and relates to the technical field of chips, the method comprises the following steps: splitting a cacheable command into at least one sub-command according to the number of write data of the cacheable command; obtaining at least one sub-command group according to the grouping attribute of each sub-command, and configuring calculation correlation parameters of the sub-command groups; and obtaining a write response recovery result of the current sub-command group according to the sub-command quantity and the write response quantity of the current sub-command group and an association relationship among the calculation association parameters, and obtaining a write response recovery result of the cacheable command according to the write response recovery results of all the sub-command groups. According to the technical scheme, classified management of different types of sub-commands in the cacheable command is achieved, the obtaining efficiency and obtaining accuracy of the write response result are improved, meanwhile, the write response results of different types of sub-commands are managed through the same calculation rule, and occupation of chip resources by write response management is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of human chip technology, and in particular to a write response management method, device, electronic device and storage medium. Background Art

[0002] Cache is the high-speed memory closest to the central processing unit. Its processing efficiency of write commands directly affects the data processing capability of the central processing unit.

[0003] In the cache, a write command of a write transmission corresponds to a write response, but the write command may be sent to multiple destinations, and the multiple destinations will return write responses respectively. Whether the write responses of each destination can be efficiently recovered and how to determine whether all write responses have been recovered have become the bandwidth bottleneck of the write transmission; in the prior art, the cache usually continuously tracks the response status of each write command through interactive communication with different destinations.

[0004] However, with this response management method, the cache needs to track the status of the write response based on each write command and each destination. The write response management efficiency is low and the write response recycling management effect is poor. At the same time, the above management method requires a high chip resource. Summary of the invention

[0005] The present invention provides a write response management method, device, electronic device and storage medium to solve the problem of low write response management efficiency.

[0006] According to one aspect of the present invention, there is provided a write response management method, comprising:

[0007] In response to obtaining a cacheable command, splitting the cacheable command into at least one sub-command according to the number of write data entries of the cacheable command;

[0008] According to the grouping attributes of each subcommand, at least one subcommand group is obtained, and calculation-related parameters of the subcommand group are configured; wherein the grouping attributes include a write attribute, a query attribute, and an allocation attribute; and the calculation-related parameters include a maximum forwarding multiple and a response weight coefficient;

[0009] According to the relationship between the number of subcommands, the number of write responses and the calculation-related parameters of the current subcommand group, the write response recovery result of the current subcommand group is obtained, and according to the write response recovery results of all subcommand groups, the write response recovery result of the cacheable command is obtained.

[0010] The method of obtaining at least one sub-command group according to the grouping attributes of each sub-command and configuring the calculation-related parameters of the sub-command group includes: if it is determined that the at least one sub-command group includes the first sub-command group, configuring the response weight coefficient of the first sub-command group to be half of the corresponding maximum forwarding multiple, and sending the sub-commands in the first sub-command group to the cache and the lower-level memory; wherein the first sub-command group includes at least one of a first type of sub-command and a second type of sub-command; the write attributes and query attributes of the first type of sub-command are write penetration and write hit, respectively; the write attributes, query attributes and allocation attributes of the second type of sub-command are write penetration, write miss and write allocation, respectively.

[0011] The method of obtaining at least one sub-command group according to the grouping attributes of each sub-command and configuring the calculation-related parameters of the sub-command group includes: if it is determined that the at least one sub-command group includes a second sub-command group, configuring the response weight coefficient of the second sub-command group to be equal to the corresponding maximum forwarding multiple, and sending the sub-commands in the second sub-command group to a lower-level memory; wherein the second sub-command group includes a third type of sub-command; the write attribute, query attribute and allocation attribute of the third type of sub-command are write-through, write-missing and write-unallocated, respectively.

[0012] The method of obtaining at least one sub-command group according to the grouping attributes of each sub-command and configuring the calculation-related parameters of the sub-command group includes: if it is determined that the at least one sub-command group includes a third sub-command group, configuring the response weight coefficient of the third sub-command group to be equal to the corresponding maximum forwarding multiple, and sending the sub-commands in the third sub-command group to the cache; wherein the third sub-command group includes at least one of a fourth type of sub-command and a fifth type of sub-command; the write attributes and query attributes of the fourth type of sub-command are write return and write hit, respectively; the write attributes, query attributes and allocation attributes of the fifth type of sub-command are write return, write miss and write allocation, respectively.

[0013] The method of obtaining at least one sub-command group according to the grouping attributes of each sub-command and configuring the calculation-related parameters of the sub-command group includes: if it is determined that the at least one sub-command group includes a fourth sub-command group, configuring the response weight coefficient of the fourth sub-command group to be equal to the corresponding maximum forwarding multiple, and sending the sub-commands in the fourth sub-command group to a lower-level memory; wherein the fourth sub-command group includes a sixth-type sub-command; the write attribute, query attribute and allocation attribute of the sixth-type sub-command are write return, write miss and write non-allocation, respectively.

[0014] The write response management method also includes: in response to obtaining an uncacheable command, sending the uncacheable command to a lower-level memory, and configuring the number of sub-commands, maximum forwarding multiple and response weight coefficient of the uncacheable command to a value of 1; based on the association between the number of sub-commands of the uncacheable command, the number of write responses and the calculation of associated parameters, obtaining the write response recovery result of the uncacheable command.

[0015] According to one aspect of the present invention, there is provided a write response management device, comprising:

[0016] A subcommand acquisition module, configured to, in response to acquiring a cacheable command, split the cacheable command into at least one subcommand according to the number of write data entries of the cacheable command;

[0017] A parameter configuration execution module, used to obtain at least one sub-command group according to the grouping attribute of each sub-command, and configure the calculation-related parameters of the sub-command group; wherein the grouping attribute includes a write attribute, a query attribute, and an allocation attribute; the calculation-related parameters include a maximum forwarding multiple and a response weight coefficient;

[0018] The response result acquisition module is used to obtain the write response recovery result of the current sub-command group according to the number of sub-commands in the current sub-command group, the number of write responses and the correlation between the calculation association parameters, and to obtain the write response recovery result of the cacheable command according to the write response recovery results of all sub-command groups.

[0019] According to another aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the write response management method described in any embodiment of the present invention.

[0020] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the write response management method described in any embodiment of the present invention when executed.

[0021] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the write response management method according to any embodiment of the present invention is implemented.

[0022] The technical solution of the embodiment of the present invention first splits the cacheable command into at least one sub-command according to the number of write data entries of the cacheable command, then obtains at least one sub-command group according to the grouping attributes of each sub-command, and configures the calculation association parameters of the sub-command group; finally, according to the number of sub-commands, the number of write responses and the association relationship between the calculation association parameters of the current sub-command group, the write response recovery result of the current sub-command group is obtained, and then the write response recovery result of the cacheable command is obtained, thereby realizing the classified management of different types of sub-commands in the cacheable command, improving the efficiency and accuracy of obtaining the write response results, and at the same time, using the same calculation rules, that is, the number of sub-commands, the number of write responses and the association relationship between the calculation association parameters, to manage the write response results of different types of sub-commands, reducing the occupation of chip resources by the write response management.

[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0025] Figure 1 is a flowchart of a write response management method provided according to Embodiment 1 of the present invention;

[0026] Figure 2 is a flowchart of another write response management method provided according to Embodiment 2 of the present invention;

[0027] Figure 3 is a flowchart of another write response management method provided according to Embodiment 3 of the present invention;

[0028] Figure 4 is a structural diagram of a write response management system provided according to Embodiment 4 of the present invention;

[0029] Figure 5 is a timing diagram of processing a write command by a write response management system provided in Embodiment 4 of the present invention;

[0030] Figure 6 is a structural diagram of a write response management device provided according to Embodiment 5 of the present invention;

[0031] Figure 7It is a structural schematic diagram of an electronic device for implementing the write response management method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] Embodiment 1

[0035] Figure 1 A flowchart of a write response management method provided in Embodiment 1 of the present invention is shown in FIG. Figure 1 As shown, the method is suitable for calculating the write response recovery results of different sub-command groups according to the grouping attributes of the sub-commands and the calculation associated parameters. The method can be executed by the write response management device in any embodiment of the present invention. The write response management device can be implemented in the form of hardware and / or software. The write response management device can be configured in the cache of the chip, and the chip can be configured in any electronic device. Figure 1 As shown, the method includes:

[0036] S101 . In response to obtaining a cacheable command, split the cacheable command into at least one sub-command according to the number of write data entries of the cacheable command.

[0037] After the CPU sends a write command to the Cache, the Cache first determines whether the current write command is a cacheable command based on the cache attribute of the acquired write command; the cache attribute refers to whether the write command can exchange data through the cache; if the cache attribute is cacheable, it means that the current write command can exchange data at high speed through the cache, that is, the current write command is a cacheable command; if the cache attribute is non-cacheable, it means that the current write command cannot exchange data through the cache, that is, the current write command is a non-cacheable command.

[0038] Each write command may include one or more write data. Each write data in the cacheable command is regarded as a sub-command, that is, the number of sub-commands is the same as the number of write data. Regardless of whether the above-mentioned sub-commands are sent to the lower-level memory and the data writing operation is completed by the lower-level memory, or the sub-commands are sent to the command execution module of the cache itself and the data writing operation is completed by the command execution module, they are all issued in the form of sub-commands. Each sub-command exists as a command body, that is, each sub-command actually exists in the form of a write command.

[0039] Optionally, in an embodiment of the present invention, cache may refer to a first-level cache of Cache, and correspondingly, a lower-level memory may refer to a second-level cache, a third-level cache or a memory of Cache; cache may also refer to a second-level cache of Cache, and correspondingly, a lower-level memory may refer to a third-level cache or a memory of Cache; cache may also refer to a third-level cache of Cache, and correspondingly, a lower-level memory may refer to a memory.

[0040] After obtaining the cacheable command, a different command number can be configured for each cacheable command, and the sub-commands obtained by splitting the cacheable command can include not only the sub-command numbers of the sub-commands themselves, but also the command number of the cacheable command to which it belongs; similarly, each write response obtained also includes the sub-command number of the sub-command corresponding to the write response, and the command number of the cacheable command to which it belongs, as a matching relationship between the write response and the write command; and after determining that all write responses of a cacheable command have been obtained, the command number of the command can be released to achieve command number reuse, thereby ensuring that there are no duplicate command numbers for write commands being processed at the same time.

[0041] S102. According to the grouping attributes of each subcommand, obtain at least one subcommand group and configure calculation-related parameters of the subcommand group; wherein the grouping attributes include write attributes, query attributes and allocation attributes; and the calculation-related parameters include a maximum forwarding multiple and a response weight coefficient.

[0042] The query attribute refers to querying whether the address of the data to be written in the cache exists in the cache; if the address exists in the cache, it is a hit (Hit), that is, a write hit (Write Hit); if the address does not exist in the cache, it is a miss (Miss), that is, a write miss (Write Miss); the write attribute includes write penetration (Write Through) and write return (Write Back); write penetration means that the write command must be sent to the lower-level memory; write return means that the write command may not be sent to the lower-level memory; the allocation attribute includes write allocation (Write Allocation) and write no allocation (No WriteAllocation); write allocation means that the data at the unwritten position is first loaded into the cache, followed by a write hit operation; write no allocation means that the data at the unwritten position is not loaded into the cache, but is directly written to the lower-level memory.

[0043] The maximum forwarding multiple indicates the maximum number of target objects that may be sent, which is related to the write attribute; if the write attribute of a write command is write-through, in the embodiment of the present invention, it means that the command can be written to the cache and the lower-level memory at the same time, that is, it may be forwarded to two destinations (i.e., the cache and the lower-level cache) at the same time, that is, the maximum forwarding multiple is 2; if the write attribute of a command is write-return, it indicates that the command can only be sent to one of the cache and the lower-level cache, that is, it can only be sent to one of the cache and the lower-level memory, then its corresponding maximum forwarding multiple is 1. The response weight coefficient is a weight coefficient pre-configured for the write response according to the forwarding characteristics of different types of write commands. Different response weight coefficients are assigned to subcommands in different subcommand groups according to different grouping attributes of subcommands, and subcommands in the same subcommand group have the same response weight coefficient.

[0044] Optionally, in an embodiment of the present invention, according to the grouping attributes of each sub-command, at least one sub-command group is obtained, and calculation-related parameters of the sub-command group are configured, including: if it is determined that the at least one sub-command group includes a first sub-command group, the response weight coefficient of the first sub-command group is configured to be half of the corresponding maximum forwarding multiple, and the sub-commands in the first sub-command group are sent to the cache and the lower-level memory; wherein the first sub-command group includes at least one of a first type of sub-command and a second type of sub-command; the write attributes and query attributes of the first type of sub-command are write penetration and write hit, respectively; the write attributes, query attributes and allocation attributes of the second type of sub-command are write penetration, write miss and write allocation, respectively.

[0045] Specifically, for a subcommand in a cacheable command, if the write attribute of the current subcommand is write-through and the query attribute is write hit, regardless of whether its allocation attribute is write allocation or write no allocation, it is regarded as a first type subcommand and the first type subcommand is assigned to the first subcommand group; at the same time, if the write attribute of the subcommand is write-through, the query attribute is write miss, and the allocation attribute is write allocation, the subcommand is regarded as a second type subcommand and the second type subcommand is also assigned to the first subcommand group; wherein, each subcommand in the same subcommand group has the same calculation-associated parameters and the same sending destination.

[0046] For the first type of subcommands and the second type of subcommands, the response weight coefficients of both are half of the maximum forwarding multiple, that is, the maximum forwarding multiple is 2, and the response weight coefficient is 1; at the same time, the subcommands of the first subcommand group need to be sent to the cache and the lower-level memory at the same time, thereby realizing the group management of the first type of subcommands and the second type of subcommands, so as to obtain the write response recovery result of the first subcommand group through the relationship between the number of subcommands in the first subcommand group, the number of write responses and the calculation of the associated parameters, thereby improving the write response acquisition efficiency of the first subcommand group.

[0047] Optionally, in an embodiment of the present invention, according to the grouping attributes of each sub-command, at least one sub-command group is obtained, and calculation-related parameters of the sub-command group are configured, including: if it is determined that the at least one sub-command group includes a second sub-command group, the response weight coefficient of the second sub-command group is configured to be equal to the corresponding maximum forwarding multiple, and the sub-commands in the second sub-command group are sent to a lower-level memory; wherein the second sub-command group includes a third type of sub-command; the write attribute, query attribute and allocation attribute of the third type of sub-command are write-through, write-missing and write-unallocated, respectively.

[0048] Specifically, for a subcommand in a cacheable command, if the write attribute of the current subcommand is write penetration, the query attribute is write miss, and the allocation attribute is write no allocation, the subcommand is regarded as a third type subcommand, and the third type subcommand is allocated to the second subcommand group. The response weight coefficient of the third type subcommand is the same as the maximum forwarding multiple, that is, the maximum forwarding multiple is 2, then the response weight coefficient is 2; at the same time, the subcommands of the second subcommand group only need to be sent to the lower-level memory, thereby realizing the group management of the third type subcommands, so as to obtain the write response recovery result of the second subcommand group through the association relationship between the number of subcommands, the number of write responses and the calculation association parameters of the second subcommand group, thereby improving the write response management efficiency of the second subcommand group.

[0049] Optionally, in an embodiment of the present invention, according to the grouping attributes of each sub-command, at least one sub-command group is obtained, and calculation-related parameters of the sub-command group are configured, including: if it is determined that the at least one sub-command group includes a third sub-command group, the response weight coefficient of the third sub-command group is configured to be equal to the corresponding maximum forwarding multiple, and the sub-commands in the third sub-command group are sent to the cache; wherein the third sub-command group includes at least one of a fourth type of sub-command and a fifth type of sub-command; the write attributes and query attributes of the fourth type of sub-command are write return and write hit, respectively; the write attributes, query attributes and allocation attributes of the fifth type of sub-command are write return, write miss and write allocation, respectively.

[0050] Specifically, for a subcommand in a cacheable command, if the write attribute of the current subcommand is write return and the query attribute is write hit, regardless of its allocation attribute is write allocate or write not allocate, it is regarded as a fourth type of subcommand, and the fourth type of subcommand is assigned to the third subcommand group; at the same time, if the write attribute of the subcommand is write return, the query attribute is write miss, and the allocation attribute is write allocate, the subcommand is regarded as a fifth type of subcommand, and the fifth type of subcommand is also assigned to the third subcommand group.

[0051] For the fourth type of sub-commands and the fifth type of sub-commands, their response weight coefficients are equal to the maximum forwarding multiple, that is, when the maximum forwarding multiple is 1, the response weight coefficient is 1; at the same time, the sub-commands of the third sub-command group only need to be sent to the cache, thereby realizing the group management of the fourth type of sub-commands and the fifth type of sub-commands, so as to obtain the write response recovery result of the third sub-command group through the relationship between the number of sub-commands, the number of write responses and the calculation of the associated parameters of the third sub-command group, thereby improving the write response management efficiency of the third sub-command group.

[0052] Optionally, in an embodiment of the present invention, according to the grouping attributes of each sub-command, at least one sub-command group is obtained, and calculation-related parameters of the sub-command group are configured, including: if it is determined that the at least one sub-command group includes a fourth sub-command group, the response weight coefficient of the fourth sub-command group is configured to be equal to the corresponding maximum forwarding multiple, and the sub-commands in the fourth sub-command group are sent to a lower-level memory; wherein the fourth sub-command group includes a sixth type of sub-command; the write attribute, query attribute and allocation attribute of the sixth type of sub-command are write return, write miss and write non-allocation, respectively.

[0053] Specifically, for a subcommand in a cacheable command, if the write attribute of the subcommand is write return, the query attribute is write miss, and the allocation attribute is write no allocation, the subcommand is regarded as a sixth type subcommand, and the sixth type subcommand is allocated to the fourth subcommand group. The response weight coefficient of the sixth type subcommand is the same as the maximum forwarding multiple, that is, the maximum forwarding multiple is 1, then the response weight coefficient is 1; at the same time, the subcommands of the second subcommand group only need to be sent to the lower-level memory, thereby realizing the group management of the sixth type subcommand, so as to obtain the write response recovery result of the fourth subcommand group through the association between the number of subcommands, the number of write responses and the calculation of the associated parameters of the fourth subcommand group, thereby improving the write response management efficiency of the fourth subcommand group.

[0054] S103. Obtain the write response recovery result of the current sub-command group according to the number of sub-commands in the current sub-command group, the number of write responses and the relationship between the calculation-related parameters, and obtain the write response recovery result of the cacheable command according to the write response recovery results of all sub-command groups.

[0055] The relationship between the number of subcommands, the number of write responses, and the calculation-related parameters of the current subcommand group can be expressed by equation 1:

[0056] X×Y=M×N (Equation 1)

[0057] Among them, X represents the number of subcommands, Y represents the maximum forwarding multiple, M represents the number of write responses, and N represents the response weight coefficient.

[0058] The product of the number of subcommands in the current subcommand group and the maximum forwarding multiple is taken as the first product result, and the product of the number of write responses of the current subcommand group and the response weight coefficient is taken as the second product result; if the first product result is equal to the second product result, it means that the write response recovery of each subcommand in the current subcommand group has been completed, that is, each subcommand in the current subcommand group has been written and the write status response has been fed back; obviously, if the write response recovery of all subcommand groups is completed, it means that the write response recovery of the current cacheable command is completed, and the write response is fed back to the issuer of the cacheable command to complete the processing operation of the cacheable command.

[0059] If the first product result is greater than the second product result, it indicates that there are write responses that have not been recovered. If the first product result is less than the second product result, it indicates that there are write responses with abnormal recovery. For example, due to abnormal command number allocation, the write responses of other cacheable commands or other sub-command groups are mistakenly regarded as the write responses of the current sub-command group. Based on this, subsequent write response verification and detection operations can be performed to ensure the accuracy of the write response recovery results.

[0060] Taking the above technical solution as an example, if the first sub-command group includes 5 first-type sub-commands and 3 second-type sub-commands, and the maximum forwarding multiple is 2, then the first product result is 16; since the response weight coefficient is 1, when 16 write responses are obtained under the first sub-command group, it indicates that the write response recovery under the first sub-command group is completed; if the second sub-command group includes 3 third-type sub-commands, and the maximum forwarding multiple is 2, then the first product result is 6; since the response weight coefficient is 2, when 3 write responses are obtained under the first sub-command group, it indicates that the write response recovery under the second sub-command group is completed.

[0061] If the third sub-command group includes 4 fourth-type sub-commands and 2 fifth-type sub-commands, and the maximum forwarding multiple is 1, then the first product result is 6; since the response weight coefficient is 1, when 6 write responses are obtained under the first sub-command group, it indicates that the write response recovery under the first sub-command group is completed; if the fourth sub-command group includes 3 sixth-type sub-commands, and the maximum forwarding multiple is 1, then the first product result is 3; since the response weight coefficient is 1, when 3 write responses are obtained under the first sub-command group, it indicates that the write response recovery under the fourth sub-command group is completed.

[0062] The technical solution of the embodiment of the present invention first splits the cacheable command into at least one sub-command according to the number of write data entries of the cacheable command, then obtains at least one sub-command group according to the grouping attributes of each sub-command, and configures the calculation association parameters of the sub-command group; finally, according to the number of sub-commands, the number of write responses and the association relationship between the calculation association parameters of the current sub-command group, the write response recovery result of the current sub-command group is obtained, and then the write response recovery result of the cacheable command is obtained, thereby realizing the classified management of different types of sub-commands in the cacheable command, improving the efficiency and accuracy of obtaining the write response results, and at the same time, using the same calculation rules, that is, the number of sub-commands, the number of write responses and the association relationship between the calculation association parameters, to manage the write response results of different types of sub-commands, reducing the occupation of chip resources by the write response management.

[0063] Embodiment 2

[0064] Figure 2 This is a flowchart of a write response management method provided by Embodiment 2 of the present invention. The relationship between this embodiment and the above embodiment is that the cache obtains the non-cacheable command issued by the CPU. Figure 2 As shown, the method includes:

[0065] S201. In response to obtaining a non-cacheable command, send the non-cacheable command to a lower-level memory, and configure the number of sub-commands, the maximum forwarding multiple, and the response weight coefficient of the non-cacheable command to be a value of 1.

[0066] For uncacheable commands, since the cache does not participate in the write operation of the command, the cache regards the uncacheable command as a whole and forwards it directly to the lower-level memory. Therefore, no matter how many write data it includes, it is regarded as a whole, that is, the number of sub-commands is specified to be 1; at the same time, since it only needs to be sent to the lower-level memory, the maximum forwarding multiplier is also configured to 1, and the response weight coefficient is also configured to be 1 accordingly.

[0067] S202: Obtain a write response recovery result of the uncacheable command according to an association relationship among the number of subcommands of the uncacheable command, the number of write responses, and calculation association parameters.

[0068] As described in the above technical solution, the cache forwards the uncacheable command as a whole directly to the lower-level memory, and the lower-level memory will only return a write response for the command. As described in the above equation 1, since the number of sub-commands, the maximum forwarding multiple and the response weight coefficient are all configured as the value 1, then when the number of write responses obtained is 1, it indicates that the write response recovery under the first sub-command group is completed, that is, there is no write response missing phenomenon for the uncacheable command, and the write response is fed back to the issuer of the uncacheable command to complete the processing operation of the uncacheable command; obviously, the above equation 1 is also applicable to the write response recovery management of the uncacheable command.

[0069] The technical solution of the embodiment of the present invention, after obtaining the uncacheable command, sends the uncacheable command to the lower-level memory, and configures the number of sub-commands, the maximum forwarding multiple and the response weight coefficient of the uncacheable command to the value 1, and then obtains the write response recovery result of the uncacheable command according to the association relationship between the number of sub-commands, the number of write responses and the calculation association parameters of the uncacheable command. As a result, the above-mentioned association relationship that has been constructed can be used for the write response recovery management of both cacheable and uncacheable commands, thereby expanding the scope of application of the constructed calculation rules and simplifying the management complexity of the write response recovery results.

[0070] Embodiment 3

[0071] Figure 3 This is a flowchart of a write response management method provided by Embodiment 3 of the present invention. The relationship between this embodiment and the above embodiment is that the current subcommands are grouped and calculation-related parameters are configured. Figure 3 As shown, the method includes:

[0072] S301, obtain the write attribute of the current subcommand; if it is write-through, execute S302; if it is write-return, execute S308.

[0073] S302. Configure the maximum forwarding multiple of the current subcommand to 2; and execute S303.

[0074] S303, obtain the query attribute of the current subcommand; if it is a write hit, execute S304; if it is a write miss, execute S305.

[0075] S304: Configure the response weight coefficient of the current subcommand to 1, and assign the current subcommand as a first type subcommand to a first subcommand group.

[0076] S305, obtain the allocation attribute of the current subcommand; if it is write allocation, execute S306; if it is write non-allocation, execute S307.

[0077] S306: Configure the response weight coefficient of the current subcommand to 1, and assign the current subcommand as a second type subcommand to the first subcommand group.

[0078] S307: Configure the response weight coefficient of the current subcommand to be 2, and assign the current subcommand as a third type subcommand to the second subcommand group.

[0079] S308. Configure the maximum forwarding multiple of the current subcommand to 1; and execute S309.

[0080] S309, obtain the query attribute of the current subcommand; if it is a write hit, execute S310; if it is a write miss, execute S311.

[0081] S310: Configure the response weight coefficient of the current subcommand to be 1, and assign the current subcommand to the third subcommand group as a fourth type subcommand.

[0082] S311, obtain the allocation attribute of the current subcommand; if it is write allocation, execute S312; if it is write non-allocation, execute 313.

[0083] S312: Configure the response weight coefficient of the current subcommand to be 1, and assign the current subcommand to the third subcommand group as a fifth type subcommand.

[0084] S313: Configure the response weight coefficient of the current subcommand to 1, and assign the current subcommand to the fourth subcommand group as a sixth type subcommand.

[0085] The technical solution of the embodiment of the present invention assigns each subcommand to a matching subcommand group according to the grouping attributes of each subcommand, and configures a maximum forwarding multiple and a response weight coefficient for each subcommand group, thereby realizing classified management of different types of subcommands in cacheable commands and improving the efficiency and accuracy of obtaining write response results.

[0086] Embodiment 4

[0087] Figure 4This is a structural diagram of a write response management system provided in Embodiment 4 of the present invention. The write response management system can be used to execute the write response management method described in any embodiment. The write response management system specifically includes a command parsing module 401, a grouping execution module 402 and a write response recovery module 403.

[0088] The command parsing module 401 is connected to the write command interface between the CPU and the cache, and is used to obtain the write command, and determine whether the write command is a cacheable command or a non-cacheable command according to the cache attribute, and when the write command is determined to be a cacheable command, split the write command into at least one sub-command according to the number of write data; in addition, it is also used to split the cacheable command to obtain the sub-commands and non-cacheable commands, and send them to the command execution module in the cache, and then the command execution module completes the data writing operation in the cache, and / or sends them to the lower-level memory, and the lower-level memory completes the data writing operation; and the grouping execution module 402 is used to obtain at least one sub-command group according to the grouping attribute of each sub-command, and configure the calculation association parameters of the sub-command group.

[0089] A write response recovery module is used to obtain the write response recovery result of the current sub-command group based on the number of sub-commands in the current sub-command group, the number of write responses and the correlation between the calculation-related parameters, and to obtain the write response recovery result of the cacheable command based on the write response recovery results of all sub-command groups; wherein the write response recovery module is connected to the command execution module and the lower-level memory in the cache through different write response interfaces, respectively, to obtain the write response in the cache fed back by the command execution module, and to obtain the write response fed back by the lower-level memory, so as to avoid back pressure on different write response channels.

[0090] In addition, the write response recovery module can also instantiate a calculation unit for write commands with different command numbers, through which the write response result of the current write command is calculated based on the association between the number of subcommands, the number of write responses and the calculation association parameters of each subcommand group. Figure 5 For example, the write response management system obtains two cacheable commands successively, namely, cacheable command 1 numbered 1 and cacheable command 2 numbered 2; wherein, cacheable command 1 includes 1 write data, and cacheable command 2 includes 3 write data; wherein, the yellow part represents cacheable command 1; and the orange part represents cacheable command 2.

[0091] Cacheable command 1 includes one subcommand, namely subcommand 11. Subcommand 11 is actually cacheable command 1 itself. Subcommand 11 is write-through and write-hit, which belongs to the first type of subcommand in the above technical solution; cacheable command 2 includes three subcommands, namely subcommand 21, subcommand 22, and subcommand 23. The above three subcommands are all write-return, write-miss, and write-non-allocation, which actually belong to the sixth type of subcommand in the above technical solution.

[0092] When destination 1 returns a write response to cacheable command 1, according to the above equation 1, the first product result is 1×2=2, and the second product result is 1×1=1. Obviously, the calculation results of the two are different at this time, and the write response of cacheable command 1 has not been recovered; when destination 2 also returns a write response to cacheable command 1, the first product result is 1×2=2, and the second product result is (1+1)×1=2. Obviously, the calculation results of the two are the same at this time, and the write response of cacheable command 1 has been recovered; at this time, the Done (Complete) signal is set to send a write response to the issuer of cacheable command 1 through the arbitrator.

[0093] When destination 2 returns a write response to cacheable command 2, according to equation 1 above, the first multiplication result is 3×1=3, and the second multiplication result is 1×1=1. Obviously, the calculation results of the two are different at this time, and the write response of cacheable command 2 has not been recovered; until destination 2 returns three write responses to cacheable command 2, the first multiplication result is 3×1=3, and the second multiplication result is (1+1+1)×1=3. Obviously, the calculation results of the two are the same at this time, and the write response of cacheable command 2 has not been recovered; at this time, the Done (Completion) signal is set to send a write response to the issuer of cacheable command 2 through the arbitrator.

[0094] The technical solution of the embodiment of the present invention realizes the classified management of different types of sub-commands in cacheable commands, improves the efficiency and accuracy of obtaining write response results, and at the same time, uses the same calculation rules, that is, the association between the number of sub-commands, the number of write responses and the calculation-related parameters, to manage the write response results of different types of sub-commands, thereby reducing the occupation of chip resources by write response management.

[0095] Embodiment 5

[0096] Figure 6 : is a structural block diagram of a write response management device provided by Embodiment 5 of the present invention, and the write response management device specifically includes:

[0097] A subcommand acquisition module 601 is used for, in response to acquiring a cacheable command, splitting the cacheable command into at least one subcommand according to the number of write data entries of the cacheable command;

[0098] The parameter configuration execution module 602 is used to obtain at least one sub-command group according to the grouping attribute of each sub-command, and configure the calculation-related parameters of the sub-command group; wherein the grouping attribute includes a write attribute, a query attribute, and an allocation attribute; and the calculation-related parameters include a maximum forwarding multiple and a response weight coefficient;

[0099] The response result acquisition module 603 is used to obtain the write response recovery result of the current sub-command group according to the number of sub-commands in the current sub-command group, the number of write responses and the correlation relationship between the calculation association parameters, and to obtain the write response recovery result of the cacheable command according to the write response recovery results of all sub-command groups.

[0100] The technical solution of the embodiment of the present invention first splits the cacheable command into at least one sub-command according to the number of write data entries of the cacheable command, then obtains at least one sub-command group according to the grouping attributes of each sub-command, and configures the calculation association parameters of the sub-command group; finally, according to the number of sub-commands, the number of write responses and the association relationship between the calculation association parameters of the current sub-command group, the write response recovery result of the current sub-command group is obtained, and then the write response recovery result of the cacheable command is obtained, thereby realizing the classified management of different types of sub-commands in the cacheable command, improving the efficiency and accuracy of obtaining the write response results, and at the same time, using the same calculation rules, that is, the number of sub-commands, the number of write responses and the association relationship between the calculation association parameters, to manage the write response results of different types of sub-commands, reducing the occupation of chip resources by the write response management.

[0101] Optionally, a parameter configuration execution module 602 is specifically used to configure the response weight coefficient of the first sub-command group to be half of the corresponding maximum forwarding multiple if it is determined that the at least one sub-command group includes the first sub-command group, and to send the sub-commands in the first sub-command group to the cache and the lower-level memory; wherein the first sub-command group includes at least one of a first type of sub-command and a second type of sub-command; the write attributes and query attributes of the first type of sub-command are write penetration and write hit, respectively; the write attributes, query attributes and allocation attributes of the second type of sub-command are write penetration, write miss and write allocation, respectively.

[0102] Optionally, the parameter configuration execution module 602 is specifically used to configure the response weight coefficient of the second sub-command group to be equal to the corresponding maximum forwarding multiple if it is determined that the at least one sub-command group includes a second sub-command group, and send the sub-commands in the second sub-command group to the lower-level memory; wherein the second sub-command group includes a third type of sub-command; the write attribute, query attribute and allocation attribute of the third type of sub-command are write-through, write-missing and write-unallocated, respectively.

[0103] Optionally, a parameter configuration execution module 602 is specifically used to configure the response weight coefficient of the third sub-command group to be equal to the corresponding maximum forwarding multiple, and send the sub-commands in the third sub-command group to the cache if it is determined that the at least one sub-command group includes a third sub-command group; wherein the third sub-command group includes at least one of a fourth type of sub-command and a fifth type of sub-command; the write attributes and query attributes of the fourth type of sub-command are write return and write hit, respectively; the write attributes, query attributes and allocation attributes of the fifth type of sub-command are write return, write miss and write allocation, respectively.

[0104] Optionally, the parameter configuration execution module 602 is specifically used to configure the response weight coefficient of the fourth sub-command group to be equal to the corresponding maximum forwarding multiple if it is determined that the at least one sub-command group includes a fourth sub-command group, and to send the sub-commands in the fourth sub-command group to a lower-level memory; wherein the fourth sub-command group includes a sixth type of sub-command; the write attribute, query attribute and allocation attribute of the sixth type of sub-command are write return, write miss and write non-allocation, respectively.

[0105] Optionally, the write response management device is also used to send the uncacheable command to a lower-level memory in response to obtaining an uncacheable command, and configure the number of sub-commands, maximum forwarding multiple and response weight coefficient of the uncacheable command to a value of 1; and obtain the write response recovery result of the uncacheable command based on the relationship between the number of sub-commands of the uncacheable command, the number of write responses and the calculation of associated parameters.

[0106] The write response management device provided by the present invention can execute the write response management method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the write response management method provided by any embodiment of the present invention.

[0107] Embodiment 6

[0108] Figure 7 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0109] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0110] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0111] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the write response management method.

[0112] In some embodiments, the write response management method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on a heterogeneous hardware accelerator via a ROM and / or a communication unit. When the computer program is loaded into RAM and executed by a processor, one or more steps of the write response management method described above may be performed. Alternatively, in other embodiments, the processor may be configured to perform the write response management method in any other appropriate manner (e.g., by means of firmware).

[0113] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0114] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable response management device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0115] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0116] To provide interaction with a user, the systems and techniques described herein may be implemented on a heterogeneous hardware accelerator having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) through which a user can provide input to the heterogeneous hardware accelerator. Other types of devices may also be used to provide interaction with a user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0117] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0118] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0119] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0120] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A write response management method, characterized in that: Configured in the cache, including: In response to obtaining a cacheable command, splitting the cacheable command into at least one sub-command according to the number of write data entries of the cacheable command; According to the grouping attributes of each subcommand, at least one subcommand group is obtained, and calculation-related parameters of the subcommand group are configured; wherein the grouping attributes include a write attribute, a query attribute, and an allocation attribute; and the calculation-related parameters include a maximum forwarding multiple and a response weight coefficient; According to the relationship between the number of subcommands, the number of write responses and the calculation-related parameters of the current subcommand group, the write response recovery result of the current subcommand group is obtained, and according to the write response recovery results of all subcommand groups, the write response recovery result of the cacheable command is obtained.

2. The method according to claim 1, characterized in that The acquiring at least one sub-command group according to the grouping attribute of each sub-command and configuring the calculation associated parameters of the sub-command group includes: If it is determined that the at least one sub-command group includes a first sub-command group, configuring a response weight coefficient of the first sub-command group to be half of a corresponding maximum forwarding multiple, and sending sub-commands in the first sub-command group to the cache and the lower-level memory; Among them, the first sub-command group includes at least one of the first type sub-command and the second type sub-command; the write attributes and query attributes of the first type sub-command are write penetration and write hit, respectively; the write attributes, query attributes and allocation attributes of the second type sub-command are write penetration, write miss and write allocation, respectively.

3. The method according to claim 1, characterized in that The acquiring at least one sub-command group according to the grouping attribute of each sub-command and configuring the calculation associated parameters of the sub-command group includes: If it is determined that the at least one sub-command group includes a second sub-command group, configuring a response weight coefficient of the second sub-command group to be equal to a corresponding maximum forwarding multiple, and sending sub-commands in the second sub-command group to a lower-level memory; The second sub-command group includes the third type of sub-commands; the write attribute, query attribute and allocation attribute of the third type of sub-commands are write-through, write-miss and write-unallocate, respectively.

4. The method according to claim 1, characterized in that: The acquiring at least one sub-command group according to the grouping attribute of each sub-command and configuring the calculation associated parameters of the sub-command group includes: If it is determined that the at least one sub-command group includes a third sub-command group, configuring the response weight coefficient of the third sub-command group to be equal to the corresponding maximum forwarding multiple, and sending the sub-commands in the third sub-command group to the cache; Among them, the third sub-command group includes at least one of the fourth type sub-command and the fifth type sub-command; the write attributes and query attributes of the fourth type sub-command are write return and write hit, respectively; the write attributes, query attributes and allocation attributes of the fifth type sub-command are write return, write miss and write allocation, respectively.

5. The method according to claim 1, characterized in that The acquiring at least one sub-command group according to the grouping attribute of each sub-command and configuring the calculation associated parameters of the sub-command group includes: If it is determined that the at least one sub-command group includes a fourth sub-command group, configuring the response weight coefficient of the fourth sub-command group to be equal to the corresponding maximum forwarding multiple, and sending the sub-commands in the fourth sub-command group to the lower-level memory; Among them, the fourth sub-command group includes the sixth type of sub-command; the write attribute, query attribute and allocation attribute of the sixth type of sub-command are write return, write miss and write no allocation respectively.

6. The method according to claim 1, characterized in that The write response management method further includes: In response to obtaining a non-cacheable command, sending the non-cacheable command to a lower-level memory, and configuring the number of sub-commands, the maximum forwarding multiple, and the response weight coefficient of the non-cacheable command to be a value of 1; The write response recovery result of the uncacheable command is obtained according to the association relationship between the number of sub-commands of the uncacheable command, the number of write responses and the calculation association parameter.

7. A write response management device, characterized in that: include: A subcommand acquisition module, configured to, in response to acquiring a cacheable command, split the cacheable command into at least one subcommand according to the number of write data entries of the cacheable command; A parameter configuration execution module, used to obtain at least one sub-command group according to the grouping attributes of each sub-command, and configure the calculation-related parameters of the sub-command group; wherein the grouping attributes include write attributes, query attributes and allocation attributes; the calculation-related parameters include a maximum forwarding multiple and a response weight coefficient; The response result acquisition module is used to obtain the write response recovery result of the current sub-command group based on the number of sub-commands in the current sub-command group, the number of write responses and the correlation between the calculation association parameters, and to obtain the write response recovery result of the cacheable command based on the write response recovery results of all sub-command groups.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the write response management method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the write response management method according to any one of claims 1 to 6 when executed.

10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the write response management method according to any one of claims 1 to 6.