A state link maintenance method, device and equipment based on OPC protocol
The state link maintenance method of the OPC protocol solves the problem of child link interruption caused by long-term non-communication of the parent link. By finding and updating the association relationship between the child link and the parent link, the efficiency of data packet transmission is improved.
Patent Information
- Application Number
- CN202310194899.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2043-02-28
AI Technical Summary
In the prior art, a long-term non-communication of a parent link causes interruption of the communication service of the child link, thereby reducing the efficiency of data packet transmission.
Through the state link maintenance method based on the OPC protocol, the transmission information is extracted from the data packet, and the association relationship between the child link and the parent link is found and updated to ensure that the child link will not be interrupted even if the parent link does not communicate for a long time. The child link and the parent link are maintained in a maintenance manner.
It improves the communication efficiency of data packets, avoids the interruption of sub-links caused by long-term non-communication of the parent link, and saves communication time.
Smart Images

Figure CN116192920B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of firewalls, and in particular to a state link maintenance method, device and equipment based on the OPC protocol. Background Art
[0002] Administrator-configured control policies exist within the firewall to restrict the passage of packets with certain characteristics. However, if every packet passing through the firewall were to undergo a complete re-entry of all security policies, firewall performance would be significantly reduced. Therefore, a state link module is introduced before the control policy module. When a packet passes through the firewall, it first passes through the state link module. When a packet hits a state link entry, the entry is updated and the updated link state is written to the packet. Finally, the security module determines whether to allow the packet to pass based on the link state carried in the packet.
[0003] However, in the state link module, there are often interrelated parent links and child links. Since the child link depends on the parent link, if the parent link is not communicating for a long time, the communication service of the child link will be interrupted, which will reduce the transmission efficiency of data packets. Summary of the Invention
[0004] Therefore, the technical problem to be solved by the present invention is to overcome the defect in the prior art that the communication service of the child link is interrupted due to the long-term non-communication of the parent link, thereby providing a state link maintenance method, device and equipment based on the OPC protocol.
[0005] In a first aspect, the present invention provides a state link maintenance method based on the OPC protocol, comprising:
[0006] Extract transmission information from a pre-acquired data packet; based on the transmission information, search for sub-link information corresponding to the transmission information from a pre-constructed first information table; when sub-link information corresponding to the transmission information exists in the first information table, search for the sub-link corresponding to the transmission information from a pre-constructed second information table based on the transmission information, and generate a first search result; based on the first search result, maintain the sub-link using a maintenance method corresponding to the first search result, and update the parent link information associated with the sub-link; or, when sub-link information corresponding to the transmission information does not exist in the first information table, search for the parent link corresponding to the transmission information from a pre-constructed second information table based on the transmission information, and generate a second search result; based on the second search result, maintain the parent link using a maintenance method corresponding to the second search result.
[0007] In the present invention, after receiving a data packet, the transmission information is first extracted from the data packet. Based on the transmission information, a search is performed from the first information table to determine whether there is a child link information corresponding to the transmission information. If not, a search is performed from the second information table to determine whether there is a parent link corresponding to the transmission information. Based on the search result, the parent link is maintained using a maintenance method corresponding to the search result. If the parent link exists, a search is performed from the second information table to determine whether there is a child link corresponding to the transmission information. Based on the search result, the child link and the parent link associated with the child link are maintained. In this way, even if the parent link does not communicate for a long time, as long as a data packet of a child link associated with the parent link passes through, the parent link will be updated, so that the parent link will not be interrupted due to a long period of non-communication, nor will the child link be disconnected due to a long period of non-communication between the parent link and the parent link. This saves the communication time of the data packet and improves communication efficiency.
[0008] In combination with the first aspect, in a first embodiment of the first aspect, maintaining the child link according to the first search result using a maintenance method corresponding to the first search result and updating the parent link information associated with the child link includes:
[0009] When the first search result indicates that a sub-link corresponding to the transmission information exists in the second information table, the aging time of the sub-link is updated, and the aging time of the parent link associated with the sub-link is updated.
[0010] In combination with the first aspect, in a second embodiment of the first aspect, based on the first search result, maintaining the child link using a maintenance method corresponding to the first search result, and updating the parent link information associated with the child link, further comprising:
[0011] When the first search result is that there is no sub-link corresponding to the transmission information in the second information table, based on the sub-link information corresponding to the transmission information, a sub-link corresponding to the transmission information is established in the second information table; the aging time of the sub-link is set, and the aging time of the parent link associated with the sub-link is updated.
[0012] In combination with the first aspect, in a third embodiment of the first aspect, maintaining the parent link according to the second search result using a maintenance method corresponding to the second search result includes:
[0013] When the second search result is that a parent link corresponding to the transmission information exists in the second information table, the aging time of the parent link is updated; or, when the second search result is that a parent link corresponding to the transmission information does not exist in the second information table, a candidate link corresponding to the transmission information is established in the second information table based on the transmission information; when it is determined that the candidate link is qualified, the candidate link is determined as the parent link, and the parent link is written into the second information table.
[0014] In combination with the first aspect, in a fourth embodiment of the first aspect, after updating the aging time of the parent link, the method further includes:
[0015] Negotiate the expected IP and expected port based on the transmission information; generate sub-link information corresponding to the transmission information according to the expected IP, expected port and transmission information; and write the sub-link information into the first information table.
[0016] In combination with the first aspect, in a fifth embodiment of the first aspect, after writing the sub-link information into the first information table, the method further includes:
[0017] Associate the child link information with the parent link corresponding to the transmission information.
[0018] In combination with the first aspect, in a sixth embodiment of the first aspect, the method further includes:
[0019] The first information table and the second information table are saved in a preset file.
[0020] In combination with the first aspect, in a seventh embodiment of the first aspect, the method further includes:
[0021] When the device is restarted, the second information table and the first information table are read from the preset file; and the aging time corresponding to each link in the second information table is updated.
[0022] In a second aspect, the present invention provides a state link maintenance device based on the OPC protocol, comprising:
[0023] An extraction module is used to extract transmission information from a pre-acquired data packet; a first search module is used to search for sub-link information corresponding to the transmission information from a pre-constructed first information table based on the transmission information; a second search module is used to search for sub-links corresponding to the transmission information from a pre-constructed second information table based on the transmission information when sub-link information corresponding to the transmission information exists in the first information table, and generate a first search result; a first maintenance module is used to maintain the sub-links according to the first search result, using a maintenance method corresponding to the first search result, and update the parent link information associated with the sub-links; a third search module is used to search for parent links corresponding to the transmission information from a pre-constructed second information table based on the transmission information when sub-link information corresponding to the transmission information does not exist in the first information table, and generate a second search result; a second maintenance module is used to maintain the parent link according to the second search result, using a maintenance method corresponding to the second search result.
[0024] In a third aspect, the present invention provides a computer device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory being used to store a computer program, and when the computer program is executed by the processor, the processor executes a status link maintenance method based on the OPC protocol as described in any one of the invention contents. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0026] Figure 1 A flow chart of a state link maintenance method based on the OPC protocol provided in an embodiment of the present invention;
[0027] Figure 2 A link diagram of a state link maintenance device based on the OPC protocol provided in an embodiment of the present invention;
[0028] Figure 3 A link diagram of computer devices provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0030] Before describing this solution in detail, let's briefly explain the relationship between the firewall, the state link module, and the control policy module. The state link module and the control policy module are two independent modules of the firewall. The control policy module contains security policies that administrators can configure to control which packets with certain characteristics can pass through the firewall. An administrator can configure multiple security policies. Therefore, if every packet passing through the firewall had to pass through all security policies, firewall performance would be significantly reduced.
[0031] In order to solve this problem, a state link module is introduced before the control policy module. The state link module is mainly responsible for the maintenance (search, creation, update, and destruction) of the state link table. Each item in the state link table is called a state link table item. When a data packet passes through the firewall, it first passes through the state link module to determine whether the five-tuple information of the data packet hits a state link table item in the state link table. If it hits, the hit state link table item is updated, the updated link status is written into the data packet, and the data packet is uploaded to the control policy module. The control policy module reads the link status carried in the data packet and determines whether to release the data packet based on the link status. If it does not hit, a temporary link item is established based on the five-tuple information of the data packet. After the control policy module verifies that the temporary link item is qualified, the temporary link item is written into the state link table as a qualified link item.
[0032] In the state link module, there are often interrelated parent-child links. When the parent link is not communicating for a long time, the communication service of the child link will be interrupted. At this time, if a data packet that meets the requirements of the child link passes, it must first establish a link before normal communication can proceed. This will reduce communication efficiency.
[0033] The present invention discloses a state link maintenance method based on OPC protocol, such as Figure 1 As shown, the following steps are included:
[0034] S11: Extract transmission information from the pre-acquired data packet.
[0035] Specifically, the data packet carries transmission information, which is a five-tuple information, namely source port, source IP, destination port, destination IP, and protocol type.
[0036] S12: According to the transmission information, search for sub-link information corresponding to the transmission information from a pre-built first information table.
[0037] Specifically, the first information table is the expected table, which stores sub-link information corresponding to sub-links. For example, the sub-link information corresponding to sub-link A includes: source IP, source port, destination IP, destination port, protocol type, association relationship, etc. In the sub-link information, the source port can be any port. It should be noted that the sub-link information stored in the expected table includes sub-link information corresponding to sub-links that have been created and sub-link information corresponding to sub-links that have been reported but not yet created.
[0038] Specifically, the source IP, destination IP and destination port are read from the transmission information, and the first information table is searched to determine whether there is a sub-link whose source IP, destination IP and destination port are consistent with the source IP, destination IP and destination port of the transmission information. Based on the search result, it is determined whether the data packet hits a sub-link information in the first information table.
[0039] S13: When sub-link information corresponding to the transmission information exists in the first information table, the sub-link corresponding to the transmission information is searched for in the pre-built second information table according to the transmission information to generate a first search result.
[0040] Specifically, when there is sub-link information consistent with the transmission information in the first information table, it means that the current data packet hits the sub-link. However, whether the sub-link hit by the data packet has been created needs to be found from the pre-built second information table based on the transmission information.
[0041] Specifically, the second information table is a state link table, which stores already created parent links and child links. Each parent / child link includes five-tuple information about the packet request direction, five-tuple information about the response direction, link status, and aging time. The aging time is the countdown to the expiration and destruction of the entry. Link states include SYN_SENT, ESTABLISHED, TIME_WAIT, and RELATED. Whenever a packet hits a parent link or child link, the link status of the hit link is updated.
[0042] Specifically, since the five-tuple information corresponding to each link in the second information table includes the five-tuple information of the request direction and the five-tuple information of the response direction, when matching the transmission information with the five-tuple information in the second information table, the transmission information only needs to be consistent with the five-tuple information corresponding to either the request direction or the response direction.
[0043] S14: Based on the first search result, the sub-link is maintained using a maintenance method corresponding to the first search result, and the parent link information associated with the sub-link is updated.
[0044] Specifically, maintenance methods include creation, search, update, and destruction. When the first search result indicates that a sublink corresponding to the transmission information exists in the second information table, the maintenance method corresponding to the first search result is to update the sublink and simultaneously update the parent link associated with the sublink; when the first search result indicates that a sublink corresponding to the transmission information does not exist in the second information table, the maintenance method corresponding to the first search result is to create the sublink and simultaneously update the parent link associated with the sublink. It should be noted that the destruction operation in the maintenance method needs to be determined based on the link information of the sublink and is part of normal link maintenance.
[0045] S15: Alternatively, when the child link information corresponding to the transmission information does not exist in the first information table, the parent link corresponding to the transmission information is searched from the pre-built second information table according to the transmission information to generate a second search result.
[0046] Specifically, when the child link information corresponding to the transmission information does not exist in the first information table, it means that the current data packet hits the parent link. At this time, it is necessary to search the parent link corresponding to the transmission information from the pre-built second information table according to the transmission information.
[0047] S16: Based on the second search result, the parent link is maintained using a maintenance method corresponding to the second search result.
[0048] Specifically, when the second search result is that there is a parent link corresponding to the transmission information in the second information table, the maintenance method corresponding to the second search result is update, that is, updating the parent link; when the second search result is that there is no parent link corresponding to the transmission information in the second information table, the maintenance method corresponding to the second search result is creation, that is, creating the parent link.
[0049] In the present invention, after receiving a data packet, the transmission information is first extracted from the data packet. Based on the transmission information, a search is performed from the first information table to determine whether there is a child link information corresponding to the transmission information. If not, a search is performed from the second information table to determine whether there is a parent link corresponding to the transmission information. Based on the search result, the parent link is maintained using a maintenance method corresponding to the search result. If the parent link exists, a search is performed from the second information table to determine whether there is a child link corresponding to the transmission information. Based on the search result, the child link and the parent link associated with the child link are maintained. In this way, even if the parent link does not communicate for a long time, as long as a data packet of a child link associated with the parent link passes through, the parent link will be updated, so that the parent link will not be interrupted due to a long period of non-communication, nor will the child link be disconnected due to a long period of non-communication between the parent link and the parent link. This saves the communication time of the data packet and improves communication efficiency.
[0050] In an optional embodiment, based on the first search result, maintaining the child link using a maintenance method corresponding to the first search result and updating the parent link information associated with the child link include:
[0051] When the first search result indicates that a sub-link corresponding to the transmission information exists in the second information table, the aging time of the sub-link is updated, and the aging time of the parent link associated with the sub-link is updated.
[0052] For example, when the first information table contains child link information corresponding to the transmission information, and the second information table contains a child link corresponding to the transmission information, it indicates that the data packet has hit the child link and the hit child link has been created. At this time, the aging time of the child link in the second information table is updated to the initial value, and the aging time of the parent link associated with the child link in the second information table is also updated to the initial value. At the same time, the link status of the child link needs to be updated and written into the data packet. The data packet is then transmitted to the control policy module, so that the control policy module can decide whether to release the data packet based on the link status carried in the data packet. The initial value of the aging time is set by the user based on the actual data communication situation, such as 3 days. The aging time gradually decreases from the update time. Before the aging time is reduced to 0, if the link is updated again, the aging time will start decreasing from 3 days again until the aging time is reduced to 0, and the corresponding parent / child link is destroyed. After the parent / child link is destroyed, if data that hits the link passes, the corresponding link needs to be re-established before communication can resume.
[0053] For example, in another embodiment, when sub-link information corresponding to the transmission information exists in the first information table and a sub-link corresponding to the transmission information exists in the second information table, when the data packet carries end information (FIN / RST), the link state in the sub-link is updated to the TIME_WAIT state, and the aging time corresponding to the sub-link is updated to the system default value. Since the system default value is much smaller than the initial value for a period of time, when the data packet carries end information, the sub-link will be cleared in a very short time. This situation is a case of the data request end actively interrupting communication. Updating the aging time of the sub-link to the system default value can disconnect the link as soon as possible, which can ensure that memory is released in time and reduce the number of unnecessary connections.
[0054] In an optional embodiment, based on the first search result, maintaining the child link using a maintenance method corresponding to the first search result and updating the parent link information associated with the child link further includes:
[0055] When the first search result is that there is no sub-link corresponding to the transmission information in the second information table, based on the sub-link information corresponding to the transmission information, a sub-link corresponding to the transmission information is established in the second information table; the aging time of the sub-link is set, and the aging time of the parent link associated with the sub-link is updated.
[0056] When the sub-link information corresponding to the transmission information exists in the first information table, and the sub-link corresponding to the transmission information does not exist in the second information table, it means that the sub-link has been reported but has not been created. At this time, it is necessary to create the sub-link corresponding to the transmission information in the second information table based on the sub-link information corresponding to the transmission information in the first information table. Creating a sub-link mainly involves creating the five-tuple information of the sub-link in the request direction, the five-tuple information in the response direction, the link state corresponding to the sub-link, and the aging time corresponding to the sub-link. The link state is set to the SYN_SENT state, and the aging time is set to the initial value. When the data packet carries the end information (FIN / RST), the link state in the parent link is updated to the TIME_WAIT state, and the aging time corresponding to the parent link is updated to the initial value, so that the sub-link associated with the parent link will not be interrupted in a short time.
[0057] In an optional embodiment, maintaining the parent link according to the second search result using a maintenance method corresponding to the second search result includes:
[0058] When the second search result is that a parent link corresponding to the transmission information exists in the second information table, the aging time of the parent link is updated; or, when the second search result is that a parent link corresponding to the transmission information does not exist in the second information table, a candidate link corresponding to the transmission information is established in the second information table based on the transmission information; when it is determined that the candidate link is qualified, the candidate link is determined as the parent link, and the parent link is written into the second information table.
[0059] For example, if the child link information corresponding to the transmission information does not exist in the first information table, it indicates that the current data packet corresponds to the parent link, not the child link. Under this premise, if the second search result indicates that the parent link corresponding to the transmission information exists in the second information table, the aging time of the parent link is updated, the link status of the parent link is updated, the updated link status is written to the data packet, and the data packet is transmitted to the control policy module, so that the control policy module can determine whether to release the data packet based on the link status carried in the data packet.
[0060] When the second search result is that there is no parent link corresponding to the transmission information in the second information table, it means that the current data packet is the first packet of a certain link. At this time, it is necessary to first create a candidate link corresponding to the data packet based on the five-tuple information of the data packet, and write the link status of the candidate link into the data packet. The data packet is transmitted to the control policy module, and the control policy detects the data packet. It determines whether the candidate link is qualified based on the detection result. When the candidate link is determined to be qualified, the candidate link is written into the second information table as a parent link. When the candidate link is determined to be unqualified, the candidate link is destroyed.
[0061] In an optional embodiment, after updating the aging time of the parent link, the method further includes:
[0062] Negotiate the expected IP and expected port based on the transmission information; generate sub-link information corresponding to the transmission information according to the expected IP, expected port and transmission information; and write the sub-link information into the first information table.
[0063] For example, in this embodiment, when there is no sub-link information corresponding to the transmission information in the first information table, and there is a parent link corresponding to the transmission information in the second information table, it is necessary to first call the deep parsing module to parse the data packet, obtain the data format in the data packet after parsing, compare the parsed data format with the preset data format, and when the two are consistent, update the parent link, and after updating the parent link, use the deep parsing module to negotiate the expected IP and expected port based on the transmission information, and generate sub-link information based on the transmission information, expected IP, and expected port, and write the sub-link information into the first information table. The above operation is equivalent to the reporting of the sub-link. When another data packet hits the reported sub-link, a sub-link can be created based on the sub-link information. The preset format can be the data format corresponding to the OPC protocol.
[0064] In an optional embodiment, after writing the sub-link information into the first information table, the method further includes:
[0065] Associate the child link information with the parent link corresponding to the transmission information.
[0066] Exemplarily, after the sub-link information is written into the first information table, the sub-link information is associated with the parent link corresponding to the transmission information, and an association relationship is established. The association relationship is saved in the corresponding sub-link information, so that when a data packet hits the sub-link, the parent link associated with the hit sub-link can be determined based on the association relationship here.
[0067] In an optional embodiment, the method further comprises:
[0068] The first information table and the second information table are saved in a preset file.
[0069] For example, during device operation, a dynamic table of a first information table and a dynamic table of a second information table exist. Whenever an information item is created, updated, or deleted in either of these tables, the corresponding result in the dynamic table is synchronously stored in a preset file. For example, when a child link is written to the first information table, the change is saved in the first information table in the preset file. When a parent link is deleted in the second information table, the same operation is performed in the second information table in the preset file. However, the normal decrement of the aging time of parent / child links in the second information table does not need to be saved.
[0070] In an optional embodiment, the method further comprises:
[0071] When the device is restarted, the second information table and the first information table are read from the preset file; and the aging time corresponding to each link in the second information table is updated.
[0072] For example, when the device is shut down, the dynamic tables of the first information table and the dynamic tables of the second information table will disappear, but the first information table and the second information table stored in the preset file will remain in the state at the time of shutdown. Therefore, when the device is restarted, the corresponding dynamic tables will be restored according to the first information table and the second information table stored in the preset file, and after the restoration, the aging time in the dynamic table of the second information table will be set to the initial value. In this way, the first information table and the second information table can be directly restored to the state before the restart after the device is restarted, without having to re-establish the link after the restart, thereby saving communication time and improving communication efficiency.
[0073] In a second aspect, the present invention provides a state link maintenance device based on the OPC protocol, such as Figure 2 As shown, it includes the following modules:
[0074] The extraction module 21 is configured to extract transmission information from the pre-acquired data packet.
[0075] The first search module 22 is configured to search for sub-link information corresponding to the transmission information from a pre-built first information table according to the transmission information.
[0076] The second search module 23 is configured to search for the sublink corresponding to the transmission information from the pre-built second information table according to the transmission information when the sublink information corresponding to the transmission information exists in the first information table, and generate a first search result.
[0077] The first maintenance module 24 is configured to maintain the child link according to the first search result using a maintenance method corresponding to the first search result, and update the parent link information associated with the child link.
[0078] The third search module 25 is configured to search for a parent link corresponding to the transmission information from a pre-built second information table according to the transmission information when the child link information corresponding to the transmission information does not exist in the first information table, and generate a second search result.
[0079] The second maintenance module 26 is configured to maintain the parent link according to the second search result using a maintenance method corresponding to the second search result.
[0080] This embodiment provides a computer device, such as Figure 3As shown, the computer device may include at least one processor 31, at least one communication interface 32, at least one communication bus 33 and at least one memory 34, wherein the communication interface 32 may include a display screen (Display), a keyboard (Keyboard), and the optional communication interface 32 may also include a standard wired interface and a wireless interface. The memory 34 may be a high-speed RAM memory (Random Access Memory, volatile random access memory) or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 34 may also be at least one storage device located away from the aforementioned processor 31. The processor 31 may be combined with Figure 3 In the described device, the memory 34 stores an application program, and the processor 31 calls the program code stored in the memory 34 to execute the state link maintenance method based on the OPC protocol of any of the above method embodiments.
[0081] The communication bus 33 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The communication bus 33 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0082] Among them, the memory 34 may include a volatile memory (English: volatile memory), such as a random-access memory (English: random-access memory, abbreviated: RAM); the memory may also include a non-volatile memory (English: non-volatile memory), such as a flash memory (English: flash memory), a hard disk drive (English: hard disk drive, abbreviated: HDD) or a solid-state drive (English: solid-state drive, abbreviated: SSD); the memory 34 may also include a combination of the above types of memory.
[0083] The processor 31 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and a NP.
[0084] The processor 31 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. Optionally, the memory 34 is further used to store program instructions. The processor 31 may call the program instructions to implement the state link maintenance method based on the OPC protocol in any embodiment of the present invention.
[0085] Obviously, the above embodiments are merely examples for clarity of explanation and are not intended to limit the implementation methods. Those skilled in the art will readily appreciate that other variations or modifications based on the above descriptions are possible. It is not necessary and impossible to enumerate all implementation methods here. Obvious variations or modifications arising therefrom remain within the scope of protection of the present invention.
Claims
1. A state link maintenance method based on the OPC protocol, characterized in that: include: extracting transmission information from pre-acquired data packets; According to the transmission information, searching for sub-link information corresponding to the transmission information from a pre-built first information table; the first information table stores sub-link information corresponding to the sub-link; When the first information table contains child link information corresponding to the transmission information, searching for the child link corresponding to the transmission information from a pre-built second information table according to the transmission information to generate a first search result; the second information table stores parent links and child links; According to the first search result, maintaining the child link in a maintenance manner corresponding to the first search result, and updating the parent link information associated with the child link; Alternatively, when the child link information corresponding to the transmission information does not exist in the first information table, searching for the parent link corresponding to the transmission information from the pre-constructed second information table according to the transmission information to generate a second search result; According to the second search result, the parent link is maintained using a maintenance method corresponding to the second search result.
2. The state link maintenance method based on the OPC protocol according to claim 1, characterized in that: Maintaining the child link according to the first search result using a maintenance method corresponding to the first search result and updating parent link information associated with the child link includes: When the first search result indicates that a sub-link corresponding to the transmission information exists in the second information table, the aging time of the sub-link is updated, and the aging time of the parent link associated with the sub-link is updated.
3. The state link maintenance method based on the OPC protocol according to claim 1 or 2, characterized in that: The method of maintaining the child link according to the first search result using a maintenance method corresponding to the first search result and updating the parent link information associated with the child link further includes: When the first search result is that the sublink corresponding to the transmission information does not exist in the second information table, creating a sublink corresponding to the transmission information in the second information table based on the sublink information corresponding to the transmission information; The aging time of the child link is set, and the aging time of the parent link associated with the child link is updated.
4. The state link maintenance method based on the OPC protocol according to claim 1, characterized in that: Maintaining the parent link according to the second search result using a maintenance method corresponding to the second search result includes: When the second search result indicates that a parent link corresponding to the transmission information exists in the second information table, updating the aging time of the parent link; Alternatively, when the second search result is that the parent link corresponding to the transmission information does not exist in the second information table, creating a candidate link corresponding to the transmission information in the second information table based on the transmission information; When it is determined that the candidate link is qualified, the candidate link is determined as the parent link, and the parent link is written into the second information table.
5. The method for maintaining a state link based on the OPC protocol according to claim 4, characterized in that: After updating the aging time of the parent link, the method further includes: Negotiate an expected IP and an expected port based on the transmission information; Generate sub-link information corresponding to the transmission information according to the expected IP, expected port and the transmission information; The sub-link information is written into the first information table.
6. The method for maintaining a state link based on the OPC protocol according to claim 5, characterized in that: After writing the sub-link information into the first information table, the method further includes: The child link information is associated with the parent link corresponding to the transmission information.
7. The state link maintenance method based on the OPC protocol according to claim 1, characterized in that: The method further comprises: The first information table and the second information table are saved in a preset file.
8. The method for maintaining a state link based on the OPC protocol according to claim 7, wherein: The method further comprises: After the device is restarted, the second information table and the first information table are read from the preset file; Update the aging time corresponding to each link in the second information table.
9. A state link maintenance device based on the OPC protocol, characterized in that: include: an extraction module, for extracting transmission information from pre-acquired data packets; A first search module is configured to search, based on the transmission information, for sub-link information corresponding to the transmission information from a pre-built first information table; the first information table stores sub-link information corresponding to the sub-link; a second search module configured to, when sub-link information corresponding to the transmission information exists in the first information table, search for the sub-link corresponding to the transmission information from a pre-constructed second information table according to the transmission information, and generate a first search result; the second information table stores parent links and sub-links; a first maintenance module, configured to maintain the child link according to the first search result, using a maintenance method corresponding to the first search result, and update parent link information associated with the child link; a third search module configured to search for a parent link corresponding to the transmission information from a pre-built second information table based on the transmission information when the child link information corresponding to the transmission information does not exist in the first information table, and generate a second search result; The second maintenance module is configured to maintain the parent link according to the second search result and in a maintenance manner corresponding to the second search result.
10. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory is used to store a computer program, and when the computer program is executed by the processor, the processor executes the state link maintenance method based on the OPC protocol as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Firewall multi-outlet intelligent route selection method
CN101753426A
Method for automatically establishing tunnel, CPE and convergence device
CN106713100A