Communication method and apparatus, related device, and storage medium
Patent Information
- Application Number
- CN202210812045.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-11
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2042-07-11
Smart Images

Figure CN116962354B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communications, and more particularly to a communication method, apparatus, related equipment, and storage medium. Background Technology
[0002] With the continuous advancement of communication technology, Session Initialization Protocol (SIP) calling services have been widely used in many fields. For example, in smart home application scenarios, audio and video communication servers based on SIP communication can now support calls from various smart home products such as smart doorbells, smart speakers, security cameras, and large TV screens.
[0003] However, in related technologies, SIP servers suffer from problems such as large data processing volume and long call setup time when processing calls. Summary of the Invention
[0004] To address the related technical problems, embodiments of this application provide a communication method, apparatus, related devices, and storage medium.
[0005] The technical solution of this application embodiment is implemented as follows:
[0006] This application provides a communication method applied to a first device, including:
[0007] Determine the routing information related to the first call initiated by the first device;
[0008] Based on the determined routing-related information and the first Session Initiation Protocol (SIP) packet associated with the first call, a second SIP packet is generated, the second SIP packet containing the first SIP packet and the routing-related information;
[0009] Send the second SIP packet.
[0010] In the above scheme, the first field of the second SIP packet carries the routing-related information. The first field is located between the packet header and the first SIP packet, and the first field is a custom field.
[0011] In the above scheme, the routing-related information includes at least:
[0012] First information, the first information being used to identify the first call;
[0013] The second information represents the call type of the first call.
[0014] In the above scheme, the routing-related information also includes third information, which represents the parameters of the first call and is used to determine the resources required by the first call.
[0015] The method in the above scheme further includes:
[0016] Based on the association between the call types that the first device can initiate and routing-related information, the routing-related information of the first call is determined.
[0017] The method in the above scheme further includes:
[0018] Send a first request to the first platform; the first request is used to request the aforementioned association relationship.
[0019] Receive the association relationship sent by the first platform based on the first request.
[0020] This application also provides a communication method applied to a second device, including:
[0021] Receive a second SIP packet sent by the first device; the second SIP packet contains routing information related to the first call and a first SIP packet associated with the first call;
[0022] Parse the second SIP packet to obtain the routing-related information and the first SIP packet;
[0023] Based on the routing-related information, the target process of the first call is determined;
[0024] The first SIP packet is forwarded to the target process for call processing.
[0025] In the above scheme, the first field of the second SIP packet carries the routing-related information. The first field is located between the packet header and the first SIP packet, and the first field is a custom field.
[0026] In the above scheme, the routing-related information includes at least:
[0027] First information, the first information being used to identify the first call;
[0028] The second information represents the call type of the first call;
[0029] Determining the target process of the first call based on the routing-related information includes:
[0030] Based on the second information, a target process cluster is determined from at least one process cluster; different process clusters in the at least one process cluster correspond to different call types;
[0031] The target process is determined from at least one process in the target process cluster.
[0032] In the above scheme, determining the target process from at least one process in the target process cluster includes:
[0033] Determine whether a process has been allocated for the first call from the target process cluster;
[0034] If a process has already been allocated for the first call from the target process cluster, the allocated process shall be used as the target process; or, if a process has not been allocated for the first call from the target process cluster, an idle process shall be selected from at least one idle process in the target process cluster as the target process.
[0035] In the above scheme, the routing-related information further includes third information, which represents the parameters of the first call and is used to determine the resources required by the first call;
[0036] Based on the third information, an idle process is selected from at least one idle process in the target process cluster as the target process.
[0037] This application also provides a communication device, including:
[0038] The first determining unit is used to determine the routing-related information of the first call initiated by the first device;
[0039] The processing unit is configured to generate a second SIP packet based on determined routing-related information and a first SIP packet associated with the first call, wherein the second SIP packet contains the first SIP packet and routing-related information.
[0040] The first sending unit is used to send the second SIP packet.
[0041] This application also provides a communication device, including:
[0042] The second receiving unit is configured to receive a second SIP packet sent by the first device; the second SIP packet contains routing-related information of the first call and a first SIP packet associated with the first call;
[0043] The parsing unit is used to parse the second SIP packet to obtain the routing-related information and the first SIP packet;
[0044] The second determining unit is used to determine the target process of the first call based on the routing-related information.
[0045] The second sending unit is used to forward the first SIP packet to the target process for call processing.
[0046] This application also provides a first device, including a first processor and a first communication interface; wherein,
[0047] The first processor is configured to determine routing-related information of a first call initiated by the first device; and generate a second SIP packet based on the determined routing-related information and a first SIP packet associated with the first call, wherein the second SIP packet contains the first SIP packet and the routing-related information.
[0048] The first communication interface is used to send the second SIP packet.
[0049] This application also provides a second device, including a second processor and a second communication interface; wherein,
[0050] The second communication interface is used to receive a second SIP packet sent by the first device; the second SIP packet contains routing information related to the first call and a first SIP packet associated with the first call; and to forward the first SIP packet to the target process for call processing;
[0051] The second processor is configured to parse the second SIP packet to obtain the routing-related information and the first SIP packet; and to determine the target process of the first call based on the routing-related information.
[0052] This application also provides a first device, including a first processor and a first memory for storing a computer program capable of running on the processor.
[0053] Wherein, when the first processor is used to run the computer program, it executes the steps of any of the methods described above on the first device side.
[0054] This application also provides a second device, including a second processor and a second memory for storing computer programs capable of running on the processor.
[0055] Wherein, when the second processor is used to run the computer program, it executes the steps of any of the methods described above on the second device side.
[0056] This application embodiment also provides a storage medium storing a computer program thereon, wherein when the computer program is executed by a processor, it implements the steps of any of the methods described above on the first device side, or implements the steps of executing any of the methods described above on the second device side.
[0057] The communication method, apparatus, related devices, and storage medium provided in this application embodiment include: a first device determining routing-related information of a first call initiated by the first device; generating a second SIP packet based on the determined routing-related information and a first SIP packet associated with the first call, the second SIP packet containing the first SIP packet and routing-related information; sending the second SIP packet; a second device receiving the second SIP packet sent by the first device; the second SIP packet containing routing-related information of the first call and a first SIP packet associated with the first call; parsing the second SIP packet to obtain the routing-related information and the first SIP packet; determining the target process of the first call based on the routing-related information; and forwarding the first SIP packet to the target process for call processing. The solution provided in this application embodiment encapsulates routing-related information and a call-related SIP packet and sends them to the SIP server, eliminating the need for the SIP server to obtain routing-related information from the service management platform, thereby reducing the interaction between the SIP server and the service management platform and reducing the data processing load of the SIP server; simultaneously, by reducing the number of interactions between the SIP server and the service management platform, the call setup time can be shortened. Attached Figure Description
[0058] Figure 1 This is a schematic flowchart of the first communication method according to an embodiment of this application;
[0059] Figure 2 This is a schematic diagram of the structure of the second SIP packet in the communication method of this application embodiment.
[0060] Figure 3 This is a schematic diagram of the structure of the first field in the communication method of this application embodiment;
[0061] Figure 4 This is a schematic diagram of the header structure in the second SIP packet of the communication method in this application embodiment;
[0062] Figure 5 This is a schematic flowchart of the second communication method according to an embodiment of this application;
[0063] Figure 6 This is a schematic flowchart of the third communication method according to an embodiment of this application;
[0064] Figure 7 This application provides a schematic diagram of the method flow for an example SIP session.
[0065] Figure 8 This is a schematic diagram of a communication device structure according to an embodiment of this application;
[0066] Figure 9 This is a schematic diagram of another communication device structure according to an embodiment of this application.
[0067] Figure 10 This is a schematic diagram of the structure of the first device according to an embodiment of this application;
[0068] Figure 11 This is a schematic diagram of the structure of the second device according to an embodiment of this application;
[0069] Figure 12 This is a schematic diagram of the communication system structure according to an embodiment of this application. Detailed Implementation
[0070] The present application will now be described in further detail with reference to the accompanying drawings and embodiments.
[0071] Due to the actual usage needs of existing users and product definitions, the routing information varies across different devices. For example, in a smart home application scenario, when a smart doorbell makes a call, both the doorbell speaker and the mobile phone simultaneously respond; when a smart TV makes a call, only the smart TV responds. A call response can be understood as the response from the called device after receiving a call initiated by the calling device, such as vibration or ringing. Therefore, when processing calls based on SIP communication, the SIP server needs to obtain the corresponding routing information based on the information of the calling and called parties, such as their phone numbers. Specifically, it first needs to parse the calling and called party information from the call-related SIP packets, and then obtain routing information from the service management platform based on the parsed information, such as call routing, video resolution, bitrate negotiation, audio sampling rate, and video encoding rules, and then process the call according to the obtained routing information.
[0072] However, in related technologies, due to the limited extended fields contained in SIP packets related to calls, they cannot carry routing information such as call routing and video resolution. Therefore, when passing through each routing node, routing information needs to be obtained from the service management platform, and different processing is performed based on the obtained information. The device's call routing acquisition and call processing are both implemented by the same process. For example, when a smart doorbell initiates a call, it needs to obtain the called number from the service management platform at the routing node; when a TV screen initiates a call, it needs to send both the calling and called numbers to the service management platform at the negotiation node to query the resolution support of both the calling and called devices. In this way, the SIP server needs to interact frequently with the service management platform. However, the interaction between servers requires initiating network requests. Therefore, frequent interactions will increase the data processing load of the SIP server, and under high concurrency of calls, network request backlog will occur, thus affecting the performance of the SIP server. At the same time, each time a network request is initiated, the service management platform needs to spend time processing the network request and querying relevant information from the database, increasing the request response time and thus increasing the call setup time.
[0073] Based on this, in various embodiments of this application, the calling device encapsulates routing-related information and call-related SIP packets and sends them to the SIP server, so that the SIP server no longer needs to obtain routing-related information from the service management platform, thereby reducing the interaction between the SIP server and the service management platform and thus reducing the amount of data processing by the SIP server; at the same time, since the number of interactions between the SIP server and the service management platform is reduced, the call setup time can be shortened.
[0074] This application provides a communication method applied to a first device, such as... Figure 1 The method includes:
[0075] Step 101: Determine the routing information for the first call initiated by the first device;
[0076] Step 102: Based on the determined routing-related information and the first SIP packet associated with the first call, generate a second SIP packet, the second SIP packet containing the first SIP packet and the routing-related information;
[0077] Step 103: Send the second SIP packet.
[0078] The first device can also be referred to as the calling device, and may specifically include a terminal device that integrates a Software Development Kit (SDK), such as a smart doorbell, smart speaker, or smart TV. This application embodiment does not limit this, as long as the functionality is implemented. The SDK provides a specific software function of the software product. In practical applications, native code encoding can be used instead of the SDK. However, using encoding requires knowledge of complex business logic such as protocol content and parameter transmission, resulting in higher complexity. Integrating software functions into the SDK provides stable and convenient functional services. The first SIP packet can also be referred to as a SIP signaling packet or a raw SIP packet. This application embodiment does not limit this; the first SIP packet can be understood as a call-related SIP packet.
[0079] The routing-related information, also known as call-related information, can be understood as information related to the call, such as call type, maximum resolution, call rules, bit rate, etc. This application embodiment does not limit this, as long as its function is implemented; the routing-related information is used for the second device to determine the process of processing the first call.
[0080] In practical applications, the corresponding routing information varies depending on the call type. Therefore, the routing information of the first call can be determined by the correlation between the call type and the routing information.
[0081] Based on this, in one embodiment, the first device can determine the routing-related information of the first call based on the association between the call type of the call that the first device can initiate and the routing-related information; specifically, the first device can determine the routing-related information of the first call through the SDK.
[0082] In practical applications, the first device needs to obtain the association relationship in order to determine the routing information related to different types of calls; specifically, the first device can obtain the association relationship from the first platform.
[0083] Based on this, in one embodiment, the method may further include:
[0084] Send a first request to the first platform; the first request is used to request the aforementioned association relationship.
[0085] Receive the association relationship sent by the first platform based on the first request.
[0086] In practical applications, the first platform can also be called a business management platform or a business platform. This application embodiment does not limit this, as long as its functions are implemented. The first platform is used for business ordering, contact management, call detail record management, billing and settlement, and routing settings, etc.
[0087] In practical applications, when initializing the SDK, the first device can initiate a first request to the first platform based on protocols such as Hypertext Transfer Security Protocol (HTTPS). The first request can carry device information of the first device, such as the device identifier or number of the first device. The first platform can parse the first request to obtain the device information, determine the association relationship based on the device information, and then send the determined association relationship to the first device.
[0088] In practical applications, the permissions of the first device vary depending on its registration status, and consequently, the types of calls that can be initiated also differ. For example, in a smart home application scenario, when a smart doorbell makes a call, if the mobile phone number bound to the smart doorbell is in an account-opened state (i.e., registered state), both the doorbell speaker and the mobile phone will respond to the call. If the mobile phone number corresponding to the smart doorbell is in an unopened state (i.e., unregistered state), only the doorbell speaker will respond to the call.
[0089] Therefore, in practical applications, after obtaining the device information, the first platform acquires the binding relationship and account opening relationship of the first device based on the device information. The binding relationship can be understood as the binding relationship between device information and a call number, such as the binding relationship between the device identifier of the first device and a mobile phone number. The account opening relationship can be understood as whether the first device has been opened for account; specifically, whether the call number bound to the first device has been registered. For example, when the mobile phone number bound to the device is bound to a landline, the device is in an opened account state. The first platform determines the call number bound to the first device based on the binding relationship and determines whether the call number bound to the first device has been opened for account based on the account opening relationship, thereby determining the call types that the first device can initiate and the corresponding routing information, that is, determining the association relationship.
[0090] In one embodiment, the routing-related information includes at least:
[0091] First information, the first information being used to identify the first call;
[0092] The second information represents the call type of the first call.
[0093] In practical applications, the call type can include any of the call types supported by the first device, that is, any of the call types that the first device can initiate; among them, different devices can initiate different call types. For example, in smart home application scenarios, the call type of a smart doorbell can include voice calls, and the call types supported by a smart TV can include voice calls and video calls.
[0094] In practical applications, in order for the SIP server to understand the resources required to process the first call, the routing-related information may also include parameter information related to the first call.
[0095] Based on this, in one embodiment, the routing-related information further includes third information, which characterizes the parameters of the first call and is used to determine the resources required by the first call.
[0096] In practical applications, the routing-related information will contain different information depending on the call type. For example, when making a voice call, the routing-related information needs to include audio-related information such as the call type and audio sampling rate, while when making a video call, the routing-related information also needs to include video-related information such as the maximum resolution. Therefore, in order to flexibly configure the routing-related information, a custom field can be defined in the second SIP packet, and this custom field can be used to carry the routing-related information.
[0097] Based on this, in one embodiment, the first field of the second SIP packet carries the routing-related information, and the first field is located between the packet header and the first SIP packet. The first field is a custom field.
[0098] In practical applications, the first field can also be called a label field, the first SIP packet can also be called a SIP raw packet, and the second SIP packet can be used... Figure 2 The structure is shown below. In this structure, different tags within the first field carry different information, namely, first information, second information, or third information. For the first information, a tag containing only a single field can be used, while for the second and third information, a group of tags containing two fields can be used. Specifically, one field in the tag group represents the corresponding information type, also known as the corresponding tag type. This can be understood as the type of different information contained in the routing-related information, such as call type, maximum resolution, etc. The other field in the tag group represents the specific content of the information, such as the specific type of call.
[0099] For example, such as Figure 3As shown, the first field may contain a call ID (CallID) and at least one tag group. The call ID contains a field that is a unique identifier for a call, i.e., the first information, which occupies four bytes. Each tag group consists of two fields: tag ID (TagID) and tag content (TagValue). Both tagID and tagValue occupy two bytes. The TagID represents the information type corresponding to the tag group. Occupying two bytes, the TagID can represent 65,535 different information types. For example, when TagID is set to 0000 0000 0000 0001, it indicates that the information corresponding to the tag group is a call type; when TagID is set to 0000 0000 0000 0002, it indicates that the information corresponding to the tag group is video resolution. Different TagValues represent the specific content of the information corresponding to the tag group. Occupying two bytes, the TagValue can represent 65,535 different information types. For example, when the information corresponding to the tag group is a call type, when TagValue is set to 0000 0000 0000 0001, it indicates that the call type is a speaker landline call; when TagValue is set to 0000 0000 0000 0002, it indicates that the call type is a speaker free call; when TagValue is set to 0000 0000... When TagValue is 0000 0003, it indicates that the call type is simultaneous vibration of the doorbell speaker and IP Multimedia Subsystem (IMS). This can be understood as the doorbell speaker ringing simultaneously with the mobile phone or landline. When TagValue is set to 0000 0000 0000 0004, it indicates that the call type is sequential vibration of the mobile application (APP) and IMS. This can be understood as the APP being called first, followed by the mobile phone or landline. When the tag group corresponds to the maximum video resolution, when TagValue is set to 0000 0000 0000 0001, it means the maximum video resolution for this call is 640×480. When TagValue is set to 0000 0000 0000 0002, it means the maximum video resolution for this call is 1280×720. When TagValue is set to 0000 0000 0000... At 0003, it means that the maximum video resolution corresponding to this call is 1920×1080, etc.
[0100] In practical applications, the tag groups contained in the first domain can be expanded according to actual usage needs, specifically determined by the configuration of the routing-related information. For example, they can also carry information such as encoding type and audio sampling rate. This application embodiment does not limit this.
[0101] In practical applications, the header of the second SIP packet can carry the length information of the first field and the length information of the first SIP packet in the second field.
[0102] For example, such as Figure 4 As shown, the packet header specifically includes three fields: Magic Head, Expand Size, and SIP Size, occupying a total of five bytes. The Magic Head, also known as the magic byte, is used to locate the start of the SIP packet and occupies one byte; Expand Size indicates the length of the first field and occupies two bytes; and SIP Size indicates the length of the first SIP packet and occupies two bytes.
[0103] In this embodiment, the calling device encapsulates routing-related information and call-related SIP packets and sends them to the SIP server. At this time, the SIP server no longer needs to obtain routing-related information from the service management platform, thereby reducing the number of interactions between the SIP server and the service management platform and reducing the data processing load of the SIP server. At the same time, since the number of interactions between the SIP server and the service management platform is reduced, the call setup time can be shortened.
[0104] Accordingly, embodiments of this application also provide a communication method applied to a second device, such as... Figure 5 As shown, the method includes:
[0105] Step 501: Receive a second SIP packet sent by the first device; the second SIP packet contains routing information related to the first call and a first SIP packet associated with the first call;
[0106] Step 502: Parse the second SIP packet to obtain the routing-related information and the first SIP packet;
[0107] Step 503: Based on the routing-related information, determine the target process of the first call;
[0108] Step 504: Forward the first SIP packet to the target process for call processing.
[0109] In practical applications, the second device can also be called a SIP server or a proxy server. This application embodiment does not limit this, as long as its function is implemented.
[0110] In one embodiment, the routing-related information may include at least:
[0111] First information, the first information being used to identify the first call;
[0112] The second information represents the call type of the first call.
[0113] As mentioned earlier, the device's call routing and call processing are both implemented by the same process. When a new call type is added, it needs to be modified in the existing process, which may interfere with other types of calls.
[0114] Based on this, in one embodiment, determining the target process of the first call based on the routing-related information may include:
[0115] Based on the second information in the routing-related information, the target process cluster is determined from at least one process cluster; different process clusters correspond to different call types;
[0116] The target process is determined from at least one process in the target process cluster.
[0117] In this embodiment, the process is divided into different process clusters according to the call type, that is, the process is modularized. So when a new call type is added, only the corresponding process cluster needs to be added, without changing the original process cluster, thereby increasing the stability of the second device. At the same time, different calls run in separate processes, which can avoid mutual interference between different processes.
[0118] In practical applications, the first call may be a call that has been initiated before. That is, the second device has already allocated a process for the first call from the target cluster. When the second device has already allocated a process for the first call from the target cluster, the first SIP packet can be directly forwarded to that process. However, when the second device has not allocated a process for the first call from the target cluster, an idle process needs to be selected for the corresponding call processing.
[0119] Based on this, in one embodiment, the method may further include:
[0120] Determine whether a process has been allocated for the first call from the target process cluster;
[0121] If a process has already been allocated for the first call from the target process cluster, the allocated process shall be used as the target process; or, if a process has not been allocated for the first call from the target process cluster, an idle process shall be selected from at least one idle process in the target process cluster as the target process.
[0122] In practical applications, the association between allocated processes and calls can be stored in a cache cluster, such as a Redis cluster. When determining whether to allocate a process for the first call from the target process cluster, the cache cluster is queried to see if a process has already been allocated for the first call. That is, the call associated with the allocated process is queried to see if it contains the identifier information of the first call, i.e., the first information. If it has been allocated, it means that the first call is not the first call, and the second device directly forwards the first SIP packet to the process allocated for the first call. If it has not been allocated, it means that the first call is the first command, and the second device selects an idle process from at least one idle process in the target process cluster as the target process and forwards the first SIP packet to it.
[0123] In practical applications, the resources required to process a call vary depending on the call parameters. For example, when initiating a video call, to ensure the quality of the video call, a server with corresponding processing capabilities needs to be selected based on the maximum resolution of the video call to perform the call processing. Therefore, in order for the second device to understand the resources required to process the first call, the routing-related information may also include parameter information related to the first call.
[0124] Based on this, in one embodiment, the routing-related information further includes third information, which characterizes the parameters of the first call and is used to determine the resources required by the first call;
[0125] Based on the third information, the target process is determined from at least one process in the target process cluster.
[0126] In practical applications, the third information is used to determine the resources required for the first call, which can be understood as selecting a server with corresponding processing capabilities. For example, when the third information includes the maximum video resolution, the second device determines the resources needed to process this call based on the third information, thereby selecting a server with corresponding processing capabilities and bandwidth resources, and determining the target process from the idle processes corresponding to the selected server.
[0127] In this embodiment, since the SIP server no longer needs to obtain routing-related information from the service management platform, the number of interactions between the SIP server and the service management platform can be reduced, thus reducing the data processing volume of the SIP server. At the same time, by reducing the number of interactions between the SIP server and the service management platform, the call setup time can be shortened.
[0128] Meanwhile, by modularizing the processing process, different types of processing processes are made independent of each other, thus avoiding the impact of modifying one processing process on other types of processing processes, thereby improving the system stability of the SIP server; by running different types of calls in separate processes, interference between different processes can be avoided.
[0129] At the same time, by including call parameters in the routing information, the SIP server can determine the resources needed to process the corresponding call, so that the server with the corresponding capability can perform the corresponding processing, thereby ensuring call quality.
[0130] This application also provides a communication method, such as... Figure 6 As shown, the method includes:
[0131] Step 601: The first device determines the routing information related to the first call initiated by the first device;
[0132] Step 602: Based on the determined routing-related information and the first SIP packet associated with the first call, generate a second SIP packet, wherein the second SIP packet contains the first SIP packet and the routing-related information;
[0133] Step 603: Send the second SIP packet;
[0134] Step 604: The second device receives the second SIP packet sent by the first device;
[0135] Step 605: Parse the second SIP packet to obtain the routing-related information and the first SIP packet;
[0136] Step 606: Based on the routing-related information, determine the target process of the first call;
[0137] Step 607: Forward the first SIP packet to the target process for call processing.
[0138] It should be noted that the specific processing procedures of the first and second devices have been detailed above and will not be repeated here.
[0139] The communication method provided in this application embodiment includes: a first device determining routing-related information of a first call initiated by the first device; generating a second SIP packet based on the determined routing-related information and a first SIP packet associated with the first call, the second SIP packet containing the first SIP packet and routing-related information; sending the second SIP packet; a second device receiving the second SIP packet sent by the first device; the second SIP packet containing routing-related information of the first call and a first SIP packet associated with the first call; parsing the second SIP packet to obtain the routing-related information and the first SIP packet; determining the target process of the first call based on the routing-related information; and forwarding the first SIP packet to the target process for call processing. The solution provided in this application embodiment encapsulates routing-related information and call-related SIP packets and sends them to the SIP server, eliminating the need for the SIP server to obtain routing-related information from the service management platform, thereby reducing the interaction between the SIP server and the service management platform and reducing the data processing load of the SIP server; simultaneously, by reducing the number of interactions between the SIP server and the service management platform, the call setup time can be shortened.
[0140] The following section provides a more detailed description of this application with reference to application examples.
[0141] Figure 7 This is a schematic diagram of the method flow for a sample SIP session in this application, as shown below. Figure 7 As shown, the method includes:
[0142] Step 1: The calling device obtains routing-related information from the service management platform via the SDK;
[0143] Here, the routing-related information obtained by the calling device includes the call ID, call type, and maximum resolution.
[0144] Specifically, when obtaining routing-related information, the calling device integrating the SDK function sends a request to the service management platform during initialization. The request carries the calling device's device number, such as a device ID. The service management platform obtains the device's binding relationship and account opening relationship based on the device number, and determines the binding information and account opening information based on the device number and account opening relationship. Based on the determined binding information and account opening information, it determines the call types that the calling device can initiate, and returns the determined call types and the entry address of the signaling distribution cluster to the calling device, i.e., sends a first request to the first platform. The first request is used to request the association relationship, and the platform receives the association relationship sent by the first platform based on the first request.
[0145] Here, the binding relationship represents the binding relationship between a mobile phone number and a device number, and the mobile phone that can receive calls is determined based on the binding relationship; the account opening relationship represents the binding relationship between a mobile phone number and a landline, and the account opening relationship determines whether the bound mobile phone has been opened, and the routing information of the call is determined based on the determined account opening information. For example, when applied to a smart doorbell calling scenario, if the mobile phone bound to the smart doorbell has been opened, the doorbell speaker and the mobile phone will vibrate together; if the mobile phone bound to the smart doorbell has not been opened, the doorbell speaker and the terminal where the APP used for SIP calls is located will vibrate together.
[0146] Step 2: The calling device encapsulates the obtained routing-related information and the original SIP packet into a new signaling packet through the SDK, and sends the encapsulated new signaling packet to the SIP server. That is, based on the determined routing-related information and the first SIP packet associated with the first call, a second SIP packet is generated. The second SIP packet contains the first SIP packet and the routing-related information, and is used to send the second SIP packet.
[0147] Here, when encapsulating new signaling packets, a custom tag field, also known as the first field, can be added between the packet header and the original SIP packet, such as... Figure 2 As shown. The header is used to carry the label field and the length information of the original SIP packet, specifically, as follows: Figure 4 As shown, the packet header includes three fields: Magic Head, Expand Size, and SIP Size. The Magic Head is used to locate the starting point of the SIP packet, Expand Size indicates the length of the label field, and SIP Size indicates the length of the raw SIP packet. The label field carries routing-related information, specifically, as shown... Figure 3 As shown, the tag field can contain CallID and at least one tag group. CallID contains a field that is a unique identifier for a call, i.e., the first information. Each tag group consists of two fields: TagID and TagValue. TagID represents the information type corresponding to the tag group, and TagValue represents the specific content of the information corresponding to the tag group.
[0148] In this application example, the call type initiated by the calling device is a video call, and the tag field contains identification information, call type, and maximum video resolution. After the calling device completes the encapsulation, it can send the encapsulated signaling packet to the corresponding SIP server according to the entry address of the obtained signaling distribution cluster.
[0149] Step 3: The SIP server receives the new signaling packet and parses it to obtain the original SIP packet and the routing-related information, and determines the target process based on the routing-related information;
[0150] Here, the SIP server calls a distribution process in the signaling distribution cluster to receive the new signaling packet. After parsing the new signaling packet, it obtains the SIP raw packet, call ID, call type, and maximum resolution. Based on the call ID, it determines whether this call command is the first call of the first call. Specifically, it queries the association between the allocated processes and calls stored in the Redis cluster to determine whether the call has been allocated a process. If a process has been allocated, it obtains the routing information of the allocated process from the Redis cluster and forwards the SIP raw packet to this allocated process. If no process has been allocated, it indicates that this call is not the first call. In this case, an idle process needs to be selected for call processing. That is, if a process has been allocated for the first call from the target process cluster, the allocated process is used as the target process; or, if a process has not been allocated for the first call from the target process cluster, an idle process is selected from at least one idle process in the target process cluster as the target process.
[0151] Here, the processes used to handle calls are divided into multiple process clusters according to the call type, such as a doorbell call processing process cluster and a doorbell call processing process cluster. All processes in each process cluster have the same routing information. When an idle process is selected for call processing, the process cluster where the process to be forwarded is located is first determined according to the call type. Then, the resources required to process this call are determined according to the maximum resolution. Thus, a server with corresponding processing capabilities is selected from at least one server deployed in the process cluster, and a process is selected as the target process from the idle processes corresponding to the selected server.
[0152] Step 4: Forward the raw SIP packet to the target process.
[0153] After forwarding the raw SIP packet to the target process, subsequent call processing can proceed.
[0154] The solution provided in this application example firstly reduces the number of interactions between the SIP server and the service management platform. Secondly, the acquisition and selection of the call flow are completed on the calling device, eliminating the need for the SIP server to parse the raw SIP packets before retrieving call information from the service platform. This reduces the data processing pressure on the SIP server and shortens the call setup time.
[0155] Secondly, by dividing the process into different process clusters according to different call types and running each type of call in a separate process, different types of processes will not interfere with each other. Therefore, when adding a new call type, only the process cluster corresponding to the call type needs to be added, without modifying the existing processes, thereby increasing the stability of the SIP server.
[0156] Third, the SIP server can determine the resources needed to process the call based on the parameters in the label field, thereby enabling resource pre-allocation, that is, allocating servers and bandwidth resources with corresponding processing capabilities to ensure the quality of the SIP session.
[0157] Fourth, the tag types within the tag field can be flexibly expanded according to the needs of the project.
[0158] To implement the method on the first device side of this application, embodiments of this application also provide a communication device, disposed on the first device, such as... Figure 8 As shown, the device includes:
[0159] The first determining unit 801 is used to determine the routing-related information of the first call initiated by the first device;
[0160] Processing unit 802 is configured to generate a second SIP packet based on determined routing-related information and a first SIP packet associated with the first call, wherein the second SIP packet contains the first SIP packet and routing-related information.
[0161] The first sending unit 803 is used to send the second SIP packet.
[0162] In one embodiment, the first field of the second SIP packet carries the routing-related information. The first field is located between the packet header and the first SIP packet, and the first field is a custom field.
[0163] In one embodiment, the routing-related information includes at least:
[0164] First information, the first information being used to identify the first call;
[0165] The second information represents the call type of the first call.
[0166] In one embodiment, the routing-related information further includes third information, which characterizes the parameters of the first call and is used to determine the resources required by the first call.
[0167] In one embodiment, the first determining unit 801 is specifically used for:
[0168] Based on the association between the call types that the first device can initiate and routing-related information, the routing-related information of the first call is determined.
[0169] In one embodiment, the first transmitting unit 803 is further configured to:
[0170] Send a first request to the first platform; the first request is used to request the aforementioned association relationship.
[0171] Receive the association relationship sent by the first platform based on the first request.
[0172] In practical applications, the first determining unit 801 and the processing unit 802 can be implemented by a processor in the communication device, and the first sending unit 803 can be implemented by a communication interface in the communication device.
[0173] To implement the method on the second device side of this application, embodiments of this application also provide a communication device, such as... Figure 9 As shown, the device includes:
[0174] The second receiving unit 901 is configured to receive a second SIP packet sent by the first device; the second SIP packet contains routing-related information of the first call and a first SIP packet associated with the first call;
[0175] Parsing unit 902 is used to parse the second SIP packet to obtain the routing-related information and the first SIP packet;
[0176] The second determining unit 903 is used to determine the target process of the first call based on the routing-related information.
[0177] The second sending unit 904 is used to forward the first SIP packet to the target process for call processing.
[0178] In one embodiment, the first field of the second SIP packet carries the routing-related information. The first field is located between the packet header and the first SIP packet, and the first field is a custom field.
[0179] In one embodiment, the routing-related information includes at least:
[0180] First information, the first information being used to identify the first call;
[0181] The second information represents the call type of the first call;
[0182] The second determining unit 903 is specifically used for:
[0183] Based on the second information in the routing-related information, the target process cluster is determined from at least one process cluster; different process clusters correspond to different call types;
[0184] The target process is determined from at least one process in the target process cluster.
[0185] In one embodiment, the second determining unit 903 is further configured to:
[0186] Determine whether a process has been allocated for the first call from the target process cluster;
[0187] If a process has already been allocated for the first call from the target process cluster, the allocated process shall be used as the target process; or, if a process has not been allocated for the first call from the target process cluster, an idle process shall be selected from at least one idle process in the target process cluster as the target process.
[0188] In one embodiment, the routing-related information further includes third information, which characterizes the parameters of the first call and is used to determine the resources required by the first call;
[0189] The second determining unit 903 is used to select an idle process as the target process from at least one idle process in the target process cluster based on the third information.
[0190] In practical applications, the parsing unit 902 and the second determining unit 903 can be implemented by a processor in the communication device, and the second receiving unit 901 and the second sending unit 904 can be implemented by a communication interface in the communication device.
[0191] It should be noted that the communication device provided in the above embodiments is only illustrated by the division of the above program modules. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the communication device and communication method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0192] Based on the hardware implementation of the above program modules, and in order to implement the method on the first device side of the embodiments of this application, the embodiments of this application also provide a first device, such as... Figure 10 As shown, the first device 1000 includes:
[0193] The first communication interface 1001 is capable of exchanging information with the second device and the first platform, such as sending the second SIP packet and sending a first request to the first platform;
[0194] The first processor 1002 is connected to the first communication interface 1001 to enable information interaction with the second device and to execute the methods provided by one or more technical solutions on the first device side when running a computer program.
[0195] The computer program is stored in the first memory 1003.
[0196] Specifically, the first processor 1002 is configured to determine routing-related information of a first call initiated by the first device; and generate a second SIP packet based on the determined routing-related information and a first SIP packet associated with the first call, wherein the second SIP packet contains the first SIP packet and the routing-related information.
[0197] The first communication interface 1001 is used to send the second SIP packet.
[0198] In one embodiment, the first field of the second SIP packet carries the routing-related information. The first field is located between the packet header and the first SIP packet, and the first field is a custom field.
[0199] In one embodiment, the routing-related information includes at least:
[0200] First information, the first information being used to identify the first call;
[0201] The second information represents the call type of the first call.
[0202] In one embodiment, the routing-related information further includes third information, which characterizes the parameters of the first call and is used to determine the resources required by the first call.
[0203] In one embodiment, the first processor 1002 is specifically used for:
[0204] Based on the association between the call types that the first device can initiate and routing-related information, the routing-related information of the first call is determined.
[0205] In one embodiment, the first communication interface 1001 is further configured to:
[0206] Send a first request to the first platform; the first request is used to request the aforementioned association relationship.
[0207] Receive the association relationship sent by the first platform based on the first request.
[0208] It should be noted that the specific processing procedures of the first processor 1002 and the first communication interface 1001 can be understood by referring to the above method.
[0209] Of course, in practical applications, the various components in the first device 1000 are coupled together through the bus system 1004. It can be understood that the bus system 1004 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1004 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in... Figure 10The general labeled all buses as Bus System 1004.
[0210] The first memory 1003 in this embodiment is used to store various types of data to support the operation of the first device 1000. Examples of such data include any computer program used to operate on the first device 1000.
[0211] The methods disclosed in the embodiments of this application can be applied to the first processor 1002, or implemented by the first processor 1002. The first processor 1002 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware or by instructions in the form of software in the first processor 1002. The first processor 1002 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The first processor 1002 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in the first memory 1003. The first processor 1002 reads the information in the first memory 1003 and completes the steps of the aforementioned method in combination with its hardware.
[0212] In an exemplary embodiment, the first device 1000 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the aforementioned method.
[0213] Based on the hardware implementation of the above program modules, and in order to implement the method on the second device side of the embodiments of this application, the embodiments of this application also provide a second device, such as... Figure 11As shown, the second device 1100 includes:
[0214] The second communication interface 1101 is capable of exchanging information with the first device, such as receiving the second SIP packet sent by the first device;
[0215] The second processor 1102 is connected to the second communication interface 1101 to enable information interaction with the first device and to execute the methods provided by one or more technical solutions on the second device side when running a computer program.
[0216] The second memory 1103, wherein the computer program is stored in the first memory.
[0217] Specifically, the second communication interface 1101 is used to receive a second SIP packet sent by the first device; the second SIP packet contains routing-related information of the first call and a first SIP packet associated with the first call; and to forward the first SIP packet to the target process for call processing;
[0218] The second processor 1102 is used to parse the second SIP packet to obtain the routing-related information and the first SIP packet; and to determine the target process of the first call based on the routing-related information.
[0219] In one embodiment, the first field of the second SIP packet carries the routing-related information. The first field is located between the packet header and the first SIP packet, and the first field is a custom field.
[0220] In one embodiment, the routing-related information includes at least:
[0221] First information, the first information being used to identify the first call;
[0222] The second information represents the call type of the first call;
[0223] The second processor 1102 is specifically used for:
[0224] Based on the second information in the routing-related information, the target process cluster is determined from at least one process cluster; different process clusters correspond to different call types;
[0225] The target process is determined from at least one process in the target process cluster.
[0226] In one embodiment, the second processor 1102 is further configured to:
[0227] Determine whether a process has been allocated for the first call from the target process cluster;
[0228] If a process has already been allocated for the first call from the target process cluster, the allocated process shall be used as the target process; or, if a process has not been allocated for the first call from the target process cluster, an idle process shall be selected from at least one idle process in the target process cluster as the target process.
[0229] In one embodiment, the routing-related information further includes third information, which characterizes the parameters of the first call and is used to determine the resources required by the first call;
[0230] The second processor 1102 is configured to select an idle process as the target process from at least one idle process in the target process cluster based on the third information.
[0231] Of course, in practical applications, the various components in the second device 1100 are coupled together via the bus system 1104. It can be understood that the bus system 1104 is used to implement communication between these components. In addition to a data bus, the bus system 1104 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 11 The general designated all buses as Bus System 1104.
[0232] The second memory 1103 in this embodiment is used to store various types of data to support the operation of the second device 1100. Examples of such data include any computer program used to operate on the second device 1100.
[0233] The methods disclosed in the above embodiments of this application can be applied to the second processor 1102, or implemented by the second processor 1102. The second processor 1102 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware or by instructions in the form of software in the second processor 1102. The second processor 1102 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The second processor 1102 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware decoding processor, or being executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, which is located in the second memory 1103. The second processor 1102 reads the information in the second memory 1103 and completes the steps of the aforementioned method in conjunction with its hardware.
[0234] In an exemplary embodiment, the second device 1100 may be implemented by one or more ASICs, DSPs, PLDs, CPLDs, FPGAs, general-purpose processors, controllers, MCUs, microprocessors, or other electronic components to perform the aforementioned method.
[0235] It is understood that the memories (first memory 1003, second memory 1103) in the embodiments of this application can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memories described in the embodiments of this application are intended to include, but are not limited to, these and any other suitable types of memories.
[0236] To implement the methods of the embodiments of this application, the embodiments of this application also provide a communication system, such as... Figure 12 As shown, the system includes: a first device 1201 and a second device 1202.
[0237] It should be noted that the specific processing procedures of the first device 1201 and the second device 1202 have been described in detail above and will not be repeated here.
[0238] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a first memory 1003 storing a computer program, which can be executed by a first processor 1002 of a first device 1000 to complete the steps described in the aforementioned first device-side method. Another example is a second memory 1103 storing a computer program, which can be executed by a second processor 1102 of a second device 1100 to complete the steps described in the aforementioned network device-side method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.
[0239] It should be noted that terms such as "first" and "second" are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0240] Furthermore, the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.
[0241] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application.
Claims
1. A communication method, characterized in that, Applied to the first device, including: Determine the routing information related to the first call initiated by the first device; Based on the determined routing-related information and the first Session Initiation Protocol (SIP) packet associated with the first call, a second SIP packet is generated. The second SIP packet contains the first SIP packet and the routing-related information. The first field of the second SIP packet carries the routing-related information. The first field is located between the packet header and the first SIP packet. The first field is a custom field. The first SIP packet represents a raw SIP packet. Send the second SIP packet.
2. The method according to claim 1, characterized in that, The routing-related information includes at least: First information, the first information being used to identify the first call; The second information represents the call type of the first call.
3. The method according to claim 2, characterized in that, The routing-related information also includes third information, which represents the parameters of the first call and is used to determine the resources required by the first call.
4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Based on the association between the call types that the first device can initiate and routing-related information, the routing-related information of the first call is determined.
5. The method according to claim 4, characterized in that, The method further includes: Send a first request to the first platform; the first request is used to request the aforementioned association relationship. Receive the association relationship sent by the first platform based on the first request.
6. A communication method, characterized in that, Applied to a second device, including: Receive a second SIP packet sent by a first device; the second SIP packet contains routing information related to the first call and a first SIP packet associated with the first call; a first field of the second SIP packet carries the routing information, the first field is located between the packet header and the first SIP packet, and the first field is a custom field; the first SIP packet represents a raw SIP packet; Parse the second SIP packet to obtain the routing-related information and the first SIP packet; Based on the routing-related information, the target process of the first call is determined; The first SIP packet is forwarded to the target process for call processing.
7. The method according to claim 6, characterized in that, The routing-related information includes at least: First information, the first information being used to identify the first call; The second information represents the call type of the first call; Determining the target process of the first call based on the routing-related information includes: Based on the second information, a target process cluster is determined from at least one process cluster; different process clusters in the at least one process cluster correspond to different call types. The target process is determined from at least one process in the target process cluster.
8. The method according to claim 7, characterized in that, Determining the target process from at least one process in the target process cluster includes: Determine whether a process has been allocated for the first call from the target process cluster; If a process has already been allocated for the first call from the target process cluster, the allocated process shall be used as the target process; or, if a process has not been allocated for the first call from the target process cluster, an idle process shall be selected from at least one idle process in the target process cluster as the target process.
9. The method according to claim 8, characterized in that, The routing-related information also includes third information, which represents the parameters of the first call and is used to determine the resources required by the first call; Based on the third information, an idle process is selected from at least one idle process in the target process cluster as the target process.
10. A communication device, characterized in that, include: The first determining unit is used to determine the routing-related information of the first call initiated by the first device; The processing unit is configured to generate a second SIP packet based on determined routing-related information and a first SIP packet associated with the first call, wherein the second SIP packet contains the first SIP packet and routing-related information. The first field of the second SIP packet carries the routing-related information. The first field is located between the packet header and the first SIP packet, and the first field is a custom field. The first SIP packet represents a raw SIP packet. The first sending unit is used to send the second SIP packet.
11. A communication device, characterized in that, include: The second receiving unit is used to receive the second SIP packet sent by the first device; The second SIP packet contains routing information related to the first call and a first SIP packet associated with the first call; The first field of the second SIP packet carries the routing-related information. The first field is located between the packet header and the first SIP packet, and the first field is a custom field. The first SIP packet represents the original SIP packet; The parsing unit is used to parse the second SIP packet to obtain the routing-related information and the first SIP packet; The second determining unit is used to determine the target process of the first call based on the routing-related information. The second sending unit is used to forward the first SIP packet to the target process for call processing.
12. A first device, characterized in that, Includes a first processor and a first communication interface; wherein, The first processor is configured to determine routing-related information of a first call initiated by the first device; based on the determined routing-related information and a first SIP packet associated with the first call, generate a second SIP packet, the second SIP packet containing the first SIP packet and the routing-related information; a first field of the second SIP packet carries the routing-related information, the first field being located between the packet header and the first SIP packet, and the first field being a user-defined field; the first SIP packet represents a raw SIP packet. The first communication interface is used to send the second SIP packet.
13. A second device, characterized in that, Includes a second processor and a second communication interface; wherein, The second communication interface is used to receive a second SIP packet sent by the first device; the second SIP packet contains routing information related to the first call and a first SIP packet associated with the first call; and to forward the first SIP packet to a target process for call processing; the first field of the second SIP packet carries the routing information, the first field is located between the packet header and the first SIP packet, and the first field is a custom field; the first SIP packet represents a raw SIP packet; The second processor is configured to parse the second SIP packet to obtain the routing-related information and the first SIP packet; and to determine the target process of the first call based on the routing-related information.
14. A first device, characterized in that, It includes a first processor and a first memory for storing computer programs that can run on the processor. Wherein, when the first processor is used to run the computer program, it performs the steps of the method according to any one of claims 1 to 5.
15. A second device, characterized in that, Includes a second processor and a second memory for storing computer programs that can run on the processor. Wherein, when the second processor is used to run the computer program, it performs the steps of the method according to any one of claims 6 to 9.
16. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5, or implements the steps of the method according to any one of claims 6 to 9.
Citation Information
Patent Citations
System device and method for realizing special calling class service
CN101022483A
Routing method of call service and network edge computing platform
CN112910823A
