WO2021179254A1 - Data update method, apparatus and device - Google Patents

Data update method, apparatus and device Download PDF

Info

Publication number
WO2021179254A1
WO2021179254A1 PCT/CN2020/079011 CN2020079011W WO2021179254A1 WO 2021179254 A1 WO2021179254 A1 WO 2021179254A1 CN 2020079011 W CN2020079011 W CN 2020079011W WO 2021179254 A1 WO2021179254 A1 WO 2021179254A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
update
information
update mode
mode
Prior art date
Application number
PCT/CN2020/079011
Other languages
French (fr)
Chinese (zh)
Inventor
郭磊
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN202080095654.0A priority Critical patent/CN115087958B/en
Priority to PCT/CN2020/079011 priority patent/WO2021179254A1/en
Publication of WO2021179254A1 publication Critical patent/WO2021179254A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • the embodiments of the present application relate to the field of communication technologies, and in particular, to a data update method, device, and equipment.
  • Direct memory access is a high-speed data transfer mode. Data can be transferred from a channel directly between external devices and memory without the intervention of the central processing unit (CPU). .
  • CPU central processing unit
  • DMA Direct memory access
  • routers can use DMA to refresh the multicast identification (MID) table configuration to update the MID stored in the router's memory.
  • MID multicast identification
  • the MID address corresponds to the physical address of the memory in the router one-to-one, and the MID address is required to be continuous when configured through the DMA refreshing table. If the data of a part of the MID address is updated, all the MIDs in the memory need to be read out and stored in the external storage space. After the data of a part of the MID address is modified in the external storage space, all the MIDs are configured back into the memory.
  • the embodiments of the present application provide a data update method, device, and equipment, which improve the efficiency of data configuration and shorten the processing delay.
  • an embodiment of the present application provides a data update method, including: receiving update information, the update information includes mode indication information, the mode indication information indicates the update mode of the update information and the data type included in the update information; Mode, obtain the target storage space in the storage area; among them, the storage area stores routing information; according to the data type included in the update information, extract the routing information to be updated from the update information; update the target storage space according to the routing information to be updated Routing information in.
  • the update information is received, the update mode of the update information and the data type included in the update information can be obtained from the update information, and the target storage space in the storage area is obtained according to the update mode of the update information.
  • the data type included in the information extracts the routing information to be updated from the update information, and updates the routing information in the target storage space according to the routing information to be updated. Since there is no need to read the information in the storage area to the external storage space, modify the data in the external storage space and write it back to the storage area, which reduces the requirements for external storage resources, shortens the time delay, and improves the efficiency of data configuration.
  • receiving the update information includes: receiving the first data; if it is determined that the first data is associated with the second data according to the value of the indication field of the first data, acquiring The second data; where the update information includes the first data and the second data.
  • determining that the first data is associated with the second data includes: determining the update mode of the first data according to the value of the indication field of the first data; If the update mode of the data is associated with at least two data types, it is determined that the first data is associated with the second data.
  • the method further includes: if it is determined according to the value of the indication field of the first data that the first data is not associated with the second data, determining the first data as update information .
  • obtaining the target storage space in the storage area according to the update mode of the update information includes: if the update mode of the update information is the first update mode, storing The area is determined as the target storage space; if the update mode of the update information is the second update mode or the third update mode or the fourth update mode, the target storage space is determined according to the data corresponding to the second data type.
  • the indication field includes a first sub-indication field and a second sub-indication field
  • the value of the first sub-indication field is related to preset multiple update modes
  • the second The value of the sub-indicating field is related to preset multiple data types.
  • the indication field is located at the front end of all bits in the data.
  • an embodiment of the present application provides a data update device, including: a receiving module configured to receive update information, the update information includes mode indication information, the mode indication information indicates the update mode of the update information and the data type included in the update information;
  • the first acquisition module is used to obtain the target storage space in the storage area according to the update mode of the update information; wherein the storage area stores routing information;
  • the second acquisition module is used to obtain information from the update information according to the data type included in the update information
  • the routing information to be updated is extracted from the processing module; the processing module is used to update the routing information in the target storage space according to the routing information to be updated.
  • the receiving module is specifically configured to: receive the first data; if it is determined according to the value of the indication field of the first data that the first data is associated with the second data, obtain The second data; where the update information includes the first data and the second data.
  • the receiving module is specifically configured to: determine the update mode of the first data according to the value of the indication field of the first data; if the update mode of the first data is at least If the two data types are associated, it is determined that the first data is associated with the second data.
  • the receiving module is further configured to: if it is determined according to the value of the indication field of the first data that the first data is not associated with the second data, determine the first data To update information.
  • the first acquisition module is specifically configured to: if the update mode of the update information is the first update mode, determine the storage area as the target storage space; if the update information is updated If the update mode of is the second update mode or the third update mode or the fourth update mode, the target storage space is determined according to the data corresponding to the second data type.
  • the indication field includes a first sub-indication field and a second sub-indication field
  • the value of the first sub-indication field is related to preset multiple update modes
  • the second The value of the sub-indicating field is related to preset multiple data types.
  • the indication field is located at the front end of all bits in the data.
  • an embodiment of the present application provides a data update device, including a processor, a memory, and an interface circuit.
  • the interface circuit is used to communicate with other devices, and the processor is used to call a program stored in the memory to execute the above-mentioned program provided in the first aspect.
  • the data update method is used to call a program stored in the memory to execute the above-mentioned program provided in the first aspect.
  • an embodiment of the present application provides a computer-readable storage medium with instructions stored in the computer-readable storage medium.
  • the instructions are executed on a computer or a processor, the method provided in the above first aspect is implemented.
  • inventions of the present application provide a program product.
  • the program product includes a computer program.
  • the computer program is stored in a readable storage medium.
  • At least one processor of the device can read the computer program from the readable storage medium.
  • the computer program is executed by the device to make the device implement the method provided in the above first aspect.
  • the update information includes at least one preset bit length data
  • the data includes an indication field; wherein the value of the indication field and the preset multiple update modes and The preset multiple data types are related, and each update mode is associated with at least one data type of the preset multiple data types.
  • the preset multiple data types include: a first data type, used to indicate routing information to be updated; a second data type, used to indicate routing information to be updated corresponding to Address information; the third data type is used to indicate the bits that need to be updated in the routing information to be updated.
  • preset multiple update modes include: a first update mode, the first update mode is only associated with the first data type; the second update mode, the second update mode and the first update mode A data type, a second data type, and a third data type are associated; a third update mode, the third update mode is associated with the first data type and the second data type, and the data corresponding to the first data type is one; Four update modes, the fourth update mode is associated with the first data type and the second data type, and there are at least two data corresponding to the first data type.
  • FIG. 1 is a schematic diagram of the corresponding relationship between the physical address of the storage area and the MID address of the MID table;
  • Figure 2 is a schematic diagram of an existing update MID table
  • FIG. 3 is a schematic diagram of updating the MID table applicable to the embodiment of this application.
  • FIG. 4 is a flowchart of a data update method provided by an embodiment of the application.
  • FIG. 5 is a schematic diagram of update information provided by an embodiment of the application.
  • FIG. 6 is a schematic diagram of data with a preset bit length in FIG. 5;
  • FIG. 7 is a schematic diagram of the principle of the first update mode provided by an embodiment of the application.
  • FIG. 8 is a schematic diagram of the principle of the second update mode provided by an embodiment of the application.
  • FIG. 9 is a schematic diagram of the principle of the third update mode provided by an embodiment of the application.
  • FIG. 10 is a schematic diagram of the principle of the fourth update mode provided by an embodiment of the application.
  • FIG. 11 is another flowchart of a data update method provided by an embodiment of the application.
  • FIG. 12 is a schematic structural diagram of a data update device provided by an embodiment of this application.
  • FIG. 13 is a schematic structural diagram of a data update device provided by an embodiment of this application.
  • the router can refresh the configuration of the MID table through DMA.
  • the physical address of the storage area where the MID table is stored in the router corresponds to the MID address of the MID table in a one-to-one correspondence.
  • FIG. 1 is a schematic diagram of the corresponding relationship between the physical address of the storage area and the MID address of the MID table.
  • the physical address of the storage area (for example, memory) in the router is P0 ⁇ Pn
  • the MID address of the MID table is MID0 ⁇ MID n
  • the physical address P0 ⁇ Pn corresponds to the MID address MID 0 ⁇ MID n.
  • the physical address P0 corresponds to the MID address MID
  • the physical address P1 corresponds to the MID address MID 1.
  • the router currently stores data D0 to Dn, which are also called MID entries. Among them, the data D0 is stored in the physical address P0, the data D1 is stored in the physical address P1, and so on.
  • the router is configured by DMA refreshing the table, it is usually required that the MID address is continuous.
  • the to-be-updated information corresponding to MID addresses MID 0 ⁇ MID n includes data D0' ⁇ Dn'.
  • the router can perform continuous address updates and update the data D0 ⁇ Dn stored in the physical addresses P0 ⁇ Pn to Data D0' ⁇ Dn', for example, the data stored in the physical address P0 is updated from D0 to D0', and the data stored in the physical address P1 is updated from D1 to D1'.
  • FIG. 2 is a schematic diagram of an existing update MID table.
  • the existing update process includes: first read out the data D0 ⁇ Dn in the memory through the CPU and store it in the external storage area. In the external storage area, update the data corresponding to the MID address MID 1 from D1 to D1', and then store the data externally.
  • the updated data D0, D1', D2 ⁇ Dn in the area are all written into the memory by the CPU to complete the data update, and the data in the storage area is updated from D0 ⁇ Dn to D0, D1', D2 ⁇ Dn.
  • FIG. 3 is a schematic diagram of updating the MID table applicable to the embodiment of this application.
  • the update information is received, and the update mode of the update information and the data type included in the update information can be extracted from the update information.
  • the target storage space in the storage area that needs to update data can be determined.
  • the target storage space may be the storage unit indicated by the physical address P1 corresponding to the MID address MID1.
  • the routing information to be updated can be obtained by the data type included in the update information.
  • the routing information in the target storage space can be updated according to the routing information to be updated.
  • the data update method provided by the embodiment of the present application does not need to read the information in the storage area to the external storage space, modify the data in the external storage space and write it back to the storage area ,
  • the data in the storage area can be directly updated, which reduces the requirements for external storage resources, and even has no demand for external storage resources, shortens the time delay, and improves the efficiency of data configuration.
  • the data update method provided in the embodiment of the present application is applicable to devices that use DMA to update data, and the embodiment of the present application does not limit the type of the device.
  • the device may include, but is not limited to, routers, switches, and so on.
  • FIG. 4 is a flowchart of a data update method provided by an embodiment of the application.
  • the execution subject may be a data update device or a data update device.
  • the data update method provided in this embodiment may include:
  • the update information includes mode indication information
  • the mode indication information indicates the update mode of the update information and the type of data included in the update information.
  • multiple update modes and multiple data types can be preset.
  • Different update modes can be applied to different data update scenarios, and the data update scenarios can include but are not limited to the continuous address update scenario shown in FIG. 1 and the discontinuous address update scenario shown in FIG. 2 or FIG. 3.
  • Different data types are used to indicate the meaning or purpose of the data.
  • the update mode of the update information may be one of multiple preset update modes, and the data type included in the update information may be at least one of the preset multiple data types.
  • multiple preset data types may include but are not limited to:
  • the first data type is used to indicate the routing information to be updated.
  • the second data type is used to indicate the address information corresponding to the routing information to be updated.
  • the third data type is used to indicate the bits that need to be updated in the routing information to be updated.
  • multiple preset update modes may include but are not limited to:
  • the first update mode, the first update mode is only associated with the first data type.
  • the second update mode, the second update mode is associated with the first data type, the second data type, and the third data type.
  • the third update mode, the third update mode is associated with the first data type and the second data type, and there is one data corresponding to the first data type.
  • the fourth update mode, the fourth update mode is associated with the first data type and the second data type, and there are at least two data corresponding to the first data type.
  • S402 Obtain a target storage space in the storage area according to the update mode of the update information.
  • the storage area stores routing information.
  • the storage area is the memory of the router
  • the physical address is P0 to Pn
  • the target storage space is the storage area
  • the physical address is P0 to Pn.
  • the physical addresses of the storage area are P0 to Pn
  • the target storage space is the storage unit indicated by the physical address P1.
  • S403 Extract routing information to be updated from the update information according to the data type included in the update information.
  • the routing information to be updated can be extracted from the update information according to the data types included in the update information.
  • the routing information to be updated includes D0'-Dn'.
  • the routing information to be updated includes D1'.
  • the routing information in the target storage space can be updated.
  • the routing information in the target storage space can be updated through DMA.
  • this embodiment does not limit other update methods.
  • the data update method provided in this embodiment can obtain the update mode of the update information and the data type included in the update information from the update information by receiving the update information, and obtain the target storage space in the storage area according to the update mode of the update information.
  • the routing information to be updated is extracted from the update information according to the data type included in the update information, and the routing information in the target storage space is updated according to the routing information to be updated.
  • the data update method provided by this embodiment does not need to read the information in the storage area to the external storage space, modify the data in the external storage space and write it back to the storage area, which reduces the requirements for external storage resources and shortens the time Delay, improve the efficiency of data allocation.
  • the update information may include at least one piece of data with a preset bit length, and the data with a preset bit length may include an indication field.
  • the value of the indication field is related to preset multiple update modes and preset multiple data types, and each update mode is associated with at least one data type of the preset multiple data types.
  • this embodiment does not limit the specific value of the preset bit length, for example, the preset bit length is 32 bits.
  • This embodiment does not limit the amount of data with a preset bit length included in the update information, which is related to the update mode of the update information and the type of data included in the update information.
  • This embodiment does not limit the occupied position of the indicator field in the preset bit length and the bit length of the indicator field.
  • the indicator field can be located at the front of all bits in the data of the preset bit length, and can occupy the preset bit length. Reserved bits in bit-length data.
  • the indication field may include a first sub-indication field and a second sub-indication field. Multiple data types are related.
  • this embodiment does not limit the front and back positions of the first sub-indication field and the second sub-indication field.
  • the first sub-indication field is located in front of the second sub-indication field.
  • the second sub-indication field may be located in front of the first sub-indication field.
  • the bit length of the first sub-indication field may be related to the number of preset multiple update modes.
  • the bit length of the first sub-indication field may be 2 bits, and when the preset multiple update modes include 5 update modes, the bit length of the first sub-indication field may be 3bit.
  • This embodiment does not limit the correspondence between the value of the first sub-indication field and the preset multiple update modes.
  • the preset multiple update modes include 2 update modes
  • the bit length of the second sub-indication field may be related to the number of preset multiple data types. This embodiment does not limit the correspondence between the value of the second sub-indication field and the preset multiple data types. .
  • update information in conjunction with Tables 1 to 6 and Figures 7 to 10, by way of example, update information, preset bit length data, indicator field, first sub-indicator field, second sub-indicator field, preset multiple update modes and A variety of data types are preset for description.
  • bits 0 to 27 carry payload or effective information
  • bits 28 to 31 are indicator fields
  • the first sub indicator field is bit 30 to bit 31
  • the second sub indicator field is bit 28 to bit 29.
  • the preset multiple data types include the first data type to the third data type.
  • the first data type may be expressed as a bitmap (bitmap, bmp), and bits 0 to 27 in bmp are used to indicate routing information to be updated.
  • the second data type can be expressed as MID, and bits 0 to 27 in the MID are used to indicate the address information corresponding to the routing information to be updated.
  • bits 0 to 27 in the MID are used to indicate MID 1.
  • the third data type can be expressed as msk (mask), and bits 0 to 27 in msk are used to indicate the bits that need to be updated in the routing information to be updated.
  • the bits that need to be updated in the routing information (28 bits) to be updated are bit5 ⁇ bit0
  • the values of bit5 ⁇ bit0 in msk can all be binary 0, bit6 ⁇ bit27
  • the value of can all be binary 1; or, in another implementation manner, the values of bit5 to bit0 in msk can all be binary 1, and the values of bit6 to bit27 can all be binary 0.
  • the first data type (bmp) To To 0 1 To Second data type (MID) To To 0 0 To The third data type (msk) To To 1 0 To
  • the preset multiple update modes include the first update mode to the fourth update mode.
  • the value of bit31 and bit30 is binary 0, 0, it indicates the first update mode; when the value of bit31 and bit30 is binary 0, 1, it indicates the second update mode; when the value of bit31 and bit30 is binary 1, 0 , Indicates the third update mode; when the values of bit31 and bit30 are binary 1, 1, indicating the fourth update mode.
  • Update mode bit31 bit30 bit29 bit28 bit27...bit0 First update mode 0 0 To To To Second update mode 0 1 To To To Third update mode 1 0 To To To To Fourth update mode 1 1 To To To To To To
  • Table 3 shows the update information in the first update mode
  • FIG. 7 is a schematic diagram of the principle of the first update mode provided in an embodiment of this application.
  • the first update mode is only associated with the first data type.
  • the first update mode may be suitable for continuous address update scenarios.
  • the update information may include n+1 pieces of 32-bit data.
  • the n+1 pieces of data are all of the first data type, and the n+1 pieces of data correspond to the MID address MID 0 ⁇ MID n.
  • the values of bit31 and bit30 are binary 0 and 0, indicating the first update mode; the values of bit29 and bit28 are binary 0 and 1, indicating the first data type bmp; bit0 ⁇ bit27 are used to indicate the waiting Updated routing information.
  • Table 3 and FIG. 7 are only examples, and this embodiment does not limit the number of the first data types included in the update information.
  • the directly written DMA address and data correspond to the address and data of the MID table entry one-to-one, and the look-up table (Look-Up Table) , LUT) Internal First In First Out (First In First Out, FIFO) is cached and then distributed to the uplink multicast table (Ingress MID, iMID) or downlink multicast table (egress MID, eMID).
  • the first update mode can be used as the default configuration mode of the MID table, and can be issued through DMA when the software is fully refreshed.
  • Table 4 shows the update information in the second update mode
  • FIG. 8 is a schematic diagram of the principle of the second update mode provided in an embodiment of this application.
  • the second update mode is associated with the first data type, the second data type, and the third data type.
  • the second update mode may be suitable for discontinuous address update scenarios, especially for update scenarios that carry a third data type (msk).
  • the update information may include three 32-bit length data, which are respectively the first data type (bmp), the second data type (MID), and the third data type (msk).
  • the values of bit31 and bit30 are binary 0 and 1, indicating the second update mode.
  • bits 0 to bit 27 in the second data type (MID) are used to indicate the MID address MID 1
  • bits 0 to bit 27 in the first data type (bmp) are used to indicate the to-be-updated corresponding to MID 1
  • bits 0 to 27 in the third data type (msk) are used to indicate the bits that need to be updated in the routing information to be updated corresponding to MID 1.
  • the three 32-bit data shown in Table 4 corresponds to the entry refresh of a MID address, which can be pre-stored in the LUT internal FIFO to perform all data After parsing, the update of each MID entry is completed.
  • the second update mode can be used in the MID table item update scenario with the msk refresh part in the software increment, and can be issued through the DMA mode.
  • Second data type 0 1 0 0 To The first data type (bmp) 0 1 0 1 To The third data type (msk) 0 1 1 0 To
  • Table 5 shows the update information in the third update mode
  • FIG. 9 is a schematic diagram of the principle of the third update mode provided in an embodiment of this application.
  • the third update mode is associated with the first data type and the second data type, and there is one data corresponding to the first data type.
  • the third update mode may be suitable for discontinuous address update scenarios.
  • the update information may include two 32-bit length data, which are respectively the first data type (bmp) and the second data type (MID).
  • the values of bit31 and bit30 are binary 1, 0, indicating the third update mode.
  • bits 0 to bit 27 in the second data type (MID) are used to indicate the MID address MID 1
  • bits 0 to bit 27 in the first data type (bmp) are used to indicate the to-be-updated corresponding to MID 1 Routing information.
  • the two 32-bit data shown in Table 5 correspond to the entry refresh of a MID address, which can be pre-stored in the LUT internal FIFO to perform all data After parsing, the update of each MID entry is completed.
  • the third update mode can be used in the MID table item update scenario where the software increment does not have the msk refresh part, and can be issued through DMA.
  • Table 6 shows the update information in the fourth update mode
  • FIG. 10 is a schematic diagram of the principle of the fourth update mode provided in an embodiment of this application.
  • the fourth update mode is associated with the first data type and the second data type, and there are at least two data corresponding to the first data type.
  • the fourth update mode may be suitable for discontinuous address update scenarios, especially for discontinuous address update scenarios in multiple storage areas.
  • the update information may include 9 pieces of 32-bit length data, and the 9 pieces of data include 1 second data type (MID) and 8 first data types (bmp).
  • the values of bit31 and bit30 are binary 1, 1, indicating the fourth update mode.
  • bits 0 to bit 27 in the second data type (MID) are used to indicate the MID address MID
  • the 8 bits 0 to bit 27 in the first data type (bmp) correspond to 8 storage areas (LUT0). ⁇ MID 0 in LUT7).
  • Table 6 and FIG. 10 are only examples, and this embodiment does not limit the number of the first data types included in the update information.
  • the eMID in an actual application that uses DMA to update data, can support the fourth update mode.
  • MIDn has 8 bmps, corresponding to the MIDn of 8 LUTs.
  • Each LUT receives the same MID plus 8 bmp data when writing via private global broadcast.
  • Each LUT will extend a 3bit pin signal to connect to a fixed Value, connect 0-7 when connecting at the top level to let the LUT identify its own number, and then refresh the MID table with the corresponding bmp data.
  • the fourth update mode can be used in application scenarios where DMA is used for broadcasting and the EMID table is incrementally configured.
  • obtaining the target storage space in the storage area according to the update mode of the update information may include:
  • the storage area is determined as the target storage space.
  • the target storage space is determined according to the data corresponding to the second data type.
  • the first update mode may be suitable for a continuous address update scenario, and the storage area may be determined as the target storage space.
  • the second update mode, the third update mode, or the fourth update mode can be applied to discontinuous address update scenarios.
  • the second update mode, the third update mode, or the fourth update mode are all associated with the second data type, and the second data type is used for In order to indicate the address information corresponding to the routing information to be updated, the target storage space is determined according to the data corresponding to the second data type.
  • the address information indicated by the second data type may be an offset address relative to the base address of the storage area, or a virtual address corresponding to the physical address of the storage area.
  • FIG. 11 is another flowchart of a data update method provided by an embodiment of the application.
  • this embodiment provides another implementation manner of the data update method, and mainly provides an implementation manner of receiving update information in S401.
  • receiving update information may include:
  • the first data is the aforementioned data with a preset bit length.
  • the update information includes the first data and the second data.
  • This implementation manner may be applicable to the above-mentioned second update mode, third update mode, and fourth update mode.
  • the second update mode, the third update mode, or the fourth update mode at least two data types are associated. Therefore, all the second data types associated with the first data need to be collected together as update information.
  • S1103 If it is determined according to the value of the indication field of the first data that the first data is not associated with the second data, determine the first data as update information.
  • the first update mode is only associated with the first data type, and therefore, the received first data is determined as update information.
  • this embodiment does not limit the number of first data.
  • the number of first data is n+1.
  • determining that the first data is associated with second data may include:
  • the update mode of the first data is determined.
  • the first data is the first data type (bmp).
  • the second update mode is determined. Since the second update mode is associated with the first data type, the second data type, and the third data type, it can be determined that the first data is associated with the second data, and the second data is the second data type (MID) and the third data type.
  • Data type (msk) is the first data type (bmp).
  • Table 4 Assume that the first data is of the second data type (MID). According to the values of bit31 and bit30 in the second data type (MID), it is determined as the second update mode. Since the second update mode is associated with the first data type, the second data type, and the third data type, it can be determined that the first data is associated with the second data, and the second data is the first data type (bmp) and the third data type. Data type (msk).
  • the fourth update mode is determined. Since the fourth update mode is associated with the first data type and the second data type, and there are at least two data corresponding to the first data type, it can be determined that the first data is associated with the second data, and there are 8 second data.
  • the first data type (bmp).
  • the fourth update mode is determined. Since the fourth update mode is associated with the first data type and the second data type, and there are at least two data corresponding to the first data type, it can be determined that the first data is associated with the second data, and the second data is one The second data type (MID) and 7 first data types (bmp).
  • the first data is the first data type (bmp). According to the values of bit31 and bit30 in the first data type (bmp), it is determined as the first update mode. Since the first update mode is only associated with the first data type, it can be determined that the first data is not associated with the second data, and the received n+1 first data types (bmp) are used as update information.
  • FIG. 12 is a schematic structural diagram of a data update device provided by an embodiment of this application. As shown in Figure 12, the data update device provided in this embodiment may include:
  • the receiving module 1201 is configured to receive update information, where the update information includes mode indication information, and the mode indication information indicates an update mode of the update information and the type of data included in the update information;
  • the first obtaining module 1202 is configured to obtain the target storage space in the storage area according to the update mode of the update information; wherein the storage area stores routing information;
  • the second acquisition module 1203 is configured to extract routing information to be updated from the update information according to the data type included in the update information
  • the processing module 1204 is configured to update the routing information in the target storage space according to the routing information to be updated.
  • the update information includes at least one data with a preset bit length, and the data includes an indication field; wherein, the value of the indication field is related to preset multiple update modes and preset multiple data types.
  • This update mode is associated with at least one of the preset multiple data types.
  • the receiving module 1201 is specifically configured to:
  • the second data is acquired; wherein the update information includes the first data and the second data .
  • the receiving module 1201 is specifically configured to:
  • the receiving module 1201 is further configured to:
  • the first data is determined as the update information.
  • the preset multiple data types include:
  • the first data type is used to indicate the routing information to be updated
  • the second data type is used to indicate the address information corresponding to the routing information to be updated
  • the third data type is used to indicate the bits that need to be updated in the routing information to be updated.
  • the preset multiple update modes include:
  • a first update mode where the first update mode is only associated with the first data type
  • a second update mode where the second update mode is associated with the first data type, the second data type, and the third data type;
  • a third update mode where the third update mode is associated with the first data type and the second data type, and there is one data corresponding to the first data type;
  • a fourth update mode where the fourth update mode is associated with the first data type and the second data type, and there are at least two data corresponding to the first data type.
  • the first obtaining module 1202 is specifically configured to:
  • the target storage space is determined according to the data corresponding to the second data type.
  • the indication field includes a first sub-indication field and a second sub-indication field, the value of the first sub-indication field is related to the preset multiple update modes, and the value of the second sub-indication field Related to the preset multiple data types.
  • the indication field is located at the front of all bits in the data.
  • the data update device provided in this embodiment is used to execute the data update method provided in the method embodiment of the present application.
  • the technical principles and technical effects are similar, and will not be repeated here.
  • modules in the above device is only a division of logical functions, and may be fully or partially integrated into one physical entity in actual implementation, or may be physically separated.
  • the modules in the device may be all implemented in the form of software called by processing elements; or all may be implemented in the form of hardware; part of the modules may be implemented in the form of software called by the processing elements, and some of the modules may be implemented in the form of hardware.
  • each module can be a separately established processing element, or it can be integrated in a certain chip of the device for implementation.
  • it can also be stored in the memory in the form of a program, which is called and executed by a certain processing element of the device. Function.
  • all or part of these modules can be integrated together or implemented independently.
  • the processing element described here can also become a processor, which can be an integrated circuit with signal processing capabilities.
  • each step of the above method or each of the above modules may be implemented by an integrated logic circuit of hardware in a processor element or implemented in a form of being called by software through a processing element.
  • the modules in any of the above devices may be one or more integrated circuits configured to implement the above methods, for example: one or more application specific integrated circuits (ASICs), or, one or Multiple microprocessors (digital singnal processors, DSPs), or, one or more field programmable gate arrays (Field Programmable Gate Arrays, FPGAs), or a combination of at least two of these integrated circuits.
  • ASICs application specific integrated circuits
  • DSPs digital singnal processors
  • FPGAs Field Programmable Gate Arrays
  • FPGAs Field Programmable Gate Arrays
  • the module in the device can be implemented in the form of a processing element scheduler
  • the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call programs.
  • these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
  • SOC system-on-a-chip
  • FIG. 13 is a schematic structural diagram of a data update device provided by an embodiment of this application. As shown in FIG. 13, this embodiment provides a data update device, including a processor 1301, a memory 1302, and an interface circuit 1303. The interface circuit 1303 is used to communicate with other devices, and the processor 1301 is used to call the The program stored in the memory 1302 is used to execute the data update method provided by the method embodiment of the present application. The technical principles and technical effects are similar, and will not be repeated here.
  • the device may include, but is not limited to, routers, switches, and so on.
  • the foregoing processor may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), and application specific integrated circuits (ASICs). )Wait.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like.
  • the steps in the data update method provided in conjunction with this application can be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
  • the memory may be one memory or a collective term for multiple storage elements.

