CN109862131B - Server access address allocation method and device and computer readable storage medium - Google Patents

Server access address allocation method and device and computer readable storage medium Download PDF

Info

Publication number
CN109862131B
CN109862131B CN201910127233.0A CN201910127233A CN109862131B CN 109862131 B CN109862131 B CN 109862131B CN 201910127233 A CN201910127233 A CN 201910127233A CN 109862131 B CN109862131 B CN 109862131B
Authority
CN
China
Prior art keywords
node
network segment
server access
nodes
access address
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.)
Active
Application number
CN201910127233.0A
Other languages
Chinese (zh)
Other versions
CN109862131A (en
Inventor
郝辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201910127233.0A priority Critical patent/CN109862131B/en
Publication of CN109862131A publication Critical patent/CN109862131A/en
Application granted granted Critical
Publication of CN109862131B publication Critical patent/CN109862131B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a method and a device for allocating server access addresses and a computer readable storage medium, wherein the method comprises the following steps: establishing a first distribution model, wherein a plurality of first nodes in the first distribution model form a tree structure, and each first node comprises a first IP network segment; allocating a server access address for a target first node according to a first IP network segment of the target first node; and if the target first node has a child node, aiming at an unprocessed child node which is not allocated with the server access address in the child nodes, allocating the server access address of a parent node which is closest to the unprocessed child node. The invention utilizes the transfer characteristic between the parent node and the child node in the tree structure, the server access address distributed to the parent node can be automatically distributed to the child node of the parent node, and the distribution operation of the server access address to each node is avoided, thereby reducing the complexity of the distribution operation of the server access address and improving the scheduling efficiency.

Description

Server access address allocation method and device and computer readable storage medium
Technical Field
The invention belongs to the technical field of computers, and particularly relates to a method and a device for allocating server access addresses and a computer readable storage medium.
Background
With the continuous development of business of merchants, the business access amount can be greatly improved, and how to realize the optimized scheduling of business access is the key for improving the business quality.
In the prior art, a scheduling distribution system usually adopts an exhaustive method to list combinations of all service providers and regions to form a scheduling policy table, for example, for a communication service, the combinations in the scheduling policy table may include: for each combination, the china mobile, the Shandong Union, the Shanghai telecommunication, the Qingdao telecommunication and the like generally need to be allocated with the server access address one by one, and when the users in the area belonging to the combination access the services, the scheduling server can send the server access address of the combination to the users, so as to realize the service access of the users.
However, with the rapid increase of traffic volume, simply listing all the combinations of operators and areas and allocating server access addresses for the combinations one by one will greatly increase the data processing amount of the allocation system, consume more and more manpower and time costs, and reduce the scheduling efficiency.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for allocating a server access address, and a computer readable storage medium, which solve the problems of large data processing amount, high consumption of labor and time costs, and reduced scheduling efficiency of a scheduling allocation system in the current scheme to a certain extent.
According to a first aspect of the present invention, there is provided a method for allocating a server access address, the method may include:
establishing a first distribution model, wherein the first distribution model comprises a plurality of first nodes, the first nodes form a tree structure, and each first node comprises a first Internet Protocol (IP) network segment;
selecting a target first node from the first nodes;
according to a first IP network segment of the target first node, allocating a server access address to the target first node;
if the target first node has a child node, then aiming at an unprocessed child node which is not allocated with the server access address in the child nodes, allocating the server access address of a parent node which is closest to the unprocessed child node.
According to a second aspect of the present invention, there is provided an apparatus for allocating a server access address, the apparatus may include:
the system comprises a first establishing module, a second establishing module and a third establishing module, wherein the first establishing module is used for establishing a first distribution model, the first distribution model comprises a plurality of first nodes, the first nodes form a tree structure, and each first node comprises a first Internet Protocol (IP) network segment;
a selecting module for selecting a target first node from the first nodes;
the first distribution module is used for distributing a server access address for the target first node according to the first IP network segment of the target first node;
and the policy inheritance module is used for allocating the server access address of the father node which is closest to the unprocessed child node aiming at the unprocessed child node which is not allocated with the server access address in the child nodes if the target first node has the child node.
In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of the method for allocating a server access address according to the first aspect.
Aiming at the prior art, the invention has the following advantages:
according to the tree structure formed by the plurality of first nodes, the parent-child structure relationship among the first nodes in the tree structure is utilized, so that after a server access address is allocated to a parent first node, the server access address of the parent node closest to the child first node can be automatically allocated to the child first node aiming at the child first node of the parent first node.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart illustrating steps of a method for allocating server access addresses according to an embodiment of the present invention;
fig. 2 is an architecture diagram of a system for allocating server access addresses according to an embodiment of the present invention;
fig. 3 is a tree structure diagram of a method for allocating server access addresses according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating steps of another method for allocating server access addresses according to an embodiment of the present invention;
fig. 5 is a tree structure diagram of another allocation method for server access addresses according to an embodiment of the present invention;
fig. 6 is a block diagram of an apparatus for allocating a server access address according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
Fig. 1 is a flowchart of steps of a method for allocating a server access address according to an embodiment of the present invention, which is applied to a terminal, and as shown in fig. 1, the method may include:
step 101, establishing a first distribution model, wherein the first distribution model comprises a plurality of first nodes, the plurality of first nodes form a tree structure, and each first node comprises a first Internet Protocol (IP) network segment.
In an embodiment of the present invention, the method for allocating a server access address may generally be implemented based on a server access address allocation system, and referring to fig. 2, an architecture diagram of a server access address allocation system provided in an embodiment of the present invention is shown, where the server access address allocation system may generally include: the scheduling server 10 and the service server 20, an execution subject of the server access address allocation method provided by the embodiment of the present invention is the scheduling server 10, wherein service services are provided in a plurality of regions according to the development of business services of merchants, so that the service servers 20 can be correspondingly deployed in each region, and the scheduling server 10 is deployed to uniformly manage access scheduling to all the service servers 20. The dispatcher 40 may implement the allocation operation of the server access address by dispatching the server 10, and dispatch the access of the client 30 to the service server 20 corresponding to the preferred region and the preferred operator.
Specifically, in this step, a plurality of first IP network segments may be divided by the scheduling server 10 based on a service development requirement, where the service development requirement refers to that a service server of a certain operator is deployed in a certain area due to development of a service, for example, if the service is expanded to the eastern china, a junsu unicom server, a Shandong telecom server, and the like may be correspondingly deployed.
Further, a network segment generally refers to a portion of a computer network that can directly communicate using the same physical layer device (transmission medium, relay, hub, etc.), and can be used to distinguish whether devices on the network are in the same network segment, for example, a segment from 192.168.0.1 to 192.168.255.255.
In the embodiment of the invention, two parameters can be extracted according to the analysis of the operation of a business server which deploys a certain operator in a certain area: operator information and regional information, and it is found that regions can be divided according to certain characteristics, for example, when grouped according to a coverage geographical range, there are country regions, provincial regions and city regions, and it can be seen that there are obvious inclusion relations, therefore, the inclusion relations are connected in series to form a tree structure model, and the operator information and the regional information can be combined to form nodes in a tree structure. In the allocation system of the server access addresses shown in fig. 2, the tree structure can be intuitively displayed in the display screen of the scheduling server 10 in the form of a tree diagram, and the scheduler 40 can perform operation processing on nodes therein to implement addition and modification of allocation.
For example, referring to fig. 3, a tree structure diagram of a method for allocating a server access address according to an embodiment of the present invention is shown, where a geographic area may be represented by a first node, and a plurality of first nodes may be established as a tree structure according to an inclusion relationship of parent and child nodes according to an inclusion relationship of a geographic range in a region, and in addition, according to a combination relationship between a region and an operator in an actual application scenario, a correspondence relationship between an operator and a geographic area may be further added to each first node in the tree structure, which may be specifically implemented in the form of an IP network segment, and one IP network segment may include the correspondence relationship between the operator and the geographic area. For example, the IP network segment of China telecom is 123.499.776. The IP network segment of Jiangsu Union comprises: 112.80.0.0 to 112.87.255.255, and the like.
And 102, selecting a target first node from the first nodes.
In this step, one or more target nodes may be selected from the first nodes in combination with actual service requirements, so as to allocate server access addresses to the target first nodes.
For example, in fig. 3, four nodes of china communication, china mobile, china unicom and shandong unicom may be selected as the target first node.
Step 103, allocating a server access address to the target first node according to the first IP network segment of the target first node.
In this step, access scheduling is performed on the service servers deployed in each region, specifically, in the first allocation model of the tree structure, a server access address is allocated to the selected target first node, the server access address may be a Domain Name System (DNS) address, which is simply referred to as a Domain Name, and a user may obtain an accurate IP address of the service server through resolution by using the server Domain Name, so as to access the service server.
Generally, a server access address is allocated to a target first node, and the server access address may generally be an access address of a service server deployed in the target first node, so that when a user in a geographic area of the target first node performs service access, the service server deployed in the geographic area may be accessed through the server access address of the target first node.
Step 104, if the target first node has a child node, for an unprocessed child node not assigned the server access address in the child nodes, assigning the server access address of a parent node closest to the unprocessed child node.
In the embodiment of the invention, the nodes in the tree structure are distinguished from the father nodes and the child nodes, the father nodes are the nodes on the upper layer of the child nodes, and the father nodes can usually comprise a plurality of child nodes, so that after the server access address is added to the father nodes, the server access address of the father node closest to the child node can be automatically allocated to the child node aiming at the child node of the father node.
For example, in FIG. 3, the dispatcher assigns four different sets of server access addresses a, b, c, d, as needed. And are respectively and correspondingly distributed at China communication nodes, China mobile nodes, China Unicom nodes and Shandong Unicom nodes. Therefore, the distribution of all the nodes in the first distribution model of the whole tree structure is realized, and the dispatcher only needs to execute four distribution operations, so that the server access address distribution of the rest nodes can automatically inherit the corresponding server access address distribution in the China communication nodes, the China mobile nodes, the China Unicom nodes and the Shandong Unicom nodes.
Further, in fig. 3, a solid line box represents the active assignment of the server access address by the dispatcher, and a dotted line box represents the automatic transmission and addition of the server access address by the transmission characteristic of the tree structure. The dispatcher assigns four different sets of server access addresses a, b, c, d as required. And are respectively and correspondingly distributed at China communication nodes, China mobile nodes, China Unicom nodes and Shandong Unicom nodes. According to the conduction characteristic of the tree structure, the four nodes can be used as father nodes, the server access addresses of the four nodes are automatically conducted and added to unprocessed child nodes until all the nodes are distributed with the server access addresses. It should be noted that the conducting processes are not interfered with each other, for example, although the shandong unicom node is a child node of the china unicom node, since the shandong unicom node has a server access address, the shandong unicom node is not used as an unprocessed child node, does not automatically inherit the server access address of the china unicom node, but is independently used as a parent node, and automatically conducts the server access address of the shandong unicom node to the kan unicom node and the Qingdao unicom node.
In summary, the method for allocating server access addresses provided in the embodiment of the present invention includes: establishing a first distribution model, wherein the first distribution model comprises a plurality of first nodes, the first nodes form a tree structure, and each first node comprises a first Internet Protocol (IP) network segment; selecting a target first node from the first nodes; allocating a server access address for a target first node according to a first IP network segment of the target first node; if the target first node has a child node, the server access address of a parent node closest to the unprocessed child node is allocated to the unprocessed child node aiming at the unprocessed child node without the server access address allocated to the unprocessed child node, according to a tree structure formed by a plurality of first nodes, by using a parent-child structure relationship among the first nodes in the tree structure, after the server access address is allocated to one parent first node, the server access address of the parent node closest to the child first node is automatically allocated to the child first node aiming at the child first node of the parent first node, therefore, the invention utilizes the transfer characteristic among the parent and child nodes in the tree structure, the server access address allocated to the parent node is automatically allocated to the child node of the parent node, and the allocation operation of the server access address to each node is avoided, therefore, the complexity of server access address allocation operation is reduced, the labor and time cost is reduced, the allocation efficiency is improved, and the scheduling efficiency is further improved.
Fig. 4 is a flowchart of steps of another method for allocating a server access address according to an embodiment of the present invention, and as shown in fig. 4, the method may include:
step 401, dividing a plurality of the first IP network segments according to a preset IP address base.
In practical application, the division of the plurality of first IP network segments can be realized through an IP address library.
Data in the IP address library is collected by professional technicians through various technical means for a long time, and the professional technicians update, maintain and supplement the data for a long time. The IP address database stores a large number of IP addresses, which is convenient for users to inquire, for example, if you know a certain IP, you can find out which street and even which internet cafe of the city the computer is in, otherwise, you know a region or an operator, and can also see which IP sections are in the place or which IP sections are corresponding to the operator.
For example, the IP network segment of China telecom is 123.499.776. The IP network segment of Jiangsu Union comprises: 112.80.0.0 to 112.87.255.255, and the like.
Step 402, establishing the first allocation model, and adding the first IP network segment to a first node in the first allocation model.
Optionally, the first node in the first allocation model further includes operator information and regional information.
In the embodiment of the invention, two parameters can be extracted according to the analysis of the operation of a business server which deploys a certain operator in a certain area: operator information and area information, and it is found that areas can be divided according to certain characteristics, for example, when grouped according to a coverage geographical range, there will be a country area, a provincial area and a city area, and an obvious inclusion relationship can be seen, therefore, a geographical area can be represented by one first node, and according to the inclusion relationship of the geographical range in the area, a plurality of first nodes can be established into a tree structure according to the inclusion relationship of parent sub-nodes, and in addition, according to the combination relationship between the area and the operator in an actual application scene, a corresponding relationship between the operator and the geographical area can be further added to each first node in the tree structure, and the method can be specifically realized in the form of an IP network segment, and one IP network segment can include the corresponding relationship between the operator and the geographical area.
It should be noted that, in practical applications, it is found that management scheduling cannot be smoothly implemented in a large geographic area range, for example, china unicom is a parent node of all provincial level unicom areas, according to service specifications, allocation logics of server access addresses of south province and north province are usually different, at this time, a concept of a virtual area may be added, that is, a hierarchy is added between the provincial level area and the national level area as a virtual area, a virtual area node is established, for example, a node "east China" and "north China" in fig. 3, by mounting a provincial level node onto a virtual area node, then mounting a virtual area node onto a national level area node, although a corresponding service server is not deployed in the virtual area node, when allocating a server access address, a server access address matching the service of the virtual area may be added to the virtual area node, the provincial nodes mounted on the virtual region nodes can be used as sub-nodes to automatically acquire the server access addresses of the virtual region nodes, the provincial nodes in the region administration range of the virtual region nodes can be quickly allocated with the server access addresses through the virtual region nodes in the middle position in a large geographic region range, the allocation efficiency of the server access addresses in the scene is improved, the virtual region nodes are only used when in management, the finally generated allocation files cannot appear, the purpose of optimizing management is achieved, and interference on normal service expansion is avoided.
Step 403, selecting a target first node from the first nodes.
This step may specifically refer to step 102, which is not described herein again.
Step 404, allocating a server access address to the target first node according to the first IP network segment of the target first node.
This step may specifically refer to step 103, which is not described herein again.
Step 405, if the target first node has a child node, for an unprocessed child node not assigned the server access address in the child nodes, assigning the server access address of a parent node closest to the unprocessed child node.
This step may specifically refer to step 104, which is not described herein again.
Step 406, determining a target first IP network segment to which a user IP address included in the first user access request belongs and a target server access address corresponding to the target first IP network segment according to the received first user access request and the first allocation model.
In the embodiment of the invention, after all nodes in the tree structure are allocated with the corresponding server access addresses, the user IP addresses in the received first user access request are extracted, the extracted user IP addresses are matched with the IP network segments included by the nodes in the first allocation model, and the target first IP network segment to which the user IP addresses belong and the target server access address corresponding to the target first IP network segment are determined.
For example, referring to fig. 3, assume that the IP network segment of Jiangsu Union includes: 112.80.0.0-112.87.255.255, etc., when the extracted user IP address is 112.80.12.1, it can be determined that the user is currently in the jurisdiction of Jiangsu Union, and it can be determined that the target server access address is the server access address c.
Optionally, in an implementation manner of the embodiment of the present invention, step 406 specifically may include:
substep 4061, generating an allocation file of the first allocation model, where the allocation file includes a correspondence between the first IP network segment and the server access address.
In this step, the scheduling server implements access scheduling, and may specifically implement scheduling for the allocation file through the scheduler, where after all nodes in the first allocation model of the tree structure are allocated with corresponding server access addresses, the allocation file includes a corresponding relationship between the first IP network segment and the server access addresses. The scheduler can quickly realize the matching of the network segment to which the user belongs and the determination of the access address of the corresponding server according to the distribution file.
Substep 4062, when receiving the first user access request, matching the user IP address included in the first user access request with the corresponding relationship, and determining a target first IP network segment to which the user IP address belongs and a target server access address corresponding to the target first IP network segment.
In the embodiment of the invention, for the received first user access request, the user IP address is extracted, the extracted user IP address is matched with the corresponding relation stored in the distribution file, and the target first IP network segment to which the user IP address belongs and the target server access address corresponding to the target first IP network segment are determined.
Step 407, adding the target server access address in the response to the first user access request.
Referring to fig. 2, the client 30 sends a first user access request to the scheduling server 10, the scheduling server 10 adds a target server access address to a response to the first user access request after determining a corresponding target server access address according to the first user access request, and the client 30 obtains the target server access address by analyzing the response, so as to access a service server of an operator corresponding to a corresponding region, thereby implementing service access.
Optionally, in an implementation manner of the embodiment of the present invention, after step 405, the method may further include:
and step 408, establishing a second distribution model of the tree structure, wherein each second node in the second distribution model comprises a corresponding second IP network segment.
In practical applications, with the popularization of services, a problem is found, when a service party needs to deploy a plurality of different services according to business needs, if the services are all tree structure models, and only a small part of the tree structures are different, for example, if a first distribution model including 300 first nodes is established for service a, a second distribution model including 300 second nodes is established for service B, and a second IP network segment of 280 second nodes in the second distribution model is the same as a first IP network segment of 280 first nodes in the first distribution model, assuming that after the server access addresses are allocated to the 300 first nodes in the first distribution model, a new online service B is needed, if server access address allocation is directly performed to the 300 second nodes included in the second distribution model, the original intention of reducing repeated operations is not met, therefore, the service inheritance characteristics among models with different tree structures can be increased, and the allocation operation amount is reduced.
In the tree structure, when a node is assigned to inherit another tree structure, the node inherits the assignment of the same node in the other tree structure, and by utilizing the inheritance characteristics of the tree structure, the sub-node which is not assigned with the server access address of the node also inherits the server access address.
For example, after the server access addresses are allocated to the 300 first nodes of the service a, the service B is newly brought online, the service B may directly map the 280 second nodes to the same 280 first nodes in the service a, and obtain the server access addresses of the 280 first nodes, the process only needs to perform allocation operation once, and then, the service B may only need to perform allocation of the server access addresses to the remaining 20 second nodes individually, so that the number of times the service B needs to be allocated becomes 21 (300 + 280), and the operation amount is greatly reduced.
In this step, the business rules formed by the combination of the operator and the region are not changed at will, but when the business rules are changed or new business rules are generated, the original first distribution model cannot meet the requirements of the new business rules. In this case, therefore, a second distribution model of the tree structure may be established, each second node in the second distribution model comprising a corresponding second IP network segment.
Optionally, in an implementation manner of the embodiment of the present invention, step 408 may specifically include:
substep 4081, dividing the plurality of second IP network segments according to a preset IP address library.
In practical application, the division of the plurality of second IP network segments can be realized by an IP address library.
Data in the IP address library is collected by professional technicians through various technical means for a long time, and the professional technicians update, maintain and supplement the data for a long time. A large number of IP addresses are stored in the IP address database, so that the user can conveniently inquire the IP addresses.
Substep 4082, establishing said second allocation model, and adding said second IP network segment to a second node in said second allocation model.
Optionally, the second node in the second distribution model further includes operator information and regional information.
In the embodiment of the present invention, a geographical area may be represented by one second node, and according to an inclusion relationship of a geographical range in a region, a plurality of second nodes may be established into a tree structure according to an inclusion relationship of parent and child nodes, and in addition, according to a combination relationship between a region and an operator in an actual application scenario, a correspondence relationship between an operator and a geographical area may be further added to each second node in the tree structure, and this manner may be specifically implemented in the form of an IP network segment, and one IP network segment may include the correspondence relationship between the operator and the geographical area.
Further, referring to fig. 5, a tree structure diagram of another allocation method for server access addresses according to an embodiment of the present invention is shown, assuming that a tree structure a is a first allocation model, where two server access addresses a and B are allocated, but a new second allocation model is generated with a change in a service rule, and in a tree structure B of the second allocation model, a chinese telecommunication and a huadong telecommunication node in the tree structure a are replaced by a chinese subway and a huanan subway node.
It should be noted that, in the tree structure a, a chinese iron-through node and a south china iron-through node may actually exist, but since the service a does not specifically focus on these two nodes, the chinese iron-through node and the south china iron-through node may not be embodied in the tree structure a, so as to enhance the intuitiveness of the scheme of the present invention. Or, the chinese iron-through node and the south china iron-through node may be embodied in the tree structure a, but these two nodes are not distributed, so as to reduce the complexity of the distribution logic on the premise of ensuring the general view of the tree structure. In addition, in the tree structure B, there may actually be a chinese telecommunication node and a east china telecommunication node for the same reason as the tree structure a.
Step 409, according to the matching of the second IP network segment and the first IP network segment, determining a matched first node, a matched second node and an unmatched second node.
In this step, after the new second distribution model is established, the second IP network segment of the second node in the second distribution model may be matched with the first IP network segment of the first node in the first distribution model, so as to obtain a matched first node, a matched second node, and an unmatched second node. The first IP network segment matched with the first node is the same as the second IP network segment matched with the second node, and the second IP network segment not matched with the second node is different from the first IP network segment matched with the first node.
For example, referring to fig. 5, matching the tree structure a in the second distribution model with the tree structure B in the first distribution model, specifically, matching the IP network segment of the node of the tree structure a with the IP network segment of the node of the tree structure B, two results can be obtained, that is, 1, four nodes having the same IP network segment, which are commonly owned by the tree structure a and the tree structure B: china communication node, China Mobile node, east China Mobile node, Shanghai Mobile node. 2. Two nodes unique to the tree structure a: a chinese telecommunications node and a east china telecommunications node. Two nodes unique to the tree structure B: a Chinese iron-through node and a south China iron-through node.
Step 410, adding the server access address of the matching first node to the matching second node.
In this step, referring to fig. 5, the solid line box represents the active assignment of the server access address by the dispatcher, and the dotted line box represents the automatic conduction and addition of the server access address by the conductive nature of the tree structure. Aiming at four nodes commonly owned by the tree structure A and the tree structure B: china communication node, China Mobile node, east China Mobile node, Shanghai Mobile node. The four nodes in the tree structure B can directly inherit the server access addresses a and B of the four same nodes in the tree structure A, and the distribution complexity of the model corresponding to the tree structure B is greatly reduced.
And step 411, allocating a server access address to the unmatched second node.
In this step, with reference to fig. 5, for two nodes specific to the tree structure B: the iron through node in china and the iron through node in south china can be assigned with the corresponding server access address according to the actual requirement by the dispatcher, for example, a specific server access address d is assigned to the corresponding server access address.
Step 412, determining a target second IP network segment to which the user IP address included in the second user access request belongs and a target server access address corresponding to the target second IP network segment according to the received second user access request and the second allocation model.
Specifically, the implementation manner of this step is similar to that of step 406, and may be implemented by referring to step 406, which is not described herein again in this embodiment of the present invention.
Step 413, adding the target server access address in a response to the second user access request.
Specifically, the implementation manner of this step is similar to that of step 407, and may be implemented by referring to step 407, which is not described herein again in this embodiment of the present invention.
Optionally, in an implementation manner of the embodiment of the present invention, a service server is deployed in the first node; after step 405, it may further include:
step 414, in the first node, if there is an overloaded first node, selecting a scheduling first node from the brother nodes of the overloaded first node, and adding the server access address of the scheduling first node to the overloaded first node.
The load value of the service server deployed in the overload first node is greater than or equal to a first preset threshold, and the load value of the service server deployed in the scheduling first node is smaller than a second preset threshold.
In this step, in general, a service server may be deployed in the first node, and the first node is assigned with a server access address of the service server for a user to access, but due to the hardware performance limitation of the service server, there may be an overloaded first node where the load value of the service server is too large, and at this time, the server access address in the overloaded first node needs to be changed to the server access addresses of other service servers with normal loads, so as to ensure normal operation of services in the geographic area of the first node.
For example, referring to fig. 3, when it is found that all service servers of the shandong unicom are overloaded, a server access address of a service server of the jiangsu unicom may be allocated to a node of the shandong unicom, so that a user of the shandong may temporarily access a service through a service server of the jiangsu unicom, thereby reducing a communication loss caused by the overloaded service server of the province, and when the load of the service server of the shandong unicom is recovered to be normal, the original server access address may be recovered.
In summary, the method for allocating server access addresses provided in the embodiment of the present invention includes: establishing a first distribution model, wherein the first distribution model comprises a plurality of first nodes, the first nodes form a tree structure, and each first node comprises a first Internet Protocol (IP) network segment; selecting a target first node from the first nodes; allocating a server access address for a target first node according to a first IP network segment of the target first node; if the target first node has a child node, the server access address of a parent node closest to the unprocessed child node is allocated to the unprocessed child node aiming at the unprocessed child node without the server access address allocated to the unprocessed child node, according to a tree structure formed by a plurality of first nodes, by using a parent-child structure relationship among the first nodes in the tree structure, after the server access address is allocated to one parent first node, the server access address of the parent node closest to the child first node is automatically allocated to the child first node aiming at the child first node of the parent first node, therefore, the invention utilizes the transfer characteristic among the parent and child nodes in the tree structure, the server access address allocated to the parent node is automatically allocated to the child node of the parent node, and the allocation operation of the server access address to each node is avoided, therefore, the complexity of server access address allocation operation is reduced, the labor and time cost is reduced, the allocation efficiency is improved, and the scheduling efficiency is further improved. In addition, aiming at the newly established second distribution model, the second IP network segment in the second distribution model can be matched with the first IP network segment of the first distribution model, so that the second node can directly inherit the server access address of the first node from the same first node of the IP network segments, and the complexity of distribution operation of the second distribution model is greatly reduced.
Fig. 6 is a block diagram of an apparatus for allocating a server access address according to an embodiment of the present invention, and as shown in fig. 6, the apparatus 60 may include:
a first establishing module 604, configured to establish a first distribution model, where the first distribution model includes a plurality of first nodes, the plurality of first nodes form a tree structure, and each first node includes a first internet protocol IP network segment;
a selecting module 602, configured to select a target first node from the first nodes;
a first allocating module 603, configured to allocate a server access address to the target first node according to the first IP network segment of the target first node;
optionally, the first distribution module 603,
the first dividing module is used for dividing a plurality of first IP network segments according to a preset IP address library;
and the first establishing submodule is used for establishing the first allocation model and adding the first IP network segment to a first node in the first allocation model.
A policy inheritance module 604, configured to, if the target first node has a child node, assign, to an unprocessed child node of the child nodes to which the server access address is not assigned, a server access address of a parent node closest to the unprocessed child node.
Optionally, the apparatus further comprises:
the scheduling module is used for determining a target first IP network segment to which a user IP address included in a first user access request belongs and a target server access address corresponding to the target first IP network segment according to the received first user access request and the first allocation model;
optionally, the scheduling module includes:
a generating submodule, configured to generate an allocation file of the first allocation model after a server access address corresponding to the target first node is added to a child node of the target first node, where the allocation file includes a correspondence between the first IP network segment and the server access address;
and the scheduling sub-module is used for matching the user IP address included in the first user access request with the corresponding relation when the first user access request is received, and determining a target first IP network segment to which the user IP address belongs and a target server access address corresponding to the target first IP network segment.
A first response module for adding the target server access address in a response to the first user access request.
Optionally, a service server is deployed in the first node; the device further comprises:
an overload processing module, configured to select a scheduling first node from sibling nodes of the overload first node if the overload first node exists in the first node, and add a server access address of the scheduling first node to the overload first node;
the load value of the service server deployed in the overload first node is greater than or equal to a first preset threshold, and the load value of the service server deployed in the scheduling first node is smaller than a second preset threshold.
Optionally, the apparatus further comprises:
a second establishing module, configured to establish a second distribution model, where the second distribution model includes a plurality of second nodes, the plurality of second nodes form a tree structure, and each second node includes a second IP network segment;
the matching module is used for determining a matched first node, a matched second node and an unmatched second node according to the matching of the second IP network segment and the first IP network segment;
a mapping module for adding the server access address of the matching first node to the matching second node;
the second distribution module is used for distributing the server access address to the unmatched second node;
the first IP network segment matched with the first node is the same as the second IP network segment matched with the second node, and the second IP network segment not matched with the second node is different from the first IP network segment matched with the first node.
To sum up, the apparatus for allocating a server access address provided in the embodiment of the present invention includes: establishing a first distribution model, wherein the first distribution model comprises a plurality of first nodes, the first nodes form a tree structure, and each first node comprises a first Internet Protocol (IP) network segment; selecting a target first node from the first nodes; allocating a server access address for a target first node according to a first IP network segment of the target first node; if the target first node has a child node, the server access address of a parent node closest to the unprocessed child node is allocated to the unprocessed child node aiming at the unprocessed child node without the server access address allocated to the unprocessed child node, according to a tree structure formed by a plurality of first nodes, by using a parent-child structure relationship among the first nodes in the tree structure, after the server access address is allocated to one parent first node, the server access address of the parent node closest to the child first node is automatically allocated to the child first node aiming at the child first node of the parent first node, therefore, the invention utilizes the transfer characteristic among the parent and child nodes in the tree structure, the server access address allocated to the parent node is automatically allocated to the child node of the parent node, and the allocation operation of the server access address to each node is avoided, therefore, the complexity of server access address allocation operation is reduced, the labor and time cost is reduced, the allocation efficiency is improved, and the scheduling efficiency is further improved.
For the above device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant points, refer to the partial description of the method embodiment.
Preferably, an embodiment of the present invention further provides a terminal, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor, where the computer program, when executed by the processor, implements each process of the foregoing server access address allocation method embodiment, and can achieve the same technical effect, and details are not repeated here to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the foregoing server access address allocation method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As is readily imaginable to the person skilled in the art: any combination of the above embodiments is possible, and thus any combination between the above embodiments is an embodiment of the present invention, but the present disclosure is not necessarily detailed herein for reasons of space.
The server access address assignment methods provided herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with the teachings herein. The structure required to construct a system incorporating aspects of the present invention will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the invention and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification, and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except that at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification may be replaced by an alternative feature serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components of the server access address assignment method according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (13)

1. A method for allocating a server access address, the method comprising:
establishing a first distribution model, wherein the first distribution model comprises a plurality of first nodes, the first nodes form a tree structure, and each first node comprises a first Internet Protocol (IP) network segment; the first nodes are represented as a geographical area, the tree structure is established by a plurality of first nodes according to the inclusion relationship of parent-child nodes, and the inclusion relationship of the first nodes according to the parent-child nodes is determined according to the inclusion relationship of geographical ranges in regions; the first IP network segment of the first node comprises a corresponding relation between an operator and the geographic area of the first node;
selecting a target first node from the first nodes;
according to a first IP network segment of the target first node, allocating a server access address to the target first node;
if the target first node has a child node, then aiming at an unprocessed child node which is not allocated with the server access address in the child nodes, allocating the server access address of a parent node which is closest to the unprocessed child node.
2. The method of claim 1, wherein after said assigning the server access address of the parent node closest to said unprocessed child node, further comprising:
determining a target first IP network segment to which a user IP address included in a first user access request belongs and a target server access address corresponding to the target first IP network segment according to the received first user access request and the first allocation model;
adding the target server access address in a response to the first user access request.
3. The method of claim 2, wherein the determining, according to the received first user access request and the first allocation model, a target first IP network segment to which a user IP address included in the first user access request belongs and a target server access address corresponding to the target first IP network segment includes:
generating an allocation file of the first allocation model, wherein the allocation file comprises a corresponding relation between the first IP network segment and the server access address;
and when the first user access request is received, matching the user IP address included in the first user access request with the corresponding relation, and determining a target first IP network segment to which the user IP address belongs and a target server access address corresponding to the target first IP network segment.
4. The method of claim 1, wherein a service server is deployed in the first node;
after the allocating the server access address of the parent node closest to the unprocessed child node, the method further includes:
in the first node, if an overload first node exists, selecting a scheduling first node from brother nodes of the overload first node, and adding a server access address of the scheduling first node to the overload first node;
the load value of the service server deployed in the overload first node is greater than or equal to a first preset threshold, and the load value of the service server deployed in the scheduling first node is smaller than a second preset threshold.
5. The method of claim 1, wherein after said assigning the server access address of the parent node closest to said unprocessed child node, further comprising:
establishing a second distribution model, wherein the second distribution model comprises a plurality of second nodes, the plurality of second nodes form a tree structure, and each second node comprises a second IP network segment;
according to the matching of the second IP network segment and the first IP network segment, determining a matched first node, a matched second node and an unmatched second node;
adding the server access address of the matched first node to the matched second node;
allocating a server access address to the unmatched second node;
the first IP network segment matched with the first node is the same as the second IP network segment matched with the second node, and the second IP network segment not matched with the second node is different from the first IP network segment matched with the first node.
6. The method of claim 1, wherein the establishing a first assignment model comprises:
dividing a plurality of first IP network segments according to a preset IP address library;
and establishing the first allocation model, and adding the first IP network segment to a first node in the first allocation model.
7. An apparatus for allocating a server access address, the apparatus comprising:
the system comprises a first establishing module, a second establishing module and a third establishing module, wherein the first establishing module is used for establishing a first distribution model, the first distribution model comprises a plurality of first nodes, the first nodes form a tree structure, and each first node comprises a first Internet Protocol (IP) network segment; the first nodes are represented as a geographical area, the tree structure is established by a plurality of first nodes according to the inclusion relationship of parent-child nodes, and the inclusion relationship of the first nodes according to the parent-child nodes is determined according to the inclusion relationship of geographical ranges in regions; the first IP network segment of the first node comprises a corresponding relation between an operator and the geographic area of the first node;
a selecting module for selecting a target first node from the first nodes;
the first distribution module is used for distributing a server access address for the target first node according to the first IP network segment of the target first node;
and the policy inheritance module is used for allocating the server access address of the father node which is closest to the unprocessed child node aiming at the unprocessed child node which is not allocated with the server access address in the child nodes if the target first node has the child node.
8. The apparatus of claim 7, further comprising:
the scheduling module is used for determining a target first IP network segment to which a user IP address included in a first user access request belongs and a target server access address corresponding to the target first IP network segment according to the received first user access request and the first allocation model;
a first response module for adding the target server access address in a response to the first user access request.
9. The apparatus of claim 8, wherein the scheduling module comprises:
a generating submodule, configured to generate an allocation file of the first allocation model after a server access address corresponding to the target first node is added to a child node of the target first node, where the allocation file includes a correspondence between the first IP network segment and the server access address;
and the scheduling sub-module is used for matching the user IP address included in the first user access request with the corresponding relation when the first user access request is received, and determining a target first IP network segment to which the user IP address belongs and a target server access address corresponding to the target first IP network segment.
10. The apparatus of claim 7, wherein a service server is deployed in the first node; the device further comprises:
an overload processing module, configured to select a scheduling first node from sibling nodes of the overload first node if the overload first node exists in the first node, and add a server access address of the scheduling first node to the overload first node;
the load value of the service server deployed in the overload first node is greater than or equal to a first preset threshold, and the load value of the service server deployed in the scheduling first node is smaller than a second preset threshold.
11. The apparatus of claim 7, further comprising:
a second establishing module, configured to establish a second distribution model, where the second distribution model includes a plurality of second nodes, the plurality of second nodes form a tree structure, and each second node includes a second IP network segment;
the matching module is used for determining a matched first node, a matched second node and an unmatched second node according to the matching of the second IP network segment and the first IP network segment;
a mapping module for adding the server access address of the matching first node to the matching second node;
the second distribution module is used for distributing the server access address to the unmatched second node;
the first IP network segment matched with the first node is the same as the second IP network segment matched with the second node, and the second IP network segment not matched with the second node is different from the first IP network segment matched with the first node.
12. The apparatus of claim 7, wherein the first distribution module,
the first dividing module is used for dividing a plurality of first IP network segments according to a preset IP address library;
and the first establishing submodule is used for establishing the first allocation model and adding the first IP network segment to a first node in the first allocation model.
13. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method of allocating a server access address according to any one of claims 1 to 6.
CN201910127233.0A 2019-02-20 2019-02-20 Server access address allocation method and device and computer readable storage medium Active CN109862131B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910127233.0A CN109862131B (en) 2019-02-20 2019-02-20 Server access address allocation method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910127233.0A CN109862131B (en) 2019-02-20 2019-02-20 Server access address allocation method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109862131A CN109862131A (en) 2019-06-07
CN109862131B true CN109862131B (en) 2022-03-04

Family

ID=66898374

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910127233.0A Active CN109862131B (en) 2019-02-20 2019-02-20 Server access address allocation method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109862131B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114244805B (en) * 2021-11-08 2023-10-03 网宿科技股份有限公司 Domain name configuration method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060428A (en) * 2006-04-22 2007-10-24 深圳市瑞福特信息技术有限公司 A P2P network dispatching method
CN103825837A (en) * 2014-02-19 2014-05-28 上海视云网络科技有限公司 Node load distributed CDN global scheduling method
CN106612200A (en) * 2015-10-27 2017-05-03 成都鼎桥通信技术有限公司 Distributed network architecture and dispatching method of distributed network architecture
CN107124479A (en) * 2017-04-19 2017-09-01 成都西维数码科技有限公司 A kind of domain name multi-line intelligently parsing method based on radix tree
CN108289086A (en) * 2017-01-10 2018-07-17 阿里巴巴集团控股有限公司 Request processing method and device, server
CN108965372A (en) * 2017-12-20 2018-12-07 北京视联动力国际信息技术有限公司 A kind of service scheduling method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1684177A1 (en) * 2005-01-25 2006-07-26 France Telecom Method and system for managing in a JMX environment with a management application and software systems to be managed
CN102395126B (en) * 2011-11-14 2013-12-11 常熟理工学院 Mobile Ad hoc network address configuration realization method based on tree structure
CN103338274A (en) * 2013-05-15 2013-10-02 中国科学技术大学苏州研究院 Routing-oriented address assignment method in tree-shaped ubiquitous network
US11792872B2 (en) * 2015-02-24 2023-10-17 Intel Corporation Methods and apparatuses associated with reestablishment of a network connection with a child node

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060428A (en) * 2006-04-22 2007-10-24 深圳市瑞福特信息技术有限公司 A P2P network dispatching method
CN103825837A (en) * 2014-02-19 2014-05-28 上海视云网络科技有限公司 Node load distributed CDN global scheduling method
CN106612200A (en) * 2015-10-27 2017-05-03 成都鼎桥通信技术有限公司 Distributed network architecture and dispatching method of distributed network architecture
CN108289086A (en) * 2017-01-10 2018-07-17 阿里巴巴集团控股有限公司 Request processing method and device, server
CN107124479A (en) * 2017-04-19 2017-09-01 成都西维数码科技有限公司 A kind of domain name multi-line intelligently parsing method based on radix tree
CN108965372A (en) * 2017-12-20 2018-12-07 北京视联动力国际信息技术有限公司 A kind of service scheduling method and device

Also Published As

Publication number Publication date
CN109862131A (en) 2019-06-07

Similar Documents

Publication Publication Date Title
US11563713B2 (en) Domain name server allocation method and apparatus
CN109600768B (en) Method, device and system for managing network slices
CN109040259B (en) CDN node distribution method and system based on MEC
CN108271120B (en) Method, device and equipment for determining target area and target user
CN109151009B (en) CDN node distribution method and system based on MEC
KR20210119504A (en) Communication method and apparatus, entity and computer readable storage medium
CN114902634A (en) Apparatus and method for providing information of application server in mobile communication system
CN112995273B (en) Network call-through scheme generation method and device, computer equipment and storage medium
CN105095023A (en) Cloud host establishing device and method and calculating equipment
CN112333299B (en) Domain name resolution method, configuration method and equipment
CN110868339A (en) Node distribution method and device, electronic equipment and readable storage medium
CN104348798A (en) Network assigning method and device, scheduling server, and system
CN112543212B (en) System for providing request response exact communication delay guarantee for distributed service
CN109862131B (en) Server access address allocation method and device and computer readable storage medium
CN108366133B (en) TS server scheduling method, scheduling device and storage medium
CN108347465B (en) Method and device for selecting network data center
CN113067907B (en) Method and related equipment for addressing edge application
CN105307130A (en) Resource allocation method and resource allocation system
CN111371578B (en) Method and device for deploying virtualized network function
CN114553771A (en) Method for loading virtual router and related equipment
CN115826845A (en) Storage resource allocation method and device, storage medium and electronic device
Tikhvinskiy et al. Engineering and Architecture Building of 5G Network for Business Model of High Level Mobile Virtual Network Operator
CN112532473B (en) DNS-based multi-environment test access method and device
WO2023030218A1 (en) Network service deployment method, nfvo, and nfv system
CN113794726A (en) Multi-sip scheduling method and system

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