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

By identifying the access type of access traffic and determining the target address translation information, the problem of low synchronization efficiency of address translation information is solved, efficient address translation information synchronization is achieved, and normal communication between devices is ensured.

CN119652862AActive Publication Date: 2025-03-18CHINA TELECOM CLOUD TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411772214.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-18
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

In the case of large device access traffic or large number of devices, the synchronization efficiency of address conversion information is low, resulting in a large number of conversion relationship information waiting for synchronization.

Method used

By obtaining the address translation relationship table of the first synchronization device, the access type of the access traffic is identified, and the target address translation information is determined based on the access type. For access traffic of unconflicted types, only incoming address translation information is synchronized; for access traffic of conflicted types, incoming and outgoing address translation information is synchronized. Generate an address translation synchronization table and synchronize to the second synchronization device.

Benefits of technology

提高了地址转换信息同步效率,减少了同步的地址转换信息数量,确保了后续设备能够正常实现通信访问。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652862A_ABST
    Figure CN119652862A_ABST
Patent Text Reader

Abstract

The invention relates to an address translation 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: obtaining a first address translation relation table of first synchronization equipment; identifying the access traffic corresponding to the first address translation relation table to obtain the access type of the access traffic; under the condition that the access type of the access traffic is an access non-conflict type, determining incoming address translation information corresponding to the access traffic in the address translation relation table as target address translation information; under the condition that the access type of the access traffic is an access conflict type, determining incoming address translation information and outgoing address translation information corresponding to the access traffic in the address translation relation table as target address translation information; and synchronizing the target address conversion information of the access traffic to the second synchronization device. By adopting the method, the address translation information synchronization efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network communication technology, and in particular to an address translation information synchronization method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] In order to save resources, multiple hosts are usually allowed to access the Internet by sharing the switch port address. In this case, the conversion relationship information of the access traffic needs to be recorded so that subsequent traffic access can achieve communication by querying the records.

[0003] At present, it is necessary to synchronize all conversion relationship information recorded between devices to ensure that each device can achieve the same communication function. However, when the access traffic of the device is large or the number of devices is large, it is easy for a large amount of conversion relationship information waiting for synchronization to occur, resulting in low synchronization efficiency of address conversion information. Summary of the invention

[0004] Based on this, it is necessary to provide an address translation information synchronization method, apparatus, computer equipment, computer-readable storage medium and computer program product that can improve the efficiency of address translation information synchronization in response to the above technical problems.

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

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

[0007] Identifying access types of multiple access flows corresponding to the first address translation relationship table to obtain access types of the multiple access flows;

[0008] For each of the access traffic, when the access type of the access traffic is an access non-conflicting 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; when the access type of the access traffic is an access conflicting type, the inbound address translation information and the outbound address translation information corresponding to the access traffic in the address translation relationship table are determined as the target address translation information;

[0009] An address conversion synchronization table is generated according to the target address conversion information of each access flow, and the address conversion synchronization table is synchronized to the second synchronization device.

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

[0011] An acquisition module, used for acquiring a first address conversion relationship table of a first synchronization device;

[0012] an identification module, configured to identify access types of a plurality of access flows corresponding to the first address translation relationship table, and obtain access types of the plurality of access flows;

[0013] A determination module, for each of the access traffic, when the access type of the access traffic is an access non-conflicting type, determining the inbound address translation information corresponding to the access traffic in the address translation relationship table as the target address translation information; when the access type of the access traffic is an access conflicting type, determining the inbound address translation information and the outbound address translation information corresponding to the access traffic in the address translation relationship table as the target address translation information;

[0014] The synchronization module is used to generate an address conversion synchronization table according to the target address conversion information of each access flow, and synchronize the address conversion synchronization table to the second synchronization device.

[0015] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

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

[0017] Identifying access types of multiple access flows corresponding to the first address translation relationship table to obtain access types of the multiple access flows;

[0018] For each of the access traffic, when the access type of the access traffic is an access non-conflicting 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; when the access type of the access traffic is an access conflicting type, the inbound address translation information and the outbound address translation information corresponding to the access traffic in the address translation relationship table are determined as the target address translation information;

[0019] An address conversion synchronization table is generated according to the target address conversion information of each access flow, and the address conversion synchronization table is synchronized to the second synchronization device.

[0020] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

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

[0022] Identifying access types of multiple access flows corresponding to the first address translation relationship table to obtain access types of the multiple access flows;

