A method and device for updating a bridge status display list

By obtaining the preset bridge support sequence list and target byte array, only the binding status of the target bridge is updated, the problem of low update efficiency of bridge binding status display list in the existing technology is solved, and efficient bridges are realized Status update synchronously.

CN116248534BActive Publication Date: 2024-12-03GUANGZHOU TOZED KANGWEI INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202310007121.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-04
Publication Date
2024-12-03
Estimated Expiration
2043-01-04

AI Technical Summary

Technical Problem

In the prior art, the display list update efficiency of the bridge binding status is low, and it is necessary to traverse all routes to determine whether the bridge is bound, resulting in low update efficiency.

Method used

When detecting the change in the bridge binding status of the target device, obtain the preset bridge support sequence list and target byte array, update the corresponding element value in the target byte array according to the bridge number, and only change the binding of the target bridge status, thus updating the bridge status display list.

Benefits of technology

Improve the update efficiency of the bridge binding status display list, avoiding the need to traverse all routes to update the binding status, and realize synchronous update of the bridge status.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116248534B_ABST
    Figure CN116248534B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for updating a bridge status display list, the method comprising: when detecting that the binding state of a target bridge corresponding to a target device has changed, obtaining a preset bridge support sequence list corresponding to the target device and obtaining the number of the target bridge; obtaining a target byte array corresponding to the target device; determining the element value corresponding to the target bridge in the target byte array according to the number of the target bridge, and generating an updated target byte array after changing the corresponding element value; and updating the bridge status display list corresponding to the target device according to the updated target byte array. The present invention changes the binding state of the bridge by changing the value of the target byte array corresponding to the target device, and updates the bridge status display list by traversing the updated target byte array without re-traversing the routing data, thereby improving the efficiency of updating the display list of the bridge binding state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of CPE network bridge data processing, and in particular to a method and device for updating a network bridge status display list. Background Art

[0002] Regarding the display of bridge binding data in the CPE device, the solution adopted in the prior art is to list all the bridge names supported in the CPE device and display them on the CPE device management interface, and then loop through the data of the bound bridges of all other routes and display the binding data of all bridges. However, when the state of a bridge changes and the display list of the bridge binding data needs to be updated at the same time, the solution adopted in the prior art still needs to traverse all routes to determine whether the bridge is bound, thereby changing the binding state of the bridge and displaying it, which makes the update efficiency of the display list of the bridge binding state low. Summary of the invention

[0003] The embodiment of the present invention provides a method and device for updating a display list of a network bridge status, which can effectively solve the problem of low updating efficiency of a display list of a network bridge binding status in the prior art.

[0004] An embodiment of the present invention provides a method for updating a bridge status display list, comprising:

[0005] When it is detected that the binding state of the target bridge corresponding to the target device changes, the preset bridge support sequence table corresponding to the target device is obtained, and the number of the target bridge is obtained according to the preset bridge support sequence table; wherein the preset bridge support sequence table includes a plurality of bridges and the number corresponding to each bridge;

[0006] Obtaining a target byte array corresponding to the target device; wherein the target byte array includes a plurality of element values, each element value is composed of a plurality of bits, and the bit value of each bit is used to indicate a binding state of a bridge;

[0007] Determine the element value corresponding to the target bridge in the target byte array according to the serial number of the target bridge, change the corresponding element value to achieve the change of only the bit value corresponding to the target bridge, and generate an updated target byte array;

[0008] The network bridge status display list corresponding to the target device is updated according to the updated target byte array; wherein the network bridge status display list is used to display the binding status of each network bridge.

[0009] Preferably, the method for generating the target byte array corresponding to the target device specifically includes:

[0010] Obtaining the total number of bridges according to the preset bridge support sequence table, and generating a first initial byte array corresponding to the target device according to the total number of bridges;

[0011] Acquire a data packet sent by a route corresponding to a target device, and obtain a binding state of each bridge according to the data packet; the binding state includes: bound and unbound;

[0012] The bit value corresponding to each bridge in the first initial byte array is updated according to the binding state of each bridge to generate a target byte array.

[0013] Preferably, generating a first initial byte array corresponding to the target device according to the total number of bridges specifically includes:

[0014] The total number of element values ​​in the first initial byte array is calculated according to the following formula:

[0015]

[0016] Wherein, Len is the total number of element values ​​in the array, N is the total number of bridges, and m is the number of bits contained in each element value of the first initial byte array;

[0017] The value of each element of the first initial byte array is set to 0 to generate the first initial byte array.

[0018] Preferably, determining the element value corresponding to the target bridge in the target byte array according to the number of the target bridge, changing the corresponding element value to achieve the change of only the bit value corresponding to the target bridge, and generating an updated target byte array, specifically includes:

[0019] When it is detected that the binding state of the target bridge corresponding to the target device is changed from unbound to bound, the array index corresponding to the target bridge in the target byte array is calculated according to the following formula:

[0020]

[0021] Where a is the array subscript, n is the number of the target bridge, and s is the number of bits contained in each element value of the target byte array;

[0022] The position number of the target bit corresponding to the target bridge is calculated according to the following formula:

[0023] b = n%s;

[0024] Where b is the position number of the target bit, n is the number of the target bridge, and s is the number of bits contained in each element value of the target byte array;

[0025] Performing a modulo operation on the position number of the target bit to obtain a first shift bit number;

[0026] Obtain a first original element value having the same number of bits as the element value of the target byte array and a value of 1, and left-shift the bits having a value of 1 in the first original element value according to the first shift bit number to obtain a first reference element value;

[0027] Performing a bitwise OR operation on the first reference element value and the element value corresponding to the target bridge in the target byte array to obtain a second reference element value;

[0028] The second reference element value replaces the element value corresponding to the target bridge in the target byte array to generate an updated target byte array.

[0029] Preferably, determining the element value corresponding to the target bridge in the target byte array according to the number of the target bridge, changing the corresponding element value to achieve the change of only the bit value corresponding to the target bridge, and generating an updated target byte array, specifically includes:

[0030] When it is detected that the binding state of the target bridge corresponding to the target device is changed from bound to unbound, the array index corresponding to the target bridge in the target byte array is calculated according to the following formula:

[0031]

[0032] Where c is the array subscript, k is the number of the target bridge, and g is the number of bits contained in each element value of the target byte array;

[0033] The position number of the target bit corresponding to the target bridge is calculated according to the following formula:

[0034] d = k% g;

[0035] Where d is the position number of the target bit, k is the number of the target bridge, and g is the number of bits contained in each element value of the target byte array;

[0036] Performing a modulo operation on the position number of the target bit to obtain a second shift bit number;

[0037] Obtain a second original element value having the same number of bits as the element value of the target byte array and a value of 1, and right-shift the bits having a value of 1 in the second original element value according to the second shift bit number to obtain a third reference element value;

[0038] Performing a bitwise inversion operation on the third reference element value to obtain a fourth reference element value;

[0039] Performing a bitwise AND operation on the fourth reference element value and the element value corresponding to the target bridge in the target byte array to obtain a fifth reference element value;

[0040] The fifth reference element value is used to replace the corresponding element value of the target bridge in the target byte array to generate an updated target byte array.

[0041] Preferably, it also includes:

[0042] Obtaining a bridge status query request; wherein the bridge status query request includes a bridge to be queried;

[0043] Obtaining the serial number of the bridge to be queried according to the preset bridge support sequence table corresponding to the target device;

[0044] Obtaining a target byte array corresponding to the target device, and determining the array subscript corresponding to the bridge to be queried in the target byte array and the position number of the target bit to be queried according to the serial number of the bridge to be queried;

[0045] Performing a modulo operation on the position number of the target bit to be queried to obtain a third shift bit number;

[0046] Obtain a third original element value having the same number of bits as the element value of the target byte array and a value of 1, and right-shift the bits having a value of 1 in the third original element value according to the third shift bit number to obtain a sixth reference element value;

[0047] Performing a bitwise AND operation on the sixth reference element value and the element value corresponding to the target bridge in the target byte array to obtain a seventh reference element value;

[0048] It is determined whether the bit value corresponding to the position number of the target bit to be queried in the seventh reference element value is 1, if it is 1, the state of the bridge to be queried is determined to be bound, if not 1, the state of the bridge to be queried is determined to be unbound.

[0049] Preferably, it also includes:

[0050] Obtaining a bridge adding request; wherein the bridge adding request includes a bridge to be added;

[0051] Adding the to-be-added bridge to the preset bridge support sequence list corresponding to the target device to generate an updated preset bridge support sequence list;

[0052] Obtaining the updated total number of bridges and the number of the bridge to be added according to the updated preset bridge support sequence list;

[0053] The total number of element values ​​required in the target byte array after adding a bridge is calculated according to the following formula:

[0054]

[0055] Where L is the total number of required element values, R is the total number of updated bridges, and x is the number of bits contained in each element value of the target byte array;

[0056] Determine whether the total number of the required element values ​​is consistent with the total number of element values ​​in the first initial byte array. If they are consistent, the target byte array is not updated. If they are inconsistent, the number of element values ​​in the target byte array is changed to the total number of required element values, and the newly added element value in the target byte array is set to 0, so as to generate a target byte array after adding a bridge.

[0057] The network bridge status display list corresponding to the target device is updated according to the target byte array after a network bridge is added.

[0058] Preferably, it also includes:

[0059] Obtaining a bridge deletion request; wherein the bridge deletion request includes a bridge to be deleted;

[0060] Deleting the to-be-deleted bridge from the preset bridge support sequence list corresponding to the target device, and generating a deleted preset bridge support sequence list;

[0061] Obtaining the total number of deleted bridges according to the deleted preset bridge support sequence list, and generating a second initial byte array corresponding to the target device according to the total number of deleted bridges;

[0062] updating the element value corresponding to each bridge in the second initial byte array according to the binding state of each bridge, and generating a target byte array after deleting a bridge;

[0063] The bridge status display list corresponding to the target device is updated according to the target byte array after deleting a bridge.

[0064] Based on the above method embodiments, the present invention provides corresponding device embodiments.

[0065] An embodiment of the present invention provides a device for updating a bridge status display list, comprising: a target bridge number acquisition module, a target byte array acquisition module, a target byte array update module and a display list update module;

[0066] The target bridge number acquisition module is used to acquire the preset bridge support sequence table corresponding to the target device when detecting that the binding state of the target bridge corresponding to the target device has changed, and obtain the number of the target bridge according to the preset bridge support sequence table; wherein the preset bridge support sequence table includes a plurality of bridges and the number corresponding to each bridge;

[0067] The target byte array acquisition module is used to acquire the target byte array corresponding to the target device; wherein the target byte array includes a plurality of element values, each element value is composed of a plurality of bit values, and each bit value is used to indicate the binding state of a bridge;

[0068] The target byte array update module is used to determine the element value corresponding to the target bridge in the target byte array according to the serial number of the target bridge, and change the corresponding element value to achieve the change of only the bit value corresponding to the target bridge, thereby generating an updated target byte array;

[0069] The display list updating module is used to update the bridge status display list corresponding to the target device according to the updated target byte array; wherein the bridge status display list is used to display the binding status of each bridge.

[0070] The following beneficial effects are achieved by implementing the present invention:

[0071] The embodiment of the present invention provides a method and device for updating a bridge status display list. The method for updating the bridge status display list detects whether the binding status of a target bridge corresponding to a target device changes. If a change occurs, a preset bridge support sequence table corresponding to the target device is obtained to obtain the number of the target bridge, wherein the preset bridge support sequence table includes a plurality of bridges and a number corresponding to each bridge; a target byte array corresponding to the target device is obtained, because the target byte array includes a plurality of element values, each element value is composed of a plurality of bit values, and each bit value is used to indicate the binding status of a bridge, then the element value corresponding to the target bridge in the target byte array is determined according to the number of the target bridge, and the corresponding element value is changed to achieve a change only to the bit value corresponding to the target bridge, and an updated target byte array is generated, that is, the binding status of the target bridge is changed, and the bridge status display list corresponding to the target device is updated according to the updated target byte array, so that when the binding status of the target bridge corresponding to the target device changes, the bridge status display lists of each target bridge corresponding to the target device are also updated synchronously. Compared with the prior art, the embodiment of the present invention stores the binding state of the bridge based on the bit value of each bit in each element value in the target byte array, so that when it is detected that the binding state of the target bridge corresponding to the target device has changed, the element value corresponding to the target bridge in the target byte array is determined according to the number of the target bridge, the corresponding element value is changed, and an updated target byte array is generated, so that the bridge state display list corresponding to the target device is updated by traversing the updated target byte array. The embodiment of the present invention realizes changing the binding state of the bridge by changing the value of the target byte array corresponding to the target device, and updating the bridge state display list by traversing the updated target byte array, without traversing all routes to obtain the binding state of the bridge to update the display data, thereby improving the efficiency of updating the display list of the bridge binding state. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] Figure 1 The present invention is a flowchart of a method for updating a bridge status display list provided in accordance with an embodiment of the present invention.

[0073] Figure 2 It is a structural diagram of a device for updating a bridge status display list provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0074] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0075] like Figure 1 FIG. 1 is a flow chart of a method for updating a bridge status display list provided by an embodiment of the present invention.

[0076] An embodiment of the present invention provides a method for updating a bridge status display list, comprising:

[0077] Step S1: when it is detected that the binding state of the target bridge corresponding to the target device changes, the preset bridge support sequence table corresponding to the target device is obtained, and the number of the target bridge is obtained according to the preset bridge support sequence table; wherein the preset bridge support sequence table includes a plurality of bridges and the number corresponding to each bridge;

[0078] Step S2: obtaining a target byte array corresponding to the target device; wherein the target byte array includes a plurality of element values, each element value is composed of a plurality of bits, and the bit value of each bit is used to indicate a binding state of a bridge;

[0079] Step S3: determining the element value corresponding to the target bridge in the target byte array according to the serial number of the target bridge, changing the corresponding element value to achieve the change of only the bit value corresponding to the target bridge, and generating an updated target byte array;

[0080] Step S4: updating the bridge status display list corresponding to the target device according to the updated target byte array; wherein the bridge status display list is used to display the binding status of each bridge.

[0081] For step S1, in a preferred embodiment, when it is detected that the binding state of the target bridge corresponding to the target device changes; wherein the binding state changes include: changing from unbound to bound or from bound to unbound.

[0082] Obtain a preset bridge support sequence list corresponding to the target device, and obtain the number of the target bridge according to the preset bridge support sequence list; wherein the preset bridge support sequence list includes a number of bridges and the number corresponding to each bridge; specifically, the preset bridge support sequence list corresponding to the target device includes the bridges supported by the target device, and each device has a corresponding preset bridge support sequence list.

[0083] It should be noted that the preset bridge support sequence list corresponding to each device is generated by the bridge support capability data uploaded by each device, that is, each device sorts the supported bridges in sequence to generate the corresponding preset bridge support sequence list and numbers each bridge.

[0084] For step S2, in a preferred embodiment, the target byte array includes several element values, each element value is composed of several bits, and the bit value of each bit is used to indicate the binding state of a bridge; specifically, the bit value of each bit is 1 or 0, when the bit value is 1, it indicates that the corresponding bridge state is bound, and when the bit value is 0, it indicates that the corresponding bridge state is unbound. Using one bit to store and represent the state of a bridge can save space occupied by data storage and transmission.

[0085] In a preferred embodiment, a method for generating a target byte array corresponding to a target device specifically includes:

[0086] Obtaining the total number of bridges according to the preset bridge support sequence table, and generating a first initial byte array corresponding to the target device according to the total number of bridges, specifically includes:

[0087] The total number of element values ​​in the first initial byte array is calculated according to the following formula:

[0088]

[0089] Wherein, Len is the total number of element values ​​in the array, N is the total number of bridges, and m is the number of bits contained in each element value of the first initial byte array;

[0090] In a preferred embodiment, m=8, that is, one byte is equal to 8 bits, and one element value stores the binding status corresponding to 8 bridges; specifically, when the total number of bridges N is 12, The calculation formula can be obtained that the total number of element values ​​in the first initial byte array is:

[0091]

[0092] Therefore, it can be concluded that when the total number of bridges N is 12, the total number of element values ​​in the corresponding first initial byte array should be 2.

[0093] Setting each element value of the first initial byte array to 0 to generate the first initial byte array;

[0094] Obtaining a data packet sent by a route corresponding to a target device, and obtaining a binding state of each bridge according to the data packet; wherein the data packet includes a plurality of bridges and a binding state corresponding to each bridge, and the binding state includes: bound and unbound;

[0095] The bit value corresponding to each bridge in the first initial byte array is updated according to the binding status of each bridge to generate a target byte array; specifically, when the bit value in each element value of the target byte array is 1, it represents that the binding status of the corresponding bridge is bound, and when the bit value in each element value of the target byte array is 0, it represents that the binding status of the corresponding bridge is unbound, then the binding status of each bridge can be obtained according to the generated target array.

[0096] In the embodiment of the present invention, after obtaining the total number of bridges through the preset bridge support sequence table corresponding to the target device, the length of the first initial byte array can be known according to the total number of bridges to generate the corresponding first initial byte array, and the binding status of each bridge can be known by obtaining the data packet sent by the router, and the first initial byte array is updated according to the binding status of each bridge, that is, the initial element value is changed to generate an updated target byte array; then, the binding status of the corresponding bridge can be changed by changing the target byte array, thereby updating the bridge status display and improving the update rate.

[0097] For step S3, in a preferred embodiment, determining the element value corresponding to the target bridge in the target byte array according to the number of the target bridge, changing the corresponding element value to achieve the change of only the bit value corresponding to the target bridge, and generating an updated target byte array, specifically includes:

[0098] When it is detected that the binding state of the target bridge corresponding to the target device is changed from unbound to bound, the array index corresponding to the target bridge in the target byte array is calculated according to the following formula:

[0099]

[0100] Where a is the array subscript, n is the number of the target bridge, and s is the number of bits contained in each element value of the target byte array;

[0101] The position number of the target bit corresponding to the target bridge is calculated according to the following formula:

[0102] b = n%s;

[0103] Where b is the position number of the target bit, n is the number of the target bridge, and s is the number of bits contained in each element value of the target byte array;

[0104] Performing a modulo operation on the position number of the target bit to obtain a first shift bit number;

[0105] Obtain a first original element value having the same number of bits as the element value of the target byte array and a value of 1, wherein the first original element is: an element having a value of 1, and the bits having a value of 1 in the first original element value are left-shifted according to the first shift bit number to obtain a first reference element value;

[0106] Performing a bitwise OR operation on the first reference element value and the element value corresponding to the target bridge in the target byte array to obtain a second reference element value;

[0107] The second reference element value replaces the element value corresponding to the target bridge in the target byte array to generate an updated target byte array.

[0108] Specifically, in a preferred embodiment, when it is detected that the binding state of the target bridge corresponding to the target device is changed from unbound to bound, and the target bridge corresponding to the target device is the 7th bridge, the array index corresponding to the target bridge in the target byte array is calculated according to the following formula:

[0109]

[0110] Then the array index corresponding to the target bridge No. 7 in the target byte array is 0, and byte[0] is the element value corresponding to the bridge No. 7 in the target byte array, byte[0] = 31;

[0111] The position number of the target bit corresponding to the target bridge is calculated according to the following formula:

[0112] b = 7% s = 7% 8 = 7;

[0113] The target bit position number of the target bridge No. 7 is 7. When the binding state of the bridge No. 7 needs to be changed from unbound to bound, the bit value of the target bit position number 7 of the byte[0] element value needs to be changed to 1.

[0114] Further, as shown in the following table:

[0115]

[0116] Performing a modulo operation on the position number 7 of the target bit and obtaining a first shift bit number of 7;

[0117] Get a first original element value that has the same number of bits as the element value of the target byte array and whose value is 1, that is, shift the value 1 (binary number is 00000001) left by 7 bits to obtain a first reference element value, wherein the first reference element value is 128 (binary number is 10000000);

[0118] Performing a bitwise OR operation on the first reference element value 128 (binary number is 10000000) and the element value 31 (binary number is 00011111) corresponding to the target bridge in the target byte array to obtain a second reference element value 159 (binary number is 10011111);

[0119] The element value 31 (binary number 00011111) corresponding to the target bridge in the target byte array is replaced by the second reference element value 159 (binary number 10011111) to generate an updated target byte array. At this time, according to the second reference element value 159 (binary number 10011111), the bit value of position number 7 of the target bit in the binary number 10011111 has been changed from 0 to 1, and the binding status of the 7th bridge has been changed from unbound to bound.

[0120] In a preferred embodiment, determining the element value corresponding to the target bridge in the target byte array according to the number of the target bridge, changing the corresponding element value to achieve the change of only the bit value corresponding to the target bridge, and generating an updated target byte array, specifically includes:

[0121] When it is detected that the binding state of the target bridge corresponding to the target device is changed from bound to unbound, the array index corresponding to the target bridge in the target byte array is calculated according to the following formula:

[0122]

[0123] Where c is the array subscript, k is the number of the target bridge, and g is the number of bits contained in each element value of the target byte array;

[0124] The position number of the target bit corresponding to the target bridge is calculated according to the following formula:

[0125] d = k% g;

[0126] Where d is the position number of the target bit, k is the number of the target bridge, and g is the number of bits contained in each element value of the target byte array;

[0127] Performing a modulo operation on the position number of the target bit to obtain a second shift bit number;

[0128] Obtain a second original element value having the same number of bits as the element value of the target byte array and a value of 1, wherein the second original element is: an element having a value of 1, and right-shifting bits having a value of 1 in the second original element value according to the second shift bit number to obtain a third reference element value;

[0129] Performing a bitwise inversion operation on the third reference element value to obtain a fourth reference element value;

[0130] Performing a bitwise AND operation on the fourth reference element value and the element value corresponding to the target bridge in the target byte array to obtain a fifth reference element value;

[0131] The fifth reference element value is used to replace the corresponding element value of the target bridge in the target byte array to generate an updated target byte array.

[0132] Specifically, in a preferred embodiment,

[0133] When it is detected that the binding state of the target bridge corresponding to the target device changes from bound to unbound, and the target bridge corresponding to the target device is the 4th bridge,

[0134] Then the array index corresponding to the target 4th bridge in the target byte array is calculated according to the following formula:

[0135]

[0136] Then the array index bit corresponding to the target 4th bridge in the target byte array is 0, and byte[0] is set as the element value corresponding to the 4th bridge in the target byte array, which is byte[0]=159 (binary number is 10011111);

[0137] The position number of the target bit corresponding to the target bridge is calculated according to the following formula:

[0138] b = 4% s = 4% 8 = 4;

[0139] The target bit position number corresponding to the target 4th bridge is 4. If the binding state of the 4th bridge needs to be changed from bound to unbound, the bit value of the target bit position number 4 of the byte[0] element value needs to be changed to 0.

[0140] Further, as shown in the following table:

[0141]

[0142]

[0143] Performing a modulo operation on the position number 4 of the target bit and obtaining a second shift bit number of 4;

[0144] Get a second original element value that has the same number of bits as the element value of the target byte array and whose value is 1, that is, shift the value 1 (binary number is 00000001) left by 4 bits to obtain a third reference element value of 16 (binary number is 00010000);

[0145] The third reference element value 16 (binary number is 00010000) is bitwise inverted to obtain a fourth reference element value 239 (binary number is 11101111);

[0146] Performing a bitwise AND operation on the fourth reference element value 239 (binary number is 11101111) and the element value 159 (binary number is 10011111) corresponding to the target bridge in the target byte array to obtain a fifth reference element value 143 (binary number is 10001111);

[0147] The fifth reference element value 143 (binary number is 10001111) replaces the element value 159 (binary number is 10011111) corresponding to the target bridge in the target byte array to generate an updated target byte array; at this time, according to the fifth reference element value 143 (binary number is 10001111), it can be seen that the bit value of position number 4 of the target bit in the binary number 10001111 has been changed from 1 to 0, and the binding status of the 4th bridge has been changed from bound to unbound.

[0148] When changing the binding state of a certain bridge, the embodiment of the present invention only needs to obtain the number of the bridge, and then change the bit value corresponding to the bridge in the byte array according to the bridge number, thereby changing the state of the bridge binding, and updating the bridge state display list by traversing the updated array border, without traversing all routes to know whether the bridge is bound, and re-traversing the binding states of all bridges one by one to update the bridge state display list. The embodiment of the present invention improves the efficiency of updating the display list of the bridge binding state.

[0149] For step S4, in a preferred embodiment, the bridge status display list corresponding to the target device is updated according to the updated target byte array; wherein the bridge status display list is used to display the binding status of each bridge;

[0150] Specifically, after the target byte array is updated based on the binding status of each bridge, the updated target byte array is traversed to obtain the binding status of each bridge, so that the bridge status display list corresponding to the target device is synchronously updated to complete the update of the binding status of each bridge.

[0151] In a preferred embodiment, the embodiment of the present invention further includes:

[0152] Obtaining a bridge adding request; wherein the bridge adding request includes a bridge to be added, and the name or type of a bridge to be added can be obtained according to the bridge adding request;

[0153] Adding the bridge to be added to the preset bridge support sequence list corresponding to the target device to generate an updated preset bridge support sequence list; after adding the bridge to be added to the preset bridge support sequence list, adding a bridge to be added to the end of the sequence in the preset bridge support sequence list and increasing the number corresponding to the bridge to be added;

[0154] According to the updated preset bridge support sequence table, the updated total number of bridges and the number of the bridge to be added are obtained; generally, when the bridge addition request includes one bridge, the total number of the preset bridge support sequence table is increased by one; thus, it is necessary to further determine whether the number of element values ​​of the target byte array corresponding to the target device can store the number of newly added bridges;

[0155] The total number of element values ​​required in the target byte array after adding a bridge is calculated according to the following formula:

[0156]

[0157] Where L is the total number of required element values, R is the total number of updated bridges, and x is the number of bits contained in each element value of the target byte array;

[0158] Determine whether the total number of the required element values ​​is consistent with the total number of element values ​​in the first initial byte array. If they are consistent, it means that there are still spare bits of the element values ​​in the byte array to store the newly added bridge state, and the target byte array is not updated;

[0159] If they are inconsistent, the number of element values ​​in the target byte array needs to be changed, and the number of element values ​​in the target byte array is changed to the total number of required element values, and the newly added element values ​​in the target byte array are set to 0, and the target byte array after adding a bridge is generated, and the target byte array after adding a bridge is generated;

[0160] The bridge status display list corresponding to the target device is updated according to the target byte array after a new bridge is added; specifically, after traversing the target byte array after a new bridge is added, the bridge status display list corresponding to the target device can be synchronously updated. When implementing a new bridge type, the embodiment of the present invention only needs to change the preset bridge support sequence table, and then modify the byte array accordingly, and then the bridge status display list can be synchronously modified and updated.

[0161] In a preferred embodiment, the embodiment of the present invention further includes:

[0162] Obtaining a bridge deletion request; wherein the bridge deletion request includes a bridge to be deleted; according to the bridge deletion request, a name or type of a bridge to be deleted can be obtained;

[0163] Deleting the bridge to be deleted from the preset bridge support sequence list corresponding to the target device, and generating a preset bridge support sequence list after deletion; the preset bridge support sequence list after deletion will delete the number of the bridge;

[0164] According to the deleted preset bridge support sequence table, the total number of deleted bridges is obtained, and according to the total number of deleted bridges, a second initial byte array corresponding to the target device is generated; specifically, according to the total number of deleted bridges, an initial array, i.e., a second initial byte array, is regenerated;

[0165] updating the elements corresponding to each bridge in the second initial byte array according to the binding state of each bridge, and generating a target byte array after deleting a bridge;

[0166] The bridge status display list corresponding to the target device is updated according to the target byte array after deleting a bridge; that is, the bridge status display list corresponding to the target device is updated according to the target byte array after deleting a bridge, so that when deleting a bridge type, it is only necessary to change the preset bridge support sequence list, and then regenerate a byte array according to the preset bridge support sequence list, so that the bridge status display list can be synchronously modified and updated.

[0167] like Figure 2 As shown, based on the above-mentioned various embodiments of the method for updating the bridge status display list, the present invention provides a corresponding device item embodiment;

[0168] An embodiment of the present invention provides a device for updating a bridge status display list, comprising: a target bridge number acquisition module, a target byte array acquisition module, a target byte array update module and a display list update module;

[0169] The target bridge number acquisition module is used to acquire the preset bridge support sequence table corresponding to the target device when detecting that the binding state of the target bridge corresponding to the target device has changed, and obtain the number of the target bridge according to the preset bridge support sequence table; wherein the preset bridge support sequence table includes a plurality of bridges and the number corresponding to each bridge;

[0170] The target byte array acquisition module is used to acquire the target byte array corresponding to the target device; wherein the target byte array includes a plurality of element values, each element value is composed of a plurality of bit values, and each bit value is used to indicate the binding state of a bridge;

[0171] The target byte array update module is used to determine the element value corresponding to the target bridge in the target byte array according to the serial number of the target bridge, and change the corresponding element value to achieve the change of only the bit value corresponding to the target bridge, thereby generating an updated target byte array;

[0172] The display list updating module is used to update the bridge status display list corresponding to the target device according to the updated target byte array; wherein the bridge status display list is used to display the binding status of each bridge.

[0173] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.

[0174] Those skilled in the art can clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0175] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for updating a bridge status display list, characterized in that: include: When it is detected that the binding state of the target bridge corresponding to the target device changes, the preset bridge support sequence table corresponding to the target device is obtained, and the number of the target bridge is obtained according to the preset bridge support sequence table; wherein the preset bridge support sequence table includes a plurality of bridges and the number corresponding to each bridge; Obtain a target byte array corresponding to the target device; wherein the target byte array includes a plurality of element values, each element value is composed of a plurality of bits, and the bit value of each bit is used to indicate a binding state of a bridge; Determine the element value corresponding to the target bridge in the target byte array according to the serial number of the target bridge, change the corresponding element value to achieve the change of only the bit value corresponding to the target bridge, and generate an updated target byte array; The network bridge status display list corresponding to the target device is updated according to the updated target byte array; wherein the network bridge status display list is used to display the binding status of each network bridge.

2. A method for updating a bridge status display list as claimed in claim 1, characterized in that: The method for generating the target byte array corresponding to the target device specifically includes: Obtaining the total number of bridges according to the preset bridge support sequence table, and generating a first initial byte array corresponding to the target device according to the total number of bridges; Acquire a data packet sent by a route corresponding to a target device, and obtain a binding state of each bridge according to the data packet; the binding state includes: bound and unbound; The bit value corresponding to each bridge in the first initial byte array is updated according to the binding state of each bridge to generate a target byte array.

3. A method for automatically changing bridge data as claimed in claim 2, characterized in that: Generating a first initial byte array corresponding to the target device according to the total number of bridges specifically includes: The total number of element values ​​in the first initial byte array is calculated according to the following formula: Wherein, Len is the total number of element values ​​in the array, N is the total number of bridges, and m is the number of bits contained in each element value of the first initial byte array; The value of each element of the first initial byte array is set to 0 to generate the first initial byte array.

4. A method for updating a bridge status display list as claimed in claim 1, characterized in that: The step of determining the element value corresponding to the target bridge in the target byte array according to the number of the target bridge, changing the corresponding element value to achieve the change of only the bit value corresponding to the target bridge, and generating an updated target byte array specifically includes: When it is detected that the binding state of the target bridge corresponding to the target device is changed from unbound to bound, the array index corresponding to the target bridge in the target byte array is calculated according to the following formula: Where a is the array subscript, n is the number of the target bridge, and s is the number of bits contained in each element value of the target byte array; The position number of the target bit corresponding to the target bridge is calculated according to the following formula: b = n%s; Where b is the position number of the target bit, n is the number of the target bridge, and s is the number of bits contained in each element value of the target byte array; Performing a modulo operation on the position number of the target bit to obtain a first shift bit number; Obtain a first original element value having the same number of bits as the element value of the target byte array and a value of 1, and left-shift the bits having a value of 1 in the first original element value according to the first shift bit number to obtain a first reference element value; Performing a bitwise OR operation on the first reference element value and the element value corresponding to the target bridge in the target byte array to obtain a second reference element value; The second reference element value replaces the element value corresponding to the target bridge in the target byte array to generate an updated target byte array.

5. A method for updating a bridge status display list as claimed in claim 1, characterized in that: The step of determining the element value corresponding to the target bridge in the target byte array according to the number of the target bridge, changing the corresponding element value to achieve the change of only the bit value corresponding to the target bridge, and generating an updated target byte array specifically includes: When it is detected that the binding state of the target bridge corresponding to the target device is changed from bound to unbound, the array index corresponding to the target bridge in the target byte array is calculated according to the following formula: Where c is the array subscript, k is the number of the target bridge, and g is the number of bits contained in each element value of the target byte array; The position number of the target bit corresponding to the target bridge is calculated according to the following formula: d = k% g; Where d is the position number of the target bit, k is the number of the target bridge, and g is the number of bits contained in each element value of the target byte array; Performing a modulo operation on the position number of the target bit to obtain a second shift bit number; Obtain a second original element value having the same number of bits as the element value of the target byte array and a value of 1, and right-shift the bits having a value of 1 in the second original element value according to the second shift bit number to obtain a third reference element value; Performing a bitwise inversion operation on the third reference element value to obtain a fourth reference element value; Performing a bitwise AND operation on the fourth reference element value and the element value corresponding to the target bridge in the target byte array to obtain a fifth reference element value; The fifth reference element value is used to replace the corresponding element value of the target bridge in the target byte array to generate an updated target byte array.

6. A method for updating a bridge status display list as claimed in claim 1, characterized in that: Also includes: Obtaining a bridge status query request; wherein the bridge status query request includes a bridge to be queried; Obtaining the serial number of the bridge to be queried according to the preset bridge support sequence table corresponding to the target device; Obtaining a target byte array corresponding to the target device, and determining the array subscript corresponding to the bridge to be queried in the target byte array and the position number of the target bit to be queried according to the serial number of the bridge to be queried; Performing a modulo operation on the position number of the target bit to be queried to obtain a third shift bit number; Obtain a third original element value having the same number of bits as the element value of the target byte array and a value of 1, and right-shift the bits having a value of 1 in the third original element value according to the third shift bit number to obtain a sixth reference element value; Performing a bitwise AND operation on the sixth reference element value and the element value corresponding to the target bridge in the target byte array to obtain a seventh reference element value; It is determined whether the bit value corresponding to the position number of the target bit to be queried in the seventh reference element value is 1, if it is 1, the state of the bridge to be queried is determined to be bound, if not 1, the state of the bridge to be queried is determined to be unbound.

7. A method for updating a bridge status display list as claimed in claim 3, characterized in that: Also includes: Obtaining a bridge adding request; wherein the bridge adding request includes a bridge to be added; Adding the to-be-added bridge to the preset bridge support sequence list corresponding to the target device to generate an updated preset bridge support sequence list; Obtaining the updated total number of bridges and the number of the bridge to be added according to the updated preset bridge support sequence list; The total number of element values ​​required in the target byte array after adding a bridge is calculated according to the following formula: Where L is the total number of required element values, R is the total number of updated bridges, and x is the number of bits contained in each element value of the target byte array; Determine whether the total number of the required element values ​​is consistent with the total number of element values ​​in the first initial byte array. If they are consistent, the target byte array is not updated. If they are inconsistent, the number of element values ​​in the target byte array is changed to the total number of required element values, and the newly added element value in the target byte array is set to 0, so as to generate a target byte array after adding a bridge. The network bridge status display list corresponding to the target device is updated according to the target byte array after a network bridge is added.

8. A method for updating a bridge status display list as claimed in claim 1, characterized in that: Also includes: Obtaining a bridge deletion request; wherein the bridge deletion request includes a bridge to be deleted; Deleting the to-be-deleted bridge from the preset bridge support sequence list corresponding to the target device, and generating a deleted preset bridge support sequence list; Obtaining the total number of deleted bridges according to the deleted preset bridge support sequence list, and generating a second initial byte array corresponding to the target device according to the total number of deleted bridges; updating the element value corresponding to each bridge in the second initial byte array according to the binding state of each bridge, and generating a target byte array after deleting a bridge; The bridge status display list corresponding to the target device is updated according to the target byte array after deleting a bridge.

9. A device for updating a bridge status display list, characterized in that: include: A target bridge number acquisition module, a target byte array acquisition module, a target byte array update module and a display list update module; The target bridge number acquisition module is used to acquire the preset bridge support sequence table corresponding to the target device when detecting that the binding state of the target bridge corresponding to the target device has changed, and obtain the number of the target bridge according to the preset bridge support sequence table; wherein the preset bridge support sequence table includes a plurality of bridges and the number corresponding to each bridge; The target byte array acquisition module is used to acquire the target byte array corresponding to the target device; wherein the target byte array includes a plurality of element values, each element value is composed of a plurality of bit values, and each bit value is used to indicate the binding state of a bridge; The target byte array update module is used to determine the element value corresponding to the target bridge in the target byte array according to the serial number of the target bridge, and change the corresponding element value to achieve the change of only the bit value corresponding to the target bridge, thereby generating an updated target byte array; The display list updating module is used to update the bridge status display list corresponding to the target device according to the updated target byte array; wherein the bridge status display list is used to display the binding status of each bridge.

Citation Information

Patent Citations

  • Data processing method and device and storage medium

    CN107133329A

  • Data stream transmission method, transmission device, electronic equipment and storage medium

    CN110597644A

  • Quick query method for time attributes of graph database

    CN112650887A

  • Method and apparatus for rebooting network bridges

    US20050198232A1

  • Data processing apparatus, non-transitory computer-readable storage medium, and data processing method

    US20210173581A1