A method and device for acquiring a router management server address in a private network environment
By building a temporary DNS server outside the 5G private network environment, listening to connection tracking events and updating the DNS server list, the problem of obtaining the address of the 5G router management server is solved, and low-cost management is realized in a confidential and secure state, suitable for multiple users private network environment.
Patent Information
- Application Number
- CN202411074108.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-08-07
AI Technical Summary
In a 5G private network environment, it is difficult for the existing technology to reduce the management cost of 5G router equipment while ensuring the confidentiality and security of the network. Especially when the management server domain name cannot be obtained, it cannot connect to the external management server and directly access the IP. The administrator cannot access the router device through the 5G link when addressing.
By setting up a temporary DNS server outside the private network environment, continuously listening for connection tracking events, updating the DNS server list, and triggering DNS query messages through a timer to obtain the new address of the 5G router management server, avoiding setting up an additional dedicated DNS server. A flexible management of server address acquisition is realized.
It reduces user hardware costs, improves the security and management efficiency of the network environment, and can be used in a private network environment with multiple users, improving the flexibility and accuracy of 5G router management services.
Smart Images

Figure CN118590466B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of server address management, and in particular to a method and device for acquiring a router management server address in a private network environment. Background Art
[0002] When deploying a 5G (5th Generation, fifth generation mobile communication technology) private network environment, the DNS (Domain Name System) server inside the private network often does not add the domain name of the management server used to manage 5G routers in order to ensure its own information security. When the domain name of the management server cannot be obtained, it is naturally impossible to connect to the management server outside the private network environment.
[0003] The existing technology sets up an independent DNS server inside the private network environment. The independent DNS server records the mapping relationship between the domain name and address of the management server outside the private network environment. The above method will cause users to incur additional hardware costs. Some other existing technologies directly access the IP address of the 5G router for direct management. However, when the 5G router turns on DMZ (Demilitarized Zone) or IP (Internet Protocol) penetration, the administrator will not be able to access the 5G router device through the 5G link IP.
[0004] Therefore, how to reduce the management cost of 5G router equipment while ensuring the confidentiality and security of the user's private network environment is a technical problem that needs to be solved at present. Summary of the invention
[0005] The present application provides a method and device for obtaining the address of a router management server in a private network environment to solve the technical problem of how to reduce the management cost of 5G router equipment while ensuring that the user's private network environment is in a confidential and secure state.
[0006] In order to solve the above technical problems, in a first aspect, an embodiment of the present application provides a method for obtaining an address of a router management server in a private network environment, comprising:
[0007] Through the first process, the connection tracking event is continuously monitored, and according to the monitored connection tracking event, the first DNS server list is updated, and the first timer is triggered; the connection tracking event includes: the temporary DNS server outside the private network environment continuously sends network messages to the 5G router inside the private network according to the preset first period. The connection tracking event is generated;
[0008] When the first timer is triggered, the first process is used to traverse each first DNS server entry in the first DNS server list, and a first DNS query message is sent to the first IP address in the first DNS server entry to update the second DNS server list; the first DNS query message includes: a 5G router management server domain name;
[0009] When the time from the last time the 5G router management server address was obtained exceeds the first preset time, the first process is used to traverse each second DNS server entry in the second DNS server list, and a first DNS query message is sent to the second IP address in the second DNS server entry to obtain the new address of the 5G router management server.
[0010] Compared with the prior art, the embodiment of the present application has the following beneficial effects: by temporarily building a temporary DNS server outside the private network environment, a ping message can be regularly sent to the 5G router inside the private network environment. After sending the ping message, the 5G router can read the connection tracking event generated by the above-mentioned sending of the ping message from all connection tracking events, so that the IP address of the temporary DNS server can be resolved from the connection tracking event. However, at this time, it is also necessary to accurately identify the IP address of the temporary DNS server from all IP addresses obtained from all connection tracking events. Therefore, the temporary DNS server is required to periodically send ping messages so that the 5G router can obtain the sending regularity therefrom, and combine the first DNS query message sent to query the domain name of the 5G router management server and the first response message subsequently received to improve the detection accuracy of the IP address of the temporary DNS server. After obtaining the accurate IP address of the temporary DNS server, since the temporary DNS server has stored the mapping relationship between the 5G router management server domain name and the new address of the 5G router management server, the new address of the 5G router management server can be accurately obtained. Therefore, it can be seen that the above embodiment does not need to set up an additional dedicated DNS server to manage the mapping between the 5G router management server domain name and the new address of the 5G router management server. When obtaining the new address of the 5G router management server, it is not only more flexible, but the temporary DNS server can also be used for 5G router management services in the private network environment of multiple different users. Therefore, it can reduce the user's hardware cost while improving the security and confidentiality of the user's private network internal environment.
[0011] In some embodiments of the first aspect of the present application, continuously monitoring connection tracking events through the first process, and updating the first DNS server list according to the monitored connection tracking events, includes:
[0012] When the first process monitors the connection tracking event, parsing the connection tracking event to obtain a plurality of third IP addresses;
[0013] After deduplication of all the third IP addresses, traverse the third IP addresses and add the third IP addresses that do not exist in the first DNS server list or the second DNS server list to the first DNS server list.
[0014] Compared with the prior art, the above embodiment has the following beneficial effects: the connection tracking event includes the IP addresses of the servers that send and receive messages. At this time, all third IP addresses can be accurately read from the connection tracking event according to the index value, and it is considered that the IP address of the temporary DNS server exists in these third IP addresses. At the same time, in order to improve the efficiency of subsequent data processing, it is necessary to filter the obtained third IP addresses to remove duplicate third IP addresses and third IP addresses that already exist in the list to be verified (i.e., the first DNS server list or the second DNS server list), so as to prevent the first DNS query message from being sent repeatedly to the same IP address.
[0015] In some embodiments of the first aspect of the present application, traversing each first DNS server entry in the first DNS server list and sending a first DNS query message to the first IP address in the first DNS server entry to update the second DNS server list includes:
[0016] The first DNS server entry includes: a first IP address, a first number of times the first DNS query message is sent to the first IP address, a first sending time when the first DNS query message is last sent to the first IP address, and a first active time when the first IP address is last active;
[0017] Deleting, from the first DNS server list, the first DNS server entry corresponding to the difference between the first active time and the system time exceeding the second preset time;
[0018] Calculate, in sequence according to the first number of sent times and the first sending time in each of the first DNS server entries, a first next sending time of sending the first DNS query message to the corresponding first IP address next time;
[0019] The first DNS query message is sent in sequence to the first IP address corresponding to the first next sending time which is less than or equal to the system time, a first response result is obtained, and the second DNS server list is updated according to the first response result.
[0020] Compared with the prior art, the above embodiment has the following beneficial effects: when the first DNS server list is updated, it is necessary to check the DNS servers in the first DNS server list according to a certain periodic frequency, and select the first DNS server entry that can respond to the first DNS query message, so as to update the second DNS server list. The above process can be considered as updating the second DNS server list in real time according to the tracking link event. When the last acquired router management server address exceeds the valid time, the new address of the router management server can be immediately queried from the latest second DNS server list, so as to ensure the efficiency of acquiring the new address of the router management server.
[0021] In some embodiments of the first aspect of the present application, updating the second DNS server list according to the first response result includes:
[0022] When the first response result includes a correct response message corresponding to the first DNS query message, generating a corresponding second DNS server entry according to the first DNS server entry corresponding to the first IP address that responds to the first DNS query message;
[0023] Add the second DNS server entry to the second DNS server list.
[0024] Compared with the prior art, the above embodiment has the following beneficial effects: since the first DNS query message includes the domain name of the 5G router management server, only when the correct DNS server, that is, the temporary DNS server, receives the first DNS query message, can it make a correct response, and for the DNS server that does not have a mapping relationship between the 5G router management server domain name and the new address of the 5G router management server, when receiving the first DNS query message, it will only make a response that does not contain any IP address information, or no response. Therefore, through the correct response message, the corresponding DNS server entry of the temporary DNS server can be correctly added to the current second DNS server list, thereby improving the accuracy of subsequent acquisition of the new address of the 5G router management server.
[0025] In some embodiments of the first aspect of the present application, after the first DNS query message is sent to the first IP address corresponding to the first next sending time which is less than or equal to the system time, the first DNS server entry corresponding to the first IP address is updated.
[0026] Compared with the prior art, the above embodiment has the following beneficial effects: since the first DNS server entry records data information related to the number of transmissions, it is necessary to promptly update the data in the first DNS server entry corresponding to the first IP address after each time the first DNS query message is sent to the first IP address, to ensure that the second DNS server list can be accurately updated according to the first DNS server list subsequently.
[0027] In some embodiments of the first aspect of the present application, when the time from the last acquisition of the 5G router management server address exceeds the first preset time, traversing each second DNS server entry in the second DNS server list through the first process, and sending a first DNS query message to the second IP address in the second DNS server entry to obtain the new address of the 5G router management server, including:
[0028] The second DNS server entry includes: a second IP address, a first response failure number after sending the first DNS query message to the second IP address without receiving a correct response message, and a second sending time of the last time the first DNS query message was sent to the second IP address;
[0029] Deleting, from the second DNS server list, an entry of the second DNS server corresponding to the number of the first response failures exceeding a first preset number;
[0030] Calculate the second next sending time of sending the first DNS query message to the corresponding second IP address next time according to the first response failure number and the second sending time in each second DNS server entry;
[0031] The first DNS query message is sent in sequence to the second IP address corresponding to the second next sending time which is less than or equal to the system time, to obtain a first response result, and according to the first response result, to obtain the new address of the 5G router management server.
[0032] Compared with the prior art, the above embodiment has the following beneficial effects: when the second DNS server list is updated according to the first DNS server list, the first DNS server entry that can correctly respond to the first DNS query message at that time will be added to the second DNS server list, and the traversal operation of the second DNS server list needs to be performed according to the expiration time of the last acquisition of the new address of the 5G router management server, so there will be an invalid second IP address in the current second DNS server list. Therefore, the second next sending time calculated according to the number of first response failures can more effectively evaluate the sending frequency of the first DNS query message and improve the efficiency of acquiring the new address of the 5G router management server.
[0033] In some embodiments of the first aspect of the present application, obtaining the new address of the 5G router management server according to the first response result includes:
[0034] When the first response result includes a correct response message corresponding to the first DNS query message, stop sending the first DNS query message to other second IP addresses, interpret the correct response message currently received, and obtain the new address of the 5G router management server.
[0035] Compared with the prior art, the above embodiment has the following beneficial effects: when the correct response message is obtained, the correct new address of the 5G router management server can be obtained. At this time, there is no need to send the first DNS query message to other subsequent second IP addresses, thereby improving data processing efficiency.
[0036] In some embodiments of the first aspect of the present application, the correct response message is a response message including the address of the 5G router management server sent by the temporary DNS server based on the first DNS query message.
[0037] Compared with the prior art, the above embodiment has the following beneficial effects: since other DNS servers that are not temporary DNS servers may make various types of responses when receiving the first DNS query message, it is necessary to ensure that the first response result finally received contains a response message of the 5G router management server address.
[0038] In some embodiments of the first aspect of the present application, after the first DNS query message is sent to the second IP address corresponding to the second next sending time which is less than or equal to the system time, the second DNS server entry corresponding to the second IP address is updated.
[0039] Compared with the prior art, the above embodiment has the following beneficial effects: since the second DNS server entry contains statistical data of the number of sending failures, it is necessary to promptly update the information in the corresponding second DNS server entry after each time the first DNS query message is sent to the second IP address, so as to improve the accuracy of obtaining the new address of the 5G router management server.
[0040] In a second aspect, an embodiment of the present application further provides a device for acquiring a router management server address in a private network environment, including: a connection tracking event monitoring module, a second DNS server list updating module, and a 5G router management server new address acquiring module;
[0041] The connection tracking event monitoring module is used to continuously monitor the connection tracking event through the first process, and update the first DNS server list according to the monitored connection tracking event, and trigger the first timer; the connection tracking event includes: the temporary DNS server outside the private network environment continuously sends the network message to the 5G router inside the private network according to the preset first period. The connection tracking event is generated;
[0042] The second DNS server list updating module is used for, when the first timer is triggered, traversing each first DNS server entry in the first DNS server list through the first process, and sending a first DNS query message to the first IP address in the first DNS server entry to update the second DNS server list; the first DNS query message includes: a 5G router management server domain name;
[0043] The 5G router management server new address acquisition module is used to traverse each second DNS server entry in the second DNS server list through the first process when the time from the last acquisition of the 5G router management server address exceeds the first preset time, and send a first DNS query message to the second IP address in the second DNS server entry to obtain the new address of the 5G router management server. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 A flowchart of a method for obtaining a router management server address in a private network environment provided in some embodiments of the present application;
[0045] Figure 2 A flowchart of a method for updating a first DNS server list provided in some embodiments of the present application;
[0046] Figure 3 This is an example diagram of a connection tracking event provided in some embodiments of the present application;
[0047] Figure 4 A flowchart of a method for updating a second DNS server list provided in some embodiments of the present application;
[0048] Figure 5 A flowchart of a method for obtaining a new address of a 5G router management server from a second DNS server list provided in some embodiments of the present application;
[0049] Figure 6 This is a structural diagram of a device for acquiring a router management server address in a private network environment provided in some embodiments of the present application. DETAILED DESCRIPTION
[0050] When 5G router suppliers provide products and services to customers with private network needs, in order to ensure the security of their own private network internal network environment, the corresponding customers often do not allow suppliers to establish a mapping relationship between the 5G router management server domain name and the 5G router management server address in the DNS server inside their private network. The existing technology sets up an additional independent DNS server inside the private network environment. The independent DNS server records the mapping relationship between the domain name and address of the management server outside the private network environment. The above method will cause customers to spend additional hardware costs for the independent DNS server; some other existing technologies directly access the IP address of the 5G router for direct management. However, when the 5G router has DMZ or IP penetration turned on, the administrator will not be able to access the 5G router device through the 5G link IP.
[0051] In order to solve the above problems, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0052] Embodiment 1
[0053] Please refer to Figure 1 , a method for obtaining a router management server address in a private network environment provided by an embodiment of the present application, including S10 to S30, specifically:
[0054] S10: Through the first process, continuously monitor connection tracking events, and based on the monitored connection tracking events, update the first DNS server list and trigger the first timer; the connection tracking events include: connection tracking events generated by a temporary DNS server outside the private network environment continuously sending network packets to the 5G router inside the private network according to a preset first period.
[0055] Furthermore, in some embodiments of the present application, the first process continuously monitors connection tracking events and updates the first DNS server list based on the monitored connection tracking events, including: when the first process monitors the connection tracking event, parsing the connection tracking event to obtain several third IP addresses; traversing each of the third IP addresses, and adding the third IP address that does not exist in the first DNS server list or the second DNS server list to the first DNS server list.
[0056] In order to better explain step S10, Figure 2 and Figure 3 , describing its execution process:
[0057] first, Figure 2 A flowchart of a method for updating a first DNS server list provided in some embodiments of the present application, combined with Figure 2 As shown in the flowchart, step S10 can be performed by the following preferred implementation:
[0058] S11: The 5G router automatically starts the first process and calls the system command conntrack-E to monitor and obtain connection tracking events in real time;
[0059] S12: Determine whether the first process has received the connection tracking event in step S11, if so, execute step S13; otherwise, continue to execute S12;
[0060] S13: Parse the received connection tracking event, obtain the third IP address, filter out the same repeated third IP address, and filter the system's own IP address from the third IP address, and read the first DNS server list and each DNS server entry in the second DNS server list currently recorded. If the IP address in the DNS server entry is the third IP address, filter out the third IP address, and finally generate the first DNS server entries in sequence according to the remaining third IP addresses, and add them to the first DNS server list; the connection tracking event can be specifically referred to Figure 3 , a connection tracking event will include 4 third IP addresses; the index values of the third IP address in the connection tracking event are src and dst.
[0061] It can be seen from the above steps S11 to S13 that since the connection tracking event will definitely include the IP addresses of all servers that send and receive messages, all third IP addresses can be accurately read from the connection tracking event according to the index value, and the IP address of the temporary DNS server will exist in these third IP addresses. Based on the above premise, the obtained third IP addresses are filtered to remove duplicate third IP addresses and third IP addresses that already exist in the list to be verified (i.e., the first DNS server list or the second DNS server list), to prevent the first DNS query message from being sent repeatedly to the same IP address, to improve the efficiency of subsequent data processing, and to ensure the retention of the IP address information of the temporary DNS server.
[0062] S20: When the first timer is triggered, the first process is used to traverse each first DNS server entry in the first DNS server list, and a first DNS query message is sent to the first IP address in the first DNS server entry to update the second DNS server list; the first DNS query message includes: 5G router management server domain name.
[0063] Further, in some embodiments of the present application, the traversing of each first DNS server entry in the first DNS server list and sending a first DNS query message to the first IP address in the first DNS server entry to update the second DNS server list includes: the first DNS server entry includes: the first IP address, the first number of times the first DNS query message is sent to the first IP address, the first sending time of the last time the first DNS query message is sent to the first IP address, and the first active time when the first IP address is last active; from the first DNS server list, deleting the first DNS server entry corresponding to the difference between the first active time and the system time exceeding the second preset time; calculating the first next sending time of the next sending of the first DNS query message to the corresponding first IP address according to the first number of times the first DNS server entry is sent and the first sending time; sending the first DNS query message to the first IP address corresponding to the first next sending time less than or equal to the system time, obtaining a first response result, and updating the second DNS server list according to the first response result. By updating the second DNS server list in real time, when the router management server address obtained last time exceeds the valid time, the new address of the router management server can be immediately queried from the latest second DNS server list to ensure the efficiency of obtaining the new address of the router management server.
[0064] Further, in some embodiments of the present application, the updating of the second DNS server list according to the first response result includes: when the first response result includes a correct response message corresponding to the first DNS query message, generating a corresponding second DNS server entry according to the first DNS server entry corresponding to the first IP address that responds to the first DNS query message; and adding the second DNS server entry to the second DNS server list. Through the correct response message, the corresponding DNS server entry of the temporary DNS server can be correctly added to the current second DNS server list, thereby improving the accuracy of the subsequent acquisition of the new address of the 5G router management server.
[0065] Further, in some embodiments of the present application, after sending the first DNS query message to the first IP address corresponding to the first next sending time being less than or equal to the system time, the first DNS server entry corresponding to the first IP address is updated. By timely updating the data in the first DNS server entry, it is ensured that the second DNS server list can be accurately updated according to the first DNS server list subsequently.
[0066] Preferably, the content included in the first DNS server entry may refer to the data example shown in the following Table 1:
[0067] Table 1
[0068]
[0069] Based on Table 1 above, in S13, if the first IP address of a first DNS server entry in the first DNS server list is the third IP address, the last active time in the corresponding first DNS server entry needs to be updated at the same time to improve the real-time performance of the data in the first DNS server list.
[0070] Next, combine Figure 4 and Table 1, step S20 is further described in detail, and step S20 can be performed by the following preferred implementation:
[0071] S21: starting a first timer through a first process, and triggering the first timer when the first DNS server list is updated and the first DNS server is not traversed;
[0072] S22: through the first process, read the next first DNS server entry in the first DNS server list, and determine whether the difference between the last active time in the first DNS server entry and the system time is greater than a preset time; if greater, delete the first DNS server entry from the first DNS server list, and continue to execute step S22 until the first DNS server list is read; otherwise, execute step S23;
[0073] S23: Determine whether the system time is greater than or equal to the first next sending time. If so, execute step S24; otherwise, execute step S22. The first next sending time can be calculated by the following preferred implementation method:
[0074] S231: If the first number of sent times is less than or equal to 5 times, the first next sending time = the last sending time + the first number of sent times * 30 seconds;
[0075] S232: If the first number of sent times is greater than 5 and less than or equal to 10 times, the first next sending time = the last sending time + 5*30 seconds + (the first number of sent times - 5)*60 seconds;
[0076] S233: If the first number of sent times is greater than 10 times, the first next sending time = the last sending time + 5*30 seconds + 5 minutes;
[0077] S24: sending a first DNS query message to the first IP address in the first DNS server entry through the first process, and updating a first number of sent times and a last sent time in the first DNS server entry;
[0078] S25: Determine whether a correct response message corresponding to the first DNS query message is received. If received, execute step S26; otherwise, execute step S22.
[0079] S26: Delete the first DNS server entry from the first DNS server list, generate a corresponding second DNS server entry based on the first DNS server entry, add the generated second DNS server entry to the second DNS server list, and jump to step S22.
[0080] Through the above steps S21 to S26, it can be seen that when the first DNS server list is updated, it is necessary to check the DNS servers in the first DNS server list according to a certain periodic frequency, and select the first DNS server entry that can respond to the first DNS query message, so as to update the second DNS server list. The above process can be considered as updating the second DNS server list in real time according to the tracking link event. When the router management server address obtained last time exceeds the valid time, the new address of the router management server can be immediately queried from the latest second DNS server list to ensure the efficiency of obtaining the new address of the router management server. In addition, since the first DNS server entry records the data information related to the number of transmissions, it is necessary to timely update the data in the first DNS server entry corresponding to the first IP address after each first DNS query message is sent to the first IP address, so as to ensure that the second DNS server list can be accurately updated according to the first DNS server list later.
[0081] S30: When the time from the last time the address of the 5G router management server was obtained exceeds the first preset time, through the first process, traverse each second DNS server entry in the second DNS server list, and send a first DNS query message to the second IP address in the second DNS server entry to obtain the new address of the 5G router management server.
[0082] Further, in some embodiments of the present application, when the time from the last time the address of the 5G router management server was obtained exceeds the first preset time, the first process is used to traverse each second DNS server entry in the second DNS server list, and a first DNS query message is sent to the second IP address in the second DNS server entry to obtain the new address of the 5G router management server, including: the second DNS server entry includes: the second IP address, the first response failure number after sending the first DNS query message to the second IP address without receiving a correct response message, and the second sending time of the last time the first DNS query message was sent to the second IP address; from the second DNS server list, the second DNS server entry corresponding to the number of first response failures exceeding the first preset number is deleted; the second next sending time of sending the first DNS query message to the corresponding second IP address is calculated according to the first response failure number and the second sending time in each of the second DNS server entries; the first DNS query message is sent to the second IP address corresponding to the second next sending time less than or equal to the system time in sequence to obtain a first response result, and the new address of the 5G router management server is obtained according to the first response result. The second next sending time calculated according to the number of first response failures can more effectively evaluate the sending frequency of the first DNS query message and improve the efficiency of obtaining the new address of the 5G router management server.
[0083] Further, in some embodiments of the present application, the acquisition of the new address of the 5G router management server according to the first response result includes: when the first response result includes the correct response message corresponding to the first DNS query message, ending the sending of the first DNS query message to other second IP addresses, and interpreting the currently received correct response message to acquire the new address of the 5G router management server. When the correct response message is obtained, the correct new address of the 5G router management server can be obtained, and at this time, there is no need to send the first DNS query message to other subsequent second IP addresses, thereby improving data processing efficiency.
[0084] Furthermore, in some embodiments of the present application, after sending the first DNS query message to the second IP address corresponding to the second next sending time being less than or equal to the system time, the second DNS server entry corresponding to the second IP address is updated. By ensuring that the first response result finally received contains a response message of the 5G router management server address, the accuracy of obtaining the new address of the 5G router management server is improved.
[0085] Furthermore, in some embodiments of the present application, the correct response message is a response message including the address of the 5G router management server sent by the temporary DNS server according to the first DNS query message. By timely updating the information in the corresponding second DNS server entry, the accuracy of obtaining the new address of the 5G router management server is improved.
[0086] Preferably, the content included in the second DNS server entry may refer to the data example shown in the following Table 2:
[0087] Table 2
[0088]
[0089] Based on the above Table 2, for S26, the corresponding second DNS server entry is generated according to the first DNS server entry, the first sending time and the first IP address of the first DNS server entry can be directly used as the second IP address and the second sending time of the generated second DNS server entry, and the first response failure number is initialized to 0.
[0090] Next, combine Figure 5 and Table 2, step S30 is further described in detail, and step S30 can be performed by the following preferred implementation:
[0091] S31: through the first process, start the second timer, and when the current 5G router management server IP address exceeds the valid time and the second DNS server is not traversed, trigger the second timer; wherein, if the 5G router management server IP address exceeds the valid time, the mapping relationship between the corresponding 5G router management server address and the 5G router management server domain name is deleted from the 5G router, and the mapping relationship is stored in the system configuration file / etc / hosts of the 5G router;
[0092] S32: Read the next second DNS server entry in the second DNS server list through the first process, and determine whether the number of first response failures in the second DNS server entry is greater than a preset value; if greater, delete the second DNS server entry from the second DNS server list, and continue to execute step S32 until the second DNS server list is read; otherwise, execute step S33;
[0093] S33: Determine whether the system time is greater than or equal to the second next sending time. If so, execute step S34; otherwise, execute step S32. The second next sending time can be calculated by the following preferred implementation method:
[0094] S331: If the number of first response failures is less than or equal to 5, the second next sending time = the second sending time + the number of first response failures * 30 seconds;
[0095] S332: If the number of first response failures is greater than 5 and less than or equal to 10, the second next sending time = the second sending time + 5*30 seconds + (the number of first response failures - 5)*60 seconds;
[0096] S333: If the number of first response failures is greater than 10, the second next sending time = the second sending time + 5*30 seconds + 5 minutes;
[0097] S34: sending a first DNS query message to a second IP address in a second DNS server entry through the first process, and updating a second sending time in the second DNS server entry;
[0098] S35: Determine whether a correct response message corresponding to the first DNS query message is received. If received, execute step S36; otherwise, increase the number of first response failures in the second DNS server entry by one, and execute step S32.
[0099] S36: Clear the number of first response failures of the second DNS server entry, interpret and obtain the new address of the 5G router management server from the correct response message, generate a mapping relationship in combination with the 5G router management server domain name, write it to the system configuration file / etc / hosts, and update the valid time corresponding to the new address of the 5G router management server.
[0100] Through the above steps S31 to S36, it can be seen that when the second DNS server list is updated according to the first DNS server list, the first DNS server entry that can correctly respond to the first DNS query message at that time will be added to the second DNS server list, and the traversal operation of the second DNS server list needs to be performed according to the expiration time of the last acquisition of the new address of the 5G router management server. Therefore, there will be an invalid second IP address in the current second DNS server list. Therefore, the second next sending time calculated according to the number of first response failures can more effectively evaluate the sending frequency of the first DNS query message and improve the efficiency of obtaining the new address of the 5G router management server.
[0101] In summary, it can be seen that the method for obtaining the address of a router management server in a private network environment provided by the embodiment of the present application has the following beneficial effects: by temporarily building a temporary DNS server outside the private network environment, a ping message can be sent to the 5G router inside the private network environment at regular intervals. After sending the ping message, the 5G router can read the connection tracking event generated by the above-mentioned sending of the ping message from all connection tracking events, so that the IP address of the temporary DNS server can be parsed from the connection tracking event. However, at this time, it is also necessary to accurately identify the IP address of the temporary DNS server from all IP addresses obtained from all connection tracking events. Therefore, the temporary DNS server is required to periodically send ping messages so that the 5G router can obtain the sending regularity therefrom, and combine the first DNS query message sent to query the domain name of the 5G router management server and the first response message subsequently received to improve the detection accuracy of the IP address of the temporary DNS server. After obtaining the accurate IP address of the temporary DNS server, since the temporary DNS server has stored the mapping relationship between the 5G router management server domain name and the new address of the 5G router management server, the new address of the 5G router management server can be accurately obtained. Therefore, it can be seen that the above embodiment does not need to set up an additional dedicated DNS server to manage the mapping between the 5G router management server domain name and the new address of the 5G router management server. When obtaining the new address of the 5G router management server, it is not only more flexible, but the temporary DNS server can also be used for 5G router management services in the private network environment of multiple different users. Therefore, it can reduce the user's hardware cost while improving the security and confidentiality of the user's private network internal environment.
[0102] Embodiment 2
[0103] refer to Figure 6 , a router management server address acquisition device in a private network environment provided in an embodiment of the present application, including: a connection tracking event monitoring module 11, a second DNS server list updating module 12 and a 5G router management server new address acquisition module 13.
[0104] Further, in some embodiments of the present application, the connection tracking event monitoring module 11 is used to continuously monitor connection tracking events through a first process, and update the first DNS server list according to the monitored connection tracking events, and trigger a first timer; the connection tracking events include: a temporary DNS server outside the private network environment continuously sends network messages to the 5G router inside the private network according to a preset first period. The connection tracking event generated; the second DNS server list updating module 12 is used to traverse each first DNS server entry in the first DNS server list through the first process when the first timer is triggered, and send a first DNS query message to the first IP address in the first DNS server entry to update the second DNS server list; the first DNS query message includes: a 5G router management server domain name; the 5G router management server new address acquisition module 13 is used to traverse each second DNS server entry in the second DNS server list through the first process when the time from the last acquisition of the 5G router management server address exceeds a first preset time, and send a first DNS query message to the second IP address in the second DNS server entry to obtain the new address of the 5G router management server.
[0105] Furthermore, in some embodiments of the present application, the connection tracking event monitoring module 11 is used to continuously monitor connection tracking events through a first process, and update the first DNS server list based on the monitored connection tracking events, including: when the first process monitors the connection tracking event, parsing the connection tracking event to obtain a number of third IP addresses; traversing each of the third IP addresses, and adding the third IP address that does not exist in the first DNS server list or the second DNS server list to the first DNS server list.
[0106] Further, in some embodiments of the present application, the second DNS server list updating module 12 is used to traverse each first DNS server entry in the first DNS server list, and send a first DNS query message to the first IP address in the first DNS server entry to update the second DNS server list, including: the first DNS server entry includes: a first IP address, a first number of times the first DNS query message is sent to the first IP address, a first sending time when the first DNS query message is last sent to the first IP address, and a first active time when the first IP address was last active; from the first DNS server list, delete the first DNS server entry corresponding to the difference between the first active time and the system time exceeding the second preset time; calculate the first next sending time of sending the first DNS query message to the corresponding first IP address next time according to the first number of times the first DNS query message is sent and the first sending time in each of the first DNS server entries; send the first DNS query message to the first IP address corresponding to the first next sending time less than or equal to the system time in sequence, obtain a first response result, and update the second DNS server list according to the first response result.
[0107] Furthermore, in some embodiments of the present application, updating the second DNS server list according to the first response result includes: when the first response result includes a correct response message corresponding to the first DNS query message, generating a corresponding second DNS server entry according to the first DNS server entry corresponding to the first IP address that responds to the first DNS query message; and adding the second DNS server entry to the second DNS server list.
[0108] Further, in some embodiments of the present application, after the first DNS query message is sent to the first IP address corresponding to the first next sending time which is less than or equal to the system time, the first DNS server entry corresponding to the first IP address is updated.
[0109] Further, in some embodiments of the present application, the 5G router management server new address acquisition module 13 is used to traverse each second DNS server entry in the second DNS server list through the first process when the time from the last acquisition of the 5G router management server address exceeds the first preset time, and send a first DNS query message to the second IP address in the second DNS server entry to obtain the new address of the 5G router management server, including: the second DNS server entry includes: the second IP address, the first response failure number after sending the first DNS query message to the second IP address without receiving a correct response message, and the second sending time of the last time the first DNS query message was sent to the second IP address; delete the second DNS server entry corresponding to the number of first response failures exceeding the first preset number from the second DNS server list; calculate the second next sending time of sending the first DNS query message to the corresponding second IP address next time according to the first response failure number and the second sending time in each of the second DNS server entries; send the first DNS query message to the second IP address corresponding to the second next sending time less than or equal to the system time in sequence, obtain a first response result, and obtain the new address of the 5G router management server according to the first response result.
[0110] Further, in some embodiments of the present application, obtaining the new address of the 5G router management server based on the first response result includes: when the first response result includes a correct response message corresponding to the first DNS query message, ending sending the first DNS query message to other second IP addresses, and interpreting the correct response message currently received to obtain the new address of the 5G router management server.
[0111] Furthermore, in some embodiments of the present application, the correct response message is a response message including the address of the 5G router management server sent by the temporary DNS server based on the first DNS query message.
[0112] Further, in some embodiments of the present application, after the first DNS query message is sent to the second IP address corresponding to the second next sending time which is less than or equal to the system time, the second DNS server entry corresponding to the second IP address is updated.
[0113] In summary, it can be seen that the router management server address acquisition device in a private network environment provided by the embodiment of the present application has the following beneficial effects: by temporarily building a temporary DNS server outside the private network environment, a ping message can be sent to the 5G router inside the private network environment at regular intervals. After sending the ping message, the 5G router can read the connection tracking event generated by the above-mentioned sending of the ping message from all connection tracking events, so that the IP address of the temporary DNS server can be parsed from the connection tracking event. However, at this time, it is also necessary to accurately identify the IP address of the temporary DNS server from all IP addresses obtained from all connection tracking events. Therefore, the temporary DNS server is required to periodically send ping messages so that the 5G router can obtain the sending regularity therefrom, and combine the first DNS query message sent to query the domain name of the 5G router management server and the first response message subsequently received to improve the detection accuracy of the IP address of the temporary DNS server. After obtaining the accurate IP address of the temporary DNS server, since the temporary DNS server has stored the mapping relationship between the 5G router management server domain name and the new address of the 5G router management server, the new address of the 5G router management server can be accurately obtained. Therefore, it can be seen that the above embodiment does not need to set up an additional dedicated DNS server to manage the mapping between the 5G router management server domain name and the new address of the 5G router management server. When obtaining the new address of the 5G router management server, it is not only more flexible, but the temporary DNS server can also be used for 5G router management services in the private network environment of multiple different users. Therefore, it can reduce the user's hardware cost while improving the security and confidentiality of the user's private network internal environment.
[0114] Embodiment 3
[0115] Based on the above-mentioned embodiment of the method for obtaining the address of a router management server in a private network environment, another embodiment of the present application provides a terminal device for obtaining the address of a router management server in a private network environment. The terminal device for obtaining the address of a router management server in a private network environment includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the method for obtaining the address of a router management server in a private network environment of any embodiment of the present application is implemented.
[0116] Exemplarily, in this embodiment, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the router management server address acquisition device in the private network environment.
[0117] The router management server address acquisition device in the private network environment can be a computing device such as a desktop computer, a notebook, a palm computer, a cloud server, etc. The router management server address acquisition terminal device in the private network environment can include, but is not limited to, a processor and a memory.
[0118] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the router management server address acquisition device in the private network environment, and uses various interfaces and lines to connect various parts of the router management server address acquisition device in the entire private network environment. The memory may be used to store the computer program and / or module, and the processor implements various functions of the router management server address acquisition device in the private network environment by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory and may also include non-volatile memory, such as a hard disk, an internal memory, a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0119] Embodiment 4
[0120] Based on the embodiment of the method for obtaining the address of a router management server in a private network environment described above, another embodiment of the present application provides a storage medium, wherein the storage medium includes a stored computer program, wherein when the computer program is running, the device where the storage medium is located is controlled to execute the method for obtaining the address of a router management server in a private network environment of any embodiment of the present application.
[0121] In this embodiment, the storage medium is a computer-readable storage medium, and the computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0122] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the scope of protection of the present application. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of protection of the present application.
Claims
1. A method for obtaining a router management server address in a private network environment, characterized in that: include: Continuously monitoring connection tracking events through the first process, and updating the first DNS server list according to the monitored connection tracking events, and triggering a first timer; The connection tracking event includes: a connection tracking event generated by a temporary DNS server outside the private network environment continuously sending network messages to a 5G router inside the private network according to a preset first period; When the first timer is triggered, the first process is used to traverse each first DNS server entry in the first DNS server list, and a first DNS query message is sent to the first IP address in the first DNS server entry to update the second DNS server list; the first DNS query message includes: a 5G router management server domain name; When the time from the last acquisition of the 5G router management server address exceeds a first preset time, traversing each second DNS server entry in the second DNS server list through the first process, and sending a first DNS query message to the second IP address in the second DNS server entry to obtain a new address of the 5G router management server; The step of continuously monitoring the connection tracking event through the first process and updating the first DNS server list according to the monitored connection tracking event includes: When the first process monitors the connection tracking event, parsing the connection tracking event to obtain a plurality of third IP addresses; After deduplication of all the third IP addresses, traverse the third IP addresses, and add the third IP addresses that are not in the first DNS server list or the second DNS server list to the first DNS server list; The traversing each first DNS server entry in the first DNS server list and sending a first DNS query message to the first IP address in the first DNS server entry to update the second DNS server list includes: The first DNS server entry includes: a first IP address, a first number of times the first DNS query message is sent to the first IP address, a first sending time when the first DNS query message is last sent to the first IP address, and a first active time when the first IP address is last active; Deleting, from the first DNS server list, the first DNS server entry corresponding to the difference between the first active time and the system time exceeding the second preset time; Calculate, in sequence according to the first number of sent times and the first sending time in each of the first DNS server entries, a first next sending time of sending the first DNS query message to the corresponding first IP address next time; The first DNS query message is sent in sequence to the first IP address corresponding to the first next sending time which is less than or equal to the system time, a first response result is obtained, and the second DNS server list is updated according to the first response result.
2. The method for obtaining the address of a router management server in a private network environment according to claim 1, characterized in that: The updating the second DNS server list according to the first response result includes: When the first response result includes a correct response message corresponding to the first DNS query message, generating a corresponding second DNS server entry according to the first DNS server entry corresponding to the first IP address that responds to the first DNS query message; Add the second DNS server entry to the second DNS server list.
3. The method for obtaining the address of a router management server in a private network environment according to claim 1, characterized in that: After the first DNS query message is sent to the first IP address corresponding to the first next sending time being less than or equal to the system time, the first DNS server entry corresponding to the first IP address is updated.
4. The method for obtaining the address of a router management server in a private network environment according to claim 1, characterized in that: When the time from the last acquisition of the 5G router management server address exceeds the first preset time, traversing each second DNS server entry in the second DNS server list through the first process, and sending a first DNS query message to the second IP address in the second DNS server entry to obtain a new address of the 5G router management server, including: The second DNS server entry includes: a second IP address, a first response failure number after sending the first DNS query message to the second IP address without receiving a correct response message, and a second sending time of the last time the first DNS query message was sent to the second IP address; Deleting, from the second DNS server list, an entry of the second DNS server corresponding to the number of the first response failures exceeding a first preset number; Calculate the second next sending time of sending the first DNS query message to the corresponding second IP address next time according to the first response failure number and the second sending time in each second DNS server entry; The first DNS query message is sent in sequence to the second IP address corresponding to the second next sending time which is less than or equal to the system time, to obtain a first response result, and according to the first response result, to obtain the new address of the 5G router management server.
5. The method for obtaining the address of a router management server in a private network environment according to claim 4, characterized in that: The obtaining, according to the first response result, a new address of the 5G router management server includes: When the first response result includes a correct response message corresponding to the first DNS query message, stop sending the first DNS query message to other second IP addresses, interpret the correct response message currently received, and obtain the new address of the 5G router management server.
6. The method for obtaining the address of a router management server in a private network environment according to claim 2 or 5, characterized in that: The correct response message is a response message including the address of the 5G router management server, sent by the temporary DNS server based on the first DNS query message.
7. The method for obtaining the address of a router management server in a private network environment according to claim 4, characterized in that: After sending the first DNS query message to the second IP address corresponding to the second next sending time being less than or equal to the system time, updating the second DNS server entry corresponding to the second IP address.
8. A device for acquiring a router management server address in a private network environment, characterized in that: include: Connection tracking event monitoring module, second DNS server list update module and 5G router management server new address acquisition module; The connection tracking event monitoring module is used to continuously monitor the connection tracking event through the first process, and update the first DNS server list according to the monitored connection tracking event, and trigger the first timer; the connection tracking event includes: the temporary DNS server outside the private network environment continuously sends the network message to the 5G router inside the private network according to the preset first period. The connection tracking event is generated; The second DNS server list updating module is used for, when the first timer is triggered, traversing each first DNS server entry in the first DNS server list through the first process, and sending a first DNS query message to the first IP address in the first DNS server entry to update the second DNS server list; the first DNS query message includes: a 5G router management server domain name; The 5G router management server new address acquisition module is used to traverse each second DNS server entry in the second DNS server list through the first process when the time from the last acquisition of the 5G router management server address exceeds the first preset time, and send a first DNS query message to the second IP address in the second DNS server entry to obtain the new address of the 5G router management server; The connection tracking event monitoring module is used to continuously monitor the connection tracking event through the first process, and update the first DNS server list according to the monitored connection tracking event, including: When the first process monitors the connection tracking event, parsing the connection tracking event to obtain a plurality of third IP addresses; After deduplication of all the third IP addresses, traverse the third IP addresses, and add the third IP addresses that are not in the first DNS server list or the second DNS server list to the first DNS server list; The second DNS server list updating module is used to traverse each first DNS server entry in the first DNS server list and send a first DNS query message to the first IP address in the first DNS server entry to update the second DNS server list, including: The first DNS server entry includes: a first IP address, a first number of times the first DNS query message is sent to the first IP address, a first sending time when the first DNS query message is last sent to the first IP address, and a first active time when the first IP address is last active; Deleting, from the first DNS server list, the first DNS server entry corresponding to the difference between the first active time and the system time exceeding the second preset time; Calculate, in sequence according to the first number of sent times and the first sending time in each of the first DNS server entries, a first next sending time of sending the first DNS query message to the corresponding first IP address next time; The first DNS query message is sent in sequence to the first IP address corresponding to the first next sending time which is less than or equal to the system time, a first response result is obtained, and the second DNS server list is updated according to the first response result.