[0023] For each of the access traffic, when the access type of the access traffic is an access non-conflicting 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; when the access type of the access traffic is an access conflicting type, the inbound address translation information and the outbound address translation information corresponding to the access traffic in the address translation relationship table are determined as the target address translation information;

[0024] An address conversion synchronization table is generated according to the target address conversion information of each access flow, and the address conversion synchronization table is synchronized to the second synchronization device.

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

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

[0027] Identifying access types of multiple access flows corresponding to the first address translation relationship table to obtain access types of the multiple access flows;

[0028] For each of the access traffic, when the access type of the access traffic is an access non-conflicting 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; when the access type of the access traffic is an access conflicting type, the inbound address translation information and the outbound address translation information corresponding to the access traffic in the address translation relationship table are determined as the target address translation information;

[0029] An address conversion synchronization table is generated according to the target address conversion information of each access flow, and the address conversion synchronization table is synchronized to the second synchronization device.

[0030] The above-mentioned address translation information synchronization method, device, computer equipment, computer-readable storage medium and computer program product obtain a first address translation relationship table of a first synchronization device; identify the access types of multiple access flows corresponding to the first address translation relationship table to obtain the access types of the multiple access flows; for each of the access flows, when the access type of the access flow is an access non-conflicting type, determine the inbound address translation information corresponding to the access flow in the address translation relationship table as the target address translation information; when the access type of the access flow is an access conflicting type, determine the inbound address translation information corresponding to the access flow in the address translation relationship table as the target address translation information. The incoming address translation information and outgoing address translation information of each access flow are determined as the target address translation information; an address translation synchronization table is generated according to the target address translation information of each access flow, and the address translation synchronization table is synchronized to the second synchronization device. For access flow of access type that is an access non-conflicting type, it means that the switch port address set for the access flow is not occupied by many devices and there is no access conflict. Therefore, only the incoming address translation information needs to be synchronized. It can also ensure that the subsequent second synchronization device can implement a normal communication access process according to the address translation synchronization table, and also greatly reduce the number of synchronized address translation information, thereby improving the synchronization efficiency of the address translation information. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0032] Figure 1 A diagram of an application environment of an address translation information synchronization method in an embodiment;

[0033] Figure 2 A schematic diagram of a flow chart of a method for synchronizing address conversion information in one embodiment;

[0034] Figure 3 A schematic diagram of a flow chart of a step of obtaining a first address conversion relationship table of a first synchronization device in an embodiment;

[0035] Figure 4 A schematic flow chart of the steps of updating the 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 in an embodiment;

[0036] Figure 5 is a structural block diagram of an address translation information synchronization device in an embodiment;

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

[0038] 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.

[0039] It should be noted that the information and data involved in this application (including but not limited to data for analysis, stored data, displayed data, etc.) are all information and data authorized by the user or fully authorized by all parties, and the acquisition, transmission, storage, use and processing of relevant data are in compliance with the relevant provisions of national laws and regulations. For content pushed to users (for example, address conversion synchronization tables, etc.), users can refuse or conveniently refuse content push, etc. In the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of the implementation of the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.

[0040] The address conversion information synchronization method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The server 104 obtains the first address conversion relationship table of the first synchronization device; identifies the access types of multiple access flows corresponding to the first address conversion relationship table, and obtains the access types of multiple access flows; for each access flow, when the access type of the access flow is an access non-conflicting type, the inbound address conversion information corresponding to the access flow in the address conversion relationship table is determined as the target address conversion information; when the access type of the access flow is an access conflicting type, the inbound address conversion information and the outbound address conversion information corresponding to the access flow in the address conversion relationship table are determined as the target address conversion information; according to the target address conversion information of each access flow, an address conversion synchronization table is generated, and the address conversion synchronization table is synchronized to the second synchronization device. The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices may be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server 104 may be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.

[0041] In an exemplary embodiment, Figure 2 As shown, a method for synchronizing address conversion information is provided, and the method is applied to Figure 1 The server 104 in the example is used as an example to illustrate, including the following steps 202 to 208. Among them:

[0042] Step 202: Obtain a first address conversion relationship table of a first synchronization device.

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

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

[0045] As an embodiment, determining the first address translation relationship table of the first synchronization device according to the original address translation relationship table includes: determining the original address translation relationship table of the first synchronization device as the first address translation relationship table of the first synchronization device.

[0046] As another embodiment, determining the first address translation relationship table of the first synchronization device according to the original address translation relationship table includes: updating the original address translation relationship table to obtain the first address translation relationship table of the first synchronization device.

[0047] As another embodiment, determining the first address translation relationship table of the first synchronization device according to the original address translation relationship table includes: constructing the first address translation relationship table when the original address translation relationship table does not exist in the first synchronization device or when the original address translation relationship table in the first synchronization device is an empty table.

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

[0049] In this way, a process for acquiring the first address translation relationship table of multiple first synchronization devices is provided, thereby improving the diversity of the methods for acquiring the first address translation relationship table in the present solution.

[0050] Step 204: Identify the access types of the multiple access flows corresponding to the first address translation relationship table to obtain the access types of the multiple access flows.

[0051] Exemplarily, step 204 includes: for each access flow, obtaining access status information of the access flow, identifying the access types of multiple access flows corresponding to the first address conversion relationship table based on the access status information, and obtaining the access type of the access flow, wherein the access status information includes at least one of an access type identifier and an access relationship table update status information.

[0052] As one embodiment, access types of multiple access flows corresponding to the first address translation relationship table are identified based on access status information to obtain the access type of the access flow, including: if the access status information includes an access type identifier, then when the access type identifier of the access flow represents an access conflict, the access conflict type is determined as the access type of the access flow; when the access type identifier of the access flow represents a non-conflict access, the non-conflict access type is determined as the access type of the access flow.

[0053] As another embodiment, based on the access status information, the access types of multiple access flows corresponding to the first address translation relationship table are identified to obtain the access type of the access flow, including: if the access status information includes access relationship table update status information, then when the access relationship table update status information of the access flow indicates that the update of the original address translation relationship table has failed, the access conflict type is determined as the access type of the access flow; when the access relationship table update status information of the access flow indicates that the update of the original address translation relationship table has been successful, or the access status information does not include an access type identifier, the access non-conflict type is determined as the access type of the access flow.

[0054] In this way, a method for identifying the access type of access traffic in different situations is provided.

[0055] Step 206, for each access traffic, when the access type of the access traffic is an access non-conflict 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; when the access type of the access traffic is an access conflict type, the inbound address translation information and the outbound address translation information corresponding to the access traffic in the address translation relationship table are determined as the target address translation information.

[0056] The first address translation relationship table in step 206 includes inbound address translation information and outbound address translation information of at least one access flow corresponding to the first synchronization device.

[0057] Step 208: Generate an address translation synchronization table according to the target address translation information of each access flow, and synchronize the address translation synchronization table to the second synchronization device.

[0058] The second synchronization device in step 208 is a device waiting for address translation information synchronization. In the active-standby switching scenario, the second synchronization device is a device whose initial device state is a standby device.

[0059] Exemplarily, generating an address translation synchronization table according to target address translation information of each access flow includes: fusing the target address translation information of each access flow to obtain the address translation synchronization table.

[0060] As an embodiment, synchronizing the address translation synchronization table to the second synchronization device includes: storing the address translation synchronization table to the second synchronization device.

[0061] As another embodiment, synchronizing the address conversion synchronization table to the second synchronization device includes: sending the address conversion synchronization table to the second synchronization device, so that the second synchronization device stores the address conversion synchronization table.

[0062] Optionally, after generating an address conversion synchronization table based on the target address conversion information of each access flow and synchronizing the address conversion synchronization table to the second synchronization device, the method also includes: if it is detected that the device state of the second synchronization device is switched from a backup device to a master device, then when a second access flow packet for the second synchronization device is detected, extracting the flow packet address information from the second access flow packet; querying the address conversion synchronization table in the second synchronization device based on the flow packet address information to obtain a query result; when the query result is a successful query result, generating second address conversion information corresponding to the second access flow packet based on the address conversion synchronization table; when the query result includes a failed query result, constructing the second address conversion information corresponding to the second access flow packet; and updating the address conversion relationship table of the second access flow packet based on the second address conversion information.

[0063] Furthermore, according to the address translation synchronization table, second address translation information corresponding to the second access traffic packet is generated, including: filtering matching address translation information corresponding to the traffic packet address information from the address translation synchronization table; and generating second address translation information corresponding to the second access traffic packet according to the matching address translation information.

[0064] As an embodiment, second address translation information corresponding to the second access traffic packet is generated based on the matching address translation information, including: determining the matching address translation information as the second address translation information corresponding to the second access traffic packet; or, obtaining the traffic packet access time corresponding to the second access traffic packet, modifying the access time in the matching address translation information to the traffic packet access time, and obtaining the second address translation information corresponding to the second access traffic packet.

[0065] Optionally, the specific implementation content of constructing the second address translation information corresponding to the second access traffic packet can refer to the following steps 302 to 306, and the specific implementation steps of steps 402 to 406, which are not repeated here.

[0066] In the above-mentioned address conversion information synchronization method, a first address conversion relationship table of a first synchronization device is obtained; the access types of multiple access flows corresponding to the first address conversion relationship table are identified to obtain the access types of multiple access flows; for each access flow, when the access type of the access flow is an access non-conflicting type, the inbound address conversion information corresponding to the access flow in the address conversion relationship table is determined as the target address conversion information; when the access type of the access flow is an access conflicting type, the inbound address conversion information and the outbound address conversion information corresponding to the access flow in the address conversion relationship table are determined as the target address conversion information; according to the target address conversion information of each access flow, an address conversion synchronization table is generated, and the address conversion synchronization table is synchronized to the second synchronization device. For the access flow whose access type is an access non-conflicting type, it means that the switch port address set by the access flow is not occupied by many devices, so only the inbound address conversion information needs to be synchronized, which can also ensure that the subsequent second synchronization device can implement a normal communication access process according to the address conversion synchronization table, and also greatly reduce the number of synchronized address conversion information, so as to improve the efficiency of address conversion information synchronization.

[0067] In an exemplary embodiment, Figure 3 As shown, a method for accurately obtaining a first address conversion relationship table of a first synchronization device is provided, and obtaining the first address conversion relationship table of the first synchronization device includes steps 302 to 306. Among them:

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

[0069] Among them, the first access traffic packet in step 302 can be the first packet or a non-first packet, and there is no limitation here.

[0070] Step 304, a generation step: generating first address translation information corresponding to the first access traffic packet according to the switch port address, wherein the first address translation information is used to instruct the first synchronization device to perform address translation for subsequent communications.

[0071] Among them, the first address translation information in step 304 is composed of the inbound address translation information and the outbound address translation information of the access traffic corresponding to the first access traffic packet, the inbound address translation information includes the first inbound address information of the access traffic before the address conversion is performed in the inbound direction, and the second inbound address information after the address conversion; the outbound address translation information includes the first outbound address information of the access traffic before the address conversion is performed in the outbound direction, and the second outbound address information after the address conversion.

[0072] As an embodiment, step 304 includes: 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] Among them, 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, destination Internet Protocol address) information and dport (destination port address).

[0074] As an embodiment, address conversion information corresponding to the first access traffic packet is generated according to the message quintuple information and the switch port address, including: when the access direction corresponding to the first access traffic packet is the first synchronization device accessing the outside, the source port address and the destination port address in the message quintuple information are determined as the first outbound address information of the access traffic corresponding to the first access traffic packet; when the access direction corresponding to the first access traffic packet is external access to the first synchronization device, the source port address and the destination port address in the message quintuple information are determined as the first inbound address information of the access traffic corresponding to the first access traffic packet.

[0075] Furthermore, after determining the source port address and the destination port address in the message quintuple information as the first outbound address information of the access traffic corresponding to the first access traffic packet, the source port address in the first outbound address information is modified to the switch port address to obtain the second outbound address information; the destination port address in the first outbound address information or the second outbound address information is determined as the source port address of the first inbound address information and the second inbound address information; the source port address in the second outbound address information is determined as the destination port address of the first inbound address information; the source port address in the first outbound address information is determined as the destination port address of the second inbound address information.

[0076] For example, when the first synchronization device accesses the Internet, the source port address and destination port address in the corresponding extracted message 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 outbound address information is 192.168.1.10:10000→100.123.10.2:80, and the second outbound address information is 100.10.1.2:20000→100.123.10.2:80; the first inbound address information is 100.123.10.2:80→100.10.1.2:20000, and the second inbound address information is 100.123.10.2:80→192.168.1.10:10000.

[0077] Optionally, the method of determining the second inbound address information, the second outbound address information and the first outbound address information after determining the source port address and the destination port address in the message quintuple information as the first inbound address information corresponding to the access traffic of the first access traffic packet can refer to the above-mentioned method of determining the second outbound address information, the second inbound address information and the first inbound address information after determining the source port address and the destination port address in the message quintuple information as the first outbound address information corresponding to the access traffic of the first access traffic packet. The specific implementation content will not be repeated here.

[0078] Step 306: Update the original address translation relationship table in the first synchronization device according to the first address translation information to obtain a first address translation relationship table.

[0079] Exemplarily, step 306 includes: updating the original address translation relationship table in the first synchronization device according to the first address translation information to obtain an update result, and determining the first address translation relationship table according to the update result.

[0080] In this 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 generation step: according to the switch port address, the first address conversion information corresponding to the first access traffic packet is generated, wherein the first address conversion information is used to indicate the first synchronization device to perform address conversion for subsequent communications; according to the first address conversion information, the original address conversion relationship table in the first synchronization device is updated to obtain the first address conversion relationship table, which provides a real-time update method for the first address conversion relationship table and ensures the timeliness of the first address conversion relationship table.

[0081] In an exemplary embodiment, Figure 4As shown, in order to provide an accurate update method 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: Update 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 translation information to the original address translation relationship table in the first synchronization device to update the original address translation relationship table in the first synchronization device.

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

[0085] It is understandable that when the first address translation information does not conflict with the original address translation relationship table, the original address translation relationship table is updated successfully, and when the first address translation information conflicts with the original address translation relationship table, the original address translation relationship table is updated unsuccessfully.

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

[0087] If it is detected that the original address translation relationship table fails to be updated, step 406 is executed to update the switch port address, and the process returns 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; selecting the next port address arranged after the switch port address from the plurality of preset port addresses according to the arrangement order of the port addresses corresponding to the plurality of preset port addresses, and determining it 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 translation relationship table is updated successfully, step 408 is executed to identify the access type of the access traffic corresponding to the first access traffic packet as an access conflict type.

[0090] In this way, the access type of access traffic with access conflicts can be marked, and when the address translation information is subsequently synchronized, the target address translation information of each access traffic can be accurately confirmed, ensuring that the subsequent second synchronization device can implement normal communication access process according to the address translation synchronization table.

[0091] In this 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 updated successfully, 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 updated unsuccessfully, the switch port address is updated, and the generation step is returned to execute 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 an access conflict type. For each access traffic, in the case of failure to update the original address conversion relationship table, 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 updated successfully, ensuring that each access traffic can be accurately updated to the original address conversion relationship table, and realizing access type marking of access traffic with access conflicts. When the subsequent address conversion information is synchronized, the target address conversion information of each access traffic can be accurately confirmed, ensuring that the subsequent second synchronization device can realize normal communication access process according to the address conversion synchronization table.

[0092] As a detailed embodiment, if a first access traffic packet of a first synchronization device is detected, an access source port address in the first access traffic packet is extracted, and the access source port address is set as a switch port address; generation step: extracting message quintuple information from the first access traffic packet; generating address conversion information corresponding to the first access traffic packet based on the message quintuple information and the switch port address, wherein the first address conversion information is used to instruct the first synchronization device to perform address conversion for subsequent communications; updating the original address conversion relationship table in the first synchronization device based on the first address conversion information; if it is detected that the original address conversion relationship table is updated successfully, 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 fails to be updated, a target port address is randomly selected from a plurality of preset port addresses; or, based on the arrangement order of the port addresses 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, and the generation step is returned to be executed 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 an access conflict type.

[0093] Furthermore, the access types of the multiple access flows corresponding to the first address translation relationship table are identified to obtain the access types of the multiple access flows; for each access flow, when the access type of the access flow is an access non-conflicting type, the inbound address translation information corresponding to the access flow in the address translation relationship table is determined as the target address translation information; when the access type of the access flow is an access conflicting type, the inbound address translation information and the outbound address translation information corresponding to the access flow in the address translation relationship table are determined as the target address translation information; based on the target address translation information of each access flow, an address translation synchronization table is generated, and the address translation synchronization table is synchronized to the second address translation synchronization table. step device; if it is detected that the device state of the second synchronization device is switched from the backup device to the main device, then 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; according to the traffic packet address information, the address conversion synchronization table in the second synchronization device is queried to obtain the query result; when the query result is a successful query result, according to the address conversion synchronization table, the second address conversion information corresponding to the second access traffic packet is generated; when the query result includes a failed query result, the second address conversion information corresponding to the second access traffic packet is constructed; according to the second address conversion information, the address conversion relationship table of the second access traffic packet is updated.

[0094] Furthermore, by obtaining a first address translation relationship table of a first synchronization device; identifying access types of multiple access flows corresponding to the first address translation relationship table, obtaining access types of multiple access flows; for each access flow, when the access type of the access flow is an access non-conflicting type, determining the inbound address translation information of the access flow corresponding to the address translation relationship table as the target address translation information; when the access type of the access flow is an access conflicting type, determining the inbound address translation information and the outbound address translation information of the access flow corresponding to the address translation relationship table as the target address translation information; generating an address translation synchronization table according to the target address translation information of each access flow, and synchronizing the address translation synchronization table to the second synchronization device, for access flows whose access type is an access non-conflicting type, it means that the switch port address set for the access flow is not occupied by many devices, and there is no access conflict, so only the inbound address translation information needs to be synchronized, and it can also ensure that the subsequent second synchronization device can implement a normal communication access process according to the address translation synchronization table, and also greatly reduce the number of synchronized address translation information, so as to improve the synchronization efficiency of the address translation information.

[0095] In this way, 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 to the switch port address; the generation step: according to the switch port address, the first address conversion information corresponding to the first access traffic packet is generated, wherein the first address conversion information is used to indicate the first synchronization device to perform address conversion for subsequent communications; according to the first address conversion information, the original address conversion relationship table in the first synchronization device is updated to obtain the first address conversion relationship table, which provides a real-time update method for the first address conversion relationship table, ensures the timeliness of the first address conversion relationship table, and, for each For access traffic, when the original address conversion relationship table fails to be updated, that is, when 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 updated successfully, ensuring that each access traffic can be accurately updated to the original address conversion relationship table, and the access type marking of the access traffic with access conflicts is realized. When the subsequent address conversion information is synchronized, the target address conversion information of each access traffic can be accurately confirmed, ensuring that the subsequent second synchronization device can realize normal communication access process according to the address conversion synchronization table.

[0096] 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.

[0097] Based on the same inventive concept, the embodiment of the present application also provides an address translation information synchronization device for implementing the address translation information synchronization 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 embodiments of the address translation information synchronization device provided below can refer to the limitations of the address translation information synchronization method above, and will not be repeated here.

[0098] In an exemplary embodiment, Figure 5As shown, an address translation information synchronization device 500 is provided, comprising: an acquisition module 502, an identification module 504, a determination module 506 and a synchronization module 508, wherein:

[0099] An acquisition module 502 is used to acquire a first address conversion relationship table of a first synchronization device;

[0100] An identification module 504, configured to identify access types of multiple access flows corresponding to the first address translation relationship table, and obtain access types of the multiple access flows;

[0101] The determination module 506 is used for, for each access flow, when the access type of the access flow is an access non-conflicting type, determining the inbound address translation information corresponding to the access flow in the address translation relationship table as the target address translation information; when the access type of the access flow is an access conflicting type, determining the inbound address translation information and the outbound address translation information corresponding to the access flow in the address translation relationship table as the target address translation information;

[0102] The synchronization module 508 is used to generate an address translation synchronization table according to the target address translation information of each access flow, and synchronize the address translation synchronization table to the second synchronization device.

[0103] In one of the embodiments, the acquisition module 502 is also used to extract the access source port address in the first access traffic packet if a first access traffic packet of the first synchronization device is detected, and set the access source port address as the switch port address; generation step: based on the switch port address, generate first address conversion information corresponding to the first access traffic packet, wherein the first address conversion information is used to indicate the first synchronization device to perform address conversion for subsequent communications; based on the first address conversion information, update the original address conversion relationship table in the first synchronization device to obtain the first address conversion relationship table.

[0104] In one of the embodiments, the acquisition module 502 is also used 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, 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 updated unsuccessfully, the switch port address is updated and the generation step is returned to execute 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 an access conflict type.

[0105] In one of the embodiments, the acquisition module 502 is also used for one of the following: randomly selecting a target port address from a plurality of preset port addresses; selecting the next port address arranged after the switch port address from the plurality of preset port addresses according to the arrangement order of the port addresses corresponding to the plurality of preset port addresses, and determining it 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 acquisition module 502 is further used to extract message quintuple information from the first access traffic packet; and generate 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, an address conversion synchronization table is generated according to the target address conversion information of each access flow, and after the address conversion synchronization table is synchronized to the second synchronization device, the device also includes: a query module, which is used to extract the flow packet address information from the second access flow packet when the second access flow packet for the second synchronization device is detected if it is detected that the device state of the second synchronization device is switched from the backup device to the main device; according to the flow packet address information, query the address conversion synchronization table in the second synchronization device to obtain the query result; when the query result is a query success result, generate the second address conversion information corresponding to the second access flow packet according to the address conversion synchronization table; when the query result includes a query failure result, construct the second address conversion information corresponding to the second access flow packet; according to the second address conversion information, update the address conversion relationship table of the second access flow packet.

[0108] Each module in the above-mentioned address translation information synchronization 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 above.

[0109] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 6As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. 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. 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 an 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 realized through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, an address conversion information synchronization 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.

[0110] Those skilled in the art will understand that Figure 6 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.

[0111] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0112] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0113] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[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 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 this application can include at least one of non-volatile memory 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), magnetic 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, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0115] 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 application.

[0116] 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 method for synchronizing address translation information, characterized in that: The method comprises: Acquire a first address conversion relationship table of a first synchronization device; Identifying access types of multiple access flows corresponding to the first address translation relationship table to obtain access types of the multiple access flows; For each of the access traffic, when the access type of the access traffic is an access non-conflicting 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; when the access type of the access traffic is an access conflicting type, the inbound address translation information and the outbound address translation information corresponding to the access traffic in the address translation relationship table are determined as the target address translation information; An address conversion synchronization table is generated according to the target address conversion information of each access flow, and the address conversion synchronization table is synchronized to the second synchronization device.

2. The method according to claim 1, characterized in that The step of obtaining a first address conversion relationship table of a first synchronization device includes: If a first access traffic packet of a first synchronization device is detected, extracting an access source port address in the first access traffic packet, and setting the access source port address as a switch port address; Generating step: generating 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 for subsequent communication; According to the first address conversion information, the original address conversion relationship table in the first synchronization device is updated to obtain a first address conversion relationship table.

3. The method according to claim 2, characterized in that The updating of the 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 includes: updating an 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 translation relationship table is updated successfully, the updated original address translation relationship table is determined as the first address translation relationship table; If it is detected that the update of the original address translation relationship table fails, the switch port address is updated and the generation step is returned to execute until it is detected that the update of the original address translation relationship table is successful, and the access type of the access traffic corresponding to the first access traffic packet is identified as an access conflict type.

4. The method according to claim 3, characterized in that The method further comprises one of the following: Randomly select a target port address from a plurality of preset port addresses; According to the arrangement order of the port addresses corresponding to the multiple preset port addresses, the next port address arranged after the switch port address is selected from the multiple 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 according to the switch port address includes: Extracting message five-tuple information from the first access traffic packet; Address conversion information corresponding to the first access traffic packet is generated according to the message quintuple information and the switch port address.

6. The method according to any one of claims 1 to 5, characterized in that After generating an address conversion synchronization table according to the target address conversion information of each access flow, and synchronizing the address conversion synchronization table to the second synchronization device, the method further includes: If it is detected that the device state of the second synchronization device is switched from the backup device to the master device, 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; According to the traffic packet address information, query the address conversion synchronization table in the second synchronization device to obtain a query result; In the case where the query result is a successful query result, generating second address translation information corresponding to the second access traffic packet according to the address translation synchronization table; In the case where the query result includes a query failure result, constructing second address translation information corresponding to the second access traffic packet; According to the second address translation information, the address translation relationship table of the second access traffic packet is updated.

7. An address conversion information synchronization device, characterized in that: The device comprises: An acquisition module, used for acquiring a first address conversion relationship table of a first synchronization device; an identification module, configured to identify access types of a plurality of access flows corresponding to the first address translation relationship table, and obtain access types of the plurality of access flows; A determination module, for each of the access traffic, when the access type of the access traffic is an access non-conflicting type, determining the inbound address translation information corresponding to the access traffic in the address translation relationship table as the target address translation information; when the access type of the access traffic is an access conflicting type, determining the inbound address translation information and the 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 conversion synchronization table according to the target address conversion information of each access flow, and synchronize the address conversion synchronization table to the second synchronization device.

8. 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.

9. 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.

10. 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

  • Data processing method and related equipment

    CN115292439A

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

    CN116561036A

  • Information processing method and device, computer equipment and storage medium

    CN117390612A

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

    CN118199781A

  • Marking storage keys to indicate memory used to back address translation structures

    US20180018279A1