Mapping rule distribution method and device, computer equipment and storage medium
By selecting the master device and the slave device in the IPv6 single-stack network, and splitting the address mapping rule logs for processing and distribution, the problem of IPv4 data packet transmission obstacles in the IPv6 single-stack network is solved, and the normal traversal and rules of data packets are realized. consistent transmission.
Patent Information
- Application Number
- CN202410820341.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-08-23
AI Technical Summary
In an IPv6 single-stack network, due to differences in network address mapping rules stored in network edge devices, IPv4 data packets cannot normally pass through a pure IPv6 single-stack network for data transmission.
By selecting the master device and the slave device from the network edge device, the address mapping rule log is sent to the master device for split processing, and sent to each slave device in sequence according to the allocation order, ensuring that each device obtains a complete address mapping rule log. Avoid data transmission obstacles caused by rule differences.
It realizes the normal transmission of IPv4 data packets in the IPv6 single-stack network, ensures the consistency and integrity of address mapping rules, reduces transmission pressure, and avoids data packet traversal problems caused by rule differences.
Smart Images

Figure CN118540302A
Abstract
Description
Technical Field
[0001] The present application relates to the field of network technology and communication technology, and in particular to a mapping rule allocation method, device, computer equipment and storage medium. Background Art
[0002] An IPv6 (Internet Protocol Version 6) single-stack network is a single-stack network that realizes the interconnection between multiple pure IPv6 network domains and adapts to a variety of application scenarios. However, in some cases, an IPv6 single-stack network is required to carry IPv4 (Internet Protocol Version 4) services, that is, the network edge devices in the IPv6 single-stack network encapsulate the IPv4 data packets sent by the client side, and then transmit them to the corresponding egress network edge devices through the IPv6 network.
[0003] However, since the network address mapping rules stored in each network edge device in the IPv6 single stack network may be different, IPv4 data packets cannot pass through the pure IPv6 single stack network to achieve normal data transmission. Summary of the invention
[0004] Based on this, it is necessary to provide a mapping rule allocation method, device, computer equipment and storage medium to ensure that IPv4 data packets can smoothly pass through a pure IPv6 single-stack network to achieve normal data transmission in response to the above technical problems.
[0005] In a first aspect, the present application provides a mapping rule allocation method, which is applied to an edge control device, and the method includes:
[0006] Selecting a master device from at least one network edge device, and using network edge devices other than the master device as slave devices;
[0007] The address mapping rule log is sent to the master device, so that the master device splits the address mapping rule log, and sends each log entry to each slave device in sequence according to the allocation order corresponding to at least two log entries obtained by the splitting.
[0008] In one embodiment, selecting a master device from at least one network edge device includes:
[0009] Determine the waiting time corresponding to each network edge device;
[0010] A master device is selected from at least one network edge device according to the waiting time corresponding to each of the network edge devices.
[0011] In one of the embodiments, selecting a master device from at least one network edge device according to the waiting time corresponding to each of the network edge devices includes:
[0012] Determine a target edge device with the shortest waiting time from among the network edge devices;
[0013] When the current time reaches the waiting time corresponding to the target edge device, control the target edge device to send a voting request to network edge devices other than the target edge device; wherein the voting request is used to request the network edge device to feed back a voting response to the target edge device;
[0014] If it is determined that the number of voting responses received by the target edge device exceeds a quantity threshold, the target edge device is used as a master device.
[0015] In one embodiment, the step of using other network edge devices other than the master device as slave devices includes:
[0016] For any network edge device other than the master device, if it is determined that the network edge device has received a voting request and / or a heartbeat message sent by the master device, the network edge device is used as a slave device.
[0017] In a second aspect, the present application provides a mapping rule allocation method, which is applied to a master device, and the method includes:
[0018] Receive address mapping rule logs sent by edge control devices;
[0019] Splitting the address mapping rule log to obtain at least two log entries;
[0020] Determining an allocation order corresponding to each of the log entries;
[0021] Based on the allocation order, each log entry is sent to each slave device in turn.
[0022] In one embodiment, sending each log entry to each slave device in sequence based on the allocation order includes:
[0023] For each log entry, based on the allocation order, sending the log entry to each slave device;
[0024] receiving acquisition feedback from each slave device regarding the log entry;
[0025] If it is determined according to the acquisition feedback that there is a slave device that has not received the log entry, the log entry is resent to the slave device that has not received the log entry.
[0026] In a third aspect, the present application further provides a mapping rule allocation device, which is configured in an edge control device, and the device includes:
[0027] A selection module, configured to select a master device from at least one network edge device, and use network edge devices other than the master device as slave devices;
[0028] The first sending module is used to send the address mapping rule log to the master device so that the master device splits the address mapping rule log and sends each log entry to each slave device in turn according to the allocation order corresponding to at least two log entries obtained by the splitting.
[0029] In a fourth aspect, the present application further provides a mapping rule allocation device, which is configured in a master device, and the device includes:
[0030] A receiving module, used for receiving the address mapping rule log sent by the edge control device;
[0031] A splitting module, used for splitting the address mapping rule log to obtain at least two log entries;
[0032] A determination module, used to determine the allocation order corresponding to each of the log entries;
[0033] The second generating module is used to send each log entry to each slave device in sequence based on the allocation order.
[0034] In a fifth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0035] Selecting a master device from at least one network edge device, and using network edge devices other than the master device as slave devices;
[0036] The address mapping rule log is sent to the master device, so that the master device splits the address mapping rule log, and sends each log entry to each slave device in sequence according to the allocation order corresponding to at least two log entries obtained by the splitting.
[0037] In a sixth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0038] Receive address mapping rule logs sent by edge control devices;
[0039] Splitting the address mapping rule log to obtain at least two log entries;
[0040] Determining an allocation order corresponding to each of the log entries;
[0041] Based on the allocation order, each log entry is sent to each slave device in turn.
[0042] In a seventh aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0043] Selecting a master device from at least one network edge device, and using network edge devices other than the master device as slave devices;
[0044] The address mapping rule log is sent to the master device, so that the master device splits the address mapping rule log, and sends each log entry to each slave device in sequence according to the allocation order corresponding to at least two log entries obtained by the splitting.
[0045] In an eighth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0046] Receive address mapping rule logs sent by edge control devices;
[0047] Splitting the address mapping rule log to obtain at least two log entries;
[0048] Determining an allocation order corresponding to each of the log entries;
[0049] Based on the allocation order, each log entry is sent to each slave device in turn.
[0050] In a ninth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0051] Selecting a master device from at least one network edge device, and using network edge devices other than the master device as slave devices;
[0052] The address mapping rule log is sent to the master device, so that the master device splits the address mapping rule log, and sends each log entry to each slave device in sequence according to the allocation order corresponding to at least two log entries obtained by the splitting.
[0053] In a tenth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0054] Receive address mapping rule logs sent by edge control devices;
[0055] Splitting the address mapping rule log to obtain at least two log entries;
[0056] Determining an allocation order corresponding to each of the log entries;
[0057] Based on the allocation order, each log entry is sent to each slave device in turn.
[0058] The above-mentioned mapping rule allocation method, device, computer equipment and storage medium select a main device from at least one network edge device, and use the network edge devices other than the main device as slave devices, and then send the address mapping rule log to the main device, so that the main device splits the address mapping rule log, and sends each log entry to each slave device in turn according to the allocation order corresponding to at least two log entries obtained by the split. According to the above content, the present application divides at least one network edge device into a master device and at least one slave device to realize the subsequent sending of the address mapping rule log to the master device, so that the master device sends the address mapping rule log to each slave device, realizes the distribution operation of the address mapping rule log, and ensures that each network edge device can obtain the address mapping rule log, and prevents the IPv4 data packet from being unable to pass through the pure IPv6 single stack network to realize normal data transmission due to differences in the network address mapping rules stored in each network edge device in the IPv6 single stack network; and, in the process of the master device sending the address mapping rule log to each slave device, the address mapping rule log is first split and processed, and then each log entry is sent to each slave device in turn according to the allocation order corresponding to at least two log entries obtained by the split, thereby ensuring that in the process of the master device transmitting the address mapping rule log, no slave device will receive an erroneous address mapping rule log, so that each address mapping rule log can obtain a complete address mapping rule log, and the transmission pressure of a single transmission of the address mapping rule log is reduced, ensuring the consistency of the address mapping rule log received by each slave device. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 An application environment diagram of a mapping rule allocation method provided in an embodiment of the present application;
[0060] Figure 2 A flowchart of a first mapping rule allocation method provided in an embodiment of the present application;
[0061] Figure 3 An application scenario diagram of an IPv6 single stack network provided in an embodiment of the present application;
[0062] Figure 4 A flowchart of a second mapping rule allocation method provided in an embodiment of the present application;
[0063] Figure 5 A flowchart of a mapping rule allocation method provided in an embodiment of the present application;
[0064] Figure 6 A flowchart of a third mapping rule allocation method provided in an embodiment of the present application;
[0065] Figure 7 A flowchart of a fourth mapping rule allocation method provided in an embodiment of the present application;
[0066] Figure 8 A flowchart of a fifth mapping rule allocation method provided in an embodiment of the present application;
[0067] Fig. 9 A structural block diagram of a first mapping rule allocation device provided in an embodiment of the present application;
[0068] Fig.10 A structural block diagram of a second mapping rule allocation device provided in an embodiment of the present application;
[0069] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0070] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0071] It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. In the description of the present application, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms is not necessarily for the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples without contradicting each other.
[0072] The mapping rule allocation method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the edge control device 102 communicates with the main device 104 through the network, and the main device 104 and the slave device 103 communicate through the network. The data storage system can store the data that the main device 104 needs to process. The data storage system can be integrated on the main device 104, or it can be placed on the cloud or other network servers. By selecting a main device from at least one network edge device, and using the network edge devices other than the main device as slave devices, and then sending the address mapping rule log to the main device, so that the main device splits the address mapping rule log, and sends each log entry to each slave device in turn according to the allocation order corresponding to at least two log entries obtained by splitting. Among them, the edge control device 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The main device 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0073] In one embodiment, Figure 2 As shown, a mapping rule allocation method is provided, which is applied to Figure 1 Taking the edge control device 102 in FIG. 1 as an example, the following steps are included:
[0074] S201, selecting a master device from at least one network edge device, and using network edge devices other than the master device as slave devices.
[0075] It should be noted that in order to ensure the consistency of the address mapping rule log stored in each network edge device and to simplify the subsequent management of the address mapping rule log and the complexity of abnormality troubleshooting, a master device can be selected from at least one network edge device, and the address mapping rule log can be updated and modified on the master device subsequently so that the master device can synchronize the address mapping rule log to each slave device, thereby achieving the purpose of not having to update and modify the address mapping rule log of each network edge device, thereby reducing the complexity and error probability of the address mapping rule log configuration.
[0076] Further explanation: when it is necessary to select a main device from at least one network edge device, it can be verified whether there are performance differences in the equipment performance of each network edge device. If the equipment performance of each network edge device is the same, the main device is selected from at least one network edge device in a randomly determined manner; if there is a network edge device whose equipment performance is different from that of other network edge devices, the main device is selected from at least one network edge device based on the equipment performance of each network edge device.
[0077] Specifically, when it is necessary to verify whether there are performance differences in the equipment performance of each network edge device, each network edge device can be subjected to benchmark testing, load testing, power consumption assessment testing, response time and delay testing, etc., and then, the test results are used as the equipment performance of each network edge device, so as to verify whether there are performance differences in the equipment performance of each network edge device based on the equipment performance of each network edge device.
[0078] Among them, benchmark tests may include but are not limited to: CPU (Central Processing Unit) performance test, memory throughput test, storage IO test, network speed test, etc. Load testing refers to applying different degrees of load to each network edge device to evaluate the corresponding device operation stability of each network edge device under the premise of different degrees of load. Power consumption evaluation test refers to measuring the corresponding device power consumption of each network edge device under different degrees of load, and then evaluating the performance of each network edge device based on the device power consumption. Response time and delay test refers to assigning processing tasks to each network edge device and recording the response time and delay of each network edge device for the processing tasks, so as to evaluate the performance of each network edge device based on response time and delay.
[0079] Furthermore, when verifying whether there is a performance difference in the equipment performance of each network edge device based on the equipment performance of each network edge device, it can be verified whether the equipment performance difference between each network edge device is greater than a preset performance difference threshold; if there is a equipment performance difference between two network edge devices that is greater than the preset performance difference threshold, it is determined that there is a performance difference in the equipment performance of each network edge device; conversely, if there is no equipment performance difference between two network edge devices that is greater than the preset performance difference threshold, it is determined that there is no performance difference in the equipment performance of each network edge device.
[0080] In one embodiment of the present application, if a master device is selected from at least one network edge device in a randomly determined manner, a corresponding identity number can be randomly assigned to each network edge device, and then the network edge device with the smallest identity number (or the largest identity number) is selected as the master device.
[0081] If an abnormality occurs in the currently determined master device, the currently abnormal master device will be deleted, and the network edge device with the smallest identity number (or the largest identity number) will be re-selected as the master device according to the identity numbers of the remaining network edge devices to achieve the purpose of restarting the master device.
[0082] In another embodiment of the present application, when a main device is selected from at least one network edge device based on the device performance of each network edge device, the network edge devices can be sorted in order from high to low according to the device performance of each network edge device, and the network edge device ranked first can be used as the main device.
[0083] If an abnormality occurs in the currently determined main device, the current abnormal main device will be deleted, and the remaining network edge devices will be sorted in descending order of device performance, and the network edge device ranked first will be used as the main device to achieve the purpose of restarting the main device.
[0084] S202, sending the address mapping rule log to the master device, so that the master device splits the address mapping rule log, and sends each log entry to each slave device in sequence according to the allocation order corresponding to at least two log entries obtained by the splitting.
[0085] The allocation order refers to the order of the corresponding positions of the log entries obtained after splitting in the address mapping rule log.
[0086] It should be noted that by sending each log entry to each slave device in turn according to the allocation order corresponding to at least two log entries obtained by splitting, each slave device can determine the corresponding order of each log entry in the address mapping rule log according to the receiving order of the received log entries, so that each slave device can obtain a complete address mapping rule log.
[0087] To further explain, after each log entry is sent to each slave device, it is necessary to obtain reception feedback from each slave device for the log entry. The accuracy of the log entries received by each slave device can be verified based on the reception feedback to prevent omission or modification of the log entries during transmission to each slave device.
[0088] In one embodiment of the present application, the application scenario of the IPv6 single stack network can be as follows: Figure 3 As shown, the network edge devices can be divided into inlet network edge devices and outlet network edge devices. The client communicates with at least one inlet network edge device through the user edge device to transmit the IPv4 data packet to the inlet network edge device. The inlet network edge device is used to receive and process the IPv4 data packet sent by the client, and convert the IPv4 address of the IPv4 data packet into an IPv6 address, so as to transmit the converted IPv6 data packet to the outlet network edge device; the outlet network edge device is used to receive and process the IPv6 data packet sent by the inlet network edge device, convert the IPv6 data packet into an IPv4 data packet, and transmit it to the target server. The network edge devices are connected through an autonomous domain, and the edge control device sends the address mapping rule log to the master device, so that the master device sends the address mapping rule log to each slave device.
[0089] After the master device sends each log entry to each slave device in turn, when the client sends an IPv4 data packet or the server sends an IPv4 data packet, each network edge device can convert the IPv4 address of the IPv4 data packet into an IPv6 address according to the address mapping rule log, so as to encapsulate the converted data packet and pass it to the corresponding egress network edge device or ingress network edge device, so as to correctly transmit the IPv4 data packet to the target server or client in the IPv6 single stack network, thereby achieving stateless IPv4-IPv6 address conversion and transmitting IPv4 business data.
[0090] The above-mentioned mapping rule allocation method selects a main device from at least one network edge device, and uses the network edge devices other than the main device as slave devices, and then sends the address mapping rule log to the main device, so that the main device splits the address mapping rule log, and sends each log entry to each slave device in turn according to the allocation order corresponding to at least two log entries obtained by the split. According to the above content, the present application divides at least one network edge device into a master device and at least one slave device to realize the subsequent sending of the address mapping rule log to the master device, so that the master device sends the address mapping rule log to each slave device, realizes the distribution operation of the address mapping rule log, and ensures that each network edge device can obtain the address mapping rule log, and prevents the IPv4 data packet from being unable to pass through the pure IPv6 single stack network to realize normal data transmission due to differences in the network address mapping rules stored in each network edge device in the IPv6 single stack network; and, in the process of the master device sending the address mapping rule log to each slave device, the address mapping rule log is first split and processed, and then each log entry is sent to each slave device in turn according to the allocation order corresponding to at least two log entries obtained by the split, thereby ensuring that in the process of the master device transmitting the address mapping rule log, no slave device will receive an erroneous address mapping rule log, so that each address mapping rule log can obtain a complete address mapping rule log, and the transmission pressure of a single transmission of the address mapping rule log is reduced, ensuring the consistency of the address mapping rule log received by each slave device.
[0091] In one embodiment, if Figure 4 As shown, when it is necessary to select a master device from at least one network edge device, the following contents may be specifically included:
[0092] S401, determining the waiting time corresponding to each network edge device.
[0093] The waiting time refers to the time that each network edge device needs to remain in a static state (ie, a state of not performing any operation) starting from the current moment.
[0094] It should be noted that when it is necessary to determine the waiting time corresponding to the network edge device, a random determination method can be used to determine the waiting time corresponding to each network edge device.
[0095] Furthermore, a random number generator may be used to determine the waiting time corresponding to each network edge device.
[0096] S402: Select a master device from at least one network edge device according to the waiting time corresponding to each network edge device.
[0097] In one embodiment of the present application, when it is necessary to select a master device from at least one network edge device based on the waiting time corresponding to each network edge device, the network edge devices can be sorted in ascending order according to the waiting time corresponding to each network edge device, and the network edge device ranked first in the sorting result is the master device.
[0098] It should be noted that in order to ensure that the determined master device can interact with the devices between each slave device, the process of selecting the master device from at least one network edge device may specifically include the following contents: determining the target edge device with the shortest waiting time from each network edge device; when the current time reaches the waiting time corresponding to the target edge device, controlling the target edge device to send a voting request to network edge devices other than the target edge device; wherein the voting request is used to request the network edge device to feedback a voting response to the target edge device; if it is determined that the number of voting responses received by the target edge device exceeds the quantity threshold, the target edge device is used as the master device.
[0099] Further explanation: in the process of treating network edge devices other than the master device as slave devices, for any network edge device other than the master device, if it is determined that the network edge device has received a voting request and / or received a heartbeat message sent by the master device, the network edge device will be treated as a slave device.
[0100] In one embodiment of the present application, Figure 5 As shown, after determining the waiting time corresponding to each network edge device, when the current time reaches the waiting time corresponding to the network edge device, the network edge device is used as a candidate device, and a voting request is sent to other network edge devices. If it is determined that the number of voting responses received by the candidate device exceeds the number threshold, the candidate device is used as the master device. Further, if the candidate device receives a voting request and / or receives a heartbeat message sent by the master device, the candidate device is used as a slave device; if the master device fails, or the network edge device serves as the master device for more than the pre-set master device term, the master device is used as a slave device and a new master device is selected.
[0101] The above-mentioned mapping rule allocation method selects a main device from at least one network edge device by determining the waiting time corresponding to each network edge device, thereby ensuring the smooth determination of the main device, and realizes the distribution operation of the address mapping rule log, thereby ensuring that each network edge device can obtain the address mapping rule log, thereby preventing the IPv4 data packets from being unable to pass through the pure IPv6 single stack network to achieve normal data transmission due to differences in the network address mapping rules stored in each network edge device in the IPv6 single stack network.
[0102] In one embodiment, Figure 6 As shown, a mapping rule allocation method is provided, which is applied to Figure 1 Taking the master device 104 in the example as an example, the following steps are included:
[0103] S601: Receive an address mapping rule log sent by an edge control device.
[0104] It should be noted that after receiving the address mapping rule log sent by the edge control device, the address mapping rule log can be verified for integrity to prevent the address mapping rule log from being abnormal during the subsequent synchronization of the address mapping rule log to other slave devices.
[0105] Furthermore, if the address mapping rule log integrity verification passes, subsequent operations are performed; if the address mapping rule log integrity verification fails, a secondary acquisition request is sent to the edge control device, so that after the edge control device receives the secondary acquisition request, it will resend the address mapping rule log to the main device.
[0106] Specifically, before the edge control device provides the address mapping rule log to the main device, it can perform a hash operation on the address mapping rule log to obtain a first hash value corresponding to the address mapping rule log. After providing the address mapping rule log to the main device, the main device also performs a hash operation on the address mapping rule log to obtain a second hash value corresponding to the address mapping rule log. The integrity of the address mapping rule log is verified by verifying whether the first hash value and the second hash value are the same; if they are the same, it is determined that the integrity verification has passed; if they are not the same, the integrity verification has failed.
[0107] S602: Split the address mapping rule log to obtain at least two log entries.
[0108] In one embodiment of the present application, when the address mapping rule log needs to be split, the maximum number of characters corresponding to each log entry can be determined in advance, and then the address mapping rule log is split according to the maximum number of characters to ensure that the number of characters in at least two log entries obtained by splitting is less than or equal to the maximum number of characters.
[0109] S603: Determine the allocation order corresponding to each log entry.
[0110] The allocation order refers to the order of the corresponding positions of the log entries obtained after splitting in the address mapping rule log.
[0111] Therefore, when it is necessary to determine the allocation order corresponding to each log entry, the corresponding position of each log entry obtained after splitting in the address mapping rule log can be determined, and then the order of the positions of each log entry in the address mapping rule log can be used as the allocation order corresponding to each log entry.
[0112] S604, sending each log entry to each slave device in sequence based on the allocation order.
[0113] It should be noted that when each log entry is sent to each slave device in sequence based on the allocation order, the following contents may be specifically included: for each log entry, the log entry is sent to each slave device based on the allocation order; acquisition feedback from each slave device for the log entry is received; if it is determined based on the acquisition feedback that there is a slave device that has not received the log entry, the log entry is resent to the slave device that has not received the log entry.
[0114] To further explain, after receiving the log entries sent by the master device, the slave device will feed back the log entries stored by itself as acquisition feedback to the master device, so that the master device can determine whether there are log entries that have not been received by the slave device based on the difference between the log entries contained in the acquisition feedback and the log entries stored by the master device itself.
[0115] In one embodiment of the present application, after the master device splits the address mapping rule log to obtain at least two log entries, after sending the log entry to the slave device, the slave device will feedback a confirmation message, and the confirmation message is used to inform the master device that the slave device has received the log entry; when the number of confirmation messages received by the master device is greater than the quantity threshold, the master device will inform the slave device to send acquisition feedback for the log entry, and the master device receives the acquisition feedback from each slave device for the log entry; if it is determined based on the acquisition feedback that there is a slave device that has not received the log entry, the log entry is resent to the slave device that has not received the log entry.
[0116] The above mapping rule allocation method obtains at least two log entries by splitting the address mapping rule log; and then, according to the allocation order corresponding to each log entry, each log entry is sent to each slave device in turn. According to the above content, the present application divides at least one network edge device into a master device and at least one slave device to realize the subsequent sending of the address mapping rule log to the master device, so that the master device sends the address mapping rule log to each slave device, realizes the distribution operation of the address mapping rule log, and ensures that each network edge device can obtain the address mapping rule log, and prevents the IPv4 data packet from being unable to pass through the pure IPv6 single stack network to realize normal data transmission due to differences in the network address mapping rules stored in each network edge device in the IPv6 single stack network; and, in the process of the master device sending the address mapping rule log to each slave device, the address mapping rule log is first split and processed, and then each log entry is sent to each slave device in turn according to the allocation order corresponding to at least two log entries obtained by the split, thereby ensuring that in the process of the master device transmitting the address mapping rule log, no slave device will receive an erroneous address mapping rule log, so that each address mapping rule log can obtain a complete address mapping rule log, and the transmission pressure of a single transmission of the address mapping rule log is reduced, ensuring the consistency of the address mapping rule log received by each slave device.
[0117] In one embodiment, if Figure 7 As shown in the figure, when the address mapping rule log is distributed to each network edge device, the following contents may be included:
[0118] S701, determining the waiting time corresponding to each network edge device.
[0119] S702: Determine a target edge device with the shortest waiting time from among the network edge devices.
[0120] S703: When the current time reaches the waiting time corresponding to the target edge device, control the target edge device to send a voting request to network edge devices other than the target edge device.
[0121] The voting request is used to request the network edge device to feed back a voting response to the target edge device.
[0122] S704: If it is determined that the number of voting responses received by the target edge device exceeds the number threshold, the target edge device is used as the master device.
[0123] S705, for any network edge device except the master device, if it is determined that the network edge device receives a voting request and / or receives a heartbeat message sent by the master device, the network edge device is used as a slave device.
[0124] S706, sending the address mapping rule log to the master device, so that the master device splits the address mapping rule log, and sends each log entry to each slave device in sequence according to the allocation order corresponding to at least two log entries obtained by the splitting.
[0125] In one embodiment, if Figure 8 As shown in the figure, when the address mapping rule log is distributed to each network edge device, the following contents can also be included:
[0126] S801: Receive an address mapping rule log sent by an edge control device.
[0127] S802: Split the address mapping rule log to obtain at least two log entries.
[0128] S803: Determine the allocation order corresponding to each log entry.
[0129] S804: For each log entry, send the log entry to each slave device based on the allocation order.
[0130] S805: Receive acquisition feedback from each slave device regarding the log entry.
[0131] S806: If it is determined according to the acquired feedback that there is a slave device that has not received the log entry, resend the log entry to the slave device that has not received the log entry.
[0132] The above-mentioned mapping rule allocation method selects a main device from at least one network edge device, and uses the network edge devices other than the main device as slave devices, and then sends the address mapping rule log to the main device, so that the main device splits the address mapping rule log, and sends each log entry to each slave device in turn according to the allocation order corresponding to at least two log entries obtained by the split. According to the above content, the present application divides at least one network edge device into a master device and at least one slave device to realize the subsequent sending of the address mapping rule log to the master device, so that the master device sends the address mapping rule log to each slave device, realizes the distribution operation of the address mapping rule log, and ensures that each network edge device can obtain the address mapping rule log, and prevents the IPv4 data packet from being unable to pass through the pure IPv6 single stack network to realize normal data transmission due to differences in the network address mapping rules stored in each network edge device in the IPv6 single stack network; and, in the process of the master device sending the address mapping rule log to each slave device, the address mapping rule log is first split and processed, and then each log entry is sent to each slave device in turn according to the allocation order corresponding to at least two log entries obtained by the split, thereby ensuring that in the process of the master device transmitting the address mapping rule log, no slave device will receive an erroneous address mapping rule log, so that each address mapping rule log can obtain a complete address mapping rule log, and the transmission pressure of a single transmission of the address mapping rule log is reduced, ensuring the consistency of the address mapping rule log received by each slave device.
[0133] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0134] Based on the same inventive concept, the embodiment of the present application also provides a mapping rule allocation device for implementing the mapping rule allocation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more mapping rule allocation device embodiments provided below can refer to the limitations of the mapping rule allocation method above, and will not be repeated here.
[0135] In one embodiment, Fig. 9 As shown, a mapping rule allocation device is provided, comprising: a selection module 10 and a first sending module 20, wherein:
[0136] The selection module 10 is used to select a master device from at least one network edge device, and use the network edge devices other than the master device as slave devices.
[0137] The first sending module 20 is used to send the address mapping rule log to the master device, so that the master device splits the address mapping rule log and sends each log entry to each slave device in turn according to the allocation order corresponding to at least two log entries obtained by the splitting.
[0138] In one embodiment, a waiting time corresponding to each network edge device is determined; and a master device is selected from at least one network edge device according to the waiting time corresponding to each network edge device.
[0139] In one embodiment, a target edge device with the shortest waiting time is determined from each network edge device; when the current time reaches the waiting time corresponding to the target edge device, the target edge device is controlled to send a voting request to network edge devices other than the target edge device; wherein the voting request is used to request the network edge device to feedback a voting response to the target edge device; if it is determined that the number of voting responses received by the target edge device exceeds a quantity threshold, the target edge device is used as the master device.
[0140] In one embodiment, for any network edge device except the master device, if it is determined that the network edge device receives a voting request and / or receives a heartbeat message sent by the master device, the network edge device is used as a slave device.
[0141] The above-mentioned mapping rule allocation device selects a main device from at least one network edge device and uses the network edge devices other than the main device as slave devices, and then sends the address mapping rule log to the main device, so that the main device splits the address mapping rule log and sends each log entry to each slave device in turn according to the allocation order corresponding to at least two log entries obtained by the split. According to the above content, the present application divides at least one network edge device into a master device and at least one slave device to realize the subsequent sending of the address mapping rule log to the master device, so that the master device sends the address mapping rule log to each slave device, realizes the distribution operation of the address mapping rule log, and ensures that each network edge device can obtain the address mapping rule log, and prevents the IPv4 data packet from being unable to pass through the pure IPv6 single stack network to realize normal data transmission due to differences in the network address mapping rules stored in each network edge device in the IPv6 single stack network; and, in the process of the master device sending the address mapping rule log to each slave device, the address mapping rule log is first split and processed, and then each log entry is sent to each slave device in turn according to the allocation order corresponding to at least two log entries obtained by the split, thereby ensuring that in the process of the master device transmitting the address mapping rule log, no slave device will receive an erroneous address mapping rule log, so that each address mapping rule log can obtain a complete address mapping rule log, and the transmission pressure of a single transmission of the address mapping rule log is reduced, ensuring the consistency of the address mapping rule log received by each slave device.
[0142] In one embodiment, Fig.10 As shown, a mapping rule allocation device is provided, which is configured in an edge control device, including: a receiving module 30, a splitting module 40, a determining module 50 and a second generating module 60, wherein:
[0143] The receiving module 30 is used to receive the address mapping rule log sent by the edge control device.
[0144] The splitting module 40 is used to split the address mapping rule log to obtain at least two log entries.
[0145] The determination module 50 is used to determine the allocation order corresponding to each log entry.
[0146] The second generating module 60 is used to send each log entry to each slave device in sequence based on the allocation order.
[0147] In one embodiment, for each log entry, the log entry is sent to each slave device based on the allocation order; acquisition feedback from each slave device for the log entry is received; if it is determined based on the acquisition feedback that there is a slave device that has not received the log entry, the log entry is resent to the slave device that has not received the log entry.
[0148] The above mapping rule allocation method obtains at least two log entries by splitting the address mapping rule log; and then, according to the allocation order corresponding to each log entry, each log entry is sent to each slave device in turn. According to the above content, the present application divides at least one network edge device into a master device and at least one slave device to realize the subsequent sending of the address mapping rule log to the master device, so that the master device sends the address mapping rule log to each slave device, realizes the distribution operation of the address mapping rule log, and ensures that each network edge device can obtain the address mapping rule log, and prevents the IPv4 data packet from being unable to pass through the pure IPv6 single stack network to realize normal data transmission due to differences in the network address mapping rules stored in each network edge device in the IPv6 single stack network; and, in the process of the master device sending the address mapping rule log to each slave device, the address mapping rule log is first split and processed, and then each log entry is sent to each slave device in turn according to the allocation order corresponding to at least two log entries obtained by the split, thereby ensuring that in the process of the master device transmitting the address mapping rule log, no slave device will receive an erroneous address mapping rule log, so that each address mapping rule log can obtain a complete address mapping rule log, and the transmission pressure of a single transmission of the address mapping rule log is reduced, ensuring the consistency of the address mapping rule log received by each slave device.
[0149] Each module in the above mapping rule allocation device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0150] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.11As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a mapping rule allocation method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0151] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0152] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0153] Selecting a master device from at least one network edge device, and using network edge devices other than the master device as slave devices;
[0154] The address mapping rule log is sent to the master device, so that the master device splits the address mapping rule log, and sends each log entry to each slave device in sequence according to the allocation order corresponding to at least two log entries obtained by the splitting.
[0155] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0156] Determine the waiting time corresponding to each network edge device;
[0157] A master device is selected from at least one network edge device according to the waiting time corresponding to each network edge device.
[0158] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0159] Determine a target edge device with the shortest waiting time from among the network edge devices;
[0160] When the current time reaches the waiting time corresponding to the target edge device, control the target edge device to send a voting request to network edge devices other than the target edge device; wherein the voting request is used to request the network edge device to feed back a voting response to the target edge device;
[0161] If it is determined that the number of voting responses received by the target edge device exceeds the number threshold, the target edge device is used as the master device.
[0162] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0163] For any network edge device except the master device, if it is determined that the network edge device receives a voting request and / or receives a heartbeat message sent by the master device, the network edge device is regarded as a slave device.
[0164] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0165] Receive address mapping rule logs sent by edge control devices;
[0166] The address mapping rule log is split to obtain at least two log entries;
[0167] Determine the allocation order corresponding to each log entry;
[0168] Each log entry is sent to each slave device in turn based on the allocation order.
[0169] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0170] For each log entry, send the log entry to each slave device based on the allocation order;
[0171] Receive feedback from each slave device regarding log entries;
[0172] If it is determined according to the acquired feedback that there is a slave device that has not received the log entry, the log entry is resent to the slave device that has not received the log entry.
[0173] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0174] Selecting a master device from at least one network edge device, and using network edge devices other than the master device as slave devices;
[0175] The address mapping rule log is sent to the master device, so that the master device splits the address mapping rule log, and sends each log entry to each slave device in sequence according to the allocation order corresponding to at least two log entries obtained by the splitting.
[0176] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0177] Determine the waiting time corresponding to each network edge device;
[0178] A master device is selected from at least one network edge device according to the waiting time corresponding to each network edge device.
[0179] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0180] Determine a target edge device with the shortest waiting time from among the network edge devices;
[0181] When the current time reaches the waiting time corresponding to the target edge device, control the target edge device to send a voting request to network edge devices other than the target edge device; wherein the voting request is used to request the network edge device to feed back a voting response to the target edge device;
[0182] If it is determined that the number of voting responses received by the target edge device exceeds the number threshold, the target edge device is used as the master device.
[0183] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0184] For any network edge device except the master device, if it is determined that the network edge device receives a voting request and / or receives a heartbeat message sent by the master device, the network edge device is regarded as a slave device.
[0185] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0186] Receive address mapping rule logs sent by edge control devices;
[0187] The address mapping rule log is split to obtain at least two log entries;
[0188] Determine the allocation order corresponding to each log entry;
[0189] Each log entry is sent to each slave device in turn based on the allocation order.
[0190] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0191] For each log entry, send the log entry to each slave device based on the allocation order;
[0192] Receive feedback from each slave device regarding log entries;
[0193] If it is determined according to the acquired feedback that there is a slave device that has not received the log entry, the log entry is resent to the slave device that has not received the log entry.
[0194] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0195] Selecting a master device from at least one network edge device, and using network edge devices other than the master device as slave devices;
[0196] The address mapping rule log is sent to the master device, so that the master device splits the address mapping rule log, and sends each log entry to each slave device in sequence according to the allocation order corresponding to at least two log entries obtained by the splitting.
[0197] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0198] Determine the waiting time corresponding to each network edge device;
[0199] A master device is selected from at least one network edge device according to the waiting time corresponding to each network edge device.
[0200] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0201] Determine a target edge device with the shortest waiting time from among the network edge devices;
[0202] When the current time reaches the waiting time corresponding to the target edge device, control the target edge device to send a voting request to network edge devices other than the target edge device; wherein the voting request is used to request the network edge device to feed back a voting response to the target edge device;
[0203] If it is determined that the number of voting responses received by the target edge device exceeds the number threshold, the target edge device is used as the master device.
[0204] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0205] For any network edge device except the master device, if it is determined that the network edge device receives a voting request and / or receives a heartbeat message sent by the master device, the network edge device is regarded as a slave device.
[0206] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0207] Receive address mapping rule logs sent by edge control devices;
[0208] Split the address mapping rule log to obtain at least two log entries;
[0209] Determine the allocation order corresponding to each log entry;
[0210] Each log entry is sent to each slave device in turn based on the allocation order.
[0211] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0212] For each log entry, send the log entry to each slave device based on the allocation order;
[0213] Receive feedback from each slave device regarding log entries;
[0214] If it is determined according to the acquired feedback that there is a slave device that has not received the log entry, the log entry is resent to the slave device that has not received the log entry.
[0215] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
[0216] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0217] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0218] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A mapping rule allocation method, characterized in that: Applied to an edge control device, the method comprises: Selecting a master device from at least one network edge device, and using network edge devices other than the master device as slave devices; The address mapping rule log is sent to the master device, so that the master device splits the address mapping rule log, and sends each log entry to each slave device in sequence according to the allocation order corresponding to at least two log entries obtained by the splitting.
2. The method according to claim 1, characterized in that The selecting a master device from at least one network edge device comprises: Determine the waiting time corresponding to each network edge device; A master device is selected from at least one network edge device according to the waiting time corresponding to each of the network edge devices.
3. The method according to claim 2, characterized in that The selecting a master device from at least one network edge device according to the waiting time corresponding to each of the network edge devices comprises: Determine a target edge device with the shortest waiting time from among the network edge devices; When the current time reaches the waiting time corresponding to the target edge device, control the target edge device to send a voting request to network edge devices other than the target edge device; wherein the voting request is used to request the network edge device to feed back a voting response to the target edge device; If it is determined that the number of voting responses received by the target edge device exceeds a quantity threshold, the target edge device is used as a master device.
4. The method according to claim 3, characterized in that The method of using other network edge devices except the master device as slave devices includes: For any network edge device other than the master device, if it is determined that the network edge device has received a voting request and / or a heartbeat message sent by the master device, the network edge device is used as a slave device.
5. A mapping rule allocation method, characterized in that: Applied to a master device, the method comprises: Receive address mapping rule logs sent by edge control devices; Splitting the address mapping rule log to obtain at least two log entries; Determining an allocation order corresponding to each of the log entries; Based on the allocation order, each log entry is sent to each slave device in turn.
6. The method according to claim 5, characterized in that The sending each log entry to each slave device in sequence based on the allocation order includes: For each log entry, based on the allocation order, sending the log entry to each slave device; receiving acquisition feedback from each slave device regarding the log entry; If it is determined according to the acquisition feedback that there is a slave device that has not received the log entry, the log entry is resent to the slave device that has not received the log entry.
7. A mapping rule allocation device, characterized in that: Configured in an edge control device, the device includes: A selection module, configured to select a master device from at least one network edge device, and use network edge devices other than the master device as slave devices; The first sending module is used to send the address mapping rule log to the master device so that the master device splits the address mapping rule log and sends each log entry to each slave device in turn according to the allocation order corresponding to at least two log entries obtained by the splitting.
8. A mapping rule allocation device, characterized in that: Configured in a main device, the device comprises: A receiving module, used for receiving the address mapping rule log sent by the edge control device; A splitting module, used for splitting the address mapping rule log to obtain at least two log entries; A determination module, used to determine the allocation order corresponding to each of the log entries; The second generating module is used to send each log entry to each slave device in sequence based on the allocation order.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Leader electing method, device and equipment
CN108810046A
Leader node election method and system, storage medium and equipment
CN114189421A
Target tracking method, system and device based on cloud edge collaboration and medium
CN114241002A
Log file backup method and system based on block chain
CN115878383A
Data transmission method and device, storage medium and electronic equipment
CN116886594A
