CN114363167A - Network segment information processing method, device, electronic equipment and storage medium - Google Patents
Network segment information processing method, device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN114363167A CN114363167A CN202111565171.5A CN202111565171A CN114363167A CN 114363167 A CN114363167 A CN 114363167A CN 202111565171 A CN202111565171 A CN 202111565171A CN 114363167 A CN114363167 A CN 114363167A
- Authority
- CN
- China
- Prior art keywords
- mask
- network address
- string
- value
- character
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
本公开提供了一种网段信息处理方法、装置、电子设备以及存储介质,涉及计算机技术领域,尤其涉及云计算等领域。该方法为:响应于获取到第一掩码,基于所述第一掩码确定N个分段输入区域分别对应的可填写范围;N为大于等于1的整数;在所述N个分段输入区域分别展示对应的所述可填写范围;响应于在所述N个分段输入区域获取到N个输入信息,基于所述N个输入信息生成第一网络地址,基于所述第一网络地址以及所述第一掩码,确定第一网段信息。通过本公开提供的方法,可以提高输入网段信息的正确性和整体的处理效率。
The present disclosure provides a network segment information processing method, device, electronic device and storage medium, and relates to the field of computer technology, in particular to the fields of cloud computing and the like. The method includes: in response to acquiring the first mask, determining the fillable ranges corresponding to the N segment input areas based on the first mask; N is an integer greater than or equal to 1; The areas respectively display the corresponding fillable ranges; in response to acquiring N pieces of input information in the N segment input areas, a first network address is generated based on the N pieces of input information, and a first network address is generated based on the first network address and The first mask determines first network segment information. Through the method provided by the present disclosure, the correctness of the input network segment information and the overall processing efficiency can be improved.
Description
技术领域technical field
本公开涉及计算机技术领域,尤其涉及云计算等领域。The present disclosure relates to the field of computer technology, and in particular, to the fields of cloud computing and the like.
背景技术Background technique
网络配置是云计算产品中非常重要的组成部分。用户可通过控制台配置网段信息,如果配置的网段信息不正确,则可能导致用户的整个服务不可用。因此,如何保证输入网段信息的正确性从而保证整体的处理效率就成为需要解决的问题。Network configuration is a very important part of cloud computing products. Users can configure network segment information through the console. If the configured network segment information is incorrect, the entire service of the user may become unavailable. Therefore, how to ensure the correctness of the input network segment information so as to ensure the overall processing efficiency becomes a problem that needs to be solved.
发明内容SUMMARY OF THE INVENTION
本公开提供了一种网段信息处理方法、装置、电子设备以及存储介质。The present disclosure provides a network segment information processing method, device, electronic device and storage medium.
根据本公开的第一方面,提供了一种网段信息处理方法,包括:According to a first aspect of the present disclosure, a method for processing network segment information is provided, including:
响应于获取到第一掩码,基于所述第一掩码确定N个分段输入区域分别对应的可填写范围;N为大于等于1的整数;In response to acquiring the first mask, determine the fillable ranges corresponding to the N segment input areas based on the first mask; N is an integer greater than or equal to 1;
在所述N个分段输入区域分别展示对应的所述可填写范围;Display the corresponding fillable ranges in the N segment input areas respectively;
响应于在所述N个分段输入区域获取到N个输入信息,基于所述N个输入信息生成第一网络地址,基于所述第一网络地址以及所述第一掩码,确定第一网段信息。In response to acquiring N pieces of input information in the N pieces of input information, generating a first network address based on the N pieces of input information, and determining a first network address based on the first network address and the first mask. segment information.
根据本公开的第二方面,提供了一种网段信息处理装置,包括:According to a second aspect of the present disclosure, a network segment information processing device is provided, comprising:
范围确定模块,用于响应于获取到第一掩码,基于所述第一掩码确定N个分段输入区域分别对应的可填写范围;N为大于等于1的整数;a range determination module, configured to, in response to acquiring the first mask, determine the fillable ranges respectively corresponding to the N segmented input areas based on the first mask; N is an integer greater than or equal to 1;
展示模块,用于在所述N个分段输入区域分别展示对应的所述可填写范围;a display module, configured to display the corresponding fillable ranges in the N segmented input areas;
网段信息确定模块,用于响应于在所述N个分段输入区域获取到N个输入信息,基于所述N个输入信息生成第一网络地址,基于所述第一网络地址以及所述第一掩码,确定第一网段信息。A network segment information determination module, configured to generate a first network address based on the N input information in response to acquiring N pieces of input information in the N segment input areas, and based on the first network address and the first network address A mask to determine the first network segment information.
根据本公开的第三方面,提供了一种电子设备,包括:至少一个处理器;以及与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述第一方面的方法。According to a third aspect of the present disclosure, there is provided an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores information that can be used by the at least one processor Executable instructions, the instructions being executed by the at least one processor to enable the at least one processor to perform the method of the first aspect above.
根据本公开的第四方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行上述第一方面的方法。According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to perform the method of the first aspect above.
根据本公开的第五方面,提供了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现根据上述第一方面所述的方法。According to a fifth aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method according to the first aspect above.
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or critical features of embodiments of the disclosure, nor is it intended to limit the scope of the disclosure. Other features of the present disclosure will become readily understood from the following description.
通过采用上述方案,可以根据获取到的第一掩码确定每个分段输入区域分别对应的可填写范围并展示,再根据获取所述每个分段输入区域获取到的输入信息生成第一网络地址,基于所述第一网络地址和所述第一掩码确定第一网段信息。如此可以提高输入的网段信息的正确性和整体的处理效率。By adopting the above solution, the fillable range corresponding to each segmented input area can be determined and displayed according to the obtained first mask, and then the first network can be generated according to the input information obtained by obtaining the each segmented input area. address, and the first network segment information is determined based on the first network address and the first mask. In this way, the correctness of the input network segment information and the overall processing efficiency can be improved.
附图说明Description of drawings
附图用于更好地理解本方案,不构成对本公开的限定。其中:The accompanying drawings are used for better understanding of the present solution, and do not constitute a limitation to the present disclosure. in:
图1是根据本公开一实施例的网段信息处理方法的处理流程示意图;1 is a schematic diagram of a processing flow of a method for processing network segment information according to an embodiment of the present disclosure;
图2a是根据本公开一实施例的基于第一掩码和第二掩码确定可填写范围的示意图;2a is a schematic diagram of determining a fillable range based on a first mask and a second mask according to an embodiment of the present disclosure;
图2b是根据本公开一实施例的展示界面的示意图;2b is a schematic diagram of a display interface according to an embodiment of the present disclosure;
图3a是根据本公开一实施例的网段信息处理方法中掩码有效性掩码的处理流程示意图;3a is a schematic diagram of a processing flow of a mask validity mask in a network segment information processing method according to an embodiment of the present disclosure;
图3b是根据本公开一实施例的网络地址转换的处理流程示意图;3b is a schematic diagram of a processing flow of network address translation according to an embodiment of the present disclosure;
图4是根据本公开实施例的第一网段信息中的第一网络地址转换二进制字符串的示意图;4 is a schematic diagram of a first network address translation binary string in the first network segment information according to an embodiment of the present disclosure;
图5是根据本公开另一实施例的判断网络地址是否在相同网段内的处理流程示意图;5 is a schematic flowchart of a process for judging whether a network address is in the same network segment according to another embodiment of the present disclosure;
图6是根据本公开另一实施例的判断两个网段信息是否重叠的处理流程示意图;6 is a schematic flowchart of a process for determining whether two network segment information overlaps according to another embodiment of the present disclosure;
图7a是根据本公开实施例的网段信息处理装置的一种示意图;7a is a schematic diagram of a network segment information processing apparatus according to an embodiment of the present disclosure;
图7b是根据本公开实施例的网段信息处理装置的另一种示意图;7b is another schematic diagram of a network segment information processing apparatus according to an embodiment of the present disclosure;
图8是用来实现本公开实施例的网段信息处理方法的电子设备的框图。FIG. 8 is a block diagram of an electronic device for implementing the network segment information processing method according to the embodiment of the present disclosure.
具体实施方式Detailed ways
以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding and should be considered as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.
本公开第一方面实施例提供了一种网段信息处理方法,如图1所示,包括:The embodiment of the first aspect of the present disclosure provides a network segment information processing method, as shown in FIG. 1 , including:
S101:响应于获取到第一掩码,基于所述第一掩码确定N个分段输入区域分别对应的可填写范围;N为大于等于1的整数;S101: In response to acquiring the first mask, determine the fillable ranges respectively corresponding to the N segment input areas based on the first mask; N is an integer greater than or equal to 1;
S102:在所述N个分段输入区域分别展示对应的所述可填写范围;S102: Display the corresponding fillable ranges in the N segment input areas respectively;
S103:响应于在所述N个分段输入区域获取到N个输入信息,基于所述N个输入信息生成第一网络地址,基于所述第一网络地址以及所述第一掩码,确定第一网段信息。S103: In response to acquiring N pieces of input information in the N segment input areas, generate a first network address based on the N pieces of input information, and determine a first network address based on the first network address and the first mask A network segment information.
本实施例可以应用于终端设备,具体的可以应用于所述终端设备中安装的客户端。通过采用上述方案,可以根据获取到的第一掩码确定每个分段输入区域分别对应的可填写范围并展示,再根据获取所述每个分段输入区域获取到的输入信息生成第一网络地址,基于所述第一网络地址和所述第一掩码确定第一网段信息。这样能够避免由于填写错误所导致的信息无效再重新进行修改所带来的影响处理效率的问题,可以减少填写错误的概率,提高输入的网段信息的正确性和整体的处理效率。This embodiment can be applied to a terminal device, and specifically can be applied to a client installed in the terminal device. By adopting the above solution, the fillable range corresponding to each segmented input area can be determined and displayed according to the obtained first mask, and then the first network can be generated according to the input information obtained by obtaining the each segmented input area. address, and the first network segment information is determined based on the first network address and the first mask. In this way, the problem of affecting the processing efficiency caused by the invalidation of the information caused by filling errors and then re-modification can be avoided, the probability of filling in errors can be reduced, and the correctness of the input network segment information and the overall processing efficiency can be improved.
其中,所述第一掩码的最大取值可以与当前选取或确定网络地址的类型相关,比如,所述当前选取或确定网络地址的类型为网际协议版本4(IPv4,Internet Protocolversion 4),则所述第一掩码的最大取值为32;所述当前选取或确定网络地址的类型为网际协议版本6(IPv6,Internet Protocol version 6),则所述第一掩码的最大取值为128。Wherein, the maximum value of the first mask may be related to the type of the currently selected or determined network address. For example, if the type of the currently selected or determined network address is Internet Protocol version 4 (IPv4, Internet Protocolversion 4), then The maximum value of the first mask is 32; the type of the currently selected or determined network address is Internet Protocol version 6 (IPv6, Internet Protocol version 6), then the maximum value of the first mask is 128 .
所述获取到第一掩码,可以为:响应于在展示界面中的掩码输入区域获取到输入的数值,将输入的所述数值作为所述第一掩码;The obtaining the first mask may be: in response to obtaining the inputted numerical value in the mask input area in the display interface, using the inputted numerical value as the first mask;
或者,响应于在所述展示界面中的所述掩码输入区域所展示的至少一个候选数值中选取目标数值的操作,将所述目标数值作为所述第一掩码。Alternatively, in response to an operation of selecting a target value from at least one candidate value displayed in the mask input area in the display interface, the target value is used as the first mask.
其中,所述展示界面中除了上述掩码输入区域之外,还可以包括所述N个分段输入区域。所述N个分段输入区域中每个分段输入区域用于获取所述第一网络地址的一个地址分段。N可以为大于等于1的整数,优选地,N等于4。Wherein, in addition to the above-mentioned mask input area, the display interface may further include the N segment input areas. Each of the N segment input areas is used to acquire an address segment of the first network address. N can be an integer greater than or equal to 1, preferably, N is equal to 4.
所述N个分段输入区域中每个分段输入区域可以包含两个子区域,分别为第一子区域以及第二子区域;其中,所述第一子区域可以用于展示所述每个分段输入区域对应的可填写范围;所述第二子区域可以用于获取输入信息,也就是在所述第二子区域可以填写对应的所述输入信息;所述第一子区域与所述第二子区域的相对位置关系可以是:所述第一子区域在所述第二子区域的下方。Each of the N segmented input areas may include two sub-areas, namely a first sub-area and a second sub-area; wherein the first sub-area may be used to display the each segment. The fillable range corresponding to the segment input area; the second sub-area can be used to obtain input information, that is, the corresponding input information can be filled in the second sub-area; the first sub-area and the first sub-area The relative positional relationship between the two sub-regions may be: the first sub-region is below the second sub-region.
所述在所述N个分段输入区域分别展示所述可填写范围,具体可以为:在所述N个分段输入区域的所述每个分段输入区域的所述第一子区域处,展示所述每个分段输入区域对应的所述可填写范围。其中,所述可填写范围可以为一个数值区域,例如可填写范围为0-255;或者所述可填写范围也可以是一个或多个具体的数值,例如可填写范围为0,或者可填写范围为127或255。The displaying of the fillable range in the N segmented input areas may specifically be: at the first sub-area of each segmented input area of the N segmented input areas, The fillable range corresponding to each segmented input area is displayed. Wherein, the fillable range can be a numerical range, for example, the fillable range is 0-255; or the fillable range can also be one or more specific values, for example, the fillable range is 0, or the fillable range is is 127 or 255.
上述在所述每个分段输入区域的所述第一子区域处,展示所述每个分段输入区域对应的所述可填写范围,可以有多种方式:As described above, at the first sub-area of each segmented input area, the fillable range corresponding to each segmented input area can be displayed in multiple ways:
方式一、无论要在哪个输入区域处输入数值,在所述N个分段输入区域的所述每个分段输入区域均保持展示其对应的所述可填写范围。Manner 1: No matter which input area you want to input a value in, the corresponding fillable range is kept displayed in each of the N segmented input areas.
方式二、响应于针对所述N个分段输入区域中第i个分段输入区域的所述第二子区域的第三操作,在所述第i个分段输入区域的所述第一子区域处展示对应的可填写范围,并且在除所述第i个分段输入区域之外的其他分段输入区域的所述第一子区域不展示对应的所述可填写范围;i为大于等于1且小于等于N的整数。Mode 2: In response to the third operation on the second sub-area of the ith segmented input area in the N segmented input areas, in the first sub-area of the i-th segmented input area The corresponding fillable range is displayed at the area, and the corresponding fillable range is not displayed in the first sub-areas of other segmented input areas except the i-th segmented input area; i is greater than or equal to 1 and an integer less than or equal to N.
其中,所述第三操作可以指的是,点击该第i个分段输入区域的所述第二子区域的操作;或者,鼠标所在位置位于该第i个分段输入区域的所述第二子区域。Wherein, the third operation may refer to an operation of clicking on the second sub-area of the i-th segmented input area; or, the position of the mouse is located in the second sub-area of the i-th segmented input area sub area.
所述N个分段输入区域分别对应的所述第二子区域,可以均为可编辑状态;或者,根据所述每个分段输入区域对应的所述可填写范围,控制不同的分段输入区域的所述第二子区域为不同的状态,举例来说,若第j个分段输入区域对应的所述可填写范围仅包含1个数值(比如0),则可以控制第j个分段输入区域的所述第二子区域为不可编辑状态,且将该第j个分段输入区域的所述第二子区域的输入信息直接设置为0;若第j个分段输入区域对应的所述可填写范围包含多个数值,则可以控制该第j个分段输入区域的所述第二子区域为可编辑状态;j为大于等于1且小于等于N的整数。The second sub-areas corresponding to the N segmented input areas may all be in an editable state; or, according to the fillable range corresponding to each segmented input area, different segmented input areas are controlled The second sub-area of the area is in a different state. For example, if the fillable range corresponding to the j-th segment input area contains only one value (such as 0), the j-th segment can be controlled The second sub-area of the input area is in an uneditable state, and the input information of the second sub-area of the j-th segmented input area is directly set to 0; If the fillable range includes multiple values, the second sub-area of the j-th segmented input area can be controlled to be in an editable state; j is an integer greater than or equal to 1 and less than or equal to N.
所述基于所述N个输入信息生成第一网络地址,具体可以为:基于所述N个输入信息对应的所述分段输入区域的位置,确定所述N个输入信息的排列顺序;采用预设标识符将所述N个输入信息按照所述排列顺序进行组合,得到所述第一网络地址。The generating of the first network address based on the N pieces of input information may specifically include: determining an arrangement order of the N pieces of input information based on the positions of the segmented input areas corresponding to the N pieces of input information; Set the identifier to combine the N pieces of input information according to the arrangement order to obtain the first network address.
所述预设标识符可以根据所述当前选取或确定网络地址的类型来确定,比如所述当前选取或确定网络地址的类型为网际协议版本4(IPv4,Internet Protocol version4),所述预设标识符为“.”;所述当前选取或确定网络地址的类型为网际协议版本6(IPv6,Internet Protocol version 6),所述预设标识符为“:”。The preset identifier may be determined according to the type of the currently selected or determined network address, for example, the type of the currently selected or determined network address is Internet Protocol version 4 (IPv4, Internet Protocol version 4), and the preset identifier The symbol is "."; the type of the currently selected or determined network address is Internet Protocol version 6 (IPv6, Internet Protocol version 6), and the preset identifier is ":".
比如,以所述当前选取或确定网络地址的类型为IPv4为例,在第1个分段输入区域的输入信息为192,第2个分段输入区域的输入信息为xxx,第3个和第4个分段输入区域的输入信息均为0;将所述第1个输入区域至所述第4个输入区域的顺序,作为上述4个输入信息的排列顺序;采用所述预设标识符“.”对上述4个输入信息按照所述排列顺序进行组合,得到所述第一网络地址为“192.xxx.0.0”。For example, taking the type of the currently selected or determined network address as IPv4 as an example, the input information in the first segment input area is 192, the input information in the second segment input area is xxx, the third and third The input information of the four segmented input areas are all 0; the sequence from the first input area to the fourth input area is used as the arrangement order of the above four input information; the preset identifier " ." The above four input information are combined according to the arrangement order, and the first network address is obtained as "192.xxx.0.0".
基于所述第一网络地址以及所述第一掩码,确定第一网段信息,可以为:基于预设格式将所述第一网络地址以及所述第一掩码组合为所述第一网段信息。其中,所述预设格式可以根据实际情况预设,本实施例采用的所述预设格式为“网络地址/掩码”的格式。假设第一掩码为16,所述第一网络地址为“192.xxx.0.0”,则根据所述预设格式,确定所述第一网段信息表示为“192.xxx.0.0/16”。Determining the first network segment information based on the first network address and the first mask may be: combining the first network address and the first mask based on a preset format to form the first network segment segment information. The preset format may be preset according to actual conditions, and the preset format adopted in this embodiment is the format of "network address/mask". Assuming that the first mask is 16 and the first network address is "192.xxx.0.0", then according to the preset format, it is determined that the first network segment information is represented as "192.xxx.0.0/16" .
上述第一网段信息具体可以是无类别域间路由(Classless Inter-DomainRouting,CIDR)信息。The foregoing first network segment information may specifically be classless inter-domain routing (Classless Inter-Domain Routing, CIDR) information.
另外,需要指出的是,在所述展示界面中还可以为展示其他的操作区域以供用户进行其他信息的输入或选择。示例性的,在所述展示界面还可以展示类型选取区域,在所述类型选取区域中可以有多个候选网络地址类型,比如IPv4、IPv6或更多的候选网络地址类型;响应于针对所述多个候选网络地址类型中的目标网络地址类型的选取操作,确定所述当前选取或确定网络地址的类型为所述目标网络地址类型。In addition, it should be noted that other operation areas may also be displayed in the display interface for the user to input or select other information. Exemplarily, a type selection area may also be displayed on the display interface, and there may be multiple candidate network address types in the type selection area, such as IPv4, IPv6 or more candidate network address types; In the selection operation of the target network address type among the multiple candidate network address types, it is determined that the type of the currently selected or determined network address is the target network address type.
可见,通过采用上述方案,可以根据获取到的第一掩码确定每个分段输入区域分别对应的可填写范围并展示,再根据获取所述每个分段输入区域获取到的输入信息生成第一网络地址,基于所述第一网络地址和所述第一掩码确定第一网段信息。这样能够避免由于填写错误所导致的信息无效再重新进行修改所带来的影响处理效率的问题,可以减少填写错误的概率,提高输入的网段信息的正确性和整体的处理效率。It can be seen that by adopting the above scheme, the fillable range corresponding to each segmented input area can be determined and displayed according to the obtained first mask, and then the first segmented input area can be generated according to the input information obtained by obtaining the said each segmented input area. a network address, and the first network segment information is determined based on the first network address and the first mask. In this way, the problem of affecting the processing efficiency caused by the invalidation of the information caused by filling errors and then re-modification can be avoided, the probability of filling in errors can be reduced, and the correctness of the input network segment information and the overall processing efficiency can be improved.
在一种实施方式中,上述基于所述第一掩码确定N个分段输入区域分别对应的可填写范围,具体可以包括:In an embodiment, the above-mentioned determination of the fillable ranges corresponding to the N segmented input areas based on the first mask may specifically include:
基于所述第一掩码,确定第一字符串;所述第一字符串中包含第一类字符以及第二类字符,所述第一类字符的取值为第一值,所述第二类字符的取值为第二值;Based on the first mask, a first character string is determined; the first character string includes a first type of character and a second type of character, the value of the first type of character is a first value, and the second type of character The value of the class character is the second value;
对所述第一字符串进行划分,得到N个字符串分组;Divide the first character string to obtain N character string groups;
基于所述N个字符串分组中分别包含的所述第一类字符和/或所述第二类字符,确定所述N个分段输入区域所分别对应的所述可填写范围。Based on the first type of characters and/or the second type of characters included in the N character string groups, respectively, the fillable ranges corresponding to the N segmented input areas are determined.
其中,所述第一掩码的取值为十进制的整数值,所述第一掩码的最大取值与所述当前选取或确定网络地址的类型相关,比如,所述当前选取或确定网络地址的类型为IPv4,则所述第一掩码的最大取值为32;所述当前选取或确定网络地址的类型为IPv6,则所述第一掩码的最大取值为128。The value of the first mask is a decimal integer value, and the maximum value of the first mask is related to the type of the currently selected or determined network address, for example, the currently selected or determined network address If the type of the network address is IPv4, the maximum value of the first mask is 32; the type of the currently selected or determined network address is IPv6, then the maximum value of the first mask is 128.
所述第一字符串具体可以为二进制字符串;所述第一字符串包含的总位数也与所述当前选取或确定网络地址的类型相关。比如所述当前选取或确定网络地址的类型为IPv4类型的网络地址,所述第一字符串的总位数为32位;所述当前选取或确定网络地址的类型为IPv6类型的网络地址,所述第一字符串的总位数为128。The first character string may specifically be a binary character string; the total number of digits included in the first character string is also related to the type of the currently selected or determined network address. For example, the type of the currently selected or determined network address is an IPv4 type network address, and the total number of digits of the first character string is 32 bits; the type of the currently selected or determined network address is an IPv6 type network address, so The total number of digits in the first string is 128.
所述第一类字符在所述第一字符串中的数量以及位置,可以为:所述第一字符串中的前M个字符为所述第一类字符。其中M等于所述第一掩码;所述前M个字符指的是所述第一字符串中的最高位起的连续M位二进制字符。所述第一类字符的取值为第一值,所述第一值为1,也就是说所述第一类字符为1。The number and position of the first type of characters in the first character string may be: the first M characters in the first character string are the first type of characters. Wherein M is equal to the first mask; the first M characters refer to consecutive M-bit binary characters from the highest bit in the first character string. The value of the character of the first type is a first value, and the first value is 1, that is, the character of the first type is 1.
所述第二类字符在所述第一字符串中的数量以及位置,具体为:所述第一字符串中的第M+1个及其之后的全部字符为所述第二类字符。所述第M+1个字符指的是所述第一字符串中的最高位起的第M+1个二进制字符。所述第二类字符的取值为第一值,所述第一值为0,也就是说第二类字符为0。The number and position of the characters of the second type in the first character string are specifically: the M+1th and all subsequent characters in the first character string are the characters of the second type. The M+1 th character refers to the M+1 th binary character from the highest bit in the first character string. The value of the character of the second type is a first value, and the first value is 0, that is, the character of the second type is 0.
举例来说,假设所述当前选取或确定网络地址的类型为IPv4类型的网络地址,所述第一字符串的长度等于32;假设所述第一掩码为8,则M等于8,所述第一字符串中前8位为所述第一类字符也就是1,剩余24位为所述第二类字符也就是0,所述第一字符串表示为“11111111 00000000 00000000 00000000”。For example, assuming that the type of the currently selected or determined network address is an IPv4 network address, the length of the first string is equal to 32; assuming that the first mask is 8, then M is equal to 8, and the In the first character string, the first 8 bits are the first type character, that is, 1, and the remaining 24 bits are the second type character, that is, 0. The first character string is represented as "11111111 00000000 00000000 00000000".
所述对所述第一字符串进行划分,得到N个字符串分组具体可以是:从所述第一字符串的最高位开始分别依次选取预设数量个字符,将每预设数量个字符作为一个字符串分组。其中,所述N的取值可以为4,所述预设数量可以为8或者可以为32。以所述当前选取或确定网络地址的类型为IPv4类型的网络地址为例,所述第一掩码所对应的所述第一字符串划分为4个字符串分组,每一个字符串分组包含8位字符。以所述当前选取或确定网络地址的类型为IPv6类型的网络地址为例,所述第一掩码所对应的所述第一字符串划分为4个字符串分组,每一个字符串分组包含32位字符。The dividing the first character string to obtain N character string groupings may specifically be: starting from the highest position of the first character string, selecting a preset number of characters in sequence, and using each preset number of characters as A string grouping. The value of N may be 4, and the preset number may be 8 or 32. Taking the type of the currently selected or determined network address as the network address of the IPv4 type as an example, the first character string corresponding to the first mask is divided into 4 character string groupings, and each character string grouping contains 8 bit character. Taking the type of the currently selected or determined network address as the network address of the IPv6 type as an example, the first character string corresponding to the first mask is divided into 4 character string groupings, and each character string grouping contains 32. bit character.
所述基于所述N个字符串分组中分别包含的所述第一类字符和/或所述第二类字符,确定所述N个分段输入区域所分别对应的所述可填写范围,具体可以包括:determining the fillable ranges corresponding to the N segmented input areas based on the first-type characters and/or the second-type characters contained in the N character string groups respectively, specifically Can include:
判断所述N个字符串分组中的第r个字符串分组中是否包含所述第一类字符;若所述第r个字符串分组中不包含所述第一类字符,则所述第r个字符串分组所对应的第r个分段输入区域的可填写范围为0;r为大于等于1且小于等于N的整数;Determine whether the rth string grouping in the N string groupings contains the first type of characters; if the rth string grouping does not contain the first type of characters, then the rth string grouping does not contain the first type of characters The fillable range of the rth segment input area corresponding to each string group is 0; r is an integer greater than or equal to 1 and less than or equal to N;
若所述第r个字符串分组中包含x个所述第一类字符,则将所述第r个字符串分组的前x个字符位分别取第一值且其余字符位均取第二值,计算得到x个目标进制的数值;将所述x个目标进制的数值分别组合相加得到至少一个取值,基于所述至少一个取值确定所述第r个分段输入区域对应的可填写范围;x为大于等于1的整数。If the r-th string grouping contains x characters of the first type, the first x character bits of the r-th string grouping respectively take the first value and the rest of the character bits take the second value , calculate and obtain the numerical values of x target bases; combine and add the values of the x target bases to obtain at least one value, and determine the corresponding value of the rth segment input area based on the at least one value. The range can be filled; x is an integer greater than or equal to 1.
所述目标进制与所述当前选取或确定网络地址的类型相关,比如所述当前选取或确定网络地址的类型为IPv4类型的网络地址,则所述目标进制为十进制,若所述当前选取或确定网络地址的类型为IPv6类型的网络地址,则所述目标进制为十六进制。The target system is related to the type of the currently selected or determined network address. For example, the type of the currently selected or determined network address is an IPv4 type network address, then the target system is decimal. If the current selection Or if it is determined that the type of the network address is an IPv6 type network address, the target system is hexadecimal.
其中,所述将所述第r个字符串分组的前x个字符位分别取第一值且其余字符位均取第二值,计算得到x个目标进制的数值,可以包括:Wherein, the first x character bits of the r th character string grouping respectively take the first value and the rest of the character bits take the second value, and the numerical values of x number of target bases are obtained by calculation, which may include:
将所述第r个字符串分组的第1个字符位取1、其余字符位取0,计算得到第1个目标进制的数值;The first character bit of the rth string grouping is taken as 1, and the rest of the character bits are taken as 0, and the numerical value of the first target system is obtained by calculation;
以此类推,直至将所述第r个字符串分组的第x个字符位取1、其余字符位取0,计算得到第x个目标进制的数值。By analogy, the x-th character bit of the r-th string grouping is set to 1, and the remaining character bits are set to 0, and the x-th target hexadecimal value is calculated.
所述将所述x个目标进制的数值分别组合相加得到至少一个取值可以为:将所述x个目标进制的数值中的任意一个或多个分别组合相加得到所述至少一个取值。其中,所述至少一个取值的具体数量可以等于2x-1个。比如,x为2,将所述第r个字符串分组中的8位二进制字符串中最高位的第1个字符位和第2个字符位分别取值为1,计算得到27、26两个数值,将这两个数值分别组合相加可以得到3个数值。The at least one value obtained by combining and adding the numerical values of the x target radix may be: combining and adding any one or more of the numerical values of the x target radix to obtain the at least one value. value. Wherein, the specific number of the at least one value may be equal to 2 x -1. For example, if x is 2, the first character bit and the second character bit of the highest bit in the 8-bit binary string in the r-th string grouping are respectively set to 1, and 2 7 and 2 6 are calculated. Two numbers, which can be combined and added to get 3 numbers.
所述基于所述至少一个取值确定所述第r个分段输入区域对应的可填写范围,可以包括:将所述至少一个取值以及0作为所述第r个分段输入区域的可填写范围。The determining the fillable range corresponding to the rth segmented input area based on the at least one value may include: using the at least one value and 0 as the fillable range of the rth segmented input area scope.
以所述当前选取或确定网络地址的类型为IPv4类型的网络地址为例进行说明:Taking the type of the currently selected or determined network address as the network address of the IPv4 type as an example to illustrate:
假设所述第一掩码=18,也就是所述第一字符串的前18位的取值为1,其余取值为0;将所述第一字符串划分为4个字符串分组,其中,第1个字符串分组为“11111111”,将27、26~20中任意一个或多个数值进行组合相加得到28-1个数值,最终第1个分段输入区域的可填写范围包含0以及上述28-1个数值,也就是0-255。第2个字符串分组与第1个字符串分组得到的结果为相同的。第3个字符串分组为“11000000”,将27、26中任意一个或多个组合相加得到22-1个数值,最终第3个分段输入区域的可填写范围包含0以及上述3个数值。第4个字符串分组为“00000000”,对应的第4段网络地址的可填写范围为0。Assuming that the first mask=18, that is, the first 18 bits of the first character string are 1, and the rest are 0; the first character string is divided into 4 character strings, wherein , the first string is grouped as "11111111", and any one or more values from 2 7 , 2 6 to 2 0 are combined and added to obtain 2 8 -1 values. The filling range includes 0 and the above 2 8 -1 values, that is, 0-255. The result of the second string grouping and the first string grouping is the same. The third string is grouped as "11000000", and any one or more combinations of 2 7 and 2 6 are added to obtain 2 2 -1 values. Finally, the fillable range of the third segment input area includes 0 and the above 3 numbers. The fourth string is grouped as "00000000", and the corresponding range of the fourth network address is 0.
可见,通过采用上述方案,就可以基于所述第一掩码的具体取值M来确定第一字符串中包含的取值为第一值的第一类字符以及取值为第二值的第二类字符,对所述第一字符串划分后得到N个字符串分组,基于每个字符串分组中包含的第一类字符和/或第二类字符,确定所述N个分段输入区域分别对应的可填写范围。如此,就可以更加准确的确定每一个分段输入区域中的所述可填写范围,从而避免在任意一个分段输入区域进行填写时出现错误而导致网络地址无效,这样就可以提升输入的网段信息的正确性以及准确度,并提高了整体的处理效率。It can be seen that, by adopting the above solution, it is possible to determine, based on the specific value M of the first mask, the first type of characters with the first value and the first character with the second value contained in the first character string.
在另一种实施方式中,本次所要填写的所述第一网段信息为子网的网段信息的情况下,也就是所述第一掩码为子网掩码的情况下,所述N个分段输入区域分别对应的可填写范围还会受限于第二掩码,即受限于当前所属私有网络的掩码。上述基于所述第一掩码确定N个分段输入区域分别对应的可填写范围,具体可以包括:In another implementation manner, when the first network segment information to be filled in this time is the network segment information of a subnet, that is, when the first mask is a subnet mask, the The fillable ranges corresponding to the N segmented input areas are also limited by the second mask, that is, limited by the mask of the current private network. The above-mentioned determination of the fillable ranges corresponding to the N segmented input areas based on the first mask may specifically include:
根据所述第一掩码以及第二掩码,确定第一字符串;其中,所述第一字符串包含第一类字符以及第二类字符,所述第一类字符的取值为第一值,所述第二类字符的取值为第二值;所述第一类字符的数量为所述第一掩码与所述第二掩码的差值;所述第二掩码为所述第一掩码所属私有网络的网段信息中的掩码;According to the first mask and the second mask, a first character string is determined; wherein, the first character string includes a first type of character and a second type of character, and the value of the first type of character is the first value, the value of the second type of characters is the second value; the number of the first type of characters is the difference between the first mask and the second mask; the second mask is the Describe the mask in the network segment information of the private network to which the first mask belongs;
基于所述第一字符串划分得到的N个字符串分组中分别包含的所述第一类字符和/或所述第二类字符,确定所述N个分段输入区域所分别对应的至少一个调整值;Based on the first type of characters and/or the second type of characters included in the N character string groups obtained by dividing the first character string, at least one character corresponding to each of the N segmented input areas is determined adjustment value;
基于N个分段初始值以及所述N个分段输入区域所分别对应的所述至少一个调整值,确定所述N个分段输入区域分别对应的所述可填写范围。The fillable ranges respectively corresponding to the N segment input areas are determined based on the N segment initial values and the at least one adjustment value corresponding to the N segment input areas respectively.
其中,所述第一掩码和所述第二掩码均为十进制的整数值,所述第一掩码和所述第二掩码的最大取值与所述当前选取或确定网络地址的类型相关,比如所述当前选取或确定网络地址的类型为IPv4类型的网络地址,所述第一掩码和所述第二掩码的最大取值为32;所述当前选取或确定网络地址的类型IPv6类型的网络地址,所述第一掩码和所述第二掩码的最大取值为128。The first mask and the second mask are both decimal integer values, and the maximum value of the first mask and the second mask is the same as the type of the currently selected or determined network address. Relevant, for example, the type of the currently selected or determined network address is an IPv4 type network address, and the maximum value of the first mask and the second mask is 32; the type of the currently selected or determined network address For an IPv6 network address, the maximum value of the first mask and the second mask is 128.
所述根据所述第一掩码以及第二掩码,确定第一字符串,可以包括:The determining the first character string according to the first mask and the second mask may include:
根据所述第一掩码确定第一初始字符串;所述第一初始字符串中前M个字符为第一类字符,第M+1个字符之后为第二类字符,所述第一类字符的取值为第一值,第二类字符的取值为第二值;M等于所述第一掩码;A first initial character string is determined according to the first mask; the first M characters in the first initial character string are characters of the first type, the characters after the M+1th character are characters of the second type, and the first character The value of the character is the first value, and the value of the second type of character is the second value; M is equal to the first mask;
基于所述第二掩码,对所述第一初始字符串进行调整得到所述第一字符串;所述第一字符串中包含的所述第一类字符的数量为所述第一掩码与所述第二掩码的差值;所述第二掩码为所述第一掩码所属私有网络的网段信息中的掩码。Based on the second mask, the first initial character string is adjusted to obtain the first character string; the number of the first type characters contained in the first character string is the first mask The difference value from the second mask; the second mask is the mask in the network segment information of the private network to which the first mask belongs.
其中,所述第一类字符在所述第一初始字符中的数量以及位置,可以为:所述第一初始字符中的前M个字符为所述第一类字符。其中M等于所述第一掩码;所述前M个字符指的是所述第一初始字符中的最高位起的连续M个二进制字符。所述第一类字符的取值为第一值,所述第一值为1,也就是说所述第一类字符为1。The number and position of the first type of characters in the first initial character may be: the first M characters in the first initial character are the first type of characters. M is equal to the first mask; the first M characters refer to M consecutive binary characters from the highest bit in the first initial character. The value of the character of the first type is a first value, and the first value is 1, that is, the character of the first type is 1.
所述第二类字符在所述第一初始字符中的数量以及位置,具体为:所述第一初始字符中的第M+1个及其之后的全部字符为所述第二类字符。所述第M+1个字符指的是所述第一初始字符中的最高位起的第M+1个二进制字符。所述第二类字符的取值为第一值,所述第一值为0,也就是说第二类字符为0。The number and position of the second type of characters in the first initial character is specifically: the M+1th and all subsequent characters in the first initial character are the second type of characters. The M+1 th character refers to the M+1 th binary character from the highest bit in the first initial character. The value of the character of the second type is a first value, and the first value is 0, that is, the character of the second type is 0.
其中,所述基于所述第二掩码,对所述第一初始字符串进行调整得到所述第一字符串包括:基于所述第二掩码,将所述第一初始字符串中的前L个字符调整为第二类字符,其余字符保持不变,得到所述第一字符串;L等于所述第二掩码,L为小于等于M的整数。也就是说,在所述第一字符串中所述第一类字符调整为第L+1个字符至第M个字符,所述第一字符串中的最高位起的连续L位字符为所述第二类字符,且从第M+1个字符之后也均为所述第二类字符。Wherein, the adjusting the first initial character string based on the second mask to obtain the first character string includes: based on the second mask, adjusting the first character string in the first initial character string The L characters are adjusted to the second type of characters, and the remaining characters remain unchanged to obtain the first character string; L is equal to the second mask, and L is an integer less than or equal to M. That is to say, in the first character string, the first type of characters are adjusted to the L+1 th character to the M th character, and the consecutive L-bit characters from the highest position in the first character string are all character of the second type, and the characters after the M+1th character are also the characters of the second type.
所述第一字符串具体可以为二进制字符串;所述第一字符串包含的总位数也与所述当前选取或确定网络地址的类型相关,比如所述当前选取或确定网络地址的类型为IPv4类型的网络地址,所述第一字符串的总位数为32位;所述当前选取或确定网络地址的类型IPv6类型的网络地址,所述第一字符串的总位数为128。The first character string may specifically be a binary character string; the total number of digits included in the first character string is also related to the type of the currently selected or determined network address, for example, the type of the currently selected or determined network address is: For the network address of IPv4 type, the total number of digits of the first string is 32; for the network address of the IPv6 type of the currently selected or determined network address, the total number of digits of the first string is 128.
举例来说,假设所述当前选取或确定网络地址的类型为IPv4类型的网络地址,所述第一字符串的长度等于32;假设所述第一掩码为15,所述第二掩码为13,则所述第一字符串中第14、15位为1,剩余位为0,也就是第一字符串为“00000000 00000110 0000000000000000”。For example, assuming that the type of the currently selected or determined network address is an IPv4 network address, the length of the first string is equal to 32; assuming that the first mask is 15, the second mask is 13, the 14th and 15th bits in the first string are 1, and the remaining bits are 0, that is, the first string is "00000000 00000110 0000000000000000".
所述基于所述第一字符串划分得到的N个字符串分组中分别包含的第一类字符和/或第二类字符,确定所述N个分段输入区域所分别对应的至少一个调整值,可以包括:将所述第一字符串划分为N个字符串分组,基于所述N个字符串分组中分别包含的第一类字符和/或第二类字符,确定所述N个分段输入区域所分别对应的至少一个调整值。The first type of characters and/or the second type of characters included in the N character string groups obtained by dividing the first character string, determining at least one adjustment value corresponding to each of the N segmented input areas may include: dividing the first character string into N character string groups, and determining the N segments based on the first type characters and/or the second type characters respectively included in the N character string groups At least one adjustment value corresponding to the input area.
所述对所述第一字符串进行划分,得到N个字符串分组具体可以是:从所述第一字符串的最高位开始分别依次选取预设数量个字符,将每预设数量个字符作为一个字符串分组。其中,所述N的取值可以为4,所述预设数量可以为8或者可以为32。以所述当前选取或确定网络地址的类型为IPv4类型的网络地址为例,所述第一掩码所对应的所述第一字符串划分为4个字符串分组,每一个字符串分组包含8位字符。The dividing the first character string to obtain N character string groupings may specifically be: starting from the highest position of the first character string, selecting a preset number of characters in sequence, and using each preset number of characters as A string grouping. The value of N may be 4, and the preset number may be 8 or 32. Taking the type of the currently selected or determined network address as the network address of the IPv4 type as an example, the first character string corresponding to the first mask is divided into 4 character string groupings, and each character string grouping contains 8 bit character.
所述基于所述N个字符串分组中分别包含的第一类字符和/或第二类字符,确定所述N个分段输入区域所分别对应的至少一个调整值,具体可以包括:The determining at least one adjustment value corresponding to each of the N segmented input areas based on the first type of characters and/or the second type of characters contained in the N character string groups may specifically include:
判断所述N个字符串分组中的第p个字符串分组中是否包含所述第一类字符;若所述第p个字符串分组中不包含所述第一类字符,则所述第p个字符串分组所对应的第p个分段输入区域的调整值为0;p为大于等于1且小于等于N的整数;Judging whether the pth string grouping in the N string groups contains the first type of characters; if the pth string grouping does not contain the first type of characters, then the pth string grouping does not contain the first type of characters The adjustment value of the p-th segment input area corresponding to each string grouping is 0; p is an integer greater than or equal to 1 and less than or equal to N;
若所述第p个字符串分组中包含f个所述第一类字符,则将所述第p个字符串分组的f个所述第一类字符分别取第一值且其余字符位均取第二值,计算得到f个目标进制的数值;将所述f个目标进制的数值分别组合相加得到所述至少一个调整值;f为大于等于1的整数。If the p-th string grouping contains f first-type characters, the f first-type characters in the p-th string grouping take the first value respectively, and the rest of the characters are all taken as the first value. The second value is calculated to obtain f numerical values of the target base; the at least one adjustment value is obtained by combining and adding the numerical values of the f target bases; f is an integer greater than or equal to 1.
所述目标进制与所述当前选取或确定网络地址的类型相关,比如所述当前选取或确定网络地址的类型为IPv4类型的网络地址,则所述目标进制为十进制,若所述当前选取或确定网络地址的类型为IPv6类型的网络地址,则所述目标进制为十六进制。The target system is related to the type of the currently selected or determined network address. For example, the type of the currently selected or determined network address is an IPv4 type network address, then the target system is decimal. If the current selection Or if it is determined that the type of the network address is an IPv6 type network address, the target system is hexadecimal.
其中,所述将所述第p个字符串分组的f个所述第一类字符分别取第一值且其余字符位均取第二值,计算得到f个目标进制的数值,可以包括:Wherein, the f first-type characters grouped by the p-th character string respectively take the first value and the rest of the character bits take the second value respectively, and the numerical values of f target bases are obtained by calculation, which may include:
将所述第p个字符串分组的所述f个所述第一类字符中第1个字符位取1、其余字符位取0,计算得到第1个目标进制的数值;The first character bit of the f described first-class characters grouped by the p-th character string is taken as 1, and the rest of the character bits are taken as 0, and the numerical value of the first target system is obtained by calculating;
以此类推,直至将所述第p个字符串分组的所述f个所述第一类字符中的第f个字符位取1、其余字符位取0,计算得到第f个目标进制的数值。And so on, until the f-th character bit of the f first-type characters grouped by the p-th string is set to 1, and the rest of the character bits are set to 0, and the f-th target system is calculated. numerical value.
所述将所述f个目标进制的数值分别组合相加得到所述至少一个调整值可以为:将所述f个目标进制的数值中的任意一个或多个分别组合相加得到所述至少一个调整值。其中,所述至少一个调整值的具体数量可以等于2f-1个。比如,f为2,且第一类字符的位置为第14、15位,位于第2个字符串分组中的从右左数的第2、3位,将这两个字符位分别取值为1其余字符位均取0,计算得到22、23两个数值,将这两个数值分别组合相加可以得到3个调整值。The said at least one adjustment value obtained by combining and adding the numerical values of the f target radix may be: combining and adding any one or more of the numerical values of the f target radix to obtain the said at least one adjustment value. At least one adjustment value. Wherein, the specific number of the at least one adjustment value may be equal to 2 f −1 . For example, f is 2, and the positions of the first type of characters are the 14th and 15th bits, which are located in the 2nd and 3rd bits from the right to the left in the second string grouping, and the two character bits are set to 1 respectively. The rest of the character bits are all set to 0, and two values of 2 2 and 2 3 are obtained by calculation, and three adjustment values can be obtained by combining and adding these two values respectively.
所述基于N个分段初始值以及所述N个分段输入区域所分别对应的所述至少一个调整值,确定所述N个分段输入区域分别对应的所述可填写范围,包括:The determining of the fillable ranges corresponding to the N segment input areas based on the N segment initial values and the at least one adjustment value corresponding to the N segment input areas respectively includes:
基于第二网络地址划分得到N个分段初始值;所述第二网络地址为所述第一掩码所属私有网络的网段信息中的网络地址;N initial values of segments are obtained based on the second network address division; the second network address is the network address in the network segment information of the private network to which the first mask belongs;
基于所述N个分段初始值以及所述N个分段输入区域所分别对应的所述至少一个调整值,确定所述N个分段输入区域分别对应的所述可填写范围。The fillable ranges respectively corresponding to the N segment input areas are determined based on the N segment initial values and the at least one adjustment value corresponding to the N segment input areas respectively.
其中,所述基于所述N个分段初始值以及所述N个分段输入区域所分别对应的所述至少一个调整值,确定所述N个分段输入区域分别对应的所述可填写范围,具体可以为:Wherein, the fillable range corresponding to the N segment input areas is determined based on the N segment initial values and the at least one adjustment value corresponding to the N segment input areas respectively , which can be specifically:
将第y个分段初始值以及所述第y个分段输入区域对应的所述至少一个调整值分别相加,得到至少一个数值;将所述至少一个数值以及所述第y个分段初始值,均作为所述第y个分段输入区域的可填写范围;y为大于等于1且小于等于N的整数。adding the yth segment initial value and the at least one adjustment value corresponding to the yth segment input area respectively to obtain at least one numerical value; adding the at least one numerical value and the yth segment initial value value, both as the fillable range of the yth segment input area; y is an integer greater than or equal to 1 and less than or equal to N.
比如,所述第y个分段初始值为xxx,而所述第y个分段输入区域的调整值为0,则所述第y个分段输入区域的可填写范围仍然为168;所述第y个分段初始值为xxx,而所述第y个分段输入区域的调整值为0、1、2、3,则所述第y个分段输入区域的可填写范围包括:xxx、xxx+1、xxx+2、xxx+3。For example, if the initial value of the y-th segment is xxx, and the adjustment value of the y-th segment input area is 0, the fillable range of the y-th segment input area is still 168; the The initial value of the y-th segment is xxx, and the adjustment values of the y-th segment input area are 0, 1, 2, and 3. The fillable range of the y-th segment input area includes: xxx, xxx+1, xxx+2, xxx+3.
结合图2a,以所述当前选取或确定网络地址的类型为IPv4类型的网络地址为例进行说明:In conjunction with Fig. 2a, take the network address that the type of described current selection or determination network address is IPv4 type as an example to illustrate:
假设所述第一掩码=18,所述第二掩码等于16,也就是所述第一字符串的第17、18位取值为1,其余取值为0;将所述第一字符串划分为4个字符串分组,其中,第1个字符串分组为“00000000”,调整值为0,假设基于所述第二网络地址确定第1个分段初始值为192,最终第1个分段输入区域的所述可填写范围包含192这一个数值。第2个字符串分组为“00000000”,调整值为0,假设基于所述第二网络地址确定第2个分段初始值为xxx,最终第2个分段输入区域的可填写范围包含xxx。第3个字符串分组为“11000000”,将27、26中任意一个或多个组合相加得到3个数值以及0作为调整值,假设基于所述第二网络地址确定第3个分段初始值为0,则第3段网络地址的可填写范围为0以及上述3个数值。Assuming that the first mask=18, the second mask is equal to 16, that is, the 17th and 18th bits of the first character string are 1, and the rest are 0; The string is divided into 4 string groups, where the first string group is "00000000", and the adjustment value is 0. Assuming that the initial value of the first segment is determined to be 192 based on the second network address, the final first The fillable range of the segment input area includes a value of 192. The second string is grouped as "00000000", and the adjustment value is 0. Assuming that the initial value of the second segment is xxx based on the second network address, the final fillable range of the second segment input area includes xxx. The third string is grouped as "11000000", and any one or more combinations of 2 7 and 2 6 are added to obtain 3 values and 0 as the adjustment value, assuming that the third segment is determined based on the second network address The initial value is 0, and the fillable range of the network address in the third segment is 0 and the above three values.
可见,通过采用上述方案,在所述第一掩码为子网掩码的情况下,基于所述第一掩码以及其所属私有网络中的第二掩码来确定所述N个分段输入区域分别对应的可填写范围。如此,就可以结合更多的信息来保证更加准确的确定所述每一个分段输入区域中的所述可填写范围,从而避免在任意一个分段输入区域进行填写时出现错误而导致网络地址无效,这样就可以提高输入的网段信息的正确性以及准确度,并提高整体的处理效率。It can be seen that, by adopting the above solution, in the case where the first mask is a subnet mask, the N segment inputs are determined based on the first mask and the second mask in the private network to which it belongs. The corresponding fillable range of the area. In this way, more information can be combined to ensure more accurate determination of the fillable range in each segmented input area, so as to avoid errors when filling in any segmented input area and cause the network address to be invalid. , so that the correctness and accuracy of the input network segment information can be improved, and the overall processing efficiency can be improved.
在一种实施方式中,获取所述第一掩码,可以采用以下两种获取方式:In an implementation manner, to obtain the first mask, the following two obtaining methods may be adopted:
获取方式一、响应于在展示界面中的掩码输入区域获取到输入的数值,将输入的所述数值作为获取到的所述第一掩码。Obtaining method 1: In response to obtaining the input value in the mask input area in the display interface, the input value is used as the obtained first mask.
获取方式二、响应于在掩码输入区域处的第一操作,展示候选数值;响应于针对所述候选数值中的目标数值的第二操作,将所述目标数值作为所述第一掩码。Obtaining method 2: In response to a first operation at the mask input area, display a candidate value; in response to a second operation on a target value in the candidate value, use the target value as the first mask.
所述掩码输入区域可以是在所述展示界面的第一位置处,所述第一位置可以根据实际情况设置,比如可以是在所述展示界面的右侧,或者在所述展示界面的下方等等;另外,所述掩码输入区域与所述N个分段输入区域也存在相对位置关系,比如,所述掩码输入区域位于所述N个分段输入区域的右侧或下方等等,这里不做穷举。The mask input area may be at the first position of the display interface, and the first position may be set according to the actual situation, for example, it may be on the right side of the display interface, or at the bottom of the display interface etc.; in addition, there is also a relative positional relationship between the mask input area and the N segment input areas, for example, the mask input area is located to the right or below the N segment input areas, etc. , not exhaustive here.
比如图2b所示的在展示界面中,所述N个分段输入区域201的最右侧为所述掩码输入区域202。For example, in the display interface shown in FIG. 2 b , the
所述第一操作,可以为:针对所述掩码输入区域中的选取按键的点击操作。The first operation may be: a click operation on a selection button in the mask input area.
其中,所述掩码输入区域中的所述选取按键可以为虚拟按键,该选取按键可以是预设样式的,比如图2b中所述掩码输入区域的向下的箭头2021即可以为所述选取按键。相应的,在检测到点击图2b中的所述向下的箭头2021即为在所述掩码输入区域处检测到所述第一操作。The selection button in the mask input area may be a virtual button, and the selection button may be in a preset style. For example, the
所述候选数值可以为一个或多个,最大的候选数值可以与所述当前选取或确定网络地址的类型相关,比如所述当前选取或确定网络地址的类型为IPv4类型的,则所述最大的候选数值可以是32,所述当前选取或确定网络地址的类型为IPv6类型的网络地址,则所述最大的候选数值可以是128。The candidate value may be one or more, and the largest candidate value may be related to the type of the currently selected or determined network address. For example, if the type of the currently selected or determined network address is an IPv4 type, the largest The candidate value may be 32, and the type of the currently selected or determined network address is an IPv6 network address, and the maximum candidate value may be 128.
所述针对所述候选数值中的目标数值的第二操作,可以是:针对所述候选数值中的所述目标数值的点击操作。The second operation on the target value in the candidate values may be: a click operation on the target value in the candidate values.
所述将所述目标数值作为所述第一掩码可以指的是,将所述目标数值作为所述第一掩码的取值。The using the target value as the first mask may refer to using the target value as a value of the first mask.
可见,通过采用上述方案,就可以不用在编辑框内编辑输入,可直接通过选择即确定了第一掩码,不仅在一定程度上保证了输入的正确性,也便于操作,进而提高输入的网段信息的正确性和整体的处理效率。It can be seen that by adopting the above scheme, it is not necessary to edit the input in the editing box, and the first mask can be determined directly by selection, which not only ensures the correctness of the input to a certain extent, but also facilitates the operation, thereby improving the input network. The correctness of segment information and the overall processing efficiency.
在前述实施例中已经说明,所述第一掩码在为子网掩码的情况下,还会受限于其所属私有网络的所述第二掩码的限制,因此一种实施方式中,确定所述候选数值的方式可以包括:It has been described in the foregoing embodiments that, when the first mask is a subnet mask, it is also limited by the second mask of the private network to which it belongs. Therefore, in an implementation manner, The manner of determining the candidate value may include:
在所述掩码输入区域为子网掩码的选取区域的情况下,基于当前所属私有网络的第二掩码,从全部数值中确定至少部分数值作为所述候选数值。In the case that the mask input area is a selection area of a subnet mask, at least a part of the values is determined as the candidate value from all the values based on the second mask of the private network to which it currently belongs.
由于所述掩码输入区域为子网掩码的选取区域,也就是用户本次输入的所述第一掩码是子网掩码,因此会受到其所属私有网络的CIDR的第二掩码的限制。Since the mask input area is the selection area of the subnet mask, that is, the first mask input by the user this time is the subnet mask, so it will be affected by the second mask of the CIDR of the private network to which it belongs. limit.
所述从全部数值中确定至少部分数值作为所述候选数值,具体可以为:将所述全部数值中大于所述第二掩码的数值作为所述候选数值。The determining at least part of the values from all the values as the candidate values may specifically include: taking a value greater than the second mask among the all values as the candidate values.
例如所属私有网络的所述第二掩码是25,那么子网掩码也就是所述第一掩码的可选范围只有26-32,即所述候选数值为26-32。For example, the second mask of the private network to which it belongs is 25, then the optional range of the subnet mask, that is, the first mask, is only 26-32, that is, the candidate value is 26-32.
这种情况下,展示所述候选数值的方式可以包括:仅展示所述候选数值;或者,采用不同的选取状态展示全部数值,比如,采用不可选取状态展示除所述候选数值之外的其他数值,采用可选取状态展示所述候选数值。In this case, the manner of displaying the candidate value may include: displaying only the candidate value; or, displaying all values in different selection states, for example, displaying other values except the candidate value in an unselectable state , the candidate value is displayed in a selectable state.
所述不可选取状态的展示效果与所述可选取状态的展示效果不同,并且所述不可选取状态下对点击操作不做响应,所述可选取状态下对点击操作进行响应。所述不可选取状态的展示效果可以为:背景灰色、字体颜色变深灰等等;所述可选取状态的展示效果可以为:背景透明,字体颜色黑色。The display effect of the unselectable state is different from that of the selectable state, and the unselectable state does not respond to the click operation, and the selectable state responds to the click operation. The display effect of the unselectable state may be: the background is gray, the font color becomes dark gray, etc.; the display effect of the selectable state may be: the background is transparent, and the font color is black.
在当前所要选取的所述第一掩码为子网掩码的情况下,还可以基于其所属私有网络的所述第二掩码来确定所述候选数值的范围,从而提高输入的网段信息的正确性,还可以避免由于输入错误再进行修改所带来的时间消耗问题,提高整体的处理效率。When the currently selected first mask is a subnet mask, the range of the candidate value can also be determined based on the second mask of the private network to which it belongs, thereby improving the input network segment information It can also avoid the time consumption problem caused by input errors and then modify it, and improve the overall processing efficiency.
图3a是根据本公开第二实施例的网段信息处理方法的示意图,包括:3a is a schematic diagram of a network segment information processing method according to a second embodiment of the present disclosure, including:
S301:对所述第一网络地址进行转换,得到所述第一网络地址的二进制字符串;S301: Convert the first network address to obtain a binary string of the first network address;
S302:基于所述第一掩码确定所述第一网络地址的所述二进制字符串中的验证字符串;S302: Determine a verification string in the binary string of the first network address based on the first mask;
S303:基于所述验证字符串对所述第一掩码进行验证,得到所述第一掩码的有效性验证结果。S303: Verify the first mask based on the verification string to obtain a validity verification result of the first mask.
结合图3b对S301中所述第一网络地址进行转换,得到所述第一网络地址的二进制字符串进行说明:The first network address in S301 is converted in conjunction with Fig. 3b to obtain the binary string of the first network address for description:
S3011:基于所述预设标识符将所述第一网络地址拆分为N段,得到N段子信息;S3011: Split the first network address into N segments based on the preset identifier to obtain N segments of sub-information;
所述预设标识符可以跟所述第一网络地址的网络地址类型相关;比如,IPv4类型的网络地址的所述预设标识符为“.”,IPv6类型的网络地址的所述预设标识符为“:”。The preset identifier may be related to the network address type of the first network address; for example, the preset identifier of an IPv4-type network address is ".", and the preset identifier of an IPv6-type network address The character is ":".
其中N为大于等于1的整数,比如N为4,也就是可以将所述第一网络地址拆分成4段,得到4段子信息。N is an integer greater than or equal to 1, for example, N is 4, that is, the first network address can be divided into 4 segments to obtain 4 segments of sub-information.
假设所述第一网络地址为“192.xxx.0.0”可根据所述预设标识符“.”将所述第一网络地址拆分为192、xxx、0、0这4段子信息。采用的代码可以为“partArray=cidr.split(‘.’)”,其中“partArray”表示拆分后的4段子信息,“cidr”表示第一网段信息,这里所述第一网段信息即包含所述第一网络地址的网段信息,“split(‘.’)”表示采用所述预设标识符“.”拆分所述第一网络地址。Assuming that the first network address is "192.xxx.0.0", the first network address can be split into four sub-information of 192, xxx, 0, and 0 according to the preset identifier ".". The code used can be "partArray=cidr.split('.')", where "partArray" represents the 4 segments of sub-information after splitting, and "cidr" represents the first network segment information, and the first network segment information here is Contains the network segment information of the first network address, "split('.')" indicates that the first network address is split by using the preset identifier ".".
由于所述第一网络地址为不同类型网络地址的情况下可能使用不同进制的数字,比如,所述第一网络地址为IPv4类型网络地址,其每段子信息均为10进制数;所述第一网络地址为IPv6类型网络地址,其每段子信息均为16进制数。因此,本步骤还可以包括:将所述N段子信息转换成十进制。采用的代码可以为“part=parseInt(part,10)”,其中等号左边的part表示N段子信息中的任意一段转换为10进制之后的数,“parseInt(part,10)”中“parseInt()”表示函数解析字符串并返回整数,(part,10)表示将N段子信息中的任意一段转换成10进制的整数。Since the first network address is a network address of different types, numbers in different bases may be used. For example, the first network address is an IPv4 type network address, and each segment of sub-information is a decimal number; the The first network address is an IPv6 type network address, and each segment of sub-information is a hexadecimal number. Therefore, this step may further include: converting the N pieces of sub-information into decimal. The code used can be "part=parseInt(part,10)", where the part to the left of the equal sign represents the number after converting any of the N segments of sub-information into decimal, and "parseInt(part,10)" in "parseInt(part,10)" ()" means that the function parses the string and returns an integer, and (part, 10) means converts any of the N segments of sub-information into a decimal integer.
S3012:将所述N段子信息中的当前段子信息转换为二进制,得到所述当前段子信息的初始二进制字符串。S3012: Convert the current segment sub-information in the N segments of sub-information into binary to obtain an initial binary string of the current segment sub-information.
由于此时所述N段子信息中每段子信息都是0-255的十进制数,可以利用JavaScript的toString(2)方法,直接将所述当前段子信息转换成对应的二进制字符串。Since each segment of sub-information in the N segments of sub-information is a decimal number of 0-255 at this time, the toString(2) method of JavaScript can be used to directly convert the current segment of sub-information into a corresponding binary string.
S3013:判断所述当前段子信息的所述初始二进制字符串的长度是否等于预设长度,若等于,则将所述当前段子信息的所述初始二进制字符串作为所述当前段子信息的二进制字符串,然后执行S3015;否则,执行S3014。S3013: Determine whether the length of the initial binary string of the current segment sub-information is equal to a preset length, and if it is equal, use the initial binary string of the current segment sub-information as the binary string of the current segment sub-information , and then execute S3015; otherwise, execute S3014.
其中,所述预设长度与所述第一网络地址的网络地址类型相关,比如所述第一网络地址为IPv4类型网络地址,所述预设长度为8;所述第一网络地址为IPv6类型网络地址,所述预设长度为32。The preset length is related to the network address type of the first network address, for example, the first network address is an IPv4 type network address, and the preset length is 8; the first network address is an IPv6 type Network address, the preset length is 32.
假设所述第一网络地址为IPv4类型的网络地址,其拆分为192、xxx、0、0这4段子信息,所述当前段子信息为“192”,192可处理为初始二进制字符串“11000000”,此时该初始二进制字符串的长度为8,则可以直接将其作为所述当前段子信息的所述二进制字符串。Assuming that the first network address is an IPv4 type network address, it is divided into 4 segments of sub-information 192, xxx, 0, and 0, the current segment of sub-information is "192", and 192 can be processed as the initial binary string "11000000 ”, at this time, the length of the initial binary string is 8, and it can be directly used as the binary string of the sub-information of the current segment.
S3014:在所述当前段子信息的所述初始二进制字符串的前面补0,得到所述当前段子信息的所述二进制字符串。S3014:
S3015:判断所述N段子信息是否处理完成,若未完成,则返回执行S3012;若完成,则将所述N段子信息分别对应的所述二进制字符串合并,得到所述第一网络地址的所述二进制字符串。S3015: Determine whether the processing of the N segments of sub-information is completed, and if not, return to execute S3012; if completed, combine the binary strings corresponding to the N segments of sub-information to obtain all the first network addresses. describe the binary string.
示例性的,如图4所示的所述第一网段信息192.xxx.0.0/16,所述第一掩码为16,所述第一网络地址为IPv4类型的网络地址:192.xxx.0.0;将该第一网络地址根据“.”拆分为192、xxx、0、0这4段,然后分别进行二进制转换,例如直接将192处理成8位01格式的二进制字符串,其中,如果不满8位则在前补0,则192可处理为11000000,整个网络地址可处理成32位01字符串,具体的,如图4所示的所述第一网络地址192.xxx.0.0的二进制字符串“11000000 yyyyyyyy 00000000 00000000”,其中,第一分段192对应11000000,第二分段xxx对应yyyyyyyy,第三分段0对应00000000,第四分段0对应00000000。Exemplarily, as shown in FIG. 4, the first network segment information is 192.xxx.0.0/16, the first mask is 16, and the first network address is an IPv4 type network address: 192.xxx .0.0; split the first network address into 4 segments of 192, xxx, 0, and 0 according to ".", and then perform binary conversion respectively, for example, directly process 192 into a binary string in 8-bit 01 format, where, If it is less than 8 bits, add 0 in front, then 192 can be processed as 11000000, and the entire network address can be processed as a 32-bit 01 string. Specifically, as shown in Figure 4, the first network address of 192.xxx.0.0 The binary string "11000000
所述基于所述第一掩码确定所述第一网络地址的所述二进制字符串中的验证字符串,可以为基于所述第一掩码将所述第一网络地址的所述二进制字符串中的部分字符提取出来作为验证字符串。The determination of the verification string in the binary string of the first network address based on the first mask may be a combination of the binary string of the first network address based on the first mask. Part of the characters in are extracted as the verification string.
所述第一掩码的有效性验证结果可以包括有效或无效。The validity verification result of the first mask may include valid or invalid.
可见,通过采用上述方案,可以对所述第一网络地址转换得到对应的二进制字符串,进而基于所述第一掩码从中提取验证字符串,基于该验证字符串对所述第一掩码进行验证。如此,就可以在获取到所述第一网络地址以及所述第一掩码的情况下,基于所述第一网络地址对所述第一掩码进行验证,避免了仅对掩码的格式进行验证而无法验证掩码的有效性的问题,提高输入的第一网络地址以及第一掩码的准确度,进而提高整体的处理效率。It can be seen that by adopting the above solution, the first network address can be converted to obtain a corresponding binary string, and then a verification string can be extracted from the first mask based on the first mask, and the first mask can be processed based on the verification string. verify. In this way, when the first network address and the first mask are obtained, the first mask can be verified based on the first network address, avoiding the need to verify only the format of the mask. To solve the problem that the validity of the mask cannot be verified after verification, the accuracy of the inputted first network address and the first mask is improved, thereby improving the overall processing efficiency.
在一种实施方式中,所述基于所述第一掩码确定所述第一网络地址的二进制字符串中的验证字符串,包括:In an implementation manner, the determining, based on the first mask, the verification string in the binary string of the first network address includes:
基于所述第一掩码,从所述第一网络地址的所述二进制字符串中的最高位起的连续M位二进制字符之外的剩余二进制字符作为所述验证字符串;M等于所述第一掩码,M为大于等于1的整数。Based on the first mask, the remaining binary characters except the consecutive M-bit binary characters from the highest bit in the binary string of the first network address are used as the verification string; M is equal to the first A mask, M is an integer greater than or equal to 1.
如图4所示,所述第一网络地址192.xxx.0.0的二进制字符串为“11000000yyyyyyyy 00000000 00000000”,假设所述第一掩码为16,则所述验证字符串为“0000000000000000”。As shown in FIG. 4 , the binary string of the first network address 192.xxx.0.0 is "
根据上述处理,由于对得到所述第一网络地址后通过二进制转换,得到所述第一网络地址的所述二进制字符串,而采用二进制字符串进行后续的验证处理可以更加简单快捷,从而实时且准确的对所述第一掩码的有效性进行验证,避免了提交无效的网段信息,提高整体的处理效率。According to the above processing, since the binary string of the first network address is obtained through binary conversion after the first network address is obtained, the subsequent verification processing using the binary string can be simpler and faster, so that the real-time and The validity of the first mask is accurately verified, the submission of invalid network segment information is avoided, and the overall processing efficiency is improved.
所述基于所述验证字符串对所述第一掩码进行验证,得到所述第一掩码的有效性验证结果,包括:在所述验证字符串中包含第一值的情况下,确定所述第一掩码的有效性验证结果为无效;在所述验证字符串中不包含第一值的情况下,确定所述第一掩码的有效性验证结果为有效。The verifying the first mask based on the verification string to obtain a validity verification result of the first mask includes: in the case that the verification string includes a first value, determining the The validity verification result of the first mask is invalid; in the case that the verification string does not contain the first value, it is determined that the validity verification result of the first mask is valid.
其中,所述第一值为1。Wherein, the first value is 1.
也就是说,如果所述第一网络地址填写为正确的情况下,在所述第一掩码对应的M位二进制字符之外的其他二进制字符中不应该存在取值为1的字符,若出现了,就确定所述第一掩码的有效性验证结果为无效。That is to say, if the first network address is filled in correctly, there should be no character with a value of 1 in other binary characters except the M-bit binary characters corresponding to the first mask. Then, it is determined that the validity verification result of the first mask is invalid.
进一步地,还可以包括:展示所述第一掩码无效的验证结果;响应于修改指示,返回执行前述S101的处理,也就是用户在查看到本次输入的所述第一网段信息的所述第一掩码无效的情况下,可以选择重新输入所述第一网段信息。Further, it may also include: displaying the verification result that the first mask is invalid; in response to the modification instruction, returning to execute the process of the foregoing S101, that is, the user is viewing all the information of the first network segment input this time. If the first mask is invalid, you can choose to re-input the first network segment information.
在相关技术中,在客户端只能在客户端对网段信息进行格式校验,无法对用户填写的网段信息的内容正确性进行校验若网段信息无效并立即提示给用户。根据本公开实施例,可在得到所述第一网络地址后通过二进制转换,得到所述第一网络地址的二进制字符串,进而基于所述第一掩码来从所述第一网络地址的所述二进制字符串中提取所述验证字符串,基于所述验证字符串中是否包含第一值来确定所述第一掩码的所述有效性验证结果,这样就可以实时且有效的对所述第一掩码的有效性进行验证,避免提交无效的网段信息之后,再发现错误进而重新修改所带来的影响处理效果的问题,提高整体的处理效率。In the related art, the client can only perform format verification on the network segment information on the client side, and cannot verify the correctness of the content of the network segment information filled in by the user. If the network segment information is invalid, the user is immediately prompted. According to the embodiments of the present disclosure, after the first network address is obtained, a binary string of the first network address can be obtained through binary conversion, and then all the first network address can be obtained from the first network address based on the first mask. Extracting the verification string from the binary string, and determining the validity verification result of the first mask based on whether the verification string contains a first value, so that the The validity of the first mask is verified, so as to avoid the problem of affecting the processing effect caused by finding errors and then re-modifying the invalid network segment information after submitting the invalid network segment information, thereby improving the overall processing efficiency.
在一种实施方式中,如图5所示,还包括:In one embodiment, as shown in Figure 5, it also includes:
S501:将第三网络地址转换为第三网络地址的二进制字符串,将所述第一网络地址转换为所述第一网络地址的二进制字符串。S501: Convert a third network address into a binary string of the third network address, and convert the first network address into a binary string of the first network address.
S502:基于所述第一掩码从所述第三网络地址的所述二进制字符串中获取第一待比对字符串,以及从所述第一网络地址的所述二进制字符串中获取参考字符串。S502: Obtain a first character string to be compared from the binary character string of the third network address based on the first mask, and obtain a reference character from the binary character string of the first network address string.
S503:在所述第一待比对字符串与所述参考字符串相同的情况下,确定所述第三网络地址与所述第一网络地址在相同网段内。S503: In the case that the first character string to be compared is the same as the reference character string, determine that the third network address and the first network address are in the same network segment.
执行S501之前,需要首先获取所述第三网络地址;其中,获取所述第三网络地址的方式可以包括:通过用户输入、用户选择、或用户预设置等方式。也就是说,所述第三网络地址可以为用户输入或用户选择的任意一个网络地址。Before executing S501, the third network address needs to be obtained first; wherein, the method of obtaining the third network address may include: user input, user selection, or user preset and other methods. That is to say, the third network address may be any network address input by the user or selected by the user.
具体来说,所述第三网络地址可以为IP地址;另外所述第三网络地址的类型与所述第一网段信息的中的所述第一网络地址的类型可以相同或不同。比如,所述第三网络地址的类型与所述第一网络地址均为IPv4类型的网络地址或均为IPv6类型的网络地址。Specifically, the third network address may be an IP address; in addition, the type of the third network address and the type of the first network address in the first network segment information may be the same or different. For example, the type of the third network address and the first network address are both IPv4 type network addresses or both are IPv6 type network addresses.
所述基于所述第一掩码从所述第三网络地址的所述二进制字符串中获取第一待比对字符串,以及从所述第一网络地址的所述二进制字符串中获取参考字符串,可以包括:基于所述第一掩码从所述第三网络地址的所述二进制字符串中获取最高位起的连续M位二进制字符作为所述第一待比对字符串,以及从所述第一网络地址的二进制字符串中最高位起的连续M位二进制字符作为所述参考字符串;M等于所述第一掩码。obtaining a first character string to be compared from the binary character string of the third network address based on the first mask, and obtaining a reference character from the binary character string of the first network address The string may include: obtaining, based on the first mask, from the binary string of the third network address, consecutive M-bit binary characters from the highest bit as the first string to be compared; M consecutive binary characters from the highest bit in the binary string of the first network address are used as the reference string; M is equal to the first mask.
例如,第一网络地址192.xxx.0.0转换为二进制字符串“11000000 yyyyyyyy00000000 00000000”,第一掩码16对应的位数“11000000 yyyyyyyy”即为参考字符串。确定第三网络地址的第一待比对字符串的方式与其类似不做赘述。For example, the first network address 192.xxx.0.0 is converted into a binary string "11000000
所述在所述第一待比对字符串与所述参考字符串相同的情况下,确定所述第三网络地址与所述第一网络地址在相同网段内,具体可以包括:The determining that the third network address and the first network address are in the same network segment when the first character string to be compared is the same as the reference character string may specifically include:
判断所述第一待比对字符串与所述参考字符串中每一位二进制字符的取值是否相同;Judging whether the value of each binary character in the first character string to be compared and the reference character string is the same;
在所述第一待比对字符串与所述参考字符串中每一位二进制字符的取值均相同的情况下,确定所述第三网络地址与所述第一网络地址在相同网段内;In the case that the value of each binary character in the first character string to be compared and the reference character string are the same, it is determined that the third network address and the first network address are in the same network segment ;
否则,确定所述第三网络地址与所述第一网络地址在不同网段内。Otherwise, it is determined that the third network address and the first network address are in different network segments.
还需指出,所述第三网络地址与所述第一网络地址不同,举例来说,所述第一网络地址指的是所述第一网段信息中的网络地址;所述第三网络地址则可以是网络地址加主机地址组成的。根据本公开实施例,假设所述第一网段信息中的所述第一掩码为10,则可在所述参考字符串以及所述第一待比对字符串为相同的情况下,确定所述第三网络地址在所述第一网段内。It should also be pointed out that the third network address is different from the first network address. For example, the first network address refers to the network address in the first network segment information; the third network address It can be composed of the network address plus the host address. According to an embodiment of the present disclosure, assuming that the first mask in the first network segment information is 10, it can be determined that the reference character string and the first character string to be compared are the same. The third network address is within the first network segment.
由于采用十进制或十六进制表示的网络地址的规律并不明显,因此不易判断采用十进制或十六进制表示的网络地址是否处于同一网段,上述方案通过将两个网络地址均转换成二进制字符串,采用第一掩码来获取所述参考字符串以及所述第一待比对字符串判断两个网络地址是否处于同一网段内,可以保证判断效率以及判断准确性,从而为后续的处理提供可靠的参考,提高整体的处理效率。Since the rules of network addresses expressed in decimal or hexadecimal are not obvious, it is not easy to judge whether the network addresses expressed in decimal or hexadecimal are in the same network segment. The above solution converts both network addresses into binary. character string, using the first mask to obtain the reference character string and the first character string to be compared to determine whether the two network addresses are in the same network segment, which can ensure the judgment efficiency and judgment accuracy, so as to be a follow-up Processing provides a reliable reference and improves overall processing efficiency.
在一种实施方式中,如图6所示,还可以包括:In one embodiment, as shown in Figure 6, it can also include:
S601:将第四网段信息中的第四网络地址转换为所述第四网络地址的二进制字符串,将所述第一网络地址转换为所述第一网络地址的二进制字符串;S601: Convert the fourth network address in the fourth network segment information into a binary string of the fourth network address, and convert the first network address into a binary string of the first network address;
S602:将所述第一掩码与所述第四网段信息的第四掩码中的最小值作为目标掩码;S602: Use the minimum value of the first mask and the fourth mask of the fourth network segment information as a target mask;
S603:基于所述目标掩码从所述第四网络地址的所述二进制字符串中获取第二待比对字符串,基于所述目标掩码从所述第一网络地址的所述二进制字符串中获取第三待比对字符串;S603: Obtain a second character string to be compared from the binary character string of the fourth network address based on the target mask, and obtain a second character string to be compared from the binary character string of the first network address based on the target mask to obtain the third string to be compared;
S604:在所述第二待比对字符串与所述第三待比对字符串相同的情况下,确定所述第四网段信息与所述第一网段信息重叠。S604: In the case that the second character string to be compared is the same as the third character string to be compared, determine that the fourth network segment information overlaps the first network segment information.
执行S601之前,还需要获取第四网段信息。其中,所述第四网段信息可以是通过用户输入或者用户预设置等方式获取的。也就是说,所述第四网段信息可以为用户输入的任意一个网段信息。Before executing S601, the fourth network segment information also needs to be acquired. Wherein, the fourth network segment information may be acquired through user input or user preset or other means. That is to say, the fourth network segment information may be any network segment information input by the user.
具体的,分别对所述第四网络地址和所述第一网络地址进行二进制转换,以得到所述第四网络地址的二进制字符串、所述第一网络地址的二进制字符串。Specifically, binary conversion is performed on the fourth network address and the first network address, respectively, to obtain a binary string of the fourth network address and a binary string of the first network address.
所述第四掩码与所述第一掩码可以不同。所述将所述第一掩码与所述第四网段信息的第四掩码中的最小值作为目标掩码,可以是,比较所述第一掩码与所述第四掩码两者之间的大小,若所述第一掩码小于所述第四掩码,则所述目标掩码为所述第一掩码;否则,所述目标掩码为所述第四掩码。The fourth mask may be different from the first mask. The taking the minimum value of the first mask and the fourth mask of the fourth network segment information as the target mask may be, comparing both the first mask and the fourth mask If the first mask is smaller than the fourth mask, the target mask is the first mask; otherwise, the target mask is the fourth mask.
这是由于两个网段信息中掩码若相同,则直接可以看出网络地址是否相同,不需要采用本处理方式来确定两个网段信息是否存在重叠。而本方式主要针对了掩码存在不同,此时两个网段信息中的网络地址信息就无法简单的来确定是否存在相同的前缀,因此采用本实施例提供的方案,基于两个网段信息中的最小掩码作为所述目标掩码,基于该目标掩码从两个网络地址的二进制字符串中分别提取待比对字符串,基于提取的两个待比对字符串是否完全相同,来确定两个网段信息是否重叠。This is because if the masks in the two network segment information are the same, it can be directly seen whether the network addresses are the same, and this processing method does not need to be used to determine whether the two network segment information overlaps. However, this method is mainly aimed at different masks. At this time, the network address information in the two network segment information cannot simply determine whether there is the same prefix. Therefore, the solution provided by this embodiment is adopted, based on the two network segment information. The minimum mask in the target mask is used as the target mask, and based on the target mask, the strings to be compared are respectively extracted from the binary strings of the two network addresses, and based on whether the extracted two strings to be compared are exactly the same, to Determines whether two network segment information overlaps.
另外,若确定所述第四网段信息与所述第一网段信息重叠,则可以基于所述第一掩码是否大于所述第四掩码来确定所述第四网段信息与第一网段信息哪个为子网的网段信息,哪个为其所属私有网络的网段信息。In addition, if it is determined that the fourth network segment information and the first network segment information overlap, the fourth network segment information and the first network segment information may be determined based on whether the first mask is greater than the fourth mask. Which network segment information is the network segment information of the subnet, and which is the network segment information of the private network to which it belongs.
举例来说,若所述第一掩码大于所述四掩码,则所述第一网段信息为子网的网段信息,所述第四网段信息为所述第一网段所属私有网络的网段信息。For example, if the first mask is greater than the four masks, the first network segment information is the network segment information of the subnet, and the fourth network segment information is the private property to which the first network segment belongs. Network segment information.
所述基于所述目标掩码从所述第四网络地址的二进制字符串中获取第二待比对字符串,基于所述目标掩码从所述第一网络地址的二进制字符串中获取第三待比对字符串,可以包括:基于所述目标掩码从所述第四网络地址的所述二进制字符串中获取最高位起的连续K位二进制字符作为所述第二待比对字符串,以及从所述第一网络地址的二进制字符串中最高位起的连续K位二进制字符作为所述第三待比对字符串;K为大于等于1的整数,K等于所述目标掩码。The second string to be compared is obtained from the binary string of the fourth network address based on the target mask, and the third string to be compared is obtained from the binary string of the first network address based on the target mask. The character string to be compared may include: obtaining consecutive K-bit binary characters from the highest bit from the binary character string of the fourth network address based on the target mask as the second character string to be compared, And consecutive K-bit binary characters from the highest bit in the binary string of the first network address are used as the third string to be compared; K is an integer greater than or equal to 1, and K is equal to the target mask.
所述在所述第二待比对字符串与所述第三待比对字符串相同的情况下,确定所述第四网段信息与所述第一网段信息重叠,具体可以包括:The determining that the fourth network segment information overlaps the first network segment information when the second character string to be compared is the same as the third character string to be compared may specifically include:
判断所述第二待比对字符串与所述第三待比对字符串中每一位二进制字符的取值是否相同;Judging whether the value of each binary character in the second string to be compared and the third string to be compared is the same;
在所述第二待比对字符串与所述第三待比对字符串中每一位二进制字符的取值均相同的情况下,确定所述第四网段信息与所述第一网段信息重叠;In the case that the value of each binary character in the second string to be compared and the value of each binary character in the third string to be compared are the same, determine that the fourth network segment information and the first network segment information overlap;
否则,确定所述第四网段信息与所述第一网段信息不重叠。Otherwise, it is determined that the fourth network segment information does not overlap with the first network segment information.
可见,通过采用上述方案,就可以将不同的网段信息转换为易处理的二进制字符串,并通过每个网段信息分别包含的掩码提取各个网络地址的二进制字符串对应前缀,来判断确定两个网段信息有重叠。如此,可以快速的确定两个网段信息之间的关系,进而可以为后续的相关处理提供更加可靠的参考信息,以提升整体的处理效率。It can be seen that by adopting the above scheme, different network segment information can be converted into easy-to-handle binary strings, and the corresponding prefix of the binary string of each network address can be extracted through the mask contained in each network segment information to determine the determination. The information of the two network segments overlaps. In this way, the relationship between the two network segment information can be quickly determined, thereby providing more reliable reference information for subsequent related processing, so as to improve the overall processing efficiency.
本公开第二方面实施例提供一种网段信息处理装置,如图7a所示,包括:The embodiment of the second aspect of the present disclosure provides a network segment information processing apparatus, as shown in FIG. 7a, including:
范围确定模块701,用于响应于获取到第一掩码,基于所述第一掩码确定N个分段输入区域分别对应的可填写范围;N为大于等于1的整数;A
展示模块702,用于在所述N个分段输入区域分别展示对应的所述可填写范围;A
网段信息确定模块703,用于响应于在所述N个分段输入区域获取到N个输入信息,基于所述N个输入信息生成第一网络地址,基于所述第一网络地址以及所述第一掩码,确定第一网段信息。A network segment
所述范围确定模块701,用于基于所述第一掩码,确定第一字符串;所述第一字符串中包含第一类字符以及第二类字符,所述第一类字符的取值为第一值,所述第二类字符的取值为第二值;对所述第一字符串进行划分,得到N个字符串分组;基于所述N个字符串分组中分别包含的所述第一类字符和/或所述第二类字符,确定所述N个分段输入区域所分别对应的所述可填写范围。The
所述范围确定模块701,用于根据所述第一掩码以及第二掩码,确定第一字符串;其中,所述第一字符串包含第一类字符以及第二类字符,所述第一类字符的取值为第一值,所述第二类字符的取值为第二值;所述第一类字符的数量为所述第一掩码与所述第二掩码的差值;所述第二掩码为所述第一掩码所属私有网络的网段信息中的掩码;基于所述第一字符串划分得到的N个字符串分组中分别包含的所述第一类字符和/或所述第二类字符,确定所述N个分段输入区域所分别对应的至少一个调整值;基于N个分段初始值以及所述N个分段输入区域所分别对应的所述至少一个调整值,确定所述N个分段输入区域分别对应的所述可填写范围。The
在图7a的基础上,本实施例还提供如图7b所示的装置还包括:On the basis of Fig. 7a, this embodiment also provides the device shown in Fig. 7b, which further includes:
掩码获取模块704,用于响应于在掩码输入区域处的第一操作,展示候选数值;响应于针对所述候选数值中的目标数值的第二操作,将所述目标数值作为所述第一掩码。A
所述掩码获取模块704,用于在所述掩码输入区域为子网掩码的选取区域的情况下,基于所属私有网络的第二网段信息中包含的第二掩码,从全部数值中确定至少部分数值作为所述候选数值。The
所述装置,还包括:The device also includes:
掩码有效性验证模块705,用于对所述第一网络地址进行转换,得到所述第一网络地址的二进制字符串;基于所述第一掩码确定所述第一网络地址的所述二进制字符串中的验证字符串;基于所述验证字符串对所述第一掩码进行验证,得到所述第一掩码的有效性验证结果。A mask
所述掩码有效性验证模块705,用于基于所述第一掩码,从所述第一网络地址的所述二进制字符串中的最高位起的连续M位二进制字符之外的剩余二进制字符作为所述验证字符串;M为大于等于1的整数,M等于所述第一掩码。The mask
所述掩码有效性验证模块705,用于在所述验证字符串中包含第一值的情况下,确定所述第一掩码的有效性验证结果为无效;在所述验证字符串中不包含第一值的情况下,确定所述第一掩码的有效性验证结果为有效。The mask
所述装置,还包括:The device also includes:
第一比对模块706,用于将第三网络地址转换为所述第三网络地址的二进制字符串,将所述第一网络地址转换为所述第一网络地址的二进制字符串;基于所述第一掩码从所述第三网络地址的所述二进制字符串中获取第一待比对字符串,以及从所述第一网络地址的所述二进制字符串中获取参考字符串;在所述第一待比对字符串与所述参考字符串相同的情况下,确定所述第三网络地址与所述第一网络地址在相同网段内。A
所述的装置,还包括:The device also includes:
第二比对模块707,用于将第四网段信息中的第四网络地址转换为所述第四网络地址的二进制字符串,将所述第一网络地址转换为所述第一网络地址的二进制字符串;将所述第一掩码与所述第四网段信息的第四掩码中的最小值作为目标掩码;基于所述目标掩码从所述第四网络地址的所述二进制字符串中获取第二待比对字符串,基于所述目标掩码从所述第一网络地址的所述二进制字符串中获取第三待比对字符串;在所述第二待比对字符串与所述第三待比对字符串相同的情况下,确定所述第四网段信息与所述第一网段信息重叠。The
本公开的技术方案中,所涉及的用户个人信息的获取,存储和应用等,均符合相关法律法规的规定,且不违背公序良俗。In the technical solution of the present disclosure, the acquisition, storage and application of the user's personal information involved are all in compliance with the provisions of relevant laws and regulations, and do not violate public order and good customs.
根据本公开的实施例,本公开还提供了一种电子设备、一种可读存储介质和一种计算机程序产品。According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
图8示出了可以用来实施本公开的实施例的示例电子设备800的示意性框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。FIG. 8 shows a schematic block diagram of an example
如图8所示,设备800包括计算单元801,其可以根据存储在只读存储器(ROM)802中的计算机程序或者从存储单元808加载到随机访问存储器(RAM)803中的计算机程序,来执行各种适当的动作和处理。在RAM 803中,还可存储设备800操作所需的各种程序和数据。计算单元801、ROM 802以及RAM 803通过总线804彼此相连。输入/输出(I/O)接口805也连接至总线804。As shown in FIG. 8 , the
设备800中的多个部件连接至I/O接口805,包括:输入单元806,例如键盘、鼠标等;输出单元807,例如各种类型的显示器、扬声器等;存储单元808,例如磁盘、光盘等;以及通信单元809,例如网卡、调制解调器、无线通信收发机等。通信单元809允许设备800通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Various components in the
计算单元801可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元801的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元801执行上文所描述的各个方法和处理,例如网段信息处理方法。例如,在一些实施例中,网段信息处理方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元808。在一些实施例中,计算机程序的部分或者全部可以经由ROM 802和/或通信单元809而被载入和/或安装到设备800上。当计算机程序加载到RAM 803并由计算单元801执行时,可以执行上文描述的网段信息处理方法的一个或多个步骤。备选地,在其他实施例中,计算单元801可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行网段信息处理方法。
本文中以上描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、芯片上系统的系统(SOC)、负载可编程逻辑设备(CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described herein above may be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips system (SOC), load programmable logic device (CPLD), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs executable and/or interpretable on a programmable system including at least one programmable processor that The processor, which may be a special purpose or general-purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device an output device.
用于实施本公开的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer or other programmable data processing apparatus, such that the program code, when executed by the processor or controller, performs the functions/functions specified in the flowcharts and/or block diagrams. Action is implemented. The program code may execute entirely on the machine, partly on the machine, partly on the machine and partly on a remote machine as a stand-alone software package or entirely on the remote machine or server.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with the instruction execution system, apparatus or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), fiber optics, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入、或者触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or trackball) through which a user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (eg, visual feedback, auditory feedback, or tactile feedback); and can be in any form (including acoustic input, voice input, or tactile input) to receive input from the user.
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein may be implemented on a computing system that includes back-end components (eg, as a data server), or a computing system that includes middleware components (eg, an application server), or a computing system that includes front-end components (eg, a user computer having a graphical user interface or web browser through which a user may interact with implementations of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system. The components of the system may be interconnected by any form or medium of digital data communication (eg, a communication network). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,也可以为分布式系统的服务器,或者是结合了区块链的服务器。A computer system can include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a distributed system server, or a server combined with blockchain.
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that steps may be reordered, added or deleted using the various forms of flow shown above. For example, the steps described in the present disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, no limitation is imposed herein.
上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。The above-mentioned specific embodiments do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present disclosure should be included within the protection scope of the present disclosure.
Claims (23)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111565171.5A CN114363167B (en) | 2021-12-20 | 2021-12-20 | Network segment information processing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111565171.5A CN114363167B (en) | 2021-12-20 | 2021-12-20 | Network segment information processing method and device, electronic equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114363167A true CN114363167A (en) | 2022-04-15 |
| CN114363167B CN114363167B (en) | 2024-03-19 |
Family
ID=81101989
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202111565171.5A Active CN114363167B (en) | 2021-12-20 | 2021-12-20 | Network segment information processing method and device, electronic equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114363167B (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115460173A (en) * | 2022-07-21 | 2022-12-09 | 浪潮通信技术有限公司 | Method and device for generating subnet network address of virtual private cloud network |
| CN115883455A (en) * | 2022-12-09 | 2023-03-31 | 苏州盛科通信股份有限公司 | Method and device for compressing routing information, electronic equipment and storage medium |
Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060072601A1 (en) * | 2003-09-15 | 2006-04-06 | Zhidan Cheng | Virtual IP interface |
| CN104168295A (en) * | 2014-09-11 | 2014-11-26 | 东南大学 | System and processing method based on IPSec hardware firewall in IPv6 |
| CN106487939A (en) * | 2015-08-26 | 2017-03-08 | 阿里巴巴集团控股有限公司 | A kind of method and apparatus determining User IP subnet, a kind of electronic equipment |
| CN107682471A (en) * | 2017-10-17 | 2018-02-09 | 新华三云计算技术有限公司 | A kind of method and apparatus being adjusted to network address |
| CN108319589A (en) * | 2018-03-14 | 2018-07-24 | 腾讯科技(深圳)有限公司 | Parameter string processing method, apparatus, computer readable storage medium and equipment |
| CN111107173A (en) * | 2018-10-29 | 2020-05-05 | 中国移动通信集团浙江有限公司 | IP address planning method and system of IP bearing network |
| CN111586202A (en) * | 2020-05-09 | 2020-08-25 | 北京首都在线科技股份有限公司 | Network mask checking method and device, electronic equipment and storage medium |
| US20200314058A1 (en) * | 2019-04-01 | 2020-10-01 | International Business Machines Corporation | Automatic ip range selection |
| CN112600954A (en) * | 2021-03-04 | 2021-04-02 | 城云科技(中国)有限公司 | IPv4 address matching method, electronic device and storage medium |
| CN112787938A (en) * | 2021-01-14 | 2021-05-11 | 北京星网锐捷网络技术有限公司 | Routing table item configuration method and device |
-
2021
- 2021-12-20 CN CN202111565171.5A patent/CN114363167B/en active Active
Patent Citations (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060072601A1 (en) * | 2003-09-15 | 2006-04-06 | Zhidan Cheng | Virtual IP interface |
| CN104168295A (en) * | 2014-09-11 | 2014-11-26 | 东南大学 | System and processing method based on IPSec hardware firewall in IPv6 |
| CN106487939A (en) * | 2015-08-26 | 2017-03-08 | 阿里巴巴集团控股有限公司 | A kind of method and apparatus determining User IP subnet, a kind of electronic equipment |
| CN107682471A (en) * | 2017-10-17 | 2018-02-09 | 新华三云计算技术有限公司 | A kind of method and apparatus being adjusted to network address |
| CN108319589A (en) * | 2018-03-14 | 2018-07-24 | 腾讯科技(深圳)有限公司 | Parameter string processing method, apparatus, computer readable storage medium and equipment |
| CN111107173A (en) * | 2018-10-29 | 2020-05-05 | 中国移动通信集团浙江有限公司 | IP address planning method and system of IP bearing network |
| US20200314058A1 (en) * | 2019-04-01 | 2020-10-01 | International Business Machines Corporation | Automatic ip range selection |
| CN111586202A (en) * | 2020-05-09 | 2020-08-25 | 北京首都在线科技股份有限公司 | Network mask checking method and device, electronic equipment and storage medium |
| CN112787938A (en) * | 2021-01-14 | 2021-05-11 | 北京星网锐捷网络技术有限公司 | Routing table item configuration method and device |
| CN112600954A (en) * | 2021-03-04 | 2021-04-02 | 城云科技(中国)有限公司 | IPv4 address matching method, electronic device and storage medium |
Non-Patent Citations (2)
| Title |
|---|
| 孙杰挺;: "快速划分子网方法探究", no. 12 * |
| 王恒青;宋如敏;: "在TCP/IP网络模型下IP地址与子网掩码的计算解析", no. 32 * |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115460173A (en) * | 2022-07-21 | 2022-12-09 | 浪潮通信技术有限公司 | Method and device for generating subnet network address of virtual private cloud network |
| CN115460173B (en) * | 2022-07-21 | 2023-09-26 | 浪潮通信技术有限公司 | Virtual private cloud network subnet network address generation method and device |
| CN115883455A (en) * | 2022-12-09 | 2023-03-31 | 苏州盛科通信股份有限公司 | Method and device for compressing routing information, electronic equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114363167B (en) | 2024-03-19 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP2022100248A (en) | Text error correction method, apparatus therefor, electronic device therefor, and readable storage medium | |
| US12332877B2 (en) | Method for acquiring structured question-answering model, question-answering method and corresponding apparatus | |
| CN112506935B (en) | Data processing method, device, electronic device, storage medium, and program product | |
| CN112015468B (en) | Interface document processing method and device, electronic equipment and storage medium | |
| CN112529180B (en) | Method and device for model distillation | |
| CN113657518B (en) | Training method, target image detection method, device, electronic device and medium | |
| JP2017092929A (en) | Format maintenance based masking system and method | |
| JP7508418B2 (en) | Graph recommendation method, device, electronic device, and storage medium | |
| CN114363167B (en) | Network segment information processing method and device, electronic equipment and storage medium | |
| CN111767691A (en) | Computing method, apparatus, device and storage medium | |
| CN105204663A (en) | Method of virtual keyboard input and terminal | |
| CN114389969A (en) | Client test method and device, electronic equipment and storage medium | |
| CN112529181B (en) | Method and apparatus for model distillation | |
| CN111861991B (en) | Method and device for calculating image clarity | |
| CN115169530B (en) | Data processing methods, devices, electronic equipment and readable storage media | |
| CN111596897A (en) | Code multiplexing processing method and device and electronic equipment | |
| CN116306396A (en) | Chip verification method and device, equipment and medium | |
| CN112150380B (en) | Method, device, electronic device and readable storage medium for correcting image | |
| JP2023012541A (en) | Table-based question answering method, apparatus and electronic equipment | |
| CN113138760B (en) | Page generation method and device, electronic equipment and medium | |
| US11620171B2 (en) | Systems and methods for generating schema notifications | |
| US20210097038A1 (en) | Systems and methods for generating schema notifications | |
| US20240275848A1 (en) | Content initialization method, electronic device and storage medium | |
| CN117270912A (en) | Configuration updating method and device, electronic equipment and storage medium | |
| CN116384360A (en) | Task processing method, device, electronic device and computer-readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |