Communication method, device, electronic device and non-volatile storage medium
By processing session information and physical address tables under the terminal device, the problem of the user terminal being hung under the terminal device being unable to communicate normally when the threshold exceeds the threshold is exceeded, and normal forwarding and smooth communication of network messages are achieved.
Patent Information
- Application Number
- CN202411707616.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-04-04
AI Technical Summary
When the user terminal mounted on the terminal device exceeds the preset threshold, the user terminal that subsequently sends network messages cannot communicate normally.
By receiving the message sent by the terminal device, the session information and physical address of the message are obtained, and when the physical address is not stored in the session physical address table associated with the session information, it is determined whether it exists in the main physical address table. If present, release other physical addresses in the session physical address table and store them in the session physical address table so that messages are forwarded based on the session information and the updated session physical address table.
It solves the problem that the user terminal cannot communicate normally when the terminal device is hung with a user terminal exceeds the threshold, and ensures normal forwarding and smooth communication of network messages.
Smart Images

Figure CN119767381A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network technology and security, and more specifically, to a communication method, device, electronic device and non-volatile storage medium. Background Art
[0002] 3GPP (3rd Generation Partnership Project) R16 defines the 5G LAN networking solution in the mobile network architecture, providing IP or Ethernet communication services for terminals in the same virtual network group. The technical specifications of 5G LAN define that a terminal device (for example, a customer premises equipment (CPE)) has a maximum of 16 mac addresses. Therefore, in the scenario where multiple user devices (UE, one user device corresponds to one mac address) are connected to the terminal device, once the number of user devices exceeds the specified number (16), the user devices that subsequently send network messages will not be able to communicate normally.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present application provide a communication method, apparatus, electronic device and non-volatile storage medium to at least solve the technical problem that when the number of user terminals connected to a terminal device exceeds a preset threshold, the user terminals that subsequently send network messages cannot communicate normally.
[0005] According to one aspect of an embodiment of the present application, a communication method is provided, comprising: receiving a first message sent by a first terminal, and obtaining session information of the first message and a first physical address of the first terminal, wherein the session information is used to determine a packet detection rule corresponding to the first message; when the first physical address is not stored in a session physical address table associated with the session information, and the number of physical addresses in the session physical address table exceeds a first preset threshold, determining whether the first physical address exists in a main physical address table, wherein the session physical address table is used to store physical addresses associated with the session information, and the main physical address table is used to store physical addresses with a priority higher than a second preset threshold; when the first physical address exists in the main physical address table, releasing the second physical address in the session physical address table, and storing the first physical address in the session physical address table to obtain a target session physical address table, wherein the second physical address is not stored in the main physical address table; and forwarding the first message based on the session information and the target session physical address table.
[0006] In some embodiments of the present application, the method also includes: when the first physical address is stored in the session physical address table, updating the arrangement order of the physical addresses in the session physical address table, and forwarding the first message based on the session information and the updated session physical address table.
[0007] In some embodiments of the present application, the method also includes: storing the first physical address in the session physical address table when the first physical address is not stored in the session physical address table and the number of physical addresses in the session physical address table does not exceed a first preset threshold; updating the arrangement order of the physical addresses in the session physical address table, and forwarding the first message based on the session information and the updated session physical address table.
[0008] In some embodiments of the present application, when the first physical address exists in the main physical address table, the second physical address in the session physical address table is released, and the first physical address is stored in the session physical address table, including: determining the second physical address from the session physical address table; releasing the second physical address, and updating the arrangement order of the physical addresses in the session physical address table; allocating a storage location for the first physical address in the updated session physical address table, and inserting the first physical address into the storage location.
[0009] In some embodiments of the present application, determining a second physical address from a session physical address table includes: determining the access time when each physical address in the session physical address table was last accessed by a message; sorting all physical addresses in order of access time from recent to far to obtain an address sequence; and determining the physical address that is last in the address sequence and does not exist in the main physical address table as the second physical address.
[0010] In some embodiments of the present application, forwarding a first message based on session information and a target session physical address table includes: determining a packet detection rule corresponding to the first message in the session information; determining a first physical address in the target session physical address table; forwarding the first message based on the packet detection rule and the first physical address: when determining that the first message meets message forwarding requirements based on the packet detection rule, determining a forwarding physical address of the first message based on the first physical address; and forwarding the first message to a second terminal corresponding to the forwarding physical address.
[0011] In some embodiments of the present application, the method also includes: when the first physical address exists in the main physical address table, and the number of physical addresses in the session physical address table exceeds a first preset threshold, and all the physical addresses in the session physical address table exist in the main physical address table, discarding the first message and generating an alarm message, and sending the alarm message to the user terminal.
[0012] According to another aspect of an embodiment of the present application, a communication device is also provided, including: a receiving module, used to receive a first message sent by a first terminal, and obtain session information of the first message and a first physical address of the first terminal, wherein the session information is used to determine a packet detection rule corresponding to the first message; a determination module, used to determine whether the first physical address exists in a primary physical address table when the first physical address is not stored in a session physical address table associated with the session information and the number of physical addresses in the session physical address table exceeds a first preset threshold, wherein the session physical address table is used to store physical addresses associated with the session information, and the primary physical address table is used to store physical addresses with a priority higher than a second preset threshold; a storage module, used to release the second physical address in the session physical address table when the first physical address exists in the primary physical address table, and store the first physical address in the session physical address table to obtain a target session physical address table, wherein the second physical address is not stored in the primary physical address table; and a forwarding module, used to forward the first message based on the session information and the target session physical address table.
[0013] According to another aspect of an embodiment of the present application, a non-volatile storage medium is provided, in which a program is stored, wherein when the program is running, a device where the non-volatile storage medium is located is controlled to execute the above-mentioned communication method.
[0014] According to another aspect of an embodiment of the present application, an electronic device is further provided, including: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the above-mentioned communication method is executed when the program is run.
[0015] According to another aspect of an embodiment of the present application, a computer program product is also provided, including computer instructions, and when the computer instructions are executed by a processor, the above-mentioned communication method is implemented.
[0016] In an embodiment of the present application, a first message sent by a first terminal is received, and session information of the first message and a first physical address of the first terminal are obtained, wherein the session information is used to determine a packet detection rule corresponding to the first message; when the first physical address is not stored in a session physical address table associated with the session information, and the number of physical addresses in the session physical address table exceeds a first preset threshold, it is determined whether the first physical address exists in a main physical address table, wherein the session physical address table is used to store physical addresses associated with the session information, and the main physical address table is used to store physical addresses with a priority higher than a second preset threshold; when the first physical address exists in the main physical address table, the second physical address in the session physical address table is released, and the first physical address is stored in the session physical address table, to the target session physical address table, wherein the second physical address is not stored in the main physical address table; a method of forwarding the first message based on the session information and the target session physical address table, by receiving the first message sent by the first terminal, and obtaining the session information of the first message and the first physical address of the first terminal, when the first physical address does not exist in the session physical address table associated with the session information, and the session physical address table is greater than a first preset threshold, the first physical address is stored in the session physical address table through the above method to obtain the target session physical address table, thereby forwarding the first message based on the session information and the target session physical address table, thereby solving the technical problem that when the user terminals hanging under the terminal device exceed the preset threshold, the user terminals that subsequently send network messages cannot communicate normally. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0018] Figure 1 It is a hardware structure block diagram of a computer terminal for implementing a communication method provided in an embodiment of the present application;
[0019] Figure 2 It is a flowchart of a communication method provided according to an embodiment of the present application;
[0020] Figure 3 It is a communication flow diagram provided according to an embodiment of the present application;
[0021] Figure 4 is another communication flow diagram provided according to an embodiment of the present application;
[0022] Figure 5 It is a structural diagram of a communication device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0024] The information collected in the embodiments of the present application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or reject automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:
[0027] 5G Local Area Network (5G LAN): 5G LAN is a local area network solution in the 5G network architecture, which is designed to use 5G network technology to provide high-speed, low-latency connection services within a specific geographical area. It allows IP-type or Ethernet-type direct communication between terminal devices in the same virtual network group without going through the Internet or public network infrastructure.
[0028] 5G Virtual Network (5G VN): 5G VN refers to network slicing or virtualization technology in 5G networks, which allows the creation of multiple logically independent networks on the same physical 5G network infrastructure, each of which can be customized according to specific business or service requirements. 5G VN can provide dedicated network resources for different user groups, enterprises or services to meet specific performance indicators, security requirements and business needs, such as through network slicing technology.
[0029] Customer Premises Equipment (CEP): CPE refers to equipment deployed by end users or customers at their premises to access the telecommunications operator's network. In the context of 5G LAN and 5G VN, CPE can be a 5G-enabled router, gateway, or other terminal device, such as an industrial IoT device, smart home device, or enterprise-level communication device.
[0030] User Plane Function (UPF): UPF is a network function responsible for data packet processing and forwarding in the 5G core network architecture. It is located on the path between the user device and the external data network (such as the Internet, enterprise network, etc.), and handles tasks such as data packet encapsulation, decapsulation, forwarding, and policy execution. UPF is also responsible for interacting with the border gateway of the data network to achieve interconnection between the 5G network and different data networks. For example, in a 5G LAN or industrial automation scenario, UPF can prioritize and forward data packets of key equipment based on preset PDRs to ensure smooth and secure communication in the production environment.
[0031] Packet Detection Rule (PDR): PDR can identify packets based on multiple conditions such as the source and destination IP addresses, port numbers, protocol types, etc., so that UPF can apply the correct forwarding strategy, charging strategy, etc. PDR is the basis for implementing advanced functions such as network slicing, traffic control, and service isolation.
[0032] In the related art, in the scenario where a terminal device is connected to multiple user equipments (UE, one user equipment corresponds to one MAC address), once the number of user equipments exceeds the specified number (16), the user equipments that subsequently send network messages will not be able to communicate normally. Therefore, when the number of user terminals connected to the terminal device exceeds the preset threshold, the user terminals that subsequently send network messages will not be able to communicate normally. In order to solve this problem, a relevant solution is provided in the embodiments of the present application, which is described in detail below.
[0033] According to an embodiment of the present application, an embodiment of a communication method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0034] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal for implementing a communication method. Figure 1 As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0035] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0036] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the communication method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the above-mentioned communication method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0037] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0038] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .
[0039] In the above operating environment, the present application embodiment provides a flow chart of a communication method, such as Figure 2 As shown, the following steps are included:
[0040] Step S202, receiving a first message sent by a first terminal (eg, a CPE device), and acquiring session information of the first message and a first physical address of the first terminal, wherein the session information is used to determine a packet detection rule corresponding to the first message.
[0041] Step S204, when the first physical address is not stored in the session physical address table associated with the session information and the number of physical addresses in the session physical address table exceeds a first preset threshold (for example, 16), determine whether the first physical address exists in the main physical address table, wherein the session physical address table is used to store physical addresses associated with the session information, and the main physical address table is used to store physical addresses with a priority higher than a second preset threshold.
[0042] It should be noted that, in the case where the first physical address is stored in the session physical address table, the arrangement order of the physical addresses in the session physical address table is updated, and the first message is forwarded based on the session information and the updated session physical address table. By updating the arrangement order of the physical addresses, it is possible to ensure that the frequently accessed physical addresses are at the front of the table, thereby reducing the search time and improving the message processing speed, especially in load balancing and flow control in a data center or cloud service environment, the effect is particularly significant.
[0043] The following is a specific embodiment:
[0044] After receiving the first message sent by the first terminal (for example, a CPE device), the UPF searches for the session corresponding to the first terminal. If the search fails, the message is discarded. If the search succeeds, the session information of the first message sent by the first terminal, the first physical address of the first terminal, and the session physical address table associated with the session information are obtained. In the 5G network architecture, the session information contains a set of parameters and rules related to the communication session of a specific user or terminal device, which is intended to describe and manage the data flow characteristics of the session. The session information includes but is not limited to: Session identifier: used to uniquely identify a session, which is convenient for UPF and other network functions to identify and manage. User identity information: such as IP address, etc., used to associate a session with a specific user or device (for example, the above-mentioned first terminal device). Network policy and quality of service (QoS) parameters: including flow control, priority, bandwidth limitation, etc., used to determine the processing method and service quality of data packets. Security configuration: such as encryption algorithm, integrity protection mechanism, etc., to ensure the security of data transmission. Packet detection rules: used by UPF to identify and detect data packets belonging to the session, and determine how to process and forward data packets based on these rules. The session physical address table is used to quickly find the physical address of the terminal in the session (for example, the Media Access Control Address (MAC address for short), including the MAC address of the user device under the current first terminal (for example, a CPE device), etc. When the first physical address is not stored in the session physical address table associated with the session information, and the number of physical addresses in the session physical address table exceeds the first preset threshold (for example, 16), determine whether the first physical address exists in the main physical address table. The UPF locally configures the main physical address table, which consists of the physical addresses (mac addresses) of the main devices that need to give priority to business communications. The main physical address table is collected and provided to the UPF network administrator by the production environment management personnel. The UPF network administrator enters and maintains it according to the divided 5G LAN groups, and can dynamically adjust the main physical address table according to network requirements. The priority of the physical address in the main address table is greater than the second preset threshold (for example, 90%).
[0045] If the first physical address is not stored in the session physical address table and the number of physical addresses in the session physical address table does not exceed a first preset threshold (e.g., 16), the first physical address is stored in the session physical address table; the arrangement order of the physical addresses in the session physical address table is updated, and the first message is forwarded based on the session information and the updated session physical address table. This strategy can effectively avoid premature saturation of the address table, ensure timely establishment of new connections, and provide a better user experience for real-time communication systems that require fast response, such as video conferencing, online games, etc. The following is a specific embodiment:
[0046] If the number of physical addresses in the session physical address table does not exceed the first preset threshold (for example, 16), the first physical address is inserted into the first terminal session physical address table and PDR matching is continued and forwarding processing is performed according to the matched PDR; the session physical address table is maintained using the LRU algorithm. The core idea of the Least Recently Used (LRU) algorithm is that when the number of physical addresses in the session physical address table reaches the first preset threshold, the physical address (mac address) table entries that have not been accessed for the longest time (that is, the data in the column where the first physical address is located in the session physical address table) will be eliminated first, thereby making room for new physical address table entries. The first physical address is inserted into the header of the session physical address table, and the other physical addresses in the session physical address table are adaptively moved accordingly to ensure that the order of the table entries reflects the most recent access situation. The later it is, the longer the physical address has not been accessed. Forward the first message based on the session information and the updated session physical address table: determine the packet detection rule corresponding to the first message in the session information; determine the first physical address in the updated session physical address table; forward the first message based on the packet detection rule and the first physical address (i.e., perform PDR matching as described above and perform forwarding processing based on the matched PDR): determine the forwarding physical address of the first message based on the first physical address when the first message meets the message forwarding requirements based on the packet detection rule; forward the first message to the second terminal (different from the first terminal) corresponding to the forwarding physical address. Message forwarding requirements include but are not limited to detecting source and destination IP addresses or mac addresses, transmission protocols, port numbers, service identifiers or slice identifiers, etc.
[0047] In the case where the first physical address is stored in the session physical address table, the arrangement order of the physical addresses in the session physical address table is updated, and the first message is forwarded based on the session information and the updated session physical address table. The following is a specific embodiment:
[0048] If the first physical address (mac address) is in the session physical address table corresponding to the first terminal, the position of the first physical address (mac address) in the session physical address table is updated using the LRU algorithm: the first physical address (mac address) table entry is found in the session physical address table (i.e., the data in the column where the first physical address is located in the session physical address table), and the corresponding table entry (the column corresponding to the first physical address) is updated to the header of the session physical address table, indicating that it is the most recently accessed address. Other physical addresses in the session physical address table are adaptively moved accordingly to ensure that the order of the table entries reflects the most recent access. The first message is forwarded based on the session information and the updated session physical address table: the packet detection rule corresponding to the first message in the session information is determined; the first physical address in the updated session physical address table is determined; the first message is forwarded based on the packet detection rule and the first physical address: when the first message is determined to meet the message forwarding requirements based on the packet detection rule, the forwarding physical address of the first message is determined based on the first physical address; the first message is forwarded to the second terminal (different from the first terminal) corresponding to the forwarding physical address. Message forwarding requirements include but are not limited to detecting source and destination IP addresses or MAC addresses, transport protocols, port numbers, service identifiers or slice identifiers, etc.
[0049] Step S206, when the first physical address exists in the main physical address table, release the second physical address in the session physical address table, and store the first physical address in the session physical address table to obtain a target session physical address table, wherein the second physical address is not stored in the main physical address table.
[0050] In the technical solution provided in step S206, when the first physical address exists in the main physical address table, there are multiple ways to release the second physical address in the session physical address table and store the first physical address in the session physical address table, such as: determining the second physical address from the session physical address table; releasing the second physical address and updating the arrangement order of the physical addresses in the session physical address table; allocating a storage location for the first physical address in the updated session physical address table and inserting the first physical address into the storage location. This process ensures the priority storage of high priority addresses, which is particularly important for the resource management of network devices, especially when the network device has limited memory, it can allocate resources more reasonably and improve the processing capacity of the device.
[0051] In the above steps, determining the second physical address from the session physical address table can be achieved in the following ways: determining the last access time of each physical address in the session physical address table by a message; sorting all physical addresses in order of access time from recent to distant to obtain an address sequence; determining the physical address that is at the end of the address sequence and does not exist in the main physical address table as the second physical address. This access frequency-based strategy can intelligently release inactive addresses and reduce invalid storage. For address table maintenance in large networks, it can significantly reduce the memory burden of the device and improve resource utilization.
[0052] Step S208: forwarding the first message based on the session information and the target session physical address table.
[0053] In the technical solution provided in step S208, there are multiple ways to implement forwarding the first message based on the session information and the target session physical address table, for example: determine the packet detection rule corresponding to the first message in the session information; determine the first physical address in the target session physical address table; forward the first message based on the packet detection rule and the first physical address: determine the forwarding physical address of the first message based on the first physical address when the first message meets the message forwarding requirements based on the packet detection rule; forward the first message to the second terminal corresponding to the forwarding physical address. This method realizes accurate flow control and message forwarding by combining session information and physical address table, which plays an important role in improving network security and communication efficiency, especially in complex network environments with multiple users and multiple devices, and can effectively prevent network congestion and ensure the normal operation of key services.
[0054] It should be noted that, when the first physical address exists in the main physical address table, the number of physical addresses in the session physical address table is greater than the first preset threshold, and all the physical addresses in the session physical address table exist in the main physical address table, the first message is discarded and an alarm message is generated, and the alarm message is sent to the user terminal. This mechanism can notify the administrator in time when the network device detects an abnormal communication mode, which is very critical for network monitoring and troubleshooting, especially in enterprise-level networks or critical infrastructure, and can quickly respond to potential security threats and protect the network from attacks.
[0055] The following is a specific embodiment:
[0056] If the number of physical addresses in the session physical address table is greater than the first preset threshold (for example, 16) and all the physical addresses in the session physical address table exist in the main physical address table, the UPF discards the first message and generates an alarm message. The alarm content is that the number of main terminals (or user devices) under the session corresponding to the first terminal exceeds 16. The production environment administrator should adjust the equipment according to the alarm to ensure that the number of main terminals under each CPE does not exceed 16.
[0057] Through the above steps, when the number of terminals under the terminal device (for example, CPE device) exceeds the preset threshold, it can first check whether the first physical address is in the main address table. If the table indicates that this terminal is the main terminal, the UPF chooses to release the non-main terminal under the CPE device (the terminal corresponding to the physical address that is not in the main address table), thereby giving priority to the business communication of the main terminal. This method can effectively optimize the address table management of network devices, especially in high-traffic network environments, and can improve the update efficiency of the address table to ensure the smooth flow of important communications.
[0058] The present application also provides a communication flow diagram, such as Figure 3 As shown, the UPF receives the first terminal message, searches for the session corresponding to the first terminal, and discards it if the search fails. If the search succeeds, it continues to process; if the mac address of the first terminal (that is, the first physical address) is in the mac address table of the session corresponding to the first terminal (that is, the physical address table of the session), the PDR matching is continued and forwarding is performed according to the matched PDR;
[0059] If the mac address of the first terminal is not in the mac address table of the first terminal corresponding session; if the number of mac addresses in the mac address table of the first terminal corresponding session reaches 16 at this time, packet loss processing is performed, if the number of mac addresses in the mac address table of the first terminal corresponding session is less than 16 at this time, the mac address of the first terminal is inserted into the mac address table of the first terminal corresponding session and PDR matching is continued and forwarding processing is performed according to the matched PDR. The specific processing method has been described in detail in the above embodiment and will not be repeated here.
[0060] The present application embodiment also provides another communication flow diagram, such as Figure 4 As shown, it is Figure 3To optimize the process, UPF locally configures the main mac address table in the first group of 5GLAN (i.e. the main address table mentioned above). The main mac address table consists of the mac addresses of the main devices in the production environment within the first group that need to give priority to business communications. The main mac address table is collected and statistically analyzed by the production environment management personnel and provided to the UPF network administrator. The UPF network administrator enters and maintains it according to the divided 5G LAN groups. The UPF network administrator can dynamically adjust the main mac address table according to network needs. If the mac address of the first terminal is in the session mac address table corresponding to the first terminal (i.e. the above-mentioned session physical address table), PDR matching will continue and forwarding processing will be performed according to the matching PDR;
[0061] If the number of mac addresses in the first terminal corresponding session mac address table (i.e. the above-mentioned session physical address table) is less than 16, the first terminal mac address (i.e. the above-mentioned first physical address) is inserted into the first terminal corresponding session mac address table and PDR matching is continued and forwarding processing is performed according to the matched PDR; the first terminal corresponding session mac address table can be maintained using the LRU algorithm. For example, the first terminal mac address is inserted into the header of the first terminal corresponding session mac address table, and the later it is, the longer the mac address has not been accessed. If the first terminal mac address is in the first terminal corresponding session mac address table, the LRU algorithm is used to update the position of the first terminal mac address in the table, such as finding the first terminal mac address table entry from the first terminal corresponding session mac address table, and updating the corresponding entry to the header of the first terminal corresponding session mac address table.
[0062] If the mac address of the first terminal (i.e. the first physical address mentioned above) is not in the session mac address table corresponding to the first terminal (i.e. the session physical address table mentioned above) and the number of mac addresses in the session mac address table corresponding to the first terminal reaches 16, if the mac address of the first terminal is not in the main mac address table in the first group of 5G LAN (i.e. the main physical address table mentioned above), packet loss processing is performed; if the mac address of the first terminal is in the main mac address table in the first group of 5G LAN, a terminal mac address that has not been accessed for the longest time and is not in the main terminal mac address table in the first group of 5G LAN is selected from the session mac address table corresponding to the first terminal (i.e. the second physical address mentioned above) for release, and then the mac address of the first terminal is inserted into the session mac address table corresponding to the first terminal (session physical address table), and PDR matching is continued and forwarding processing is performed according to the matched PDR.
[0063] If the number of mac addresses in the session mac address table corresponding to the first terminal (i.e. the above-mentioned session physical address table) reaches 16 and all 16 terminal mac addresses are in the main terminal mac address table (i.e. the above-mentioned main physical address table), the UPF discards the message corresponding to the first terminal and generates an alarm. The alarm content is that the number of main terminals under the session corresponding to the first terminal exceeds 16. The production environment administrator adjusts the equipment according to the alarm to ensure that the number of main terminals under each CPE does not exceed 16. Figure 4 The detailed implementation of each step has been described in the above embodiments and will not be repeated here.
[0064] The present application also provides a schematic diagram of a structure of a communication device, such as Figure 5 As shown, including:
[0065] The receiving module 502 is used to receive a first message sent by a first terminal, and obtain session information of the first message and a first physical address of the first terminal, wherein the session information is used to determine a packet detection rule corresponding to the first message.
[0066] The determination module 504 is used to determine whether the first physical address exists in the main physical address table when the first physical address is not stored in the session physical address table associated with the session information and the number of physical addresses in the session physical address table exceeds a first preset threshold, wherein the session physical address table is used to store physical addresses associated with the session information, and the main physical address table is used to store physical addresses with a priority higher than a second preset threshold.
[0067] Storage module 506 is used to release the second physical address in the session physical address table when the first physical address exists in the main physical address table, and store the first physical address in the session physical address table to obtain a target session physical address table, wherein the second physical address is not stored in the main physical address table.
[0068] The storage module 506 is also used to determine the second physical address from the session physical address table; release the second physical address and update the arrangement order of the physical addresses in the session physical address table; allocate a storage location for the first physical address in the updated session physical address table and insert the first physical address into the storage location.
[0069] The storage module 506 is also used to determine the last access time of each physical address in the session physical address table by a message; sort all physical addresses in order of access time from recent to far to obtain an address sequence; and determine the physical address that is at the end of the address sequence and does not exist in the main physical address table as the second physical address.
[0070] The forwarding module 508 is configured to forward the first message based on the session information and the target session physical address table.
[0071] The forwarding module 508 is also used to determine the packet detection rules corresponding to the first message in the session information; determine the first physical address in the target session physical address table; forward the first message based on the packet detection rules and the first physical address: when it is determined based on the packet detection rules that the first message meets the message forwarding requirements, determine the forwarding physical address of the first message based on the first physical address; and forward the first message to the second terminal corresponding to the forwarding physical address.
[0072] The forwarding module 508 is further configured to discard the first message and generate an alarm message, and send the alarm message to the user terminal when the first physical address exists in the primary physical address table and all the physical addresses in the session physical address table exist in the primary physical address table.
[0073] The forwarding module 508 is further configured to update the arrangement order of the physical addresses in the session physical address table when the first physical address is stored in the session physical address table, and forward the first message based on the session information and the updated session physical address table.
[0074] The forwarding module 508 is also used to store the first physical address in the session physical address table when the first physical address is not stored in the session physical address table and the number of physical addresses in the session physical address table does not exceed a first preset threshold; update the arrangement order of the physical addresses in the session physical address table, and forward the first message based on the session information and the updated session physical address table.
[0075] It should be noted that Figure 5 The communication device shown is used to perform Figure 2 The method of communication shown is therefore Figure 2 The relevant explanations in the communication method in are also applicable to the communication device and will not be repeated here.
[0076] It should be noted that the various modules in the above-mentioned communication device can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.
[0077] The embodiment of the present application also provides a non-volatile storage medium, the non-volatile storage medium includes a stored program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to perform the above-mentioned communication method. For example, a first message sent by a first terminal is received, and session information of the first message and a first physical address of the first terminal are obtained, wherein the session information is used to determine the packet detection rule corresponding to the first message; when the first physical address is not stored in a session physical address table associated with the session information, and the number of physical addresses in the session physical address table exceeds a first preset threshold, determine whether the first physical address exists in a primary physical address table, wherein the session physical address table is used to store physical addresses associated with the session information, and the primary physical address table is used to store physical addresses with a priority higher than a second preset threshold; when the first physical address exists in the primary physical address table, release the second physical address in the session physical address table, and store the first physical address in the session physical address table to obtain a target session physical address table, wherein the second physical address is not stored in the primary physical address table; forward the first message based on the session information and the target session physical address table.
[0078] The embodiment of the present application also provides an electronic device, the electronic device includes a processor, the processor is used to run a program, wherein the above-mentioned communication method is executed when the program is running. For example, a first message sent by a first terminal is received, and session information of the first message and a first physical address of the first terminal are obtained, wherein the session information is used to determine a packet detection rule corresponding to the first message; when the first physical address is not stored in a session physical address table associated with the session information, and the number of physical addresses in the session physical address table exceeds a first preset threshold, determine whether the first physical address exists in a primary physical address table, wherein the session physical address table is used to store physical addresses associated with the session information, and the primary physical address table is used to store physical addresses with a priority higher than a second preset threshold; when the first physical address exists in the primary physical address table, release the second physical address in the session physical address table, and store the first physical address in the session physical address table to obtain a target session physical address table, wherein the second physical address is not stored in the primary physical address table; forward the first message based on the session information and the target session physical address table.
[0079] According to another aspect of the embodiment of the present application, a computer program product is also provided, including a computer program, which implements the above-mentioned communication method when executed by a processor. For example, a first message sent by a first terminal is received, and session information of the first message and a first physical address of the first terminal are obtained, wherein the session information is used to determine the packet detection rule corresponding to the first message; when the first physical address is not stored in a session physical address table associated with the session information, and the number of physical addresses in the session physical address table exceeds a first preset threshold, it is determined whether the first physical address exists in a primary physical address table, wherein the session physical address table is used to store physical addresses associated with the session information, and the primary physical address table is used to store physical addresses with a priority higher than a second preset threshold; when the first physical address exists in the primary physical address table, the second physical address in the session physical address table is released, and the first physical address is stored in the session physical address table to obtain a target session physical address table, wherein the second physical address is not stored in the primary physical address table; the first message is forwarded based on the session information and the target session physical address table.
[0080] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0081] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0082] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0083] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0084] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0085] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A communication method, characterized in that: include: receiving a first message sent by a first terminal, and acquiring session information of the first message and a first physical address of the first terminal, wherein the session information is used to determine a packet detection rule corresponding to the first message; In a case where the first physical address is not stored in a session physical address table associated with the session information and the number of physical addresses in the session physical address table exceeds a first preset threshold, determining whether the first physical address exists in a primary physical address table, wherein the session physical address table is used to store physical addresses associated with the session information, and the primary physical address table is used to store physical addresses with a priority higher than a second preset threshold; In the case where the first physical address exists in the main physical address table, releasing the second physical address in the session physical address table, and storing the first physical address in the session physical address table to obtain a target session physical address table, wherein the second physical address is not stored in the main physical address table; The first message is forwarded based on the session information and the target session physical address table.
2. The method according to claim 1, characterized in that The method further includes: when the first physical address is stored in the session physical address table, updating the arrangement order of the physical addresses in the session physical address table, and forwarding the first message based on the session information and the updated session physical address table.
3. The method according to claim 1, characterized in that The method further comprises: If the first physical address is not stored in the session physical address table and the number of physical addresses in the session physical address table does not exceed the first preset threshold, storing the first physical address in the session physical address table; The arrangement order of the physical addresses in the session physical address table is updated, and the first message is forwarded based on the session information and the updated session physical address table.
4. The method according to claim 1, characterized in that: In a case where the first physical address exists in the main physical address table, releasing the second physical address in the session physical address table and storing the first physical address in the session physical address table comprises: Determine the second physical address from the session physical address table; Release the second physical address, and update the arrangement order of the physical addresses in the session physical address table; A storage location is allocated for the first physical address in the updated session physical address table, and the first physical address is inserted into the storage location.
5. The method according to claim 4, characterized in that Determining the second physical address from the session physical address table includes: Determine the last access time of each physical address in the session physical address table being accessed by a message; Sorting all physical addresses in order of the access time from near to far to obtain an address sequence; The physical address that ranks last in the address sequence and does not exist in the main physical address table is determined as the second physical address.
6. The method according to claim 1, characterized in that Forwarding the first message based on the session information and the target session physical address table includes: Determine a packet detection rule corresponding to the first message in the session information; Determining the first physical address in the target session physical address table; Forwarding the first message based on the packet detection rule and the first physical address: When it is determined based on the packet detection rule that the first message meets the message forwarding requirement, determining a forwarding physical address of the first message based on the first physical address; The first message is forwarded to a second terminal corresponding to the forwarding physical address.
7. The method according to claim 1, characterized in that The method further comprises: When the first physical address exists in the main physical address table, and the number of physical addresses in the session physical address table exceeds the first preset threshold, and all the physical addresses in the session physical address table exist in the main physical address table, the first message is discarded and an alarm information is generated, and the alarm information is sent to the user terminal.
8. A communication device, characterized in that: include: A receiving module, configured to receive a first message sent by a first terminal, and obtain session information of the first message and a first physical address of the first terminal, wherein the session information is used to determine a packet detection rule corresponding to the first message; a determination module, configured to determine whether the first physical address exists in a primary physical address table when the first physical address is not stored in a session physical address table associated with the session information and the number of physical addresses in the session physical address table exceeds a first preset threshold, wherein the session physical address table is used to store physical addresses associated with the session information, and the primary physical address table is used to store physical addresses with a priority higher than a second preset threshold; a storage module, configured to release a second physical address in the session physical address table and store the first physical address in the session physical address table to obtain a target session physical address table when the first physical address exists in the primary physical address table, wherein the second physical address is not stored in the primary physical address table; A forwarding module is used to forward the first message based on the session information and the target session physical address table.
9. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the communication method according to any one of claims 1 to 7.
10. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the communication method according to any one of claims 1 to 7 when running.
11. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the communication method described in any one of claims 1 to 7 is implemented.