Address translation information synchronization method and apparatus, computer device, readable storage medium, and program product

By identifying the type of access traffic and generating a corresponding address translation synchronization table, the problem of low synchronization efficiency when the device access traffic is large or the number of devices is large is solved, and efficient address translation information synchronization and normal communication access are achieved.

CN119652862BActive Publication Date: 2026-01-20CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411772214.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2026-01-20
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

When there is a large amount of device access traffic or a large number of devices, the address translation information synchronization efficiency is low, resulting in a large number of translation relationship information waiting to be synchronized.

Method used

By identifying the access type of the access traffic, the system synchronizes inbound address translation information for non-conflicting access traffic and synchronizes inbound and outbound address translation information for conflicting access traffic, generates an address translation synchronization table, and synchronizes it to the second synchronization device.

Benefits of technology

It improves the efficiency of address translation information synchronization, reduces the amount of synchronized address translation information, and ensures the normal communication and access process of subsequent devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652862B_ABST
    Figure CN119652862B_ABST
Patent Text Reader

Abstract

The application relates to an address conversion information synchronization method, computer equipment, a computer readable storage medium and a computer program product, which are applied to the technical field of network communication, and the method comprises the following steps: acquiring a first address conversion relationship table of a first synchronization device; identifying access traffic corresponding to the first address conversion relationship table to obtain an access type of the access traffic; in the case that the access type of the access traffic is an access non-conflict type, determining in-bound address conversion information corresponding to the access traffic in the address conversion relationship table as target address conversion information; in the case that the access type of the access traffic is an access conflict type, determining in-bound address conversion information and out-bound address conversion information corresponding to the access traffic in the address conversion relationship table as the target address conversion information; and synchronizing the target address conversion information of the access traffic to a second synchronization device. The method can improve the address conversion information synchronization efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of network communication, in particular to an address conversion information synchronization method and device, computer equipment, computer readable storage medium and computer program product. BACKGROUND

[0002] In order to save resources, multiple hosts usually access the Internet by sharing switch port addresses, so the conversion relationship information of access traffic needs to be recorded to enable subsequent traffic access to achieve communication by querying the record.

[0003] Currently, all conversion relationship information recorded between devices needs to be synchronized to ensure that the devices can implement the same communication function. However, in the case of large access traffic of the device or a large number of devices, a large number of conversion relationship information waiting for synchronization may occur, resulting in low address conversion information synchronization efficiency. SUMMARY

[0004] Therefore, it is necessary to provide an address conversion information synchronization method and device, computer equipment, computer readable storage medium and computer program product capable of improving address conversion information synchronization efficiency to solve the above technical problems.

[0005] In a first aspect, the present application provides an address conversion information synchronization method, comprising:

[0006] obtaining a first address conversion relationship table of a first synchronization device;

[0007] identifying the access types of a plurality of access traffics corresponding to the first address conversion relationship table to obtain the access types of the plurality of access traffics;

[0008] For each access traffic, if the access type of the access traffic is an access non-conflict type, the ingress address conversion information corresponding to the access traffic in the address conversion relationship table is determined as target address conversion information; if the access type of the access traffic is an access conflict type, the ingress address conversion information and the egress address conversion information corresponding to the access traffic in the address conversion relationship table are determined as target address conversion information;

[0009] generating an address conversion synchronization table according to the target address conversion information of each access traffic, and synchronizing the address conversion synchronization table to a second synchronization device.

[0010] In a second aspect, the present application further provides an address conversion information synchronization device, comprising:

[0011] an obtaining module configured to obtain a first address conversion relationship table of a first synchronization device;

[0012] identify the access types of a plurality of access traffics corresponding to the first address conversion relationship table, to obtain the access types of the plurality of access traffics;

[0013] determine, for each of the access traffics, the ingress address conversion information corresponding to the access traffic in the address conversion relationship table as target address conversion information in a case where the access type of the access traffic is an access non-conflict type, and determine the ingress address conversion information and the egress address conversion information corresponding to the access traffic in the address conversion relationship table as target address conversion information in a case where the access type of the access traffic is an access conflict type;

[0014] synchronize the address conversion synchronization table to a second synchronization device according to the target address conversion information of each of the access traffics.

[0015] In a third aspect, a computer device is provided, which includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0016] obtain a first address conversion relationship table of a first synchronization device;

[0017] identify the access types of a plurality of access traffics corresponding to the first address conversion relationship table, to obtain the access types of the plurality of access traffics;

[0018] determine, for each of the access traffics, the ingress address conversion information corresponding to the access traffic in the address conversion relationship table as target address conversion information in a case where the access type of the access traffic is an access non-conflict type, and determine the ingress address conversion information and the egress address conversion information corresponding to the access traffic in the address conversion relationship table as target address conversion information in a case where the access type of the access traffic is an access conflict type;

[0019] synchronize the address conversion synchronization table to a second synchronization device according to the target address conversion information of each of the access traffics.

[0020] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the following steps:

[0021] obtain a first address conversion relationship table of a first synchronization device;

[0022] identify an access type of a plurality of access traffics corresponding to the first address conversion relationship table, to obtain the access type of the plurality of access traffics;

[0023] For each of the access traffics, if the access type of the access traffic is an access non-conflict type, determine the ingress address conversion information corresponding to the access traffic in the address conversion relationship table as target address conversion information; if the access type of the access traffic is an access conflict type, determine the ingress address conversion information and the egress address conversion information corresponding to the access traffic in the address conversion relationship table as target address conversion information;

[0024] generate an address conversion synchronization table according to the target address conversion information of each of the access traffics, and synchronize the address conversion synchronization table to a second synchronization device.

[0025] In a fifth aspect, the present application further provides a computer program product, comprising a computer program which, when executed by a processor, implements the following steps:

[0026] obtain a first address conversion relationship table of a first synchronization device;

[0027] identify an access type of a plurality of access traffics corresponding to the first address conversion relationship table, to obtain the access type of the plurality of access traffics;

[0028] For each of the access traffics, if the access type of the access traffic is an access non-conflict type, determine the ingress address conversion information corresponding to the access traffic in the address conversion relationship table as target address conversion information; if the access type of the access traffic is an access conflict type, determine the ingress address conversion information and the egress address conversion information corresponding to the access traffic in the address conversion relationship table as target address conversion information;

[0029] generate an address conversion synchronization table according to the target address conversion information of each of the access traffics, and synchronize the address conversion synchronization table to a second synchronization device.

[0030] The address conversion information synchronization method, apparatus, computer device, computer readable storage medium and computer program product, by obtaining a first address conversion relationship table of a first synchronization device; identifying access types of a plurality of access traffics corresponding to the first address conversion relationship table to obtain the access types of the plurality of access traffics; for each of the access traffics, in a case that the access type of the access traffic is an access non-conflict type, determining in-bound address conversion information corresponding to the access traffic in the address conversion relationship table as target address conversion information; in a case that the access type of the access traffic is an access conflict type, determining in-bound address conversion information and out-bound address conversion information corresponding to the access traffic in the address conversion relationship table as the target address conversion information; generating an address conversion synchronization table according to the target address conversion information of each of the access traffics, and synchronizing the address conversion synchronization table to a second synchronization device, for the access traffic with the access type of the access non-conflict type, it is indicated that the switch port address set by the access traffic is not occupied by more devices, and there is no access conflict, so only in-bound address conversion information needs to be synchronized, and it can also be ensured that the second synchronization device can implement a normal communication access process according to the address conversion synchronization table, and the number of synchronized address conversion information is greatly reduced, so that the address conversion information synchronization efficiency is improved. BRIEF DESCRIPTION OF DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application or the related art. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.

[0032] Figure 1 For an application environment diagram of the address conversion information synchronization method in an embodiment;

[0033] Figure 2 For a flowchart of the address conversion information synchronization method in an embodiment;

[0034] Figure 3 For a flowchart of the step of obtaining a first address conversion relationship table of a first synchronization device in an embodiment;

[0035] Figure 4 For a flowchart of the step of updating an original address conversion relationship table in a first synchronization device according to first address conversion information to obtain a first address conversion relationship table in an embodiment;

[0036] Figure 5 For a structural block diagram of the address conversion information synchronization apparatus in an embodiment;

[0037] Figure 6 Figure 1 is a diagram of the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0038] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0039] It should be noted that the information and data involved in the present application (including but not limited to data for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or authorized by all parties, and the acquisition, transmission, storage, use and processing of the relevant data comply with the relevant provisions of the national laws and regulations. The content pushed to the user (for example, the address conversion synchronization table, etc.) can be refused or can be conveniently refused, etc. In the embodiments of the present application, some software, components, models, etc. may be mentioned, which are industry existing solutions, and they should be considered as exemplary, and the purpose is only to illustrate the feasibility in the implementation of the technical solutions of the present application, but it does not mean that the applicant has or will necessarily use the scheme.

[0040] The address conversion information synchronization method provided by the embodiments of the present application can be applied to, for example, Figure 1The application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data required by the server 104 to process. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. The server 104 obtains the first address conversion relationship table of the first synchronization device; identify the access type of the plurality of access traffics corresponding to the first address conversion relationship table, to obtain the access type of the plurality of access traffics; for each access traffic, in the case that the access type of the access traffic is an access non-conflict type, determine the ingress address conversion information corresponding to the access traffic in the address conversion relationship table as the target address conversion information; in the case that the access type of the access traffic is an access conflict type, determine the ingress address conversion information and the egress address conversion information corresponding to the access traffic in the address conversion relationship table as the target address conversion information; according to the target address conversion information of each access traffic, generate an address conversion synchronization table, and synchronize the address conversion synchronization table to the second synchronization device. Among them, the terminal 102 can be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices, Internet of Things devices can be smart speakers, smart televisions, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (Virtual Reality, VR) device, an augmented reality (Augmented Reality, AR) device, smart glasses, etc. The server 104 can be a standalone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0041] In an exemplary embodiment, as shown in Figure 2 , an address conversion information synchronization method is provided, which is applied to Figure 1 The server 104 in the example is described, including the following steps 202 to 208. Among them:

[0042] Step 202, obtaining the first address conversion relationship table of the first synchronization device.

[0043] Among them, the first synchronization device in step 202 is used to provide the basis for address conversion information synchronization. In the master-slave switching scenario, the first synchronization device is the device whose initial device state is the master device.

[0044] Exemplarily, step 202 includes: obtaining the original address conversion relationship table of the first synchronization device, and determining the first address conversion relationship table of the first synchronization device according to the original address conversion relationship table.

[0045] As an embodiment, the first address conversion relationship table of the first synchronization device is determined according to the original address conversion relationship table, including: determining the original address conversion relationship table of the first synchronization device as the first address conversion relationship table of the first synchronization device.

[0046] As another embodiment, the first address conversion relationship table of the first synchronization device is determined according to the original address conversion relationship table, including: updating the original address conversion relationship table to obtain the first address conversion relationship table of the first synchronization device.

[0047] As another embodiment, the first address conversion relationship table of the first synchronization device is determined according to the original address conversion relationship table, including: in the case that the original address conversion relationship table does not exist in the first synchronization device, or the original address conversion relationship table in the first synchronization device is an empty table, the first address conversion relationship table is constructed.

[0048] Optionally, the specific implementation of updating the original address conversion relationship table to obtain the first address conversion relationship table of the first synchronization device can refer to the specific implementation of the following steps 302 to 306, which will not be repeated here.

[0049] In this way, various acquisition processes of the first address conversion relationship table of the first synchronization device are provided, and the diversity of the acquisition method of the first address conversion relationship table in the present scheme is improved.

[0050] In step 204, the access types of the plurality of access traffics corresponding to the first address conversion relationship table are identified to obtain the access types of the plurality of access traffics.

[0051] For example, step 204 includes: for each access traffic, obtaining access status information of the access traffic, and identifying the access types of the plurality of access traffics corresponding to the first address conversion relationship table according to the access status information to obtain the access type of the access traffic, wherein the access status information includes at least one of an access type identifier and access relationship table update state information.

[0052] As an embodiment, the access types of the plurality of access traffics corresponding to the first address conversion relationship table are identified according to the access status information to obtain the access types of the access traffics, including: if the access status information includes the access type identifier, determining an access conflict type as the access type of the access traffic when the access type identifier of the access traffic represents an access conflict; and determining an access non-conflict type as the access type of the access traffic when the access type identifier of the access traffic represents an access non-conflict.

[0053] As another example, according to the access status information, the access type of the plurality of access traffics corresponding to the first address conversion relationship table is identified to obtain the access type of the access traffics, including: if the access status information includes the access relationship table update state information, in a case that the access relationship table update state information of the access traffics indicates that the original address conversion relationship table update fails, the access conflict type is determined as the access type of the access traffics; in a case that the access relationship table update state information of the access traffics indicates that the original address conversion relationship table update succeeds, or the access status information does not include the access type identifier, the access non-conflict type is determined as the access type of the access traffics.

[0054] In this way, the manner of identifying the access type of the access traffics in different cases is provided.

[0055] In step 206, for each access traffic, in a case that the access type of the access traffic is the access non-conflict type, the ingress address conversion information corresponding to the access traffic in the address conversion relationship table is determined as the target address conversion information; in a case that the access type of the access traffic is the access conflict type, the ingress address conversion information and the egress address conversion information corresponding to the access traffic in the address conversion relationship table are determined as the target address conversion information.

[0056] In step 206, the first address conversion relationship table includes the ingress address conversion information and the egress address conversion information of at least one access traffic corresponding to the first synchronization device.

[0057] In step 208, the address conversion synchronization table is generated according to the target address conversion information of each access traffic, and the address conversion synchronization table is synchronized to the second synchronization device.

[0058] In step 208, the second synchronization device is a device waiting for address conversion information synchronization, and in the master-backup switching scenario, the second synchronization device is a device whose initial device state is a backup device.

[0059] For example, the address conversion synchronization table is generated according to the target address conversion information of each access traffic, including: the target address conversion information of each access traffic is fused to obtain the address conversion synchronization table.

[0060] As an example, the address conversion synchronization table is synchronized to the second synchronization device, including: the address conversion synchronization table is stored to the second synchronization device.

[0061] As another example, the address conversion synchronization table is synchronized to the second synchronization device, including: the address conversion synchronization table is sent to the second synchronization device, so that the second synchronization device stores the address conversion synchronization table.

[0062] Optionally, after the address conversion synchronization table is generated according to the target address conversion information of each access flow and is synchronized to the second synchronization device, the method further comprises: if it is detected that the device state of the second synchronization device is switched from the backup device to the master device, extracting flow packet address information from a second access flow packet when the second access flow packet is detected; querying the address conversion synchronization table in the second synchronization device according to the flow packet address information to obtain a query result; generating second address conversion information corresponding to the second access flow packet according to the address conversion synchronization table if the query result is a query success result; constructing the second address conversion information corresponding to the second access flow packet if the query result includes a query failure result; and updating the address conversion relationship table of the second access flow packet according to the second address conversion information.

[0063] Further, the second address conversion information corresponding to the second access flow packet is generated according to the address conversion synchronization table, comprising: screening matching address conversion information corresponding to the flow packet address information from the address conversion synchronization table; and generating the second address conversion information corresponding to the second access flow packet according to the matching address conversion information.

[0064] As an embodiment, the second address conversion information corresponding to the second access flow packet is generated according to the matching address conversion information, comprising: determining the matching address conversion information as the second address conversion information corresponding to the second access flow packet; or obtaining flow packet access time corresponding to the second access flow packet, modifying the access time in the matching address conversion information to the flow packet access time to obtain the second address conversion information corresponding to the second access flow packet.

[0065] Optionally, the specific implementation content of constructing the second address conversion information corresponding to the second access flow packet can refer to the specific implementation steps of steps 302 to 306 and steps 402 to 406, which will not be described here.

[0066] In the address conversion information synchronization method, the first address conversion relationship table of the first synchronization device is obtained; the access types of the plurality of access traffics corresponding to the first address conversion relationship table are identified to obtain the access types of the plurality of access traffics; for each access traffic, if the access type of the access traffic is the access non-conflict type, the ingress address conversion information corresponding to the access traffic in the address conversion relationship table is determined as the target address conversion information; if the access type of the access traffic is the access conflict type, the ingress address conversion information and the egress address conversion information corresponding to the access traffic in the address conversion relationship table are determined as the target address conversion information; the address conversion synchronization table is generated according to the target address conversion information of each access traffic, and the address conversion synchronization table is synchronized to the second synchronization device. For the access traffic with the access type of the access non-conflict type, the switch port address set by the access traffic is not occupied by more devices, so only the ingress address conversion information needs to be synchronized, the subsequent second synchronization device can also realize the normal communication access process according to the address conversion synchronization table, and the number of synchronized address conversion information is greatly reduced, so that the address conversion information synchronization efficiency is improved.

[0067] In one exemplary embodiment, as shown in Figure 3 A way of accurately obtaining the first address conversion relationship table of the first synchronization device is provided, and the obtaining of the first address conversion relationship table of the first synchronization device includes steps 302 to 306. Wherein:

[0068] Step 302: If the first access traffic packet of the first synchronization device is detected, the access source port address in the first access traffic packet is extracted, and the access source port address is set as the switch port address.

[0069] Wherein, the first access traffic packet in step 302 can be a first packet or a non-first packet, which is not limited here.

[0070] Step 304: Generating step: generating the first address conversion information corresponding to the first access traffic packet according to the switch port address, wherein the first address conversion information is used to indicate the address conversion of the first synchronization device for subsequent communication.

[0071] Wherein, the first address conversion information in step 304 is composed of ingress address conversion information and egress address conversion information of the access traffic corresponding to the first access traffic packet, the ingress address conversion information includes the first ingress address information before address conversion and the second ingress address information after address conversion of the access traffic in the ingress direction, and the egress address conversion information includes the first egress address information before address conversion and the second egress address information after address conversion of the access traffic in the egress direction.

[0072] As an embodiment, the step 304 comprises: extracting message quintuple information from the first access traffic packet; and generating address conversion information corresponding to the first access traffic packet according to the message quintuple information and the switch port address.

[0073] The message quintuple information is composed of at least one preset communication information, and the preset communication information includes but is not limited to SIP (Session initialization Protocol) information, sport (source port address), DIP (Destination Internet Protocol) information and dport (target port address).

[0074] As an embodiment, the generating address conversion information corresponding to the first access traffic packet according to the message quintuple information and the switch port address comprises: when the access direction corresponding to the first access traffic packet is the first synchronization device accessing the outside, determining the source port address and the target port address in the message quintuple information as the first out-bound address information of the access traffic corresponding to the first access traffic packet; and when the access direction corresponding to the first access traffic packet is the outside accessing the first synchronization device, determining the source port address and the target port address in the message quintuple information as the first in-bound address information of the access traffic corresponding to the first access traffic packet.

[0075] Further, after determining the source port address and the target port address in the message quintuple information as the first out-bound address information of the access traffic corresponding to the first access traffic packet, modifying the source port address in the first out-bound address information to the switch port address to obtain second out-bound address information; determining the target port address in the first out-bound address information or the second out-bound address information as the source port address of the first in-bound address information and the second in-bound address information; determining the source port address in the second out-bound address information as the target port address of the first in-bound address information; and determining the source port address in the first out-bound address information as the target port address of the second in-bound address information.

[0076] For example, when the first synchronization device accesses the Internet, the source port address and the target port address in the extracted packet quintuple information are 192.168.1.10:10000→100.123.10.2:80, and the extracted switch port address is 100.10.1.2:20000, the first out-bound address information is 192.168.1.10:10000→100.123.10.2:80, and the second out-bound address information is 100.10.1.2:20000→100.123.10.2:80; the first in-bound address information is 100.123.10.2:80→100.10.1.2:20000, and the second in-bound address information is 100.123.10.2:80→192.168.1.10:10000.

[0077] Alternatively, after determining the source port address and the target port address in the packet quintuple information as the first in-bound address information of the access traffic corresponding to the first access traffic packet, the second in-bound address information, the second out-bound address information, and the first out-bound address information are determined. For details, refer to the above description.

[0078] In step 306, the original address conversion relationship table in the first synchronization device is updated according to the first address conversion information, and a first address conversion relationship table is obtained.

[0079] For example, in step 306, the original address conversion relationship table in the first synchronization device is updated according to the first address conversion information, and an update result is obtained. According to the update result, the first address conversion relationship table is determined.

[0080] In this embodiment, when the first access traffic packet of the first synchronization device is detected, the access source port address in the first access traffic packet is extracted, and the access source port address is set as the switch port address. The generation step includes: generating the first address conversion information corresponding to the first access traffic packet according to the switch port address, wherein the first address conversion information is used to indicate the address conversion of the subsequent communication of the first synchronization device; and updating the original address conversion relationship table in the first synchronization device according to the first address conversion information, and obtaining the first address conversion relationship table. This embodiment provides a real-time updating method of the first address conversion relationship table, and ensures the timeliness of the first address conversion relationship table.

[0081] In one exemplary embodiment, as Figure 4As shown, to provide an accurate updating manner of the original address conversion relationship table in the first synchronization device, the original address conversion relationship table in the first synchronization device is updated according to the first address conversion information, and the first address conversion relationship table is obtained, including steps 402 to 406. Among them:

[0082] Step 402, updating the original address conversion relationship table in the first synchronization device according to the first address conversion information.

[0083] As an embodiment, step 402 includes adding the first address conversion information to the original address conversion relationship table in the first synchronization device to update the original address conversion relationship table in the first synchronization device.

[0084] If it is detected that the original address conversion relationship table is successfully updated, step 404 is performed to determine the updated original address conversion relationship table as the first address conversion relationship table.

[0085] It can be understood that in the case that the first address conversion information does not conflict with the original address conversion relationship table, the original address conversion relationship table is successfully updated, and in the case that the first address conversion information conflicts with the original address conversion relationship table, the original address conversion relationship table is unsuccessfully updated.

[0086] Specifically, in the case that there is no table entry in the original address conversion relationship table that matches the first inbound address information and the first outbound address information in the first address conversion information, it is determined that the first address conversion information does not conflict with the original address conversion relationship table; in the case that there is a table entry in the original address conversion relationship table that matches the first inbound address information and the first outbound address information in the first address conversion information, it is determined that the first address conversion information conflicts with the original address conversion relationship table.

[0087] If it is detected that the original address conversion relationship table is unsuccessfully updated, step 406 is performed to update the switch port address and return to step 304.

[0088] Exemplarily, step 406 includes one of the following: randomly selecting a target port address from a plurality of preset port addresses; according to a port address arrangement order corresponding to the plurality of preset port addresses, selecting a next port address arranged after the switch port address from the plurality of preset port addresses, and determining the next port address as the target port address; wherein the target port address is used to update the switch port address.

[0089] Until it is detected that the original address conversion relationship table is successfully updated, step 408 is performed to identify the access type of the access traffic corresponding to the first access traffic packet as the access conflict type.

[0090] Thus, the access type of the access traffic with the access conflict can be marked, and in subsequent address conversion information synchronization, the target address conversion information of each access traffic can be accurately confirmed, so that the second synchronization device can perform normal communication access process according to the address conversion synchronization table.

