Telephone traffic switching method, device, equipment, storage medium and computer program product

By extracting and storing the key message information of the main device in real time in the traffic switching device and sending it to the backup device, the problem of high traffic switching delay is solved and efficient communication switching is achieved.

CN120729993AActive Publication Date: 2025-09-30SHENZHEN DINSTAR TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511213220.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-28
Publication Date
2025-09-30
Estimated Expiration
2045-08-28

AI Technical Summary

Technical Problem

The existing technology has a high delay in traffic switching because when the main device fails, the session state information needs to be processed by multiple modules before being synchronized to the backup device.

Method used

The traffic switching device obtains and stores key message information from the primary device in real time, extracts and stores basic, functional, and detailed media information, and sends it to the backup device to perform session operations when preset conditions are met, avoiding waiting for synchronization after the primary device fails.

Benefits of technology

It greatly reduces the delay of call switching, improves the real-time performance and efficiency of call switching, and ensures the continuity and stability of communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120729993A_ABST
    Figure CN120729993A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of telephone traffic switching, and discloses a telephone traffic switching method, device and equipment, a storage medium and a computer program product, the method is applied to telephone traffic switching equipment, and the telephone traffic switching equipment is connected with main telephone traffic equipment and standby telephone traffic equipment for use. The method comprises the following steps: under the condition that main telephone traffic equipment executes session operation according to a current message, acquiring the current message sent by the main telephone traffic equipment; decapsulating the current message, extracting key information based on the decapsulated current message, and storing a key information extraction result; and under the condition that the main telephone traffic equipment meets a preset telephone traffic switching condition, sending the key information extraction result and a generated telephone traffic switching instruction to standby telephone traffic equipment, so that the standby telephone traffic equipment executes a session operation based on the key information extraction result when receiving the telephone traffic switching instruction. And the stored key information extraction result is sent to the standby telephone traffic equipment for telephone traffic switching, so that the switching time delay is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of traffic switching, and in particular to a traffic switching method, apparatus, device, storage medium, and computer program product. Background Art

[0002] Traffic switching refers to the process of seamlessly transferring ongoing communication traffic (such as voice calls, video conferencing, data transmission, etc.) from the primary traffic device to the backup traffic device in a communication system when the primary traffic device fails, the network link is interrupted, the device is undergoing maintenance, or the business load is too high. The purpose is to ensure the continuity and stability of communication, avoid communication interruptions caused by primary device failure, and protect user experience and service quality.

[0003] In existing technologies, session state information from the primary device is typically synchronized to the backup device only when the primary device fails during call switching. During synchronization, the session state information must be processed by software in multiple modules, including the operating system kernel, on the primary device before synchronization, resulting in significant processing latency. Summary of the Invention

[0004] The main purpose of this application is to provide a traffic switching method, aiming to solve the technical problem of how to reduce the traffic switching delay.

[0005] To achieve the above-mentioned object, the present application proposes a traffic switching method, which is applied to a traffic switching device, wherein the traffic switching device is connected to a primary traffic device and a backup traffic device respectively. The method includes: When the primary traffic device performs a session operation according to the current message, obtaining the current message sent by the primary traffic device; Decapsulating the current message, extracting key information based on the decapsulated current message, and storing the key information extraction result; When the primary traffic device meets the preset traffic switching condition, the key information extraction result and the generated traffic switching instruction are sent to the backup traffic device, so that the backup traffic device performs the session operation based on the key information extraction result when receiving the traffic switching instruction.

[0006] In one embodiment, the step of extracting key information based on the decapsulated current message and storing the key information extraction result includes: Extract features from the decapsulated current message based on preset message header format rules to obtain basic feature information; Determine the current protocol type according to the basic feature information, and perform feature extraction on the basic feature information according to the current protocol type to obtain functional feature information; Determining a current session identifier based on the functional feature information, and performing feature extraction on the functional feature information based on the current session identifier to obtain detailed media information; The detailed media information, the functional feature information, and the basic feature information are used as key information extraction results, and the key information extraction results are stored.

[0007] In one embodiment, before the step of decapsulating the current message, the method further includes: Obtaining a current check code in the current message, and verifying the current check code based on a preset verification rule; If the check result shows that the message is abnormal, generating a retransmission request and sending the retransmission request to the primary traffic device, so that the primary traffic device resends the current message to the traffic switching device based on the retransmission request; When the verification result shows that the message is normal, the current message is standardized and the step of decapsulating the current message is performed.

[0008] In one embodiment, the step of performing standardization processing on the current message includes: Performing field analysis on the current message to determine the current message field; When the current message field does not meet the protocol specification, the current message is standardized based on a preset mapping relationship table and the current message field.

[0009] In one embodiment, the step of decapsulating the current message includes: Performing type analysis on the current message to determine the message type corresponding to the current message; Extracting header fields of the current message based on the message type to obtain header key fields corresponding to the current message; Decapsulate the current message according to the header key field.

[0010] In one embodiment, after the step of sending the key information extraction result and the generated traffic switching instruction to the backup traffic device, the method further includes: Using the primary traffic device as a new backup traffic device, and using the backup traffic device as a new primary traffic device; In the case where the new primary traffic device performs a session operation according to the new current message, a step of obtaining the new current message sent by the new primary traffic device is performed.

[0011] In addition, to achieve the above-mentioned purpose, the present application also proposes a traffic switching device, which includes: A message acquisition module, configured to acquire the current message sent by the primary traffic device when the primary traffic device performs a session operation according to the current message; A message storage module, configured to decapsulate the current message, extract key information based on the decapsulated current message, and store the key information extraction result; The traffic switching module is used to send the key information extraction result and the generated traffic switching instruction to the backup traffic device when the primary traffic device meets the preset traffic switching conditions, so that the backup traffic device performs the session operation based on the key information extraction result when receiving the traffic switching instruction.

[0012] In addition, to achieve the above-mentioned purpose, the present application also proposes a traffic switching device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the traffic switching method described above.

[0013] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium. A computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the traffic switching method described above are implemented.

[0014] In addition, to achieve the above-mentioned purpose, the present application also proposes a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the traffic switching method described above are implemented.

[0015] The present application proposes a traffic switching method, apparatus, device, storage medium, and computer program product. The method is applied to a traffic switching device, wherein the traffic switching device is connected to a primary traffic device and a backup traffic device, respectively. The method comprises: obtaining a current message sent by the primary traffic device when the primary traffic device performs a session operation based on the current message; decapsulating the current message, extracting key information based on the decapsulated current message, and storing the key information extraction result; and, when the primary traffic device meets a preset traffic switching condition, sending the key information extraction result and a generated traffic switching instruction to the backup traffic device, so that the backup traffic device performs the session operation based on the key information extraction result when receiving the traffic switching instruction. Because the present application stores the key information extraction result of the message in the primary device in real time by the traffic switching device before performing the traffic switching, when traffic switching is required, the key information extraction result and the generated traffic switching instruction in the traffic switching device can be directly sent to the backup traffic device, so that the backup traffic device performs the session operation based on the key information extraction result. Compared with the existing ones, there is no need to wait for the main device to fail before starting to synchronize the session status information. Instead, the session status information can be pre-synchronized to the traffic switching device. After the main device fails, the pre-stored synchronized session status information is directly sent to the backup traffic device, which greatly reduces the switching delay and improves the real-time performance and efficiency of traffic switching. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0018] Figure 1 This is a flow chart of the first embodiment of the traffic switching method proposed in the embodiment of the present application; Figure 2 This is a schematic diagram of device connections in the traffic switching method proposed in an embodiment of the present application; Figure 3 This is a flow chart of a second embodiment of the traffic switching method proposed in an embodiment of the present application; Figure 4 This is a flow chart of a third embodiment of the traffic switching method proposed in an embodiment of the present application; Figure 5A diagram of a traffic switching device provided in an embodiment of the present application; Figure 6 It is a structural diagram of a traffic switching device suitable for implementing the embodiment of the present application.

[0019] The realization of the objectives, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0020] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not intended to limit the present application.

[0021] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0022] It should be noted that all directional indications in the embodiments of the present application (such as up, down, left, right, front, back, etc.) are only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0023] It can be understood that traffic switching refers to the process of seamlessly transferring ongoing communication traffic (such as voice calls, video conferences, data transmission, etc.) from the main traffic equipment to the backup traffic equipment in the communication system when the main traffic equipment fails, the network link is interrupted, the equipment is undergoing maintenance, or the business load is too high. The purpose is to ensure the continuity and stability of communication, avoid communication interruptions caused by failure of the main equipment, and protect user experience and service quality.

[0024] In existing technologies, session state information from the primary device is typically synchronized to the backup device only when the primary device fails during call switching. During synchronization, the session state information must be processed by software in multiple modules, including the operating system kernel, on the primary device before synchronization, resulting in significant processing latency.

[0025] Therefore, to address the technical problem of how to reduce traffic switching latency, this embodiment proposes a traffic switching method. The method is applied to a traffic switching device, which is connected to a primary traffic device and a backup traffic device. The method includes: when the primary traffic device performs a session operation based on a current message, obtaining a current message sent by the primary traffic device; decapsulating the current message, extracting key information based on the decapsulated current message, and storing the key information extraction result; when the primary traffic device meets preset traffic switching conditions, sending the key information extraction result and a generated traffic switching instruction to the backup traffic device, so that the backup traffic device performs the session operation based on the key information extraction result upon receiving the traffic switching instruction. Because this embodiment stores the key information extraction result of the message in the primary device in real time by the traffic switching device before traffic switching is performed, when traffic switching is required, the key information extraction result and the generated traffic switching instruction in the traffic switching device can be directly sent to the backup traffic device, so that the backup traffic device performs the session operation based on the key information extraction result. Compared with the existing ones, there is no need to wait for the main device to fail before starting to synchronize the session status information. Instead, the session status information can be pre-synchronized to the traffic switching device. After the main device fails, the pre-stored synchronized session status information is directly sent to the backup traffic device, which greatly reduces the switching delay and improves the real-time performance and efficiency of traffic switching.

[0026] For ease of understanding, the following Figures 1 to 6 The traffic switching method provided in the embodiment of the present application and the traffic switching method, apparatus, device, storage medium and computer program product provided in the following embodiments are introduced in detail.

[0027] The present application embodiment provides a traffic switching method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the traffic switching method proposed in the embodiment of the present application.

[0028] like Figure 1 As shown, the method includes: Step S10: When the primary traffic device performs a session operation according to the current message, the current message sent by the primary traffic device is obtained.

[0029] refer to Figure 2 , Figure 2 This is a diagram of the device connections in the traffic switching method proposed in the embodiment of the present application. It should be noted that the execution subject of this embodiment can be a multifunctional machine device with traffic switching, such as a traffic switching device, or a device that can realize the above functions. This embodiment uses a traffic switching device (hereinafter referred to as the device) for illustration. The above-mentioned traffic switching device is respectively connected to the main traffic device (i.e. Figure 2 The main traffic equipment in the Figure 2 The backup telephone equipment in the system is used for connection.

[0030] It should also be noted that the primary traffic device may be the device responsible for handling primary session operations and plays a dominant role in the communication system. The current message may be a data message being transmitted or processed, containing session-related control information and data, such as a Session Initiation Protocol message or a Session Description Protocol message. The session operation may be operations related to establishing, maintaining, and managing a communication session, such as signal transmission and media flow control.

[0031] In a specific implementation, the device acquires the current message sent by the primary traffic device when the primary traffic device performs a session operation based on the current message. For example, when the primary traffic device processes a message, the device captures the message in real time via a high-speed data interface.

[0032] Step S20: decapsulate the current message, extract key information based on the decapsulated current message, and store the key information extraction result.

[0033] It should be noted that the above-mentioned decapsulation may be the process of stripping a message from the transport layer protocol and restoring its original data content. The above-mentioned key information extraction may be the process of extracting important features and data from the decapsulated message. The above-mentioned key information extraction result may be the important features and data extracted from the message.

[0034] In a specific implementation, the device first receives the current message sent by the primary traffic device, such as a SIP INVITE message. The device then decapsulates the message, stripping away the frame headers, trailers, IP headers, and TCP or UDP headers added by the physical layer, data link layer, network layer, and transport layer, restoring the original application layer data. The device then extracts key information from the raw data, such as the source IP address, destination IP address, source port, destination port, protocol type, session ID, and caller and callee identifiers. Finally, the device stores the extracted key information in a high-speed cache and records the timestamp and message sequence number for rapid retrieval and use when needed.

[0035] Furthermore, in order to achieve accurate traffic switching, the step of extracting key information based on the decapsulated current message and storing the key information extraction result includes: Step S24: extracting features from the decapsulated current message based on preset message header format rules to obtain basic feature information.

[0036] It should be noted that the aforementioned preset message header format rules may be message header structure specifications defined according to a communication protocol standard. The aforementioned decapsulated current message may be original application layer data from which transport layer, network layer, data link layer, and physical layer encapsulation has been removed. The aforementioned basic feature information may be basic attributes extracted from the decapsulated message, including source IP address, destination IP address, source port, and destination port.

[0037] In a specific implementation, the device extracts features from the decapsulated message based on preset message header format rules to obtain basic feature information. For example, after decapsulating a SIP INVITE message, the device extracts basic feature information such as the source IP address 20.0.0.50, the destination IP address 192.168.1.100, the source port 5060, and the destination port 39328 according to the preset SIP protocol header format rules.

[0038] Step S25: determining the current protocol type according to the basic feature information, and performing feature extraction on the basic feature information according to the current protocol type to obtain functional feature information.

[0039] It should be noted that the current protocol type may be the type of the communication protocol used by the current message. The functional feature information may be features related to the protocol function that are further extracted from the basic feature information.

[0040] In a specific implementation, the device determines the current protocol type based on basic feature information and extracts features from the basic feature information based on the current protocol type to obtain functional feature information. For example, after extracting basic feature information such as the source IP address 20.0.0.50, the destination IP address 192.168.1.100, the source port 5060, and the destination port 39328 from the message, the device searches the protocol-port mapping table and finds that the destination port 39328 is typically associated with the SIP protocol, thereby determining that the current protocol type is the SIP protocol. Next, the device further extracts information from the message, such as the calling party's phone number, the called party's phone number, the session ID, the media stream type, and the codec mode, based on the SIP protocol format specification. This information is the functional feature information and is used for subsequent session management and processing.

[0041] Step S26: determining a current session identifier based on the functional feature information, and performing feature extraction on the functional feature information based on the current session identifier to obtain detailed media information.

[0042] Step S27: taking the detailed media information, the functional feature information, and the basic feature information as key information extraction results, and storing the key information extraction results.

[0043] It should be noted that the current session identifier may be specific information for uniquely identifying the current communication session. The detailed media information may be specific information about the media stream, such as media type, encoding and decoding mode, and the like.

[0044] In a specific implementation, the device determines the current session identifier based on the functional feature information and extracts features from the functional feature information based on the current session identifier to obtain detailed media information. For example, after extracting functional feature information such as source port 5060, destination port 39328, and protocol version SIP / 2.0 from the decapsulated SIP message, the device determines that the current session identifier is "SessionID_001" by searching the session identifier mapping table. Next, based on the session identifier, the device further extracts detailed media information from the functional feature information, such as the media type being audio, the codec being G.711, and the sampling rate being 8kHz. This detailed media information is used for subsequent session management and processing, ensuring smooth takeover and continued transmission of media streams during call handover. For example, if the primary call device fails, the backup call device can use this detailed media information to quickly establish a new media stream connection, ensuring call continuity.

[0045] Step S30: When the primary traffic device meets the preset traffic switching conditions, the key information extraction result and the generated traffic switching instruction are sent to the backup traffic device, so that the backup traffic device performs the session operation based on the key information extraction result when receiving the traffic switching instruction.

[0046] It should be noted that the preset traffic switching condition may be a pre-set condition for triggering traffic switching, such as a primary device failure or network quality degradation. The traffic switching instruction may be an operation instruction for notifying a backup device to take over the session. The backup device may be a backup device configured to take over session operations in the event of a primary device failure.

[0047] In a specific implementation, the above-mentioned device sends the key information extraction results and the generated traffic switching instructions to the backup traffic device when the primary traffic device meets the preset traffic switching conditions. For example, when it is monitored that the CPU usage of the primary traffic device exceeds 90% and lasts for 10 seconds, or the network delay exceeds 100 milliseconds, the device determines that the primary traffic device meets the preset traffic switching conditions. At this time, the device sends the previously extracted and stored key information extraction results, including source IP address 20.0.0.50, destination IP address 192.168.1.100, source port 5060, destination port 39328, protocol version SIP / 2.0, media type audio, codec G.711, sampling rate 8kHz, etc., together with the generated traffic switching instructions to the backup traffic device. After receiving the traffic switching instruction, the backup traffic device immediately reads the key information extraction results and performs session operations based on this information to ensure the continuity and stability of the session. For example, the backup telephone equipment uses detailed media information such as media type and codec in the key information extraction results to quickly establish a new media stream connection to maintain call continuity.

[0048] Before performing a traffic handover, this embodiment uses a traffic switching device to store key information extracted from messages on the primary device in real time. When a traffic handover is required, the key information extracted from the traffic switching device and the generated traffic handover instruction can be directly sent to the backup traffic device, allowing the backup device to perform session operations based on the key information extracted. This embodiment eliminates the need to wait for a primary device failure before synchronizing session state information. Instead, session state information can be pre-synchronized with the traffic switching device. Upon a primary device failure, the pre-stored synchronized session state information can be directly sent to the backup device. This significantly reduces handover latency and improves the real-time nature and efficiency of traffic handover.

[0049] Based on the first embodiment, in the second embodiment, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 3 , Figure 3 This is a flow chart of a second embodiment of the traffic switching method proposed in an embodiment of the present application. Further, in order to achieve more accurate traffic switching, before the step of decapsulating the current message, the method further includes: Step S201: Obtain a current check code in the current message, and verify the current check code based on a preset verification rule.

[0050] It should be noted that the current check code may be a specific field in a message used to verify data integrity and accuracy. The preset check rule may be a pre-set algorithm or method for verifying whether the check code is correct.

[0051] In a specific implementation, the device obtains the current checksum from the current message and verifies it based on preset verification rules. For example, the device extracts the checksum field from a SIP INVITE message. The device then verifies the checksum using preset verification rules, such as a CRC algorithm or a checksum calculation method. If the verification result indicates the message is intact, the device proceeds with subsequent processing. If the verification fails, the message retransmission mechanism may be triggered to ensure data accuracy and integrity.

[0052] Step S202: if the check result shows that the message is abnormal, a retransmission request is generated and sent to the primary traffic device, so that the primary traffic device re-sends the current message to the traffic switching device based on the retransmission request.

[0053] It should be noted that the above check result may be a message status conclusion obtained after verification of the check code, such as message abnormality or message normal. The above retransmission request may be a signal or message for requesting retransmission of the message, including identification information of the abnormal message and the reason for retransmission.

[0054] In a specific implementation, if the verification result indicates a message anomaly, the device generates a retransmission request and sends it to the primary traffic device. For example, when the traffic switching device detects that the checksum of the current message does not match the preset verification rules, it immediately generates a retransmission request. The device sends the retransmission request to the primary traffic device via a network interface. After receiving the retransmission request, the primary traffic device searches for the corresponding current message based on the information in the request and resends it to the traffic switching device. Specifically, assuming the current message is a SIP INVITE message, the traffic switching device finds that its checksum does not match the calculated result during verification and determines that the message is anomaly. The traffic switching device then generates a retransmission request containing the message sequence number and error type (e.g., checksum error) and sends it to the primary traffic device via a preset communication link. After receiving the retransmission request, the primary traffic device searches for the original message based on the message sequence number and resends it to the traffic switching device. After receiving the retransmitted message, the traffic switching device performs another verification. If the verification passes, subsequent processing continues. If the verification still fails, further error handling mechanisms may be triggered, such as multiple retransmission requests or discarding abnormal messages. This process ensures the accuracy and integrity of message transmission and provides a reliable data foundation for subsequent call switching and session synchronization.

[0055] Step S203: When the verification result shows that the message is normal, the current message is standardized and the step of decapsulating the current message is performed.

[0056] It should be noted that the above-mentioned standardization process may be a process of converting a message into a predetermined format, such as unifying the field order or encoding method. The above-mentioned decapsulation process may be a process of stripping the message from the transport layer protocol to restore its original data content.

[0057] In a specific implementation, if the verification result indicates that the message is normal, the above-mentioned device standardizes the current message and decapsulates the current message after standardization. For example, when the device detects that the checksum of the message matches the preset verification rules, it first standardizes the message. This step ensures that the message conforms to the preset format specifications, such as a unified field order or encoding method. Next, the device decapsulates the standardized message, removing the encapsulation information such as the frame header, frame trailer, IP header, TCP or UDP header, etc. added by the physical layer, data link layer, network layer, and transport layer in sequence, to restore the original application layer data.

[0058] Furthermore, the step of performing standardization processing on the current message includes: Step S2031: Perform field analysis on the current message to determine the current message field.

[0059] It should be noted that the above field analysis may be a process of identifying and parsing each component of a message. The above message fields may be data segments with specific meanings and formats in a message, such as source IP address, destination IP address, port number, etc.

[0060] In a specific implementation, the device performs field analysis on the current message to determine the message fields. For example, after receiving a SIP INVITE message, the device first scans and parses the message byte by byte. The device identifies the message's start line and determines it as the request line, which contains three fields: method, request URI, and protocol version, separated by spaces and ending with a carriage return and line feed. Next, the device parses the message header fields, such as the source IP address, destination IP address, source port, and destination port. During the parsing process, the device identifies specific field names and corresponding values ​​based on protocol specifications, such as SIP. Finally, the device stores the parsed fields in memory for subsequent processing and analysis. This process ensures that the device accurately understands and processes the current message content. For example, through field analysis, the device extracts fields such as source IP address 20.0.0.50, destination IP address 192.168.1.100, source port 5060, and destination port 39328. This information is used for subsequent session management and processing.

[0061] Step S2032: When the current message field does not meet the protocol specification, the current message is standardized based on a preset mapping relationship table and the current message field.

[0062] It should be noted that the protocol specification may be the message format and field requirements defined in the communication protocol. The preset mapping relationship table may be a pre-set table for mapping non-standard fields to standard fields.

[0063] In a specific implementation, when a message field doesn't meet protocol specifications, the device normalizes the message based on a pre-set mapping table. For example, if a device receives a SIP message and discovers a misspelling of the "Call-ID" field, it will identify the field as "Call-ID" based on the pre-set mapping table and replace the incorrect field with the correct one. Simultaneously, the device checks other fields, such as correcting "Content-Type" to "Content-Type," to ensure that all fields comply with SIP protocol specifications.

[0064] Based on the first and second embodiments, in the third embodiment, the same or similar contents as those in the first and second embodiments can be referred to above and will not be described in detail. Figure 4 , Figure 4 This is a flow chart of a third embodiment of the traffic switching method proposed in an embodiment of the present application. Further, the step of decapsulating the current message includes: Step S21: performing type analysis on the current message to determine the message type corresponding to the current message.

[0065] It should be noted that the above-mentioned type analysis can be a detection process to determine the type of message, which is usually distinguished based on protocol, format or content. The above-mentioned message type can be a message category divided according to protocol, format or purpose, such as request message, response message, etc.

[0066] In a specific implementation, the above-mentioned device performs a type analysis on the current message to determine the message type corresponding to the current message. For example, after the device receives a message, it first checks the header field of the message, especially the protocol version number and the message type identifier. Assuming that the header field of the message shows that the protocol version number is SIP / 2.0, and the starting behavior of the message is INVITE, the device determines that the current message is a request message of the SIP protocol, specifically an INVITE request, based on this information. The device maintains a preset message type mapping table, which defines the message types corresponding to different protocols and type identifiers. By matching the field information in the message header, the device can accurately determine the type of the current message, thereby enabling the corresponding processing logic. For example, for an INVITE request, the device will trigger the session establishment process, including parsing the session identifier, media type and other information in the request, and performing corresponding resource allocation and session management operations.

[0067] Step S22: extracting header fields of the current message based on the message type to obtain header key fields corresponding to the current message.

[0068] It should be noted that the above header fields may be various fields contained in the message header, used to identify the attributes and content of the message. The above header key fields may be header fields used to identify key information in the message, such as source address, destination address, port number, etc.

[0069] In a specific implementation, the device extracts header fields from the current message based on the message type to obtain key header fields corresponding to the current message. For example, when the device determines that the current message is a SIP INVITE request, it extracts key information from the header fields according to the SIP protocol specification. The device first identifies the request line of the message and confirms that it is an INVITE method. Next, it extracts fields from the message header, such as the source IP address, destination IP address, source port, destination port, Call-ID, From identifier, To identifier, CSeq sequence number, Contact information, etc. These key fields are stored in the device's memory for subsequent session management and processing. For example, the source IP address is 20.0.0.50, the destination IP address is 192.168.1.100, the source port is 5060, and the destination port is 39328. By extracting these key header fields, the device can accurately understand and process the content of the current message, ensuring the smooth progress of the session.

[0070] Step S23: decapsulate the current message according to the header key field.

[0071] It should be noted that the above-mentioned decapsulation can be the process of stripping the protocol headers at different levels from the message and extracting the original application layer data. In a specific implementation, the above-mentioned device decapsulates the current message based on the key fields in the header. For example, the device recognizes that the source IP address of the message is 20.0.0.50, the destination IP address is 192.168.1.100, the protocol type is UDP, and the port number is 5060. Based on these key fields, the device first strips off the frame header and trailer of the physical layer and data link layer, then removes the IP header of the network layer, and then strips off the UDP header of the transport layer. Ultimately, the device successfully extracts the original application layer data, such as the SIP message content.

[0072] Furthermore, after the step of sending the key information extraction result and the generated traffic switching instruction to the backup traffic device, the method further includes: Step S40: using the primary traffic device as a new backup traffic device, and using the backup traffic device as a new primary traffic device; Step S50: When the new primary traffic device performs a session operation according to the new current message, a step of acquiring the new current message sent by the new primary traffic device is performed.

[0073] In a specific implementation, the device switches the primary traffic device to a new backup traffic device, and then switches the original backup traffic device to the new primary traffic device. When the new primary traffic device performs session operations based on the new current message, the device performs the step of obtaining the new current message. For example, after the new primary traffic device begins processing the session, it sends a new current message, such as a SIP UPDATE message. The device captures the new current message in real time via a high-speed data interface, decapsulates it, and extracts key information.

[0074] The device parses the message header and extracts key fields, such as the source IP address 20.0.0.50, the destination IP address 192.168.1.100, the source port 5060, and the destination port 39328. It also extracts detailed media information from the message, including the session ID, caller and callee identifiers, and stores this information in a cache. The device continues to monitor the status of the new primary device, ensuring that a failover can be triggered quickly if an anomaly occurs on the new primary device, maintaining session continuity.

[0075] This embodiment also provides a first embodiment of a traffic switching device, please refer to Figure 5 , Figure 5 A diagram of a traffic switching device provided in an embodiment of the present application, wherein the traffic switching device includes: A message acquisition module, configured to acquire the current message sent by the primary traffic device when the primary traffic device performs a session operation according to the current message; A message storage module, configured to decapsulate the current message, extract key information based on the decapsulated current message, and store the key information extraction result; a traffic switching module, configured to send the key information extraction result and the generated traffic switching instruction to the backup traffic device when the primary traffic device meets a preset traffic switching condition, so that the backup traffic device performs a session operation based on the key information extraction result when receiving the traffic switching instruction; The message storage module is further used to perform feature extraction on the decapsulated current message based on preset message header format rules to obtain basic feature information; determine the current protocol type based on the basic feature information, and perform feature extraction on the basic feature information based on the current protocol type to obtain functional feature information; determine the current session identifier based on the functional feature information, and perform feature extraction on the functional feature information based on the current session identifier to obtain detailed media information; use the detailed media information, the functional feature information and the basic feature information as key information extraction results, and store the key information extraction results.

[0076] With reference to the first embodiment of the traffic switching device, this embodiment also proposes a second embodiment of the traffic switching device. The same or similar contents as those of the first embodiment of the traffic switching device can be referred to the above introduction and will not be described in detail later.

[0077] The message storage module is further configured to obtain a current check code in the current message and verify the current check code based on a preset verification rule; if the verification result shows that the message is abnormal, generate a retransmission request and send the retransmission request to the primary traffic device, so that the primary traffic device retransmits the current message to the traffic switching device based on the retransmission request; if the verification result shows that the message is normal, perform standardization processing on the current message and perform a decapsulation step on the current message after standardization processing; The message storage module is further used to perform field analysis on the current message to determine the current message field; when the current message field does not meet the protocol specification, the current message is standardized based on the preset mapping relationship table and the current message field.

[0078] With reference to the first embodiment and the second embodiment of the traffic switching device, this embodiment also proposes a third embodiment of the traffic switching device. The same or similar contents as those of the first embodiment and the second embodiment of the traffic switching device can be referred to the above introduction and will not be repeated later.

[0079] The message storage module is further configured to perform type analysis on the current message to determine the message type corresponding to the current message; extract header fields of the current message based on the message type to obtain header key fields corresponding to the current message; and decapsulate the current message according to the header key fields; The traffic switching module is further configured to use the primary traffic device as a new backup traffic device and the backup traffic device as a new primary traffic device; and to execute the step of obtaining the new current message sent by the new primary traffic device when the new primary traffic device performs a session operation according to the new current message.

[0080] The traffic switching device provided in this embodiment employs the traffic switching method of the above-described embodiment to address the technical problem of reducing traffic switching latency. Compared to the prior art, the traffic switching device provided in this embodiment achieves the same beneficial effects as the traffic switching method provided in the above-described embodiment. Other technical features of the traffic switching device are the same as those disclosed in the above-described embodiment and are not further detailed here.

[0081] This embodiment provides a traffic switching device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the traffic switching method in the above-mentioned embodiment 1.

[0082] Reference below Figure 6 , Figure 6 The diagram is a schematic diagram of the structure of a traffic switching device suitable for implementing an embodiment of the present application. The traffic switching device in the embodiment of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 6 The traffic switching device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0083] like Figure 6As shown, the traffic switching device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for the operation of the traffic switching device. Processing device 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to I / O interface 1006: input devices 1007, such as a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008, such as a liquid crystal display (LCD), speaker, vibrator, etc.; storage device 1003, such as a magnetic tape or hard disk; and communication device 1009. The communication device 1009 can allow the traffic switching device to communicate with other devices wirelessly or wired to exchange data. Although the figure shows a traffic switching device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0084] In particular, according to this embodiment, the process described above with reference to the flowchart can be implemented as a computer software program. For example, this embodiment includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from the storage device 1003, or installed from the ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in this embodiment are performed.

[0085] The traffic switching device provided in this embodiment employs the traffic switching method of the above-mentioned embodiment to solve the technical problem of reducing traffic switching latency. Compared to the prior art, the traffic switching device provided in this embodiment has the same beneficial effects as the traffic switching method provided in the above-mentioned embodiment. Other technical features of this traffic switching device are the same as those disclosed in the above-mentioned embodiment and are not further described here.

[0086] It should be understood that the various parts disclosed in this embodiment can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in an appropriate manner.

[0087] The above description is merely a specific implementation of this embodiment, but the scope of protection of this embodiment is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this embodiment should be included within the scope of protection of this embodiment. Therefore, the scope of protection of this embodiment should be based on the scope of protection of the claims.

[0088] This embodiment provides a computer-readable storage medium having computer-readable program instructions (ie, computer program) stored thereon. The computer-readable program instructions are used to execute the traffic switching method in the above embodiment.

[0089] The computer-readable storage medium provided in this embodiment may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0090] The computer-readable storage medium may be included in the traffic switching device; or may exist independently without being assembled into the traffic switching device.

[0091] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the traffic switching device, the traffic switching device is enabled to perform traffic switching.

[0092] The computer program code for performing the operations of the present embodiment can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0093] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present embodiment. In this regard, each box in the flow chart or block diagram can represent a module, program segment or part of code, and the module, program segment or part of code contains one or more executable instructions for realizing the prescribed logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart, can be implemented by a dedicated hardware-based system that performs the prescribed function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0094] The modules described in this embodiment may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.

[0095] The readable storage medium provided in this embodiment is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned traffic handover method. This computer-readable storage medium can address the technical problem of reducing traffic handover latency. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this embodiment are similar to those of the traffic handover method provided in the aforementioned embodiment and are not further elaborated here.

[0096] The above descriptions are only some embodiments and do not limit the patent scope of this embodiment. All equivalent structural transformations made using the contents of the description and drawings of this application under the technical concept of this application, or direct / indirect application in other related technical fields are included in the patent protection scope of this application.

Claims

1. A traffic switching method, characterized in that: The method is applied to a traffic switching device, wherein the traffic switching device is connected to a main traffic device and a backup traffic device respectively. The method includes: When the primary traffic device performs a session operation according to the current message, obtaining the current message sent by the primary traffic device; Decapsulating the current message, extracting key information based on the decapsulated current message, and storing the key information extraction result; When the primary traffic device meets the preset traffic switching condition, the key information extraction result and the generated traffic switching instruction are sent to the backup traffic device, so that the backup traffic device performs the session operation based on the key information extraction result when receiving the traffic switching instruction.

2. The method according to claim 1, wherein The step of extracting key information based on the decapsulated current message and storing the key information extraction result includes: Extract features from the decapsulated current message based on preset message header format rules to obtain basic feature information; Determine the current protocol type according to the basic feature information, and perform feature extraction on the basic feature information according to the current protocol type to obtain functional feature information; Determining a current session identifier based on the functional feature information, and performing feature extraction on the functional feature information based on the current session identifier to obtain detailed media information; The detailed media information, the functional feature information, and the basic feature information are used as key information extraction results, and the key information extraction results are stored.

3. The method according to claim 1, wherein Before the step of decapsulating the current message, the method further includes: Obtaining a current check code in the current message, and verifying the current check code based on a preset verification rule; If the check result shows that the message is abnormal, generating a retransmission request and sending the retransmission request to the primary traffic device, so that the primary traffic device resends the current message to the traffic switching device based on the retransmission request; When the verification result shows that the message is normal, the current message is standardized and the step of decapsulating the current message is performed.

4. The method according to claim 3, wherein The step of performing standardization processing on the current message includes: Performing field analysis on the current message to determine the current message field; When the current message field does not meet the protocol specification, the current message is standardized based on a preset mapping relationship table and the current message field.

5. The method according to claim 1, wherein The step of decapsulating the current message includes: Performing type analysis on the current message to determine the message type corresponding to the current message; Extracting header fields of the current message based on the message type to obtain header key fields corresponding to the current message; Decapsulate the current message according to the header key field.

6. The method according to claim 1, wherein After the step of sending the key information extraction result and the generated traffic switching instruction to the backup traffic device, the method further includes: Using the primary traffic device as a new backup traffic device, and using the backup traffic device as a new primary traffic device; In the case where the new primary traffic device performs a session operation according to the new current message, a step of obtaining the new current message sent by the new primary traffic device is performed.

7. A traffic switching device, characterized in that: The device comprises: A message acquisition module, configured to acquire the current message sent by the primary traffic device when the primary traffic device performs a session operation according to the current message; A message storage module, configured to decapsulate the current message, extract key information based on the decapsulated current message, and store the key information extraction result; The traffic switching module is used to send the key information extraction result and the generated traffic switching instruction to the backup traffic device when the primary traffic device meets the preset traffic switching conditions, so that the backup traffic device performs the session operation based on the key information extraction result when receiving the traffic switching instruction.

8. A traffic switching device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the traffic switching method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the traffic switching method according to any one of claims 1 to 6 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the traffic switching method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Network resource pool session synchronization method and device, electronic equipment and storage medium

    CN119449820A

  • Main-standby switching method and equipment based on EPG (Electronic Program Guide) service, and computer storage medium

    CN119729025A

  • Method and apparatus for initiating and maintaining sessions between endpoints

    US20140040488A1

  • Device session maintenance method and apparatus for internet of things platform, and device and medium

    WO2024140016A1