Abstract

A data update method, apparatus and device. The data update method comprises: receiving update information, the update information comprising mode indication information, and the mode indication information indicating an update mode of the update information and a data type comprised in the update information; obtaining a target storage space in a storage area according to the update mode of the update information, wherein the storage area stores routing information; extracting, according to the data type comprised in the update information, routing information to be updated from the update information; and updating the routing information in the target storage space according to the routing information to be updated. Therefore, the efficiency of data configuration is improved, and the processing delay is shortened.

Description

数据更新方法、装置和设备Data update method, device and equipment 技术领域Technical field
本申请实施例涉及通信技术领域,尤其涉及一种数据更新方法、装置和设备。The embodiments of the present application relate to the field of communication technologies, and in particular, to a data update method, device, and equipment.
背景技术Background technique
直接内存访问(direct memory access,DMA)是一种高速数据传输模式,数据可以从一个通道,在不经过中央处理器(central processing unit,CPU)干预的情况下直接在外部设备与存储器之间传输。目前,很多设备都采用DMA实现不同场景下的数据传输,例如,路由器可以通过DMA对多播表(multicast identification,MID)刷表配置,更新路由器的内存中存储的MID。Direct memory access (DMA) is a high-speed data transfer mode. Data can be transferred from a channel directly between external devices and memory without the intervention of the central processing unit (CPU). . At present, many devices use DMA to implement data transmission in different scenarios. For example, routers can use DMA to refresh the multicast identification (MID) table configuration to update the MID stored in the router's memory.
通常,MID地址与路由器中内存的物理地址是一一对应的,通过DMA刷表配置时要求MID地址是连续的。如果对一部分MID地址进行数据更新,需要将内存中全部的MID读出来存储到外部存储空间,在外部存储空间中对一部分MID地址的数据进行修改后,再将全部的MID配置回内存中。Generally, the MID address corresponds to the physical address of the memory in the router one-to-one, and the MID address is required to be continuous when configured through the DMA refreshing table. If the data of a part of the MID address is updated, all the MIDs in the memory need to be read out and stored in the external storage space. After the data of a part of the MID address is modified in the external storage space, all the MIDs are configured back into the memory.
通过上述方式更新MID,数据更新效率低,对外部存储资源要求较高,时延较大。Updating the MID in the above manner has low data update efficiency, high requirements on external storage resources, and large delays.
发明内容Summary of the invention
本申请实施例提供一种数据更新方法、装置和设备,提升了数据配置效率,缩短了处理时延。The embodiments of the present application provide a data update method, device, and equipment, which improve the efficiency of data configuration and shorten the processing delay.
第一方面,本申请实施例提供一种数据更新方法,包括:接收更新信息,更新信息包括模式指示信息,模式指示信息指示更新信息的更新模式以及更新信息包括的数据类型;根据更新信息的更新模式,获得存储区域中的目标存储空间;其中,存储区域存储有路由信息;根据更新信息包括的数据类型,从更新信息中提取待更新的路由信息;根据待更新的路由信息,更新目标存储空间中的路由信息。In the first aspect, an embodiment of the present application provides a data update method, including: receiving update information, the update information includes mode indication information, the mode indication information indicates the update mode of the update information and the data type included in the update information; Mode, obtain the target storage space in the storage area; among them, the storage area stores routing information; according to the data type included in the update information, extract the routing information to be updated from the update information; update the target storage space according to the routing information to be updated Routing information in.
通过第一方面提供的数据更新方法,接收更新信息,可以从更新信息中获取更新信息的更新模式和更新信息包括的数据类型,根据更新信息的更新模式获得存储区域中的目标存储空间,根据更新信息包括的数据类型从更新信息中提取待更新的路由信息,根据待更新的路由信息更新目标存储空间中的路由信息。由于不需要将存储区域中的信息读到外部存储空间,在外部存储空间中修改数据并写回至存储区域中,降低了对外部存储资源的要求,缩短了时延,提升了数据配置效率。Through the data update method provided in the first aspect, the update information is received, the update mode of the update information and the data type included in the update information can be obtained from the update information, and the target storage space in the storage area is obtained according to the update mode of the update information. The data type included in the information extracts the routing information to be updated from the update information, and updates the routing information in the target storage space according to the routing information to be updated. Since there is no need to read the information in the storage area to the external storage space, modify the data in the external storage space and write it back to the storage area, which reduces the requirements for external storage resources, shortens the time delay, and improves the efficiency of data configuration.
可选的,在第一方面的一种可能的实施方式中,接收更新信息,包括:接收第一数据;若根据第一数据的指示域的值确定第一数据关联有第二数据,则获取第二数据;其中,更新信息包括第一数据和第二数据。Optionally, in a possible implementation manner of the first aspect, receiving the update information includes: receiving the first data; if it is determined that the first data is associated with the second data according to the value of the indication field of the first data, acquiring The second data; where the update information includes the first data and the second data.
可选的,在第一方面的一种可能的实施方式中,确定第一数据关联有第二数据, 包括:根据第一数据的指示域的值,确定第一数据的更新模式;若第一数据的更新模式与至少两种数据类型相关联,则确定第一数据关联有第二数据。Optionally, in a possible implementation manner of the first aspect, determining that the first data is associated with the second data includes: determining the update mode of the first data according to the value of the indication field of the first data; If the update mode of the data is associated with at least two data types, it is determined that the first data is associated with the second data.
可选的,在第一方面的一种可能的实施方式中,还包括:若根据第一数据的指示域的值确定第一数据未关联有第二数据,则将第一数据确定为更新信息。Optionally, in a possible implementation manner of the first aspect, the method further includes: if it is determined according to the value of the indication field of the first data that the first data is not associated with the second data, determining the first data as update information .
可选的,在第一方面的一种可能的实施方式中,根据更新信息的更新模式,获得存储区域中的目标存储空间,包括:若更新信息的更新模式为第一更新模式,则将存储区域确定为目标存储空间;若更新信息的更新模式为第二更新模式或第三更新模式或第四更新模式,则根据第二数据类型对应的数据确定目标存储空间。Optionally, in a possible implementation manner of the first aspect, obtaining the target storage space in the storage area according to the update mode of the update information includes: if the update mode of the update information is the first update mode, storing The area is determined as the target storage space; if the update mode of the update information is the second update mode or the third update mode or the fourth update mode, the target storage space is determined according to the data corresponding to the second data type.
可选的,在第一方面的一种可能的实施方式中,指示域包括第一子指示域和第二子指示域,第一子指示域的值与预设多种更新模式相关,第二子指示域的值与预设多种数据类型相关。Optionally, in a possible implementation manner of the first aspect, the indication field includes a first sub-indication field and a second sub-indication field, the value of the first sub-indication field is related to preset multiple update modes, and the second The value of the sub-indicating field is related to preset multiple data types.
可选的,在第一方面的一种可能的实施方式中,指示域位于数据中所有比特位的前端。Optionally, in a possible implementation manner of the first aspect, the indication field is located at the front end of all bits in the data.
第二方面,本申请实施例提供一种数据更新装置,包括:接收模块,用于接收更新信息,更新信息包括模式指示信息,模式指示信息指示更新信息的更新模式以及更新信息包括的数据类型;第一获取模块,用于根据更新信息的更新模式,获得存储区域中的目标存储空间;其中,存储区域存储有路由信息;第二获取模块,用于根据更新信息包括的数据类型,从更新信息中提取待更新的路由信息;处理模块,用于根据待更新的路由信息,更新目标存储空间中的路由信息。In a second aspect, an embodiment of the present application provides a data update device, including: a receiving module configured to receive update information, the update information includes mode indication information, the mode indication information indicates the update mode of the update information and the data type included in the update information; The first acquisition module is used to obtain the target storage space in the storage area according to the update mode of the update information; wherein the storage area stores routing information; the second acquisition module is used to obtain information from the update information according to the data type included in the update information The routing information to be updated is extracted from the processing module; the processing module is used to update the routing information in the target storage space according to the routing information to be updated.
可选的,在第二方面的一种可能的实施方式中,接收模块具体用于:接收第一数据;若根据第一数据的指示域的值确定第一数据关联有第二数据,则获取第二数据;其中,更新信息包括第一数据和第二数据。Optionally, in a possible implementation manner of the second aspect, the receiving module is specifically configured to: receive the first data; if it is determined according to the value of the indication field of the first data that the first data is associated with the second data, obtain The second data; where the update information includes the first data and the second data.
可选的,在第二方面的一种可能的实施方式中,接收模块具体用于:根据第一数据的指示域的值,确定第一数据的更新模式;若第一数据的更新模式与至少两种数据类型相关联,则确定第一数据关联有第二数据。Optionally, in a possible implementation manner of the second aspect, the receiving module is specifically configured to: determine the update mode of the first data according to the value of the indication field of the first data; if the update mode of the first data is at least If the two data types are associated, it is determined that the first data is associated with the second data.
可选的,在第二方面的一种可能的实施方式中,接收模块还用于:若根据第一数据的指示域的值确定第一数据未关联有第二数据,则将第一数据确定为更新信息。Optionally, in a possible implementation manner of the second aspect, the receiving module is further configured to: if it is determined according to the value of the indication field of the first data that the first data is not associated with the second data, determine the first data To update information.
可选的,在第二方面的一种可能的实施方式中,第一获取模块具体用于:若更新信息的更新模式为第一更新模式,则将存储区域确定为目标存储空间;若更新信息的更新模式为第二更新模式或第三更新模式或第四更新模式,则根据第二数据类型对应的数据确定目标存储空间。Optionally, in a possible implementation manner of the second aspect, the first acquisition module is specifically configured to: if the update mode of the update information is the first update mode, determine the storage area as the target storage space; if the update information is updated If the update mode of is the second update mode or the third update mode or the fourth update mode, the target storage space is determined according to the data corresponding to the second data type.
可选的,在第二方面的一种可能的实施方式中,指示域包括第一子指示域和第二子指示域,第一子指示域的值与预设多种更新模式相关,第二子指示域的值与预设多种数据类型相关。Optionally, in a possible implementation manner of the second aspect, the indication field includes a first sub-indication field and a second sub-indication field, the value of the first sub-indication field is related to preset multiple update modes, and the second The value of the sub-indicating field is related to preset multiple data types.
可选的,在第二方面的一种可能的实施方式中,指示域位于数据中所有比特位的前端。Optionally, in a possible implementation manner of the second aspect, the indication field is located at the front end of all bits in the data.
第三方面,本申请实施例提供一种数据更新设备,包括处理器、存储器和接口电路,接口电路用于与其它设备通信,处理器用于调用存储器中存储的程序,以执行以上第一方面提供的数据更新方法。In the third aspect, an embodiment of the present application provides a data update device, including a processor, a memory, and an interface circuit. The interface circuit is used to communicate with other devices, and the processor is used to call a program stored in the memory to execute the above-mentioned program provided in the first aspect. The data update method.
第四方面,本申请实施例提供一种计算机可读存储介质,计算机可读存储介质中存储有指令,当指令在计算机或处理器上运行时,实现如以上第一方面提供的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium with instructions stored in the computer-readable storage medium. When the instructions are executed on a computer or a processor, the method provided in the above first aspect is implemented.
第五方面,本申请实施例提供一种程序产品,程序产品包括计算机程序,计算机程序存储在可读存储介质中,设备的至少一个处理器可以从可读存储介质读取计算机程序,至少一个处理器执行计算机程序使得该设备实施以上第一方面提供的方法。In a fifth aspect, embodiments of the present application provide a program product. The program product includes a computer program. The computer program is stored in a readable storage medium. At least one processor of the device can read the computer program from the readable storage medium. The computer program is executed by the device to make the device implement the method provided in the above first aspect.
在以上各个方面中,可选的,在一种可能的实施方式中,更新信息包括至少一个预设比特长度的数据,数据包括指示域;其中,指示域的值与预设多种更新模式和预设多种数据类型相关,每种更新模式与预设多种数据类型中的至少一种数据类型相关联。In each of the above aspects, optionally, in a possible implementation manner, the update information includes at least one preset bit length data, and the data includes an indication field; wherein the value of the indication field and the preset multiple update modes and The preset multiple data types are related, and each update mode is associated with at least one data type of the preset multiple data types.
可选的,在一种可能的实施方式中,预设多种数据类型包括:第一数据类型,用于指示待更新的路由信息;第二数据类型,用于指示待更新的路由信息对应的地址信息;第三数据类型,用于指示待更新的路由信息中需要更新的比特位。Optionally, in a possible implementation manner, the preset multiple data types include: a first data type, used to indicate routing information to be updated; a second data type, used to indicate routing information to be updated corresponding to Address information; the third data type is used to indicate the bits that need to be updated in the routing information to be updated.
可选的,在一种可能的实施方式中,预设多种更新模式包括:第一更新模式,第一更新模式仅与第一数据类型相关联;第二更新模式,第二更新模式与第一数据类型、第二数据类型和第三数据类型相关联;第三更新模式,第三更新模式与第一数据类型和第二数据类型相关联,且第一数据类型对应的数据为一个;第四更新模式,第四更新模式与第一数据类型和第二数据类型相关联,且第一数据类型对应的数据为至少两个。Optionally, in a possible implementation manner, preset multiple update modes include: a first update mode, the first update mode is only associated with the first data type; the second update mode, the second update mode and the first update mode A data type, a second data type, and a third data type are associated; a third update mode, the third update mode is associated with the first data type and the second data type, and the data corresponding to the first data type is one; Four update modes, the fourth update mode is associated with the first data type and the second data type, and there are at least two data corresponding to the first data type.
附图说明Description of the drawings
图1为存储区域的物理地址与MID表的MID地址之间对应关系的示意图;FIG. 1 is a schematic diagram of the corresponding relationship between the physical address of the storage area and the MID address of the MID table;
图2为现有的更新MID表的一种示意图;Figure 2 is a schematic diagram of an existing update MID table;
图3为本申请实施例适用的更新MID表的一种示意图;FIG. 3 is a schematic diagram of updating the MID table applicable to the embodiment of this application;
图4为本申请实施例提供的数据更新方法的一种流程图;FIG. 4 is a flowchart of a data update method provided by an embodiment of the application;
图5为本申请实施例提供的更新信息的一种示意图;FIG. 5 is a schematic diagram of update information provided by an embodiment of the application;
图6为图5中预设比特长度的数据的一种示意图;FIG. 6 is a schematic diagram of data with a preset bit length in FIG. 5;
图7为本申请实施例提供的第一更新模式的原理示意图;FIG. 7 is a schematic diagram of the principle of the first update mode provided by an embodiment of the application;
图8为本申请实施例提供的第二更新模式的原理示意图;FIG. 8 is a schematic diagram of the principle of the second update mode provided by an embodiment of the application;
图9为本申请实施例提供的第三更新模式的原理示意图;FIG. 9 is a schematic diagram of the principle of the third update mode provided by an embodiment of the application;
图10为本申请实施例提供的第四更新模式的原理示意图;FIG. 10 is a schematic diagram of the principle of the fourth update mode provided by an embodiment of the application;
图11为本申请实施例提供的数据更新方法的另一种流程图;FIG. 11 is another flowchart of a data update method provided by an embodiment of the application;
图12为本申请实施例提供的数据更新装置的一种结构示意图;FIG. 12 is a schematic structural diagram of a data update device provided by an embodiment of this application;
图13为本申请实施例提供的数据更新设备的一种结构示意图。FIG. 13 is a schematic structural diagram of a data update device provided by an embodiment of this application.
具体实施方式Detailed ways
下面结合附图描述本申请实施例。The embodiments of the present application are described below in conjunction with the drawings.
在现有技术中,路由器可以通过DMA对MID表刷表配置。通常,路由器中存储MID表的存储区域的物理地址与MID表的MID地址是一一对应的。示例性的,图1 为存储区域的物理地址与MID表的MID地址之间对应关系的示意图。如图1所示,路由器中存储区域(例如,内存)的物理地址为P0~Pn,MID表的MID地址为MID0~MID n,物理地址P0~Pn与MID地址MID 0~MID n一一对应,比如,物理地址P0与MID地址MID 0对应,物理地址P1与MID地址MID 1对应。在图1中,路由器当前存储有数据D0~Dn,也称为MID表项。其中,数据D0存储在物理地址P0中,数据D1存储在物理地址P1中,以此类推。路由器通过DMA刷表配置时,通常要求MID地址是连续的。例如,在图1中,MID地址MID 0~MID n对应的待更新信息包括数据D0’~Dn’,路由器可以进行连续地址更新,将物理地址P0~Pn中存储的数据D0~Dn分别更新为数据D0’~Dn’,比如,物理地址P0中存储的数据由D0更新为D0’,物理地址P1中存储的数据由D1更新为D1’。In the prior art, the router can refresh the configuration of the MID table through DMA. Generally, the physical address of the storage area where the MID table is stored in the router corresponds to the MID address of the MID table in a one-to-one correspondence. Exemplarily, FIG. 1 is a schematic diagram of the corresponding relationship between the physical address of the storage area and the MID address of the MID table. As shown in Figure 1, the physical address of the storage area (for example, memory) in the router is P0~Pn, the MID address of the MID table is MID0~MID n, and the physical address P0~Pn corresponds to the MID address MID 0~MID n. For example, the physical address P0 corresponds to the MID address MID 0, and the physical address P1 corresponds to the MID address MID 1. In Figure 1, the router currently stores data D0 to Dn, which are also called MID entries. Among them, the data D0 is stored in the physical address P0, the data D1 is stored in the physical address P1, and so on. When the router is configured by DMA refreshing the table, it is usually required that the MID address is continuous. For example, in Figure 1, the to-be-updated information corresponding to MID addresses MID 0~MID n includes data D0'~Dn'. The router can perform continuous address updates and update the data D0~Dn stored in the physical addresses P0~Pn to Data D0'~Dn', for example, the data stored in the physical address P0 is updated from D0 to D0', and the data stored in the physical address P1 is updated from D1 to D1'.
MID表更新还存在如下场景:仅对一部分MID地址进行数据更新。示例性的,图2为现有的更新MID表的一种示意图。在图2中,例如,仅需要对MID地址MID 1进行数据更新。现有的更新过程包括:通过CPU先将内存中的数据D0~Dn读出来存储到外部存储区域,在外部存储区域中对MID地址MID 1对应的数据由D1更新为D1’,再将外部存储区域中已经更新的数据D0、D1’、D2~Dn通过CPU全部写入内存中,完成数据更新,存储区域中的数据由D0~Dn更新为D0、D1’、D2~Dn。There are also scenarios in the MID table update as follows: only a part of the MID addresses are updated. Exemplarily, FIG. 2 is a schematic diagram of an existing update MID table. In Figure 2, for example, only the MID address MID 1 needs to be updated. The existing update process includes: first read out the data D0~Dn in the memory through the CPU and store it in the external storage area. In the external storage area, update the data corresponding to the MID address MID 1 from D1 to D1', and then store the data externally. The updated data D0, D1', D2 ~ Dn in the area are all written into the memory by the CPU to complete the data update, and the data in the storage area is updated from D0 ~ Dn to D0, D1', D2 ~ Dn.
可见,针对地址不连续的刷表配置的应用场景,需要在内存外部有大量的存储资源对MID表项进行缓存,对外部存储资源要求较高。而且,只能单个表项访问,无法使用DMA,由于需要将全部MID表项存储到外部存储空间,流程复杂,导致配置时间长、时延大,数据更新效率低。It can be seen that for the application scenario of refreshing the table configuration with discontinuous addresses, a large amount of storage resources outside the memory need to be cached for MID table entries, which requires high external storage resources. Moreover, only a single entry can be accessed, and DMA cannot be used. Due to the need to store all MID entries in an external storage space, the process is complicated, resulting in long configuration time, large delay, and low data update efficiency.
基于该技术问题,本申请实施例提供一种数据更新方法。示例性的,结合图3进行说明。图3为本申请实施例适用的更新MID表的一种示意图。如图3所示,接收更新信息,从更新信息中可以提取该更新信息的更新模式和该更新信息包括的数据类型。通过更新信息的更新模式,可以确定存储区域中需要更新数据的目标存储空间,例如,在图3中,目标存储空间可以为MID地址MID 1对应的物理地址P1指示的存储单元。通过更新信息包括的数据类型可以获得待更新的路由信息。这样,根据待更新的路由信息可以更新目标存储空间中的路由信息。相比于现有技术中的数据更新方法,本申请实施例提供的数据更新方法,不需要将存储区域中的信息读到外部存储空间,在外部存储空间中修改数据并写回至存储区域中,可以直接更新存储区域中的数据,降低了对外部存储资源的要求,甚至对外部存储资源没有需求,缩短了时延,提升了数据配置效率。Based on this technical problem, an embodiment of the present application provides a data update method. Exemplarily, it will be described with reference to FIG. 3. FIG. 3 is a schematic diagram of updating the MID table applicable to the embodiment of this application. As shown in FIG. 3, the update information is received, and the update mode of the update information and the data type included in the update information can be extracted from the update information. Through the update mode of the update information, the target storage space in the storage area that needs to update data can be determined. For example, in FIG. 3, the target storage space may be the storage unit indicated by the physical address P1 corresponding to the MID address MID1. The routing information to be updated can be obtained by the data type included in the update information. In this way, the routing information in the target storage space can be updated according to the routing information to be updated. Compared with the data update method in the prior art, the data update method provided by the embodiment of the present application does not need to read the information in the storage area to the external storage space, modify the data in the external storage space and write it back to the storage area , The data in the storage area can be directly updated, which reduces the requirements for external storage resources, and even has no demand for external storage resources, shortens the time delay, and improves the efficiency of data configuration.
本申请实施例提供的数据更新方法,适用于采用DMA更新数据的设备,本申请实施例对设备的类型不做限定。例如,该设备可以包括但不限于路由器、交换机,等。The data update method provided in the embodiment of the present application is applicable to devices that use DMA to update data, and the embodiment of the present application does not limit the type of the device. For example, the device may include, but is not limited to, routers, switches, and so on.
下面结合附图进行描述。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。The description is given below in conjunction with the drawings. In the case of no conflict, the following embodiments and features in the embodiments can be combined with each other.
图4为本申请实施例提供的数据更新方法的一种流程图。本实施例提供的数据更新方法,执行主体可以为数据更新装置或数据更新设备。如图4所示,本实施例提供的数据更新方法,可以包括:FIG. 4 is a flowchart of a data update method provided by an embodiment of the application. In the data update method provided in this embodiment, the execution subject may be a data update device or a data update device. As shown in Figure 4, the data update method provided in this embodiment may include:
S401、接收更新信息。S401. Receive update information.
其中,更新信息包括模式指示信息,模式指示信息指示更新信息的更新模式以及更新信息包括的数据类型。Wherein, the update information includes mode indication information, and the mode indication information indicates the update mode of the update information and the type of data included in the update information.
具体的,在本实施例中,可以预先设置多种更新模式和多种数据类型。不同的更新模式可以适用于不同的数据更新场景,数据更新场景可以包括但不限于图1所示的连续地址更新场景、以及图2或图3所示的不连续地址更新场景。不同的数据类型用于指示数据的含义或者用途不同。其中,更新信息的更新模式可以为预设多种更新模式中的一种,更新信息包括的数据类型可以为预设多种数据类型中的至少一种。Specifically, in this embodiment, multiple update modes and multiple data types can be preset. Different update modes can be applied to different data update scenarios, and the data update scenarios can include but are not limited to the continuous address update scenario shown in FIG. 1 and the discontinuous address update scenario shown in FIG. 2 or FIG. 3. Different data types are used to indicate the meaning or purpose of the data. The update mode of the update information may be one of multiple preset update modes, and the data type included in the update information may be at least one of the preset multiple data types.
可选的,预设多种数据类型可以包括但不限于:Optionally, multiple preset data types may include but are not limited to:
第一数据类型,用于指示待更新的路由信息。The first data type is used to indicate the routing information to be updated.
第二数据类型,用于指示待更新的路由信息对应的地址信息。The second data type is used to indicate the address information corresponding to the routing information to be updated.
第三数据类型,用于指示待更新的路由信息中需要更新的比特位。The third data type is used to indicate the bits that need to be updated in the routing information to be updated.
可选的,预设多种更新模式可以包括但不限于:Optionally, multiple preset update modes may include but are not limited to:
第一更新模式,第一更新模式仅与第一数据类型相关联。The first update mode, the first update mode is only associated with the first data type.
第二更新模式,第二更新模式与第一数据类型、第二数据类型和第三数据类型相关联。The second update mode, the second update mode is associated with the first data type, the second data type, and the third data type.
第三更新模式,第三更新模式与第一数据类型和第二数据类型相关联,且第一数据类型对应的数据为一个。The third update mode, the third update mode is associated with the first data type and the second data type, and there is one data corresponding to the first data type.
第四更新模式,第四更新模式与第一数据类型和第二数据类型相关联,且第一数据类型对应的数据为至少两个。The fourth update mode, the fourth update mode is associated with the first data type and the second data type, and there are at least two data corresponding to the first data type.
后续会通过表1~表6以及图7~图10,对预设多种数据类型和预设多种更新模式进行示例性说明。The following will exemplify the preset multiple data types and preset multiple update modes through Table 1 to Table 6 and Figures 7 to 10.
S402、根据更新信息的更新模式,获得存储区域中的目标存储空间。S402: Obtain a target storage space in the storage area according to the update mode of the update information.
其中,存储区域存储有路由信息。Among them, the storage area stores routing information.
示例性的,在图1所示的应用场景中,存储区域为路由器的内存,物理地址为P0~Pn,目标存储空间为该存储区域,物理地址为P0~Pn。在图2或图3所示的应用场景中,存储区域的物理地址为P0~Pn,目标存储空间为物理地址P1指示的存储单元。Exemplarily, in the application scenario shown in FIG. 1, the storage area is the memory of the router, the physical address is P0 to Pn, the target storage space is the storage area, and the physical address is P0 to Pn. In the application scenario shown in FIG. 2 or FIG. 3, the physical addresses of the storage area are P0 to Pn, and the target storage space is the storage unit indicated by the physical address P1.
S403、根据更新信息包括的数据类型,从更新信息中提取待更新的路由信息。S403: Extract routing information to be updated from the update information according to the data type included in the update information.
由于不同的数据类型用于指示数据的含义或者用途不同,根据更新信息包括的数据类型,可以从更新信息中提取待更新的路由信息。示例性的,在图1所示的应用场景中,待更新的路由信息包括D0’~Dn’。在图2或图3所示的应用场景中,待更新的路由信息包括D1’。Since different data types are used to indicate different meanings or uses of data, the routing information to be updated can be extracted from the update information according to the data types included in the update information. Exemplarily, in the application scenario shown in FIG. 1, the routing information to be updated includes D0'-Dn'. In the application scenario shown in Figure 2 or Figure 3, the routing information to be updated includes D1'.
S404、根据待更新的路由信息,更新目标存储空间中的路由信息。S404. Update the routing information in the target storage space according to the routing information to be updated.
具体的,根据更新信息获取存储区域中的目标存储空间以及待更新的路由信息后,可以更新目标存储空间中的路由信息。例如,可以通过DMA更新目标存储空间中的路由信息。其中,本实施例对其他的更新方式不做限定。Specifically, after obtaining the target storage space in the storage area and the routing information to be updated according to the update information, the routing information in the target storage space can be updated. For example, the routing information in the target storage space can be updated through DMA. Among them, this embodiment does not limit other update methods.
可见,本实施例提供的数据更新方法,通过接收更新信息,可以从更新信息中获取更新信息的更新模式和更新信息包括的数据类型,根据更新信息的更新模式获得存储区域中的目标存储空间,根据更新信息包括的数据类型从更新信息中提取待更新的 路由信息,根据待更新的路由信息更新目标存储空间中的路由信息。本实施例提供的数据更新方法,不需要将存储区域中的信息读到外部存储空间,在外部存储空间中修改数据并写回至存储区域中,降低了对外部存储资源的要求,缩短了时延,提升了数据配置效率。It can be seen that the data update method provided in this embodiment can obtain the update mode of the update information and the data type included in the update information from the update information by receiving the update information, and obtain the target storage space in the storage area according to the update mode of the update information. The routing information to be updated is extracted from the update information according to the data type included in the update information, and the routing information in the target storage space is updated according to the routing information to be updated. The data update method provided by this embodiment does not need to read the information in the storage area to the external storage space, modify the data in the external storage space and write it back to the storage area, which reduces the requirements for external storage resources and shortens the time Delay, improve the efficiency of data allocation.
可选的,参见图5,更新信息可以包括至少一个预设比特长度的数据,预设比特长度的数据可以包括指示域。其中,指示域的值与预设多种更新模式和预设多种数据类型相关,每种更新模式与预设多种数据类型中的至少一种数据类型相关联。Optionally, referring to FIG. 5, the update information may include at least one piece of data with a preset bit length, and the data with a preset bit length may include an indication field. Wherein, the value of the indication field is related to preset multiple update modes and preset multiple data types, and each update mode is associated with at least one data type of the preset multiple data types.
需要说明的是,本实施例对预设比特长度的具体取值不做限定,例如,预设比特长度为32bit。本实施例对更新信息包括的预设比特长度的数据的数量不做限定,与更新信息的更新模式和更新信息包括的数据类型相关。本实施例对指示域在预设比特长度中的占用位置以及指示域的比特长度不做限定,可选的,指示域可以位于预设比特长度的数据中所有比特位的前端,可以占用预设比特长度的数据中的预留比特位。It should be noted that this embodiment does not limit the specific value of the preset bit length, for example, the preset bit length is 32 bits. This embodiment does not limit the amount of data with a preset bit length included in the update information, which is related to the update mode of the update information and the type of data included in the update information. This embodiment does not limit the occupied position of the indicator field in the preset bit length and the bit length of the indicator field. Optionally, the indicator field can be located at the front of all bits in the data of the preset bit length, and can occupy the preset bit length. Reserved bits in bit-length data.
可选的,参见图6,指示域可以包括第一子指示域和第二子指示域,第一子指示域的值与预设多种更新模式相关,第二子指示域的值与预设多种数据类型相关。Optionally, referring to Fig. 6, the indication field may include a first sub-indication field and a second sub-indication field. Multiple data types are related.
需要说明的是,本实施例对第一子指示域和第二子指示域的前后位置不做限定。例如,在图6中,第一子指示域位于第二子指示域的前面。可选的,在另一种实现方式中,第二子指示域可以位于第一子指示域的前面。本实施例对第一子指示域和第二子指示域的比特长度不做限定。第一子指示域的比特长度可以与预设多种更新模式的数量相关。例如,预设多种更新模式包括4种更新模式时,第一子指示域的比特长度可以为2bit,预设多种更新模式包括5种更新模式时,第一子指示域的比特长度可以为3bit。本实施例对第一子指示域的取值与预设多种更新模式之间的对应关系不做限定。例如,预设多种更新模式包括2种更新模式时,在一种实现方式中,第一子指示域的取值为0时指示第一种更新模式,第一子指示域的取值为1时指示第二种更新模式;在另一种实现方式中,第一子指示域的取值为1时指示第一种更新模式,第一子指示域的取值为0时指示第二种更新模式。相似的,第二子指示域的比特长度可以与预设多种数据类型的数量相关,本实施例对第二子指示域的取值与预设多种数据类型之间的对应关系不做限定。It should be noted that this embodiment does not limit the front and back positions of the first sub-indication field and the second sub-indication field. For example, in FIG. 6, the first sub-indication field is located in front of the second sub-indication field. Optionally, in another implementation manner, the second sub-indication field may be located in front of the first sub-indication field. This embodiment does not limit the bit lengths of the first sub-indication field and the second sub-indication field. The bit length of the first sub-indication field may be related to the number of preset multiple update modes. For example, when the preset multiple update modes include 4 update modes, the bit length of the first sub-indication field may be 2 bits, and when the preset multiple update modes include 5 update modes, the bit length of the first sub-indication field may be 3bit. This embodiment does not limit the correspondence between the value of the first sub-indication field and the preset multiple update modes. For example, when the preset multiple update modes include 2 update modes, in an implementation manner, when the value of the first sub-indication field is 0, the first update mode is indicated, and the value of the first sub-indication field is 1. When the value of the first sub-indicator field is 1, it indicates the first update mode, and when the value of the first sub-indicator field is 0, it indicates the second update mode. model. Similarly, the bit length of the second sub-indication field may be related to the number of preset multiple data types. This embodiment does not limit the correspondence between the value of the second sub-indication field and the preset multiple data types. .
下面,结合表1~表6以及图7~图10,通过示例对更新信息、预设比特长度的数据、指示域、第一子指示域、第二子指示域、预设多种更新模式和预设多种数据类型进行说明。Below, in conjunction with Tables 1 to 6 and Figures 7 to 10, by way of example, update information, preset bit length data, indicator field, first sub-indicator field, second sub-indicator field, preset multiple update modes and A variety of data types are preset for description.
假设,预设比特长度为32bit。其中,bit0~bit27携带有效负荷或有效信息,bit28~bit31为指示域,第一子指示域为bit30~bit31,第二子指示域为bit28~bit29。Assume that the preset bit length is 32 bits. Among them, bits 0 to 27 carry payload or effective information, bits 28 to 31 are indicator fields, the first sub indicator field is bit 30 to bit 31, and the second sub indicator field is bit 28 to bit 29.
如表1所示,预设多种数据类型包括第一数据类型~第三数据类型。bit29、bit28的取值为二进制0、1时,指示第一数据类型;bit29、bit28的取值为二进制0、0时,指示第二数据类型;bit29、bit28的取值为二进制1、0时,指示第三数据类型。其中,第一数据类型可以表示为位表(bitmap,bmp),bmp中的bit0~bit27用于指示待更新的路由信息。第二数据类型可以表示为MID,MID中的bit0~bit27用于指示待更新的路由信息对应的地址信息。例如,在图2或图3所示的应用场景中,MID中的bit0~bit27用于指示MID 1。第三数据类型可以表示为msk(掩码),msk中的bit0~bit27用于指 示待更新的路由信息中需要更新的比特位。例如,若待更新的路由信息(28bit)中需要更新的比特位为bit5~bit0,可选的,在一种实现方式中,msk中bit5~bit0的取值可以均为二进制0,bit6~bit27的取值可以均为二进制1;或者,在另一种实现方式中,msk中bit5~bit0的取值可以均为二进制1,bit6~bit27的取值可以均为二进制0。As shown in Table 1, the preset multiple data types include the first data type to the third data type. When the value of bit29 and bit28 is binary 0, 1, it indicates the first data type; when the value of bit29 and bit28 is binary 0, 0, it indicates the second data type; when the value of bit29 and bit28 is binary 1, 0 , Indicating the third data type. Wherein, the first data type may be expressed as a bitmap (bitmap, bmp), and bits 0 to 27 in bmp are used to indicate routing information to be updated. The second data type can be expressed as MID, and bits 0 to 27 in the MID are used to indicate the address information corresponding to the routing information to be updated. For example, in the application scenario shown in FIG. 2 or FIG. 3, bits 0 to 27 in the MID are used to indicate MID 1. The third data type can be expressed as msk (mask), and bits 0 to 27 in msk are used to indicate the bits that need to be updated in the routing information to be updated. For example, if the bits that need to be updated in the routing information (28 bits) to be updated are bit5~bit0, optionally, in one implementation, the values of bit5~bit0 in msk can all be binary 0, bit6~bit27 The value of can all be binary 1; or, in another implementation manner, the values of bit5 to bit0 in msk can all be binary 1, and the values of bit6 to bit27 can all be binary 0.
表1Table 1
数据类型type of data bit31bit31 bit30bit30 bit29bit29 bit28bit28 bit27…bit0bit27...bit0
第一数据类型(bmp)The first data type (bmp)  To  To 00 11  To
第二数据类型(MID)Second data type (MID)  To  To 00 00  To
第三数据类型(msk)The third data type (msk)  To  To 11 00  To
如表2所示,预设多种更新模式包括第一更新模式~第四更新模式。bit31、bit30的取值为二进制0、0时,指示第一更新模式;bit31、bit30的取值为二进制0、1时,指示第二更新模式;bit31、bit30的取值为二进制1、0时,指示第三更新模式;bit31、bit30的取值为二进制1、1时,指示第四更新模式。As shown in Table 2, the preset multiple update modes include the first update mode to the fourth update mode. When the value of bit31 and bit30 is binary 0, 0, it indicates the first update mode; when the value of bit31 and bit30 is binary 0, 1, it indicates the second update mode; when the value of bit31 and bit30 is binary 1, 0 , Indicates the third update mode; when the values of bit31 and bit30 are binary 1, 1, indicating the fourth update mode.
表2Table 2
更新模式Update mode bit31bit31 bit30bit30 bit29bit29 bit28bit28 bit27…bit0bit27...bit0
第一更新模式 First update mode 00 00  To  To  To
第二更新模式 Second update mode 00 11  To  To  To
第三更新模式 Third update mode 11 00  To  To  To
第四更新模式 Fourth update mode 11 11  To  To  To
示例性的,表3示出了第一更新模式下的更新信息,图7为本申请实施例提供的第一更新模式的原理示意图。第一更新模式仅与第一数据类型相关联。第一更新模式可以适用于连续地址更新场景。Exemplarily, Table 3 shows the update information in the first update mode, and FIG. 7 is a schematic diagram of the principle of the first update mode provided in an embodiment of this application. The first update mode is only associated with the first data type. The first update mode may be suitable for continuous address update scenarios.
如表3和图7所示,更新信息可以包括n+1个32bit长度的数据,该n+1个数据均为第一数据类型,并且,该n+1个数据分别对应MID地址MID 0~MID n。在每个数据中,bit31、bit30的取值为二进制0、0,指示第一更新模式;bit29、bit28的取值为二进制0、1,指示第一数据类型bmp;bit0~bit27用于指示待更新的路由信息。需要说明的是,表3和图7仅是示例,本实施例对更新信息包括的第一数据类型的数量不做限定。As shown in Table 3 and FIG. 7, the update information may include n+1 pieces of 32-bit data. The n+1 pieces of data are all of the first data type, and the n+1 pieces of data correspond to the MID address MID 0~ MID n. In each data, the values of bit31 and bit30 are binary 0 and 0, indicating the first update mode; the values of bit29 and bit28 are binary 0 and 1, indicating the first data type bmp; bit0~bit27 are used to indicate the waiting Updated routing information. It should be noted that Table 3 and FIG. 7 are only examples, and this embodiment does not limit the number of the first data types included in the update information.
示例性的,在第一更新模式下,在采用DMA更新数据的一个实际应用中,直接写的DMA地址和数据与MID表项的地址和数据都一一对应,经过查找表(Look-Up Table,LUT)内部先入先出(First In First Out,FIFO)缓存后分发到上行多播表(Ingress MID,iMID)或下行多播表(egress MID,eMID)。第一更新模式可以作为MID表的 默认配置方式,当软件全量刷表时可以通过DMA方式下发。Exemplarily, in the first update mode, in an actual application that uses DMA to update data, the directly written DMA address and data correspond to the address and data of the MID table entry one-to-one, and the look-up table (Look-Up Table) , LUT) Internal First In First Out (First In First Out, FIFO) is cached and then distributed to the uplink multicast table (Ingress MID, iMID) or downlink multicast table (egress MID, eMID). The first update mode can be used as the default configuration mode of the MID table, and can be issued through DMA when the software is fully refreshed.
表3更新信息(第一更新模式)Table 3 update information (first update mode)
数据类型type of data bit31bit31 bit30bit30 bit29bit29 bit28bit28 bit27…bit0bit27...bit0
第一数据类型(bmp)The first data type (bmp) 00 00 00 11  To
第一数据类型(bmp)The first data type (bmp) 00 00 00 11  To
 To
第一数据类型(bmp)The first data type (bmp) 00 00 00 11  To
示例性的,表4示出了第二更新模式下的更新信息,图8为本申请实施例提供的第二更新模式的原理示意图。第二更新模式与第一数据类型、第二数据类型和第三数据类型相关联。第二更新模式可以适用于不连续地址更新场景,尤其适用于携带第三数据类型(msk)的更新场景。Exemplarily, Table 4 shows the update information in the second update mode, and FIG. 8 is a schematic diagram of the principle of the second update mode provided in an embodiment of this application. The second update mode is associated with the first data type, the second data type, and the third data type. The second update mode may be suitable for discontinuous address update scenarios, especially for update scenarios that carry a third data type (msk).
如表4和图8所示,更新信息可以包括3个32bit长度的数据,分别为第一数据类型(bmp)、第二数据类型(MID)和第三数据类型(msk)。在每个数据中,bit31、bit30的取值为二进制0、1,指示第二更新模式。在图8所示示例中,第二数据类型(MID)中的bit0~bit27用于指示MID地址MID 1,第一数据类型(bmp)中的bit0~bit27用于指示MID 1对应的待更新的路由信息,第三数据类型(msk)中的bit0~bit27用于指示MID 1对应的待更新的路由信息中需要更新的比特位。As shown in Table 4 and FIG. 8, the update information may include three 32-bit length data, which are respectively the first data type (bmp), the second data type (MID), and the third data type (msk). In each data, the values of bit31 and bit30 are binary 0 and 1, indicating the second update mode. In the example shown in Figure 8, bits 0 to bit 27 in the second data type (MID) are used to indicate the MID address MID 1, and bits 0 to bit 27 in the first data type (bmp) are used to indicate the to-be-updated corresponding to MID 1 For routing information, bits 0 to 27 in the third data type (msk) are used to indicate the bits that need to be updated in the routing information to be updated corresponding to MID 1.
示例性的,在第二更新模式下,在采用DMA更新数据的一个实际应用中,表4所示的三个32bit数据对应一个MID地址的entry刷新,可以预存到LUT内部FIFO,对所有数据进行解析后完成对每个MID表项的更新。第二更新模式可以用于软件增量带msk刷新部分的MID表项更新场景,可以通过DMA方式下发。Exemplarily, in the second update mode, in an actual application that uses DMA to update data, the three 32-bit data shown in Table 4 corresponds to the entry refresh of a MID address, which can be pre-stored in the LUT internal FIFO to perform all data After parsing, the update of each MID entry is completed. The second update mode can be used in the MID table item update scenario with the msk refresh part in the software increment, and can be issued through the DMA mode.
表4更新信息(第二更新模式)Table 4 update information (second update mode)
数据类型type of data bit31bit31 bit30bit30 bit29bit29 bit28bit28 bit27…bit0bit27...bit0
第二数据类型(MID)Second data type (MID) 00 11 00 00  To
第一数据类型(bmp)The first data type (bmp) 00 11 00 11  To
第三数据类型(msk)The third data type (msk) 00 11 11 00  To
示例性的,表5示出了第三更新模式下的更新信息,图9为本申请实施例提供的第三更新模式的原理示意图。第三更新模式与第一数据类型和第二数据类型相关联,且第一数据类型对应的数据为一个。第三更新模式可以适用于不连续地址更新场景。Exemplarily, Table 5 shows the update information in the third update mode, and FIG. 9 is a schematic diagram of the principle of the third update mode provided in an embodiment of this application. The third update mode is associated with the first data type and the second data type, and there is one data corresponding to the first data type. The third update mode may be suitable for discontinuous address update scenarios.
如表5和图9所示,更新信息可以包括2个32bit长度的数据,分别为第一数据类型(bmp)和第二数据类型(MID)。在每个数据中,bit31、bit30的取值为二进制1、0,指示第三更新模式。在图9所示示例中,第二数据类型(MID)中的bit0~bit27用于指示MID地址MID 1,第一数据类型(bmp)中的bit0~bit27用于指示MID 1对应的待更新的 路由信息。As shown in Table 5 and FIG. 9, the update information may include two 32-bit length data, which are respectively the first data type (bmp) and the second data type (MID). In each data, the values of bit31 and bit30 are binary 1, 0, indicating the third update mode. In the example shown in Figure 9, bits 0 to bit 27 in the second data type (MID) are used to indicate the MID address MID 1, and bits 0 to bit 27 in the first data type (bmp) are used to indicate the to-be-updated corresponding to MID 1 Routing information.
示例性的,在第三更新模式下,在采用DMA更新数据的一个实际应用中,表5所示的两个32bit数据对应一个MID地址的entry刷新,可以预存到LUT内部FIFO,对所有数据进行解析后完成对每个MID表项的更新。第三更新模式可以用于软件增量不带msk刷新部分的MID表项更新场景,可以通过DMA方式下发。Exemplarily, in the third update mode, in an actual application that uses DMA to update data, the two 32-bit data shown in Table 5 correspond to the entry refresh of a MID address, which can be pre-stored in the LUT internal FIFO to perform all data After parsing, the update of each MID entry is completed. The third update mode can be used in the MID table item update scenario where the software increment does not have the msk refresh part, and can be issued through DMA.
表5更新信息(第三更新模式)Table 5 Update information (third update mode)
数据类型type of data bit31bit31 bit30bit30 bit29bit29 bit28bit28 bit27…bit0bit27...bit0
第一数据类型(bmp)The first data type (bmp) 11 00 00 11  To
第二数据类型(MID)Second data type (MID) 11 00 00 00  To
示例性的,表6示出了第四更新模式下的更新信息,图10为本申请实施例提供的第四更新模式的原理示意图。第四更新模式与第一数据类型和第二数据类型相关联,且第一数据类型对应的数据为至少两个。第四更新模式可以适用于不连续地址更新场景,尤其适用于多个存储区域中的不连续地址更新场景。Exemplarily, Table 6 shows the update information in the fourth update mode, and FIG. 10 is a schematic diagram of the principle of the fourth update mode provided in an embodiment of this application. The fourth update mode is associated with the first data type and the second data type, and there are at least two data corresponding to the first data type. The fourth update mode may be suitable for discontinuous address update scenarios, especially for discontinuous address update scenarios in multiple storage areas.
如表6和图10所示,更新信息可以包括9个32bit长度的数据,9个数据包括1个第二数据类型(MID)和8个第一数据类型(bmp)。在每个数据中,bit31、bit30的取值为二进制1、1,指示第四更新模式。在图10所示示例中,第二数据类型(MID)中的bit0~bit27用于指示MID地址MID 0,8个第一数据类型(bmp)中的bit0~bit27分别对应8个存储区域(LUT0~LUT7)中的MID 0。需要说明的是,表6和图10仅是示例,本实施例对更新信息包括的第一数据类型的数量不做限定。As shown in Table 6 and FIG. 10, the update information may include 9 pieces of 32-bit length data, and the 9 pieces of data include 1 second data type (MID) and 8 first data types (bmp). In each data, the values of bit31 and bit30 are binary 1, 1, indicating the fourth update mode. In the example shown in Figure 10, bits 0 to bit 27 in the second data type (MID) are used to indicate the MID address MID 0, and the 8 bits 0 to bit 27 in the first data type (bmp) correspond to 8 storage areas (LUT0). ~MID 0 in LUT7). It should be noted that Table 6 and FIG. 10 are only examples, and this embodiment does not limit the number of the first data types included in the update information.
示例性的,在第四更新模式下,在采用DMA更新数据的一个实际应用中,eMID可以支持第四更新模式。MIDn带有8个bmp,分别对应8个LUT的MIDn,通过私有全局广播写每个LUT都收到相同的MID加8个bmp数据,每个LUT会伸出去一个3bit的pin脚信号连接一个固定值,在顶层连接时接0-7让LUT识别自己的编号,然后用对应的bmp数据刷新MID表。第四更新模式可以用于采用DMA方式广播且增量配置EMID表的应用场景。Exemplarily, in the fourth update mode, in an actual application that uses DMA to update data, the eMID can support the fourth update mode. MIDn has 8 bmps, corresponding to the MIDn of 8 LUTs. Each LUT receives the same MID plus 8 bmp data when writing via private global broadcast. Each LUT will extend a 3bit pin signal to connect to a fixed Value, connect 0-7 when connecting at the top level to let the LUT identify its own number, and then refresh the MID table with the corresponding bmp data. The fourth update mode can be used in application scenarios where DMA is used for broadcasting and the EMID table is incrementally configured.
表6更新信息(第四更新模式)Table 6 update information (fourth update mode)
数据类型type of data bit31bit31 bit30bit30 bit29bit29 bit28bit28 bit27…bit0bit27...bit0
第二数据类型(MID)Second data type (MID) 11 11 00 00  To
第一数据类型(bmp)The first data type (bmp) 11 11 00 11  To
第一数据类型(bmp)The first data type (bmp) 11 11 00 11  To
第一数据类型(bmp)The first data type (bmp) 11 11 00 11  To
 To
第一数据类型(bmp)The first data type (bmp) 11 11 00 11  To
可选的,S402中,根据更新信息的更新模式,获得存储区域中的目标存储空间,可以包括:Optionally, in S402, obtaining the target storage space in the storage area according to the update mode of the update information may include:
若更新信息的更新模式为第一更新模式,则将存储区域确定为目标存储空间。If the update mode of the update information is the first update mode, the storage area is determined as the target storage space.
若更新信息的更新模式为第二更新模式或第三更新模式或第四更新模式,则根据第二数据类型对应的数据确定目标存储空间。If the update mode of the update information is the second update mode or the third update mode or the fourth update mode, the target storage space is determined according to the data corresponding to the second data type.
具体的,第一更新模式可以适用于连续地址更新场景,可以将存储区域确定为目标存储空间。第二更新模式或第三更新模式或第四更新模式可以适用于不连续地址更新场景,第二更新模式或第三更新模式或第四更新模式均关联有第二数据类型,第二数据类型用于指示待更新的路由信息对应的地址信息,因此,根据第二数据类型对应的数据确定目标存储空间。Specifically, the first update mode may be suitable for a continuous address update scenario, and the storage area may be determined as the target storage space. The second update mode, the third update mode, or the fourth update mode can be applied to discontinuous address update scenarios. The second update mode, the third update mode, or the fourth update mode are all associated with the second data type, and the second data type is used for In order to indicate the address information corresponding to the routing information to be updated, the target storage space is determined according to the data corresponding to the second data type.
需要说明的是,本实施例对第二数据类型指示的地址信息的实现方式不做限定。例如,第二数据类型指示的地址信息可以为相对于存储区域的基地址的偏移地址,或者为与存储区域的物理地址对应的虚拟地址。It should be noted that this embodiment does not limit the implementation of the address information indicated by the second data type. For example, the address information indicated by the second data type may be an offset address relative to the base address of the storage area, or a virtual address corresponding to the physical address of the storage area.
图11为本申请实施例提供的数据更新方法的另一种流程图。本实施例在图4~图10所示实施例的基础上,提供了数据更新方法的另一种实现方式,主要提供了S401中接收更新信息的实现方式。如图11所示,接收更新信息,可以包括:FIG. 11 is another flowchart of a data update method provided by an embodiment of the application. On the basis of the embodiments shown in FIGS. 4 to 10, this embodiment provides another implementation manner of the data update method, and mainly provides an implementation manner of receiving update information in S401. As shown in Figure 11, receiving update information may include:
S1101、接收第一数据。S1101. Receive first data.
其中,第一数据为上述的预设比特长度的数据。Wherein, the first data is the aforementioned data with a preset bit length.
S1102、若根据第一数据的指示域的值确定第一数据关联有第二数据,则获取第二数据。其中,更新信息包括第一数据和第二数据。S1102. If it is determined according to the value of the indication field of the first data that the first data is associated with the second data, acquire the second data. Wherein, the update information includes the first data and the second data.
该种实现方式可以适用于上述第二更新模式、第三更新模式和第四更新模式。在第二更新模式、第三更新模式或者第四更新模式中,均关联有至少两种数据类型,因此,需要将所有与第一数据相关联的第二数据类型收集齐,一起作为更新信息。This implementation manner may be applicable to the above-mentioned second update mode, third update mode, and fourth update mode. In the second update mode, the third update mode, or the fourth update mode, at least two data types are associated. Therefore, all the second data types associated with the first data need to be collected together as update information.
S1103、若根据第一数据的指示域的值确定第一数据未关联有第二数据,则将第一数据确定为更新信息。S1103: If it is determined according to the value of the indication field of the first data that the first data is not associated with the second data, determine the first data as update information.
该种实现方式可以适用于上述第一更新模式。第一更新模式仅与第一数据类型相关联,因此,将接收到的第一数据确定为更新信息。This implementation manner may be applicable to the above-mentioned first update mode. The first update mode is only associated with the first data type, and therefore, the received first data is determined as update information.
需要说明的是,本实施例对第一数据的个数不做限定。例如,在图3所示示例中,第一数据的个数为n+1个。It should be noted that this embodiment does not limit the number of first data. For example, in the example shown in FIG. 3, the number of first data is n+1.
可选的,S1102中,确定第一数据关联有第二数据,可以包括:Optionally, in S1102, determining that the first data is associated with second data may include:
根据第一数据的指示域的值,确定第一数据的更新模式。According to the value of the indication field of the first data, the update mode of the first data is determined.
若第一数据的更新模式与至少两种数据类型相关联,则确定第一数据关联有第二数据。If the update mode of the first data is associated with at least two data types, it is determined that the first data is associated with the second data.
下面通过示例进行说明。The following is an example to illustrate.
可选的,在一个示例中,参见表4。假设,第一数据为第一数据类型(bmp)。根据第一数据类型(bmp)中的bit31、bit30的取值,确定为第二更新模式。由于第二更新模式与第一数据类型、第二数据类型和第三数据类型相关联,因此可以确定第一数据关联有第二数据,且第二数据为第二数据类型(MID)和第三数据类型(msk)。Optionally, in an example, see Table 4. Assume that the first data is the first data type (bmp). According to the values of bit31 and bit30 in the first data type (bmp), the second update mode is determined. Since the second update mode is associated with the first data type, the second data type, and the third data type, it can be determined that the first data is associated with the second data, and the second data is the second data type (MID) and the third data type. Data type (msk).
可选的,在另一个示例中,参见表4。假设,第一数据为第二数据类型(MID)。根据第二数据类型(MID)中的bit31、bit30的取值,确定为第二更新模式。由于第二更新模式与第一数据类型、第二数据类型和第三数据类型相关联,因此可以确定第一数据关联有第二数据,且第二数据为第一数据类型(bmp)和第三数据类型(msk)。Optionally, in another example, see Table 4. Assume that the first data is of the second data type (MID). According to the values of bit31 and bit30 in the second data type (MID), it is determined as the second update mode. Since the second update mode is associated with the first data type, the second data type, and the third data type, it can be determined that the first data is associated with the second data, and the second data is the first data type (bmp) and the third data type. Data type (msk).
可选的,在又一个示例中,参见表6。假设,第一数据为第二数据类型(MID)。根据第二数据类型(MID)中的bit31、bit30的取值,确定为第四更新模式。由于第四更新模式与第一数据类型和第二数据类型相关联,且第一数据类型对应的数据为至少两个,因此可以确定第一数据关联有第二数据,且第二数据为8个第一数据类型(bmp)。Optionally, in yet another example, see Table 6. Assume that the first data is of the second data type (MID). According to the values of bit31 and bit30 in the second data type (MID), the fourth update mode is determined. Since the fourth update mode is associated with the first data type and the second data type, and there are at least two data corresponding to the first data type, it can be determined that the first data is associated with the second data, and there are 8 second data. The first data type (bmp).
可选的,在又一个示例中,参见表6。假设,第一数据为第一数据类型(bmp)。根据第一数据类型(bmp)中的bit31、bit30的取值,确定为第四更新模式。由于第四更新模式与第一数据类型和第二数据类型相关联,且第一数据类型对应的数据为至少两个,因此可以确定第一数据关联有第二数据,且第二数据为1个第二数据类型(MID)和7个第一数据类型(bmp)。Optionally, in yet another example, see Table 6. Assume that the first data is the first data type (bmp). According to the values of bit31 and bit30 in the first data type (bmp), the fourth update mode is determined. Since the fourth update mode is associated with the first data type and the second data type, and there are at least two data corresponding to the first data type, it can be determined that the first data is associated with the second data, and the second data is one The second data type (MID) and 7 first data types (bmp).
可选的,在又一个示例中,参见表3。假设,第一数据为第一数据类型(bmp)。根据第一数据类型(bmp)中的bit31、bit30的取值,确定为第一更新模式。由于第一更新模式仅与第一数据类型相关联,因此可以确定第一数据不关联有第二数据,将接收到的n+1个第一数据类型(bmp)作为更新信息。Optionally, in yet another example, see Table 3. Assume that the first data is the first data type (bmp). According to the values of bit31 and bit30 in the first data type (bmp), it is determined as the first update mode. Since the first update mode is only associated with the first data type, it can be determined that the first data is not associated with the second data, and the received n+1 first data types (bmp) are used as update information.
图12为本申请实施例提供的数据更新装置的一种结构示意图。如图12所示,本实施例提供的数据更新装置,可以包括:FIG. 12 is a schematic structural diagram of a data update device provided by an embodiment of this application. As shown in Figure 12, the data update device provided in this embodiment may include:
接收模块1201,用于接收更新信息,所述更新信息包括模式指示信息,所述模式指示信息指示所述更新信息的更新模式以及所述更新信息包括的数据类型;The receiving module 1201 is configured to receive update information, where the update information includes mode indication information, and the mode indication information indicates an update mode of the update information and the type of data included in the update information;
第一获取模块1202,用于根据所述更新信息的更新模式,获得存储区域中的目标存储空间;其中,所述存储区域存储有路由信息;The first obtaining module 1202 is configured to obtain the target storage space in the storage area according to the update mode of the update information; wherein the storage area stores routing information;
第二获取模块1203,用于根据所述更新信息包括的数据类型,从所述更新信息中提取待更新的路由信息;The second acquisition module 1203 is configured to extract routing information to be updated from the update information according to the data type included in the update information;
处理模块1204,用于根据所述待更新的路由信息,更新所述目标存储空间中的路由信息。The processing module 1204 is configured to update the routing information in the target storage space according to the routing information to be updated.
可选的,所述更新信息包括至少一个预设比特长度的数据,所述数据包括指示域;其中,所述指示域的值与预设多种更新模式和预设多种数据类型相关,每种更新模式与预设多种数据类型中的至少一种数据类型相关联。Optionally, the update information includes at least one data with a preset bit length, and the data includes an indication field; wherein, the value of the indication field is related to preset multiple update modes and preset multiple data types. This update mode is associated with at least one of the preset multiple data types.
可选的,所述接收模块1201具体用于:Optionally, the receiving module 1201 is specifically configured to:
接收第一数据;Receive the first data;
若根据所述第一数据的指示域的值确定所述第一数据关联有第二数据,则获取所述第二数据;其中,所述更新信息包括所述第一数据和所述第二数据。If it is determined according to the value of the indication field of the first data that the first data is associated with second data, then the second data is acquired; wherein the update information includes the first data and the second data .
可选的,所述接收模块1201具体用于:Optionally, the receiving module 1201 is specifically configured to:
根据所述第一数据的指示域的值,确定所述第一数据的更新模式;Determine the update mode of the first data according to the value of the indication field of the first data;
若所述第一数据的更新模式与至少两种数据类型相关联,则确定所述第一数据关联有所述第二数据。If the update mode of the first data is associated with at least two data types, it is determined that the first data is associated with the second data.
可选的,所述接收模块1201还用于:Optionally, the receiving module 1201 is further configured to:
若根据所述第一数据的指示域的值确定所述第一数据未关联有第二数据,则将所述第一数据确定为所述更新信息。If it is determined according to the value of the indication field of the first data that the first data is not associated with the second data, the first data is determined as the update information.
可选的,所述预设多种数据类型包括:Optionally, the preset multiple data types include:
第一数据类型,用于指示所述待更新的路由信息;The first data type is used to indicate the routing information to be updated;
第二数据类型,用于指示所述待更新的路由信息对应的地址信息;The second data type is used to indicate the address information corresponding to the routing information to be updated;
第三数据类型,用于指示所述待更新的路由信息中需要更新的比特位。The third data type is used to indicate the bits that need to be updated in the routing information to be updated.
可选的,所述预设多种更新模式包括:Optionally, the preset multiple update modes include:
第一更新模式,所述第一更新模式仅与所述第一数据类型相关联;A first update mode, where the first update mode is only associated with the first data type;
第二更新模式,所述第二更新模式与所述第一数据类型、所述第二数据类型和所述第三数据类型相关联;A second update mode, where the second update mode is associated with the first data type, the second data type, and the third data type;
第三更新模式,所述第三更新模式与所述第一数据类型和所述第二数据类型相关联,且所述第一数据类型对应的数据为一个;A third update mode, where the third update mode is associated with the first data type and the second data type, and there is one data corresponding to the first data type;
第四更新模式,所述第四更新模式与所述第一数据类型和所述第二数据类型相关联,且所述第一数据类型对应的数据为至少两个。A fourth update mode, where the fourth update mode is associated with the first data type and the second data type, and there are at least two data corresponding to the first data type.
可选的,所述第一获取模块1202具体用于:Optionally, the first obtaining module 1202 is specifically configured to:
若所述更新信息的更新模式为所述第一更新模式,则将所述存储区域确定为所述目标存储空间;If the update mode of the update information is the first update mode, determine the storage area as the target storage space;
若所述更新信息的更新模式为所述第二更新模式或所述第三更新模式或所述第四更新模式,则根据所述第二数据类型对应的数据确定所述目标存储空间。If the update mode of the update information is the second update mode or the third update mode or the fourth update mode, the target storage space is determined according to the data corresponding to the second data type.
可选的,所述指示域包括第一子指示域和第二子指示域,所述第一子指示域的值与所述预设多种更新模式相关,所述第二子指示域的值与所述预设多种数据类型相关。Optionally, the indication field includes a first sub-indication field and a second sub-indication field, the value of the first sub-indication field is related to the preset multiple update modes, and the value of the second sub-indication field Related to the preset multiple data types.
可选的,所述指示域位于所述数据中所有比特位的前端。Optionally, the indication field is located at the front of all bits in the data.
本实施例提供的数据更新装置,用于执行本申请方法实施例提供的数据更新方法,技术原理和技术效果相似,此处不再赘述。The data update device provided in this embodiment is used to execute the data update method provided in the method embodiment of the present application. The technical principles and technical effects are similar, and will not be repeated here.
应理解,以上装置中模块的划分仅仅是一种逻辑功能的划分,实际实现时可以全部或部分集成到一个物理实体上,也可以物理上分开。且装置中的模块可以全部以软件通过处理元件调用的形式实现;也可以全部以硬件的形式实现;还可以部分模块以软件通过处理元件调用的形式实现,部分模块以硬件的形式实现。例如,各个模块可以为单独设立的处理元件,也可以集成在装置的某一个芯片中实现,此外,也可以以程序的形式存储于存储器中,由装置的某一个处理元件调用并执行该模块的功能。此外这些模块全部或部分可以集成在一起,也可以独立实现。这里所述的处理元件又可以成为处理器,可以是一种具有信号的处理能力的集成电路。在实现过程中,上述方法的各步骤或以上各个模块可以通过处理器元件中的硬件的集成逻辑电路实现或者以软件通过处理元件调用的形式实现。It should be understood that the division of modules in the above device is only a division of logical functions, and may be fully or partially integrated into one physical entity in actual implementation, or may be physically separated. In addition, the modules in the device may be all implemented in the form of software called by processing elements; or all may be implemented in the form of hardware; part of the modules may be implemented in the form of software called by the processing elements, and some of the modules may be implemented in the form of hardware. For example, each module can be a separately established processing element, or it can be integrated in a certain chip of the device for implementation. In addition, it can also be stored in the memory in the form of a program, which is called and executed by a certain processing element of the device. Function. In addition, all or part of these modules can be integrated together or implemented independently. The processing element described here can also become a processor, which can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules may be implemented by an integrated logic circuit of hardware in a processor element or implemented in a form of being called by software through a processing element.
在一个例子中,以上任一装置中的模块可以是被配置成实施以上方法的一个或多个集成电路,例如:一个或多个特定集成电路(Application Specific Integrated Circuit,ASIC),或,一个或多个微处理器(digital singnal processor,DSP),或,一个或者多个现场可编程门阵列(Field Programmable Gate Array,FPGA),或这些集成电路 形式中至少两种的组合。再如,当装置中的模块可以通过处理元件调度程序的形式实现时,该处理元件可以是通用处理器,例如中央处理器(Central Processing Unit,CPU)或其它可以调用程序的处理器。再如,这些模块可以集成在一起,以片上系统(system-on-a-chip,SOC)的形式实现。In an example, the modules in any of the above devices may be one or more integrated circuits configured to implement the above methods, for example: one or more application specific integrated circuits (ASICs), or, one or Multiple microprocessors (digital singnal processors, DSPs), or, one or more field programmable gate arrays (Field Programmable Gate Arrays, FPGAs), or a combination of at least two of these integrated circuits. For another example, when the module in the device can be implemented in the form of a processing element scheduler, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call programs. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).
图13为本申请实施例提供的数据更新设备的一种结构示意图。如图13所示,本实施例提供一种数据更新设备,包括处理器1301、存储器1302和接口电路1303,所述接口电路1303用于与其它设备通信,所述处理器1301用于调用所述存储器1302中存储的程序,用于执行本申请方法实施例提供的数据更新方法,技术原理和技术效果相似,此处不再赘述。FIG. 13 is a schematic structural diagram of a data update device provided by an embodiment of this application. As shown in FIG. 13, this embodiment provides a data update device, including a processor 1301, a memory 1302, and an interface circuit 1303. The interface circuit 1303 is used to communicate with other devices, and the processor 1301 is used to call the The program stored in the memory 1302 is used to execute the data update method provided by the method embodiment of the present application. The technical principles and technical effects are similar, and will not be repeated here.
需要说明的是,本实施例对数据更新设备的类型不做限定。例如,该设备可以包括但不限于路由器、交换机,等。It should be noted that this embodiment does not limit the type of the data update device. For example, the device may include, but is not limited to, routers, switches, and so on.
可选的,上述处理器可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请提供的数据更新方法中的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。Optionally, the foregoing processor may be a central processing unit (Central Processing Unit, CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), and application specific integrated circuits (ASICs). )Wait. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor or the like. The steps in the data update method provided in conjunction with this application can be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
可选的,存储器可以是一个存储器,也可以是多个存储元件的统称。Optionally, the memory may be one memory or a collective term for multiple storage elements.

Claims (22)

  1. 一种数据更新方法,其特征在于,包括:A data update method is characterized in that it includes:
    接收更新信息,所述更新信息包括模式指示信息,所述模式指示信息指示所述更新信息的更新模式以及所述更新信息包括的数据类型;Receiving update information, the update information including mode indication information, the mode indication information indicating an update mode of the update information and the type of data included in the update information;
    根据所述更新信息的更新模式,获得存储区域中的目标存储空间;其中,所述存储区域存储有路由信息;Obtaining the target storage space in the storage area according to the update mode of the update information; wherein the storage area stores routing information;
    根据所述更新信息包括的数据类型,从所述更新信息中提取待更新的路由信息;Extract routing information to be updated from the update information according to the data type included in the update information;
    根据所述待更新的路由信息,更新所述目标存储空间中的路由信息。According to the routing information to be updated, the routing information in the target storage space is updated.
  2. 根据权利要求1所述的方法,其特征在于,所述更新信息包括至少一个预设比特长度的数据,所述数据包括指示域;其中,所述指示域的值与预设多种更新模式和预设多种数据类型相关,每种更新模式与预设多种数据类型中的至少一种数据类型相关联。The method according to claim 1, wherein the update information includes at least one data with a preset bit length, and the data includes an indication field; wherein the value of the indication field corresponds to a preset multiple update mode and The preset multiple data types are related, and each update mode is associated with at least one data type of the preset multiple data types.
  3. 根据权利要求2所述的方法,其特征在于,所述接收更新信息,包括:The method according to claim 2, wherein the receiving update information comprises:
    接收第一数据;Receive the first data;
    若根据所述第一数据的指示域的值确定所述第一数据关联有第二数据,则获取所述第二数据;其中,所述更新信息包括所述第一数据和所述第二数据。If it is determined according to the value of the indication field of the first data that the first data is associated with second data, then the second data is acquired; wherein the update information includes the first data and the second data .
  4. 根据权利要求3所述的方法,其特征在于,所述确定所述第一数据关联有第二数据,包括:The method according to claim 3, wherein the determining that the first data is associated with second data comprises:
    根据所述第一数据的指示域的值,确定所述第一数据的更新模式;Determine the update mode of the first data according to the value of the indication field of the first data;
    若所述第一数据的更新模式与至少两种数据类型相关联,则确定所述第一数据关联有所述第二数据。If the update mode of the first data is associated with at least two data types, it is determined that the first data is associated with the second data.
  5. 根据权利要求3所述的方法,其特征在于,还包括:The method according to claim 3, further comprising:
    若根据所述第一数据的指示域的值确定所述第一数据未关联有第二数据,则将所述第一数据确定为所述更新信息。If it is determined according to the value of the indication field of the first data that the first data is not associated with the second data, the first data is determined as the update information.
  6. 根据权利要求2-5任一项所述的方法,其特征在于,所述预设多种数据类型包括:The method according to any one of claims 2-5, wherein the preset multiple data types include:
    第一数据类型,用于指示所述待更新的路由信息;The first data type is used to indicate the routing information to be updated;
    第二数据类型,用于指示所述待更新的路由信息对应的地址信息;The second data type is used to indicate the address information corresponding to the routing information to be updated;
    第三数据类型,用于指示所述待更新的路由信息中需要更新的比特位。The third data type is used to indicate the bits that need to be updated in the routing information to be updated.
  7. 根据权利要求6所述的方法,其特征在于,所述预设多种更新模式包括:The method according to claim 6, wherein the preset multiple update modes include:
    第一更新模式,所述第一更新模式仅与所述第一数据类型相关联;A first update mode, where the first update mode is only associated with the first data type;
    第二更新模式,所述第二更新模式与所述第一数据类型、所述第二数据类型和所述第三数据类型相关联;A second update mode, where the second update mode is associated with the first data type, the second data type, and the third data type;
    第三更新模式,所述第三更新模式与所述第一数据类型和所述第二数据类型相关联,且所述第一数据类型对应的数据为一个;A third update mode, where the third update mode is associated with the first data type and the second data type, and there is one data corresponding to the first data type;
    第四更新模式,所述第四更新模式与所述第一数据类型和所述第二数据类型相关联,且所述第一数据类型对应的数据为至少两个。A fourth update mode, where the fourth update mode is associated with the first data type and the second data type, and there are at least two data corresponding to the first data type.
  8. 根据权利要求7所述的方法,其特征在于,所述根据所述更新信息的更新模式, 获得存储区域中的目标存储空间,包括:The method according to claim 7, wherein the obtaining the target storage space in the storage area according to the update mode of the update information comprises:
    若所述更新信息的更新模式为所述第一更新模式,则将所述存储区域确定为所述目标存储空间;If the update mode of the update information is the first update mode, determine the storage area as the target storage space;
    若所述更新信息的更新模式为所述第二更新模式或所述第三更新模式或所述第四更新模式,则根据所述第二数据类型对应的数据确定所述目标存储空间。If the update mode of the update information is the second update mode or the third update mode or the fourth update mode, the target storage space is determined according to the data corresponding to the second data type.
  9. 根据权利要求2-5任一项所述的方法,其特征在于,所述指示域包括第一子指示域和第二子指示域,所述第一子指示域的值与所述预设多种更新模式相关,所述第二子指示域的值与所述预设多种数据类型相关。The method according to any one of claims 2-5, wherein the indication field comprises a first sub-indication field and a second sub-indication field, and the value of the first sub-indication field is greater than the preset value. The update mode is related, and the value of the second sub-indication field is related to the preset multiple data types.
  10. 根据权利要求2-5任一项所述的方法,其特征在于,所述指示域位于所述数据中所有比特位的前端。The method according to any one of claims 2-5, wherein the indication field is located at the front end of all bits in the data.
  11. 一种数据更新装置,其特征在于,包括:A data update device, characterized in that it comprises:
    接收模块,用于接收更新信息,所述更新信息包括模式指示信息,所述模式指示信息指示所述更新信息的更新模式以及所述更新信息包括的数据类型;A receiving module, configured to receive update information, where the update information includes mode indication information, and the mode indication information indicates an update mode of the update information and the type of data included in the update information;
    第一获取模块,用于根据所述更新信息的更新模式,获得存储区域中的目标存储空间;其中,所述存储区域存储有路由信息;The first obtaining module is configured to obtain the target storage space in the storage area according to the update mode of the update information; wherein the storage area stores routing information;
    第二获取模块,用于根据所述更新信息包括的数据类型,从所述更新信息中提取待更新的路由信息;The second acquisition module is configured to extract routing information to be updated from the update information according to the data type included in the update information;
    处理模块,用于根据所述待更新的路由信息,更新所述目标存储空间中的路由信息。The processing module is configured to update the routing information in the target storage space according to the routing information to be updated.
  12. 根据权利要求11所述的装置,其特征在于,所述更新信息包括至少一个预设比特长度的数据,所述数据包括指示域;其中,所述指示域的值与预设多种更新模式和预设多种数据类型相关,每种更新模式与预设多种数据类型中的至少一种数据类型相关联。The device according to claim 11, wherein the update information includes at least one data with a preset bit length, and the data includes an indication field; wherein the value of the indication field is in accordance with preset multiple update modes and The preset multiple data types are related, and each update mode is associated with at least one data type of the preset multiple data types.
  13. 根据权利要求12所述的装置,其特征在于,所述接收模块具体用于:The device according to claim 12, wherein the receiving module is specifically configured to:
    接收第一数据;Receive the first data;
    若根据所述第一数据的指示域的值确定所述第一数据关联有第二数据,则获取所述第二数据;其中,所述更新信息包括所述第一数据和所述第二数据。If it is determined according to the value of the indication field of the first data that the first data is associated with second data, then the second data is acquired; wherein the update information includes the first data and the second data .
  14. 根据权利要求13所述的装置,其特征在于,所述接收模块具体用于:The device according to claim 13, wherein the receiving module is specifically configured to:
    根据所述第一数据的指示域的值,确定所述第一数据的更新模式;Determine the update mode of the first data according to the value of the indication field of the first data;
    若所述第一数据的更新模式与至少两种数据类型相关联,则确定所述第一数据关联有所述第二数据。If the update mode of the first data is associated with at least two data types, it is determined that the first data is associated with the second data.
  15. 根据权利要求13所述的装置,其特征在于,所述接收模块还用于:The device according to claim 13, wherein the receiving module is further configured to:
    若根据所述第一数据的指示域的值确定所述第一数据未关联有第二数据,则将所述第一数据确定为所述更新信息。If it is determined according to the value of the indication field of the first data that the first data is not associated with the second data, the first data is determined as the update information.
  16. 根据权利要求12-15任一项所述的装置,其特征在于,所述预设多种数据类型包括:The device according to any one of claims 12-15, wherein the preset multiple data types include:
    第一数据类型,用于指示所述待更新的路由信息;The first data type is used to indicate the routing information to be updated;
    第二数据类型,用于指示所述待更新的路由信息对应的地址信息;The second data type is used to indicate the address information corresponding to the routing information to be updated;
    第三数据类型,用于指示所述待更新的路由信息中需要更新的比特位。The third data type is used to indicate the bits that need to be updated in the routing information to be updated.
  17. 根据权利要求16所述的装置,其特征在于,所述预设多种更新模式包括:The device according to claim 16, wherein the preset multiple update modes include:
    第一更新模式,所述第一更新模式仅与所述第一数据类型相关联;A first update mode, where the first update mode is only associated with the first data type;
    第二更新模式,所述第二更新模式与所述第一数据类型、所述第二数据类型和所述第三数据类型相关联;A second update mode, the second update mode being associated with the first data type, the second data type, and the third data type;
    第三更新模式,所述第三更新模式与所述第一数据类型和所述第二数据类型相关联,且所述第一数据类型对应的数据为一个;A third update mode, where the third update mode is associated with the first data type and the second data type, and there is one data corresponding to the first data type;
    第四更新模式,所述第四更新模式与所述第一数据类型和所述第二数据类型相关联,且所述第一数据类型对应的数据为至少两个。A fourth update mode, where the fourth update mode is associated with the first data type and the second data type, and there are at least two data corresponding to the first data type.
  18. 根据权利要求17所述的装置,其特征在于,所述第一获取模块具体用于:The device according to claim 17, wherein the first obtaining module is specifically configured to:
    若所述更新信息的更新模式为所述第一更新模式,则将所述存储区域确定为所述目标存储空间;If the update mode of the update information is the first update mode, determine the storage area as the target storage space;
    若所述更新信息的更新模式为所述第二更新模式或所述第三更新模式或所述第四更新模式,则根据所述第二数据类型对应的数据确定所述目标存储空间。If the update mode of the update information is the second update mode or the third update mode or the fourth update mode, the target storage space is determined according to the data corresponding to the second data type.
  19. 根据权利要求12-15任一项所述的装置,其特征在于,所述指示域包括第一子指示域和第二子指示域,所述第一子指示域的值与所述预设多种更新模式相关,所述第二子指示域的值与所述预设多种数据类型相关。The device according to any one of claims 12-15, wherein the indication field comprises a first sub-indication field and a second sub-indication field, and the value of the first sub-indication field is greater than the preset value. The update mode is related, and the value of the second sub-indication field is related to the preset multiple data types.
  20. 根据权利要求12-15任一项所述的装置,其特征在于,所述指示域位于所述数据中所有比特位的前端。The device according to any one of claims 12-15, wherein the indication field is located at the front end of all bits in the data.
  21. 一种数据更新设备,其特征在于,包括处理器、存储器和接口电路,所述接口电路用于与其它设备通信,所述处理器用于调用所述存储器中存储的程序,以执行如权利要求1至10任一项所述的方法。A data update device, characterized by comprising a processor, a memory, and an interface circuit, the interface circuit is used to communicate with other devices, and the processor is used to call a program stored in the memory to execute as claimed in claim 1. To the method of any one of 10.
  22. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当所述指令在计算机或处理器上运行时,实现如权利要求1至10任一项所述的方法。A computer-readable storage medium, characterized in that instructions are stored in the computer-readable storage medium, and when the instructions are run on a computer or a processor, the instructions described in any one of claims 1 to 10 are implemented. method.
PCT/CN2020/079011 2020-03-12 2020-03-12 Data update method, apparatus and device WO2021179254A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080095654.0A CN115087958B (en) 2020-03-12 2020-03-12 Data updating method, device and equipment
PCT/CN2020/079011 WO2021179254A1 (en) 2020-03-12 2020-03-12 Data update method, apparatus and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/079011 WO2021179254A1 (en) 2020-03-12 2020-03-12 Data update method, apparatus and device

Publications (1)

Publication Number Publication Date
WO2021179254A1 true WO2021179254A1 (en) 2021-09-16

Family

ID=77671150

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/079011 WO2021179254A1 (en) 2020-03-12 2020-03-12 Data update method, apparatus and device

Country Status (2)

Country Link
CN (1) CN115087958B (en)
WO (1) WO2021179254A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005079691A (en) * 2003-08-28 2005-03-24 Nippon Telegraph & Telephone East Corp Automatic discrimation setting apparatus of router and method, and program
CN1809809A (en) * 2003-06-20 2006-07-26 索尼株式会社 Software update system, software providing device, software processing device, and software update method
CN103902331A (en) * 2012-12-27 2014-07-02 株式会社理光 Information processing apparatus and information processing method
CN106610859A (en) * 2016-12-30 2017-05-03 珠海艾派克微电子有限公司 Program update method, device and system, and imaging box
CN108322341A (en) * 2018-01-30 2018-07-24 上海康斐信息技术有限公司 A kind of method and system in update router configuration data library

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102665196B (en) * 2012-04-28 2014-11-05 清华大学 On-line progressive program updating method for wireless sensor network
US9986434B2 (en) * 2014-04-30 2018-05-29 Avago Technologies General Ip (Singapore) Pte. Ltd. System for accelerated network route update through exclusive access to routing tables
CN106982236B (en) * 2016-01-18 2020-07-28 阿里巴巴集团控股有限公司 Information processing method, device and system
CN106802932B (en) * 2016-12-28 2021-06-22 华为技术有限公司 Routing method and device of database and database system
CN107547364B (en) * 2017-08-15 2021-08-06 新华三技术有限公司 Route issuing method, device and network equipment
CN113660161A (en) * 2018-08-30 2021-11-16 华为技术有限公司 Communication method and communication device
CN109617820B (en) * 2019-02-15 2021-05-11 中国联合网络通信集团有限公司 SDN system and route updating method
CN110166523B (en) * 2019-04-09 2022-12-27 腾讯科技(深圳)有限公司 Content updating method, device, equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1809809A (en) * 2003-06-20 2006-07-26 索尼株式会社 Software update system, software providing device, software processing device, and software update method
JP2005079691A (en) * 2003-08-28 2005-03-24 Nippon Telegraph & Telephone East Corp Automatic discrimation setting apparatus of router and method, and program
CN103902331A (en) * 2012-12-27 2014-07-02 株式会社理光 Information processing apparatus and information processing method
CN106610859A (en) * 2016-12-30 2017-05-03 珠海艾派克微电子有限公司 Program update method, device and system, and imaging box
CN108322341A (en) * 2018-01-30 2018-07-24 上海康斐信息技术有限公司 A kind of method and system in update router configuration data library

Also Published As

Publication number Publication date
CN115087958A (en) 2022-09-20
CN115087958B (en) 2024-01-16

Similar Documents

Publication Publication Date Title
US8521962B2 (en) Managing counter saturation in a filter
US9830264B2 (en) Cache memory system and operating method for the same
EP3304321B1 (en) Providing memory management unit (mmu) partitioned translation caches, and related apparatuses, methods, and computer-readable media
US10079916B2 (en) Register files for I/O packet compression
CN112540938A (en) Processor core, processor, apparatus and method
WO2019192379A1 (en) Mac pdu transmission method and apparatus
US10217400B2 (en) Display control apparatus and method of configuring an interface bandwidth for image data flow
WO2021179254A1 (en) Data update method, apparatus and device
US9697118B1 (en) Memory controller with interleaving and arbitration scheme
US9026774B2 (en) IC with boot transaction translation and related methods
US8521968B2 (en) Memory controller and methods
WO2024001310A1 (en) Data processing device and method
US20120131279A1 (en) Memory elements for performing an allocation operation and related methods
US11275683B2 (en) Method, apparatus, device and computer-readable storage medium for storage management
US9886380B2 (en) Method and device of memory space management
US20180081818A1 (en) Method and apparatus for masking and transmitting data
US10210083B1 (en) Address remapping for efficient use of distributed memory
US11557091B2 (en) Tessellation data processing method, system, medium and vector graphics processing device
US20230126011A1 (en) Computer system for processing pixel data of an image
US20240056448A1 (en) Translation Circuitry for Access Control Identifier Mechanisms
EP4277435A1 (en) Communication method and communication device
CN117075966A (en) Instruction processing method, device, equipment and readable storage medium
CN116185910A (en) Method, device and medium for accessing device memory and managing device memory
CN116012214A (en) Computer system for processing pixel data from an image
CN112306918A (en) Data access method and device, electronic equipment and computer storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20924315

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20924315

Country of ref document: EP

Kind code of ref document: A1