[0091] In the embodiment, the original address conversion relationship table in the first synchronization device is updated according to the first address conversion information; if it is detected that the original address conversion relationship table is successfully updated, the updated original address conversion relationship table is determined as the first address conversion relationship table; if it is detected that the original address conversion relationship table is unsuccessfully updated, the switch port address is updated, and the generating step is executed until it is detected that the original address conversion relationship table is successfully updated, and the access type of the access traffic corresponding to the first access traffic packet is identified as the access conflict type. In the case that the original address conversion relationship table is unsuccessfully updated, that is, the currently selected switch port address is occupied by multiple devices, the switch port address is cyclically updated until the switch port address is not occupied by multiple devices, so that the original address conversion relationship table is successfully updated, and the access type of the access traffic with the access conflict can be marked, and in subsequent address conversion information synchronization, the target address conversion information of each access traffic can be accurately confirmed, so that the second synchronization device can perform normal communication access process according to the address conversion synchronization table.

[0092] As a detailed embodiment, if the first access traffic packet of the first synchronization device is detected, the access source port address in the first access traffic packet is extracted, and the access source port address is set as the switch port address. The packet quintuple information is extracted from the first access traffic packet, and the address conversion information corresponding to the first access traffic packet is generated according to the packet quintuple information and the switch port address. The first address conversion information is used to indicate the address conversion of the first synchronization device in subsequent communication. The original address conversion relationship table in the first synchronization device is updated according to the first address conversion information. If it is detected that the original address conversion relationship table is successfully updated, the updated original address conversion relationship table is determined as the first address conversion relationship table. If it is detected that the original address conversion relationship table is unsuccessfully updated, the target port address is randomly selected from the plurality of preset port addresses. Alternatively, the next port address arranged after the switch port address in the plurality of preset port addresses is selected as the target port address according to the port address arrangement order of the plurality of preset port addresses, and the target port address is used to update the switch port address. The generating step is executed until it is detected that the original address conversion relationship table is successfully updated, and the access type of the access traffic corresponding to the first access traffic packet is identified as the access conflict type.

[0093] Further, the access types of the plurality of access traffics corresponding to the first address conversion relationship table are identified to obtain the access types of the plurality of access traffics; for each access traffic, in a case where the access type of the access traffic is an access non-conflict type, the ingress address conversion information corresponding to the access traffic in the address conversion relationship table is determined as target address conversion information; in a case where the access type of the access traffic is an access conflict type, the ingress address conversion information and the egress address conversion information corresponding to the access traffic in the address conversion relationship table are determined as the target address conversion information; the address conversion synchronization table is generated according to the target address conversion information of each access traffic, and the address conversion synchronization table is synchronized to the second synchronization device; if it is detected that the device state of the second synchronization device is switched from a backup device to a master device, when the second access traffic packet for the second synchronization device is detected, the traffic packet address information is extracted from the second access traffic packet; the address conversion synchronization table in the second synchronization device is queried according to the traffic packet address information to obtain a query result; in a case where the query result is a query success result, the second address conversion information corresponding to the second access traffic packet is generated according to the address conversion synchronization table; in a case where the query result includes a query failure result, the second address conversion information corresponding to the second access traffic packet is constructed; and the address conversion relationship table of the second access traffic packet is updated according to the second address conversion information.

[0094] Further, the first address conversion relationship table of the first synchronization device is obtained; the access types of the plurality of access traffics corresponding to the first address conversion relationship table are identified to obtain the access types of the plurality of access traffics; for each access traffic, in a case where the access type of the access traffic is an access non-conflict type, the ingress address conversion information corresponding to the access traffic in the address conversion relationship table is determined as target address conversion information; in a case where the access type of the access traffic is an access conflict type, the ingress address conversion information and the egress address conversion information corresponding to the access traffic in the address conversion relationship table are determined as the target address conversion information; the address conversion synchronization table is generated according to the target address conversion information of each access traffic, and the address conversion synchronization table is synchronized to the second synchronization device, for the access traffic with the access type of the access non-conflict type, it indicates that the switch port address set by the access traffic is not occupied by more devices, and there is no access conflict, so only the ingress address conversion information needs to be synchronized, which can also ensure that the second synchronization device can implement a normal communication access process according to the address conversion synchronization table, and the number of synchronized address conversion information is greatly reduced, so the address conversion information synchronization efficiency is improved.

[0095] Thus, by detecting the first access traffic packet of the first synchronization device, the access source port address in the first access traffic packet is extracted, and the access source port address is set as the switch port address; the generating step: generating the first address conversion information corresponding to the first access traffic packet according to the switch port address, wherein the first address conversion information is used to instruct the first synchronization device to perform address conversion in subsequent communication; and the first address conversion relationship table in the first synchronization device is updated according to the first address conversion information, to obtain the first address conversion relationship table. The real-time updating method of the first address conversion relationship table is provided, the timeliness of the first address conversion relationship table is ensured, and in the case that the original address conversion relationship table fails to be updated for each access traffic, that is, the selected switch port address is occupied by multiple devices, the switch port address is updated in a loop until the switch port address is not occupied by multiple devices, so that the original address conversion relationship table is successfully updated, it is ensured that each access traffic can be accurately updated to the original address conversion relationship table, and the access type of the access traffic with access conflict is marked. In subsequent address conversion information synchronization, the target address conversion information of each access traffic can be accurately confirmed, and it is ensured that the second synchronization device can perform normal communication access process according to the address conversion synchronization table.

[0096] It should be understood that, although each step in the flowchart involved in the above embodiments is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in the above embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.

[0097] Based on the same inventive concept, the embodiments of the present application also provide an address conversion information synchronization device for implementing the above-mentioned address conversion information synchronization method. The problem-solving implementation scheme provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more address conversion information synchronization device embodiments provided below can refer to the limitations of the address conversion information synchronization method in the above text, which will not be repeated here.

[0098] In one exemplary embodiment, as Figure 5As shown, an address conversion information synchronization device 500 is provided, comprising: an obtaining module 502, an identifying module 504, a determining module 506, and a synchronizing module 508, wherein:

[0099] The obtaining module 502 is configured to obtain a first address conversion relationship table of a first synchronization device.

[0100] The identifying module 504 is configured to identify access types of a plurality of access traffics corresponding to the first address conversion relationship table, to obtain the access types of the plurality of access traffics.

[0101] The determining module 506 is configured to, for each access traffic, in a case where the access type of the access traffic is an access non-conflict type, determine in-coming address conversion information corresponding to the access traffic in the address conversion relationship table as target address conversion information; and in a case where the access type of the access traffic is an access conflict type, determine in-coming address conversion information and out-going address conversion information corresponding to the access traffic in the address conversion relationship table as the target address conversion information.

[0102] The synchronizing module 508 is configured to generate an address conversion synchronization table according to the target address conversion information of each access traffic, and synchronize the address conversion synchronization table to a second synchronization device.

[0103] In one of the embodiments, the obtaining module 502 is further configured to, if it is detected that a first access traffic packet of the first synchronization device, extract an access source port address in the first access traffic packet, and set the access source port address as a switch port address; and generate a first address conversion information corresponding to the first access traffic packet according to the switch port address, wherein the first address conversion information is used to indicate address conversion of the first synchronization device for subsequent communication; and update an original address conversion relationship table in the first synchronization device according to the first address conversion information, to obtain the first address conversion relationship table.

[0104] In one of the embodiments, the obtaining module 502 is further configured to update the original address conversion relationship table in the first synchronization device according to the first address conversion information; if it is detected that the original address conversion relationship table is updated successfully, determine the updated original address conversion relationship table as the first address conversion relationship table; and if it is detected that the original address conversion relationship table is updated unsuccessfully, update the switch port address, and return to execute the generating step until it is detected that the original address conversion relationship table is updated successfully, and the access type of the access traffic corresponding to the first access traffic packet is identified as the access conflict type.

[0105] In one of the embodiments, the obtaining module 502 is further configured to perform one of the following: randomly select the target port address from the plurality of preset port addresses; and select a next port address arranged after the switch port address from the plurality of preset port addresses according to an arrangement order of the plurality of preset port addresses, and determine the next port address as the target port address; wherein the target port address is used to update the switch port address.

[0106] In one of the embodiments, the obtaining module 502 is further configured to extract the message quintuple information from the first access traffic packet; and generate the address conversion information corresponding to the first access traffic packet according to the message quintuple information and the switch port address.

[0107] In one of the embodiments, after the address conversion synchronization table is generated according to the target address conversion information of each access traffic and is synchronized to the second synchronization device, the apparatus further comprises a querying module configured to: if it is detected that the device state of the second synchronization device is switched from the backup device to the master device, extract the traffic packet address information from the second access traffic packet when the second access traffic packet for the second synchronization device is detected; query the address conversion synchronization table in the second synchronization device according to the traffic packet address information to obtain a query result; in a case where the query result is a query success result, generate second address conversion information corresponding to the second access traffic packet according to the address conversion synchronization table; in a case where the query result includes a query failure result, construct the second address conversion information corresponding to the second access traffic packet; and update the address conversion relationship table of the second access traffic packet according to the second address conversion information.

[0108] The modules in the address conversion information synchronization apparatus described above can be all or partially implemented by software, hardware or a combination thereof. The modules described above can be embedded in or independent of a processor in a computer device in a hardware form, or can be stored in a memory in a computer device in a software form, so as to be called and executed by a processor to perform the operations corresponding to the modules.

[0109] In one of the embodiments, a computer device is provided, which can be a terminal, and an internal structure diagram of the computer device can be as shown in Figure 6The computer device shown in the figure 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 capability. 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 operating system and the computer program in the non-volatile storage medium to run. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner. The wireless manner can be realized through WIFI, mobile cellular network, Near Field Communication (NFC) or other technologies. The computer program is executed by the processor to realize an address translation information synchronization method. 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. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.

[0110] Those skilled in the art can understand that, Figure 6 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.

[0111] In one exemplary embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps in each of the above method embodiments.

[0112] In one embodiment, a computer readable storage medium is provided, having a computer program stored thereon, and the computer program is executed by a processor to implement the steps in each of the above method embodiments.

[0113] In one embodiment, a computer program product is provided, including a computer program, and the computer program is executed by a processor to implement the steps in each of the above method embodiments.

[0114] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing relevant hardware. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, the processes of the above-mentioned embodiment methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, 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. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., but is not limited thereto. The processor involved in the embodiments provided in the present application can be a general processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but is not limited thereto.

[0115] The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combinations of the technical features do not exist contradictory, they should be considered as the scope of the present application.

[0116] The above embodiments only express several implementation ways of the present application, and the description is specific and detailed, but it should not be understood as a limitation to the patent scope of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A method for synchronizing address translation information, characterized in that, The method includes: Obtain the first address translation table of the first synchronization device; The access types of multiple access traffic corresponding to the first address translation table are identified to obtain the access types of the multiple access traffic. For each access traffic, if the access type of the access traffic is a non-conflicting access type, the inbound address translation information corresponding to the access traffic in the address translation relationship table is determined as the target address translation information; if the access type of the access traffic is a conflicting access type, the inbound address translation information and outbound address translation information corresponding to the access traffic in the address translation relationship table are determined as the target address translation information. Based on the target address translation information of each access traffic, an address translation synchronization table is generated, and the address translation synchronization table is synchronized to the second synchronization device.

2. The method according to claim 1, characterized in that, The process of obtaining the first address translation table of the first synchronization device includes: If the first access traffic packet of the first synchronization device is detected, the access source port address in the first access traffic packet is extracted and the access source port address is set as the switch port address; Generation step: Based on the switch port address, generate first address translation information corresponding to the first access traffic packet, wherein the first address translation information is used to instruct the first synchronization device to perform address translation for subsequent communication; Based on the first address translation information, the original address translation relationship table in the first synchronization device is updated to obtain the first address translation relationship table.

3. The method according to claim 2, characterized in that, The step of updating the original address translation relationship table in the first synchronization device according to the first address translation information to obtain the first address translation relationship table includes: The original address translation relationship table in the first synchronization device is updated based on the first address translation information; If the original address translation table is successfully updated, the updated original address translation table will be determined as the first address translation table. If the update of the original address translation table fails, the switch port address is updated, and the generation step is returned until the update of the original address translation table is successful. The access type of the access traffic corresponding to the first access traffic packet is then marked as an access conflict type.

4. The method according to claim 3, characterized in that, The method also includes one of the following: Randomly select the target port address from multiple preset port addresses; Based on the port address arrangement order corresponding to the plurality of preset port addresses, the next port address arranged after the switch port address is selected from the plurality of preset port addresses and determined as the target port address; The target port address is used to update the switch port address.

5. The method according to claim 2, characterized in that, The step of generating address translation information corresponding to the first access traffic packet based on the switch port address includes: Extract the packet 5-tuple information from the first access traffic packet; Based on the packet 5-tuple information and the switch port address, the address translation information corresponding to the first access traffic packet is generated.

6. The method according to any one of claims 1 to 5, characterized in that, After generating an address translation synchronization table based on the target address translation information of each access traffic, and synchronizing the address translation synchronization table to the second synchronization device, the method further includes: If it is detected that the device status of the second synchronization device has been switched from backup device to master device, then when a second access traffic packet for the second synchronization device is detected, the traffic packet address information is extracted from the second access traffic packet; Based on the traffic packet address information, query the address translation synchronization table in the second synchronization device to obtain the query result; If the query result is a successful query result, the second address translation information corresponding to the second access traffic packet is generated according to the address translation synchronization table; If the query result includes a query failure result, construct the second address translation information corresponding to the second access traffic packet; The address translation table of the second access traffic packet is updated based on the second address translation information.

7. An address translation information synchronization device, characterized in that, The device includes: The acquisition module is used to acquire the first address translation table of the first synchronization device; The identification module is used to identify the access type of multiple access traffic corresponding to the first address translation relationship table, and obtain the access type of the multiple access traffic. The determination module is used to, for each access traffic, if the access type of the access traffic is a non-conflicting access type, determine the inbound address translation information corresponding to the access traffic in the address translation relationship table as the target address translation information; if the access type of the access traffic is a conflicting access type, determine the inbound address translation information and outbound address translation information corresponding to the access traffic in the address translation relationship table as the target address translation information. The synchronization module is used to generate an address translation synchronization table based on the target address translation information of each access traffic, and to synchronize the address translation synchronization table to the second synchronization device.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data access control method and device, equipment and storage medium

    CN116561036A

  • Time synchronization method and device, computer equipment, storage medium and program product

    CN118199781A