Method and device for implementing intercom service, and intercom service system

By starting a single port on the server to receive and parse data packets, establishing a communication channel, and using UDP sockets and thread pools to transmit data, the problem of increased network ports caused by multiple groups of intercom services is solved, and network resources are saved and intercom services are efficiently transmitted.

CN115811510BActive Publication Date: 2025-09-16CHINA TELECOM CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211521123.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-30
Publication Date
2025-09-16
Estimated Expiration
2042-11-30

AI Technical Summary

Technical Problem

In the related art, since multiple groups of intercom services are initiated simultaneously, the number of network ports exposed to the external network increases, wasting network resources.

Method used

A service port is started on the server side, data packets from multiple clients are received through the port, network addresses and ports are resolved, a communication channel is established, and data packets are transmitted through the communication channel, and the intercom service is implemented using UDP sockets and thread pools.

Benefits of technology

Receiving intercom media data through a single network port reduces the number of network ports exposed to the external network, saves network port resources, and realizes efficient transmission of intercom services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115811510B_ABST
    Figure CN115811510B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for implementing an intercom service, as well as an intercom service system. The method comprises: starting a server port on the server side, and receiving multiple data packets sent by multiple clients through the server port; parsing the multiple data packets to obtain the network addresses of the multiple clients and the multiple client ports that send the multiple data packets; establishing a communication channel based on the network address, wherein the communication channel is used to transmit data between the server port and the multiple client ports; and transmitting data packets for implementing the intercom service between the multiple clients based on the communication channel. The present application solves the technical problem of an increase in the number of network ports exposed to the external network due to the related art providing multiple network ports for multiple groups of intercom services initiated simultaneously.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of audio and video communication technology, and in particular to a method and device for implementing an intercom service, and an intercom service system. Background Art

[0002] In the related art, the intercom is initiated by the application of the client terminal. After the intercom signaling interaction is completed, the intercom server generates a communication port specifically for sending and receiving media data with the client terminal. Therefore, in the related art, each application and service has a dedicated port for sending and receiving data, which is used to directly forward the intercom data to other applications after the intercom service receives it. If multiple intercom groups initiate services at the same time, the used network ports will increase exponentially, resulting in an increase in the number of network ports exposed to the external network and a waste of network port resources.

[0003] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention

[0004] The embodiments of the present application provide a method and device for implementing an intercom service, and an intercom service system, so as to at least solve the technical problem of an increase in the number of network ports exposed to the external network due to the related technology providing multiple network ports for multiple groups of intercom services initiated simultaneously.

[0005] According to one aspect of an embodiment of the present application, a method for implementing an intercom service is provided, comprising: starting a server port on a server, and receiving multiple data packets sent by multiple clients through the server port; parsing the multiple data packets to obtain network addresses of the multiple clients and multiple client ports that send the multiple data packets; establishing a communication channel based on the network address, wherein the communication channel is used to transmit data between the server port and the multiple client ports; and transmitting data packets for implementing the intercom service between the multiple clients based on the communication channel.

[0006] Optionally, establishing a communication channel based on the network address includes: determining the client corresponding to the network address and determining the client port through which the client sends data packets; determining a socket based on the network address and the client port; and reversely connecting the client port based on the socket to establish a communication channel between the server port and the client port.

[0007] Optionally, the socket is a UDP socket.

[0008] Optionally, according to the communication channel, data packets for implementing intercom services are transmitted between multiple clients, including: parsing the transmission protocol of the transmitted data packet to obtain a protocol header, wherein the protocol header includes: a synchronization source identifier; determining a target user identifier and multiple group user identifiers based on the synchronization source identifier, wherein the target user identifier is used to indicate one of the multiple clients that send the data packet, and the group user identifier is used to indicate the multiple clients that receive the target data packet, and the target data packet is sent by the client indicated by the target user identifier; starting a thread pool, and forwarding the data packet to the client indicated by the group user identifier through the thread pool.

[0009] Optionally, the synchronization source identifier is further used to identify a target data stream, wherein the target data stream is composed of data packets sent by a client indicated by the target user identifier.

[0010] Optionally, after establishing a communication channel according to the network address, the method for implementing the intercom service further includes: monitoring the communication channel; if a data packet is detected in the communication channel, determining that the client has initiated the intercom service; if no data packet is detected in the communication channel, determining that the client has not initiated the intercom service.

[0011] According to another aspect of an embodiment of the present application, an intercom service system is also provided, which includes: a client and a server, the client including multiple client ports for sending data packets to the server; the server is used to execute the above-mentioned implementation method of the intercom service.

[0012] According to another aspect of an embodiment of the present application, a device for implementing an intercom service is also provided, which includes: a startup module, which is used to start a server port on the server side and receive multiple data packets sent by multiple clients through the server port; a parsing module, which is used to parse multiple data packets to obtain network addresses of multiple clients and multiple client ports for sending multiple data packets; a creation module, which is used to establish a communication channel according to the network address, wherein the communication channel is used to transmit data between the server port and multiple client ports; and a transmission module, which is used to transmit data packets for implementing the intercom service between multiple clients according to the communication channel.

[0013] According to another aspect of an embodiment of the present application, a non-volatile storage medium is provided, in which a program is stored. When the program is running, the device where the non-volatile storage medium is located is controlled to execute the above-mentioned method for implementing the intercom service.

[0014] According to another aspect of an embodiment of the present application, an electronic device is provided, including: a memory and a processor, wherein the processor is configured to run a program stored in the memory, wherein the program executes the above-mentioned method for implementing the intercom service when running.

[0015] In an embodiment of the present application, a server port is started on the server side, and multiple data packets sent by multiple clients are received through the server port; the multiple data packets are parsed to obtain the network addresses of the multiple clients and the multiple client ports for sending the multiple data packets; a communication channel is established according to the network address, wherein the communication channel is used to transmit data between the server port and the multiple client ports; according to the communication channel, data packets for implementing intercom services are transmitted between the multiple clients, thereby achieving the purpose of significantly reducing the number of external network ports by using a single network port to receive intercom media data, thereby achieving the technical effect of reducing the number of network ports exposed to the external network and saving network port resources, thereby solving the technical problem of an increase in the number of network ports exposed to the external network caused by the related technology providing multiple network ports for multiple groups of intercom services initiated simultaneously. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0017] Figure 1 is a schematic diagram of a communication system according to the related art;

[0018] Figure 2 This is a flow chart of a method for implementing an intercom service according to an embodiment of the present application;

[0019] Figure 3 is a header structure diagram of a real-time transport protocol according to an embodiment of the present application;

[0020] Figure 4 is a schematic diagram of an intercom service system according to an embodiment of the present application;

[0021] Figure 5 This is a structural diagram of a device for implementing an intercom service according to an embodiment of the present application;

[0022] Figure 6 This is a flow chart of an intercom service according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:

[0026] Socket: An abstract endpoint for two-way communication between application processes on different hosts in a network. A socket is one end of process communication on the network.

[0027] Thread pool: A form of multithreaded processing that adds tasks to a queue during processing and then automatically starts these tasks after creating threads.

[0028] In the related art, the number of data ports generated by the intercom service is equal to the number of members in a group. Therefore, there is a problem of exposing a large number of network ports to the external network, wasting network resources. To solve this problem, the embodiments of the present application provide a relevant solution, which is described in detail below.

[0029] According to an embodiment of the present application, a method embodiment of a method for implementing an intercom service is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0030] The technical solutions of the embodiments of the present application can be applied to various communication systems, such as: Global System of Mobile communication (GSM) system, Code Division Multiple Access (CDMA) system, Wideband Code Division Multiple Access (WCDMA) system, General Packet Radio Service (GPRS), Long Term Evolution (LTE) system, LTE Frequency Division Duplex (FDD) system, LTE Time Division Duplex (TDD), Universal Mobile Telecommunication System (UMTS), Worldwide Interoperability for Microwave Access (WiMAX) communication system or 5G system, etc.

[0031] For example, the communication system 100 used in the embodiment of the present application is as follows: Figure 1 As shown. The communication system 100 may include a network device 110, which may be a device that communicates with a terminal device 120 (or referred to as a communication terminal, terminal). The network device 110 may provide communication coverage for a specific geographical area and may communicate with terminal devices located within the coverage area. Optionally, the network device 110 may be a base station (Base Transceiver Station, BTS) in a GSM system or a CDMA system, a base station (NodeB, NB) in a WCDMA system, an evolved base station (Evolutional Node B, eNB or eNodeB) in an LTE system, or a wireless controller in a cloud radio access network (Cloud Radio Access Network, CRAN), or the network device may be a mobile switching center, a relay station, an access point, a vehicle-mounted device, a wearable device, a hub, a switch, a bridge, a router, a network-side device in a 5G network, or a network device in a future evolved public land mobile network (Public Land Mobile Network, PLMN), etc.

[0032] The communication system 100 also includes at least one terminal device 120 located within the coverage area of ​​the network device 110. As used herein, "terminal device" includes, but is not limited to, a device that is connected via a wired line, such as a Public Switched Telephone Network (PSTN), a Digital Subscriber Line (DSL), a digital cable, a direct cable connection; and / or another data connection / network; and / or via a wireless interface, such as a cellular network, a Wireless Local Area Network (WLAN), a digital television network such as a DVB-H network, a satellite network, an AM-FM broadcast transmitter; and / or another terminal device configured to receive / send communication signals; and / or an Internet of Things (IoT) device. A terminal device configured to communicate via a wireless interface may be referred to as a "wireless communication terminal," "wireless terminal," or "mobile terminal." Examples of mobile terminals include, but are not limited to, satellite or cellular telephones; Personal Communications System (PCS) terminals that may combine cellular radiotelephones with data processing, fax, and data communications capabilities; PDAs that may include radiotelephones, pagers, Internet / Intranet access, web browsers, organizers, calendars, and / or Global Positioning System (GPS) receivers; and conventional laptop and / or palmtop receivers or other electronic devices that include radiotelephone transceivers. A terminal device may be referred to as an access terminal, user equipment (UE), a subscriber unit, a subscriber station, a mobile station, a mobile station, a remote station, a remote terminal, a mobile device, a user terminal, a terminal, a wireless communication device, a user agent, or a user device. The access terminal can be a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, an in-vehicle device, a wearable device, a terminal device in a 5G network, or a terminal device in a future evolved PLMN, etc.

[0033] Optionally, device to device (D2D) communication may be performed between the terminal devices 120 .

[0034] Optionally, the 5G system or 5G network may also be referred to as a New Radio (NR) system or NR network.

[0035] In the above operating environment, the embodiment of the present application provides a method for implementing an intercom service, such as Figure 2 As shown, the method includes the following steps:

[0036] Step S202: start a server port on the server, and receive multiple data packets sent by multiple clients through the server port.

[0037] In step S202, when it is detected that the client sends a data packet for implementing the intercom service, the intercom service process is started, the server is controlled to start a UDP port (i.e., the server port) that complies with the User Datagram Protocol (UDP) rules, and receives the data packet from the client through the UDP port.

[0038] Step S204: parsing the multiple data packets to obtain the network addresses of the multiple clients and the multiple client ports for sending the multiple data packets.

[0039] In step S204, multiple data packets received by the UDP port are parsed, and the network address of the client that sends the data packet and the network port that sends the data packet are obtained by parsing each data packet.

[0040] Step S206: establishing a communication channel according to the network address, wherein the communication channel is used to transmit data between the server port and the plurality of client ports.

[0041] In step S206, based on the network address parsed in step S204, the client port for sending the data packet at the network address is determined, and a communication channel for transmitting the data packet is established between the UDP port started in step S202 and the client port.

[0042] Step S208: transmitting data packets for implementing the intercom service among multiple clients according to the communication channel.

[0043] In step S208, when one or more clients initiate a talk-back service to other clients and send data packets, the data packets are transmitted through the above communication channel to implement the talk-back service.

[0044] Through the above steps, it is possible to transform a multi-port service into a single-port service. Only one port needs to be opened from the network layer to meet the port resources required by the service, which greatly saves network port resources. At the same time, the protocol is extended in combination with the characteristics of the intercom service, so that more effective data can be transmitted by using the existing protocol fields, saving network resources.

[0045] According to an optional embodiment of the present application, a communication channel is established based on a network address, including: determining a client corresponding to the network address, and determining a client port through which the client sends data packets; determining a socket based on the network address and the client port; and reversely connecting the client port based on the socket to establish a communication channel between the server port and the client port.

[0046] In this embodiment, after the network address of the client sending the media channel packet (i.e., data packet) is obtained through parsing in step S204, the client at the network address is determined, and the client port on the client that sends the above-mentioned data packet is determined; a socket indicating the client port is determined, and when the client initiates the intercom service, the server recognizes the above-mentioned socket and reversely connects to the client port indicated by the above-mentioned socket. If there are multiple client ports for sending data packets, a socket is determined for each port; therefore, a communication channel for transmitting data is successfully established between the UDP port of the server and the client port indicated by the socket.

[0047] According to some preferred embodiments of the present application, the socket is a UDP socket.

[0048] In some preferred embodiments, the socket used to indicate the client port for sending data packets determined in the previous embodiment is a UDP socket. Through the UDP socket, the client can directly send data packets to the server without connecting to the server.

[0049] According to an optional embodiment of the present application, according to a communication channel, a data packet for implementing an intercom service is transmitted between multiple clients, including the following steps: parsing the transmission protocol of the transmitted data packet to obtain a protocol header, wherein the protocol header includes: a synchronization source identifier; determining a target user identifier and multiple group user identifiers based on the synchronization source identifier, wherein the target user identifier is used to indicate one of the multiple clients that send the data packet, and the group user identifier is used to indicate the multiple clients that receive the target data packet, and the target data packet is sent by the client indicated by the target user identifier; starting a thread pool, and forwarding the data packet to the client indicated by the group user identifier through the thread pool.

[0050] Figure 3 It is a header structure diagram of the real-time transport protocol. In this embodiment, the data packet for implementing the intercom service is transmitted in the communication channel by the following method. After detecting that the client has sent a data packet, the server parses the real-time transport protocol (RTP) used to transmit the data packet, such as Figure 3As shown, the RTP protocol header includes a version field (V) for indicating the RTP protocol version; a padding field (P) for indicating the number of bytes that can be ignored in the data packet; an extension field (X); a contributing source (CSRC) count field (CC) for indicating the number of CSRC identifiers following the fixed protocol header; a flag field (M) for marking important events in the data stream, such as marking frame boundaries; a payload type field (PT) for defining the type of payload of the RTP protocol; a sequence number field (sequence number) for indicating the sequence number of the data packet transmitted by the RTP protocol; a timestamp field (timestamp) for indicating the sampling time of the first byte in the data packet transmitted in the RTP protocol; and a CSRC list field; wherein the version field (V) occupies 2 bits, the padding field (P) occupies 1 bit, the extension field (X) occupies 1 bit, the CSRC count field (CC) occupies 4 bits, the flag field (M) occupies 1 bit, the payload type field (PT) occupies 7 bits, and the sequence number field (sequence number) occupies 1 bit. The number field occupies 16 bits, the timestamp field occupies 32 bits, and the CSRC list field occupies 32 bits.

[0051] like Figure 3 As shown, the RTP protocol header also includes a synchronization source identifier (SSRC) field, which occupies 32 bits. In the embodiment of the present application, it is used to identify the client that sends the data packet and the client that receives the data packet. In the embodiment of the present application, the first two fields of the SSRC are set to the (target) user identification (Identity Document, ID) field, which is used to store the user ID (i.e., target user identification) of the data packet. The last two fields of the SSRC are set to the group user identification (Identity Document, ID) field, which is used to store the group user ID of the data packet. Therefore, by parsing the RTP protocol, the user ID (i.e., target user identification) and the group user ID of the data packet can be obtained. After obtaining the user ID (i.e., target user identification) and the group user ID, the receiving thread pool is started. The thread task is dedicated to receiving media data (i.e., data packets) and forwarding the media data (i.e., data packets) to the group members indicated by the group user identification, greatly improving the intercom concurrency capability.

[0052] According to some other preferred embodiments of the present application, the synchronization source identifier is also used to identify a target data stream, wherein the target data stream is composed of data packets sent by a client indicated by a target user identifier.

[0053] In other preferred embodiments, the SSRC field is used not only to identify the client sending the data packet and the client receiving the data packet, but also to identify the data stream composed of the data packets sent by the client; each RTP data stream is identified in the form of a sequence number, and different data streams correspond to different SSRC fields and different sequence numbers.

[0054] According to an optional embodiment of the present application, after establishing a communication channel according to the network address, the method for implementing the intercom service also includes: monitoring the communication channel; if it is monitored that there are data packets in the communication channel, determining that the client has initiated the intercom service; if it is monitored that there are no data packets in the communication channel, determining that the client has not initiated the intercom service.

[0055] In this embodiment, after the communication channel is established, the server monitors the data channel and determines whether a client has initiated an intercom service by judging whether there is a data packet in the communication channel; specifically, if a data packet is detected in the data channel, it is considered that a client has initiated an intercom service; otherwise, if no data packet is detected in the data channel, it is considered that no client has initiated an intercom service.

[0056] Figure 4 Schematic diagram of an intercom service system provided according to an embodiment of the present application. Figure 4 As shown, the system includes: a client 40 and a server 42, wherein the client 40 includes multiple client ports for sending data packets to the server; the server 42 is used to start a UDP port to receive data packets sent by the client; parse the data packets to obtain the network address of the client sending the data packet and the client port sending the data packet; create a UDP socket, reversely connect to the client port sending the data packet through the UDP socket, and establish a communication channel between the server and the client; monitor the communication channel, and when a data packet is monitored in the communication channel, parse the transmission protocol of the transmitted data packet to obtain the user ID of the sending data packet and the group user ID of the receiving data packet, and start the thread pool to transmit the data packet to multiple group users indicated by the group user ID.

[0057] Figure 5 A structural diagram of a device for implementing an intercom service according to an embodiment of the present application is shown in FIG. Figure 5As shown, the device includes: a startup module 50, which is used to start a server port on the server side and receive multiple data packets sent by multiple clients through the server port; a parsing module 52, which is used to parse the multiple data packets to obtain the network addresses of the multiple clients and the multiple client ports for sending the multiple data packets; a creation module 54, which is used to establish a communication channel according to the network address, wherein the communication channel is used to transmit data between the server port and the multiple client ports; a transmission module 56, which is used to transmit data packets for implementing the intercom service between the multiple clients according to the communication channel.

[0058] Figure 6 This is a flow chart of the intercom service, such as Figure 6 As shown, the intercom service is started, and the implementation device of the intercom service starts working. The starting module 50 starts a port on the server side and waits for receiving the data packet sent by the client; after receiving the data packet, the parsing module 52 parses the received data packet to obtain the network address of the client that sends the data packet and the client port that sends the data packet; through the creation module, a UDP socket is created to reversely connect to the client and establish a communication channel between the client and the server. The transmission module 56 monitors the communication channel and, when it monitors that there is data packet transmission in the communication channel, starts the thread pool and transmits the data packet sent by the client to multiple group users indicated by the group user identifier.

[0059] It should be noted that Figure 6 The preferred implementation of the embodiment shown can be found in Figure 2 The relevant description of the illustrated embodiment will not be repeated here.

[0060] Through the method provided in the embodiments of this application, the intercom service simply activates a single UDP port for sending and receiving media data from each user. The server establishes an actual media channel with the terminal through a reverse connection for media interaction. Simultaneously, through the extended RTP protocol, the user ID and group ID are obtained, resolving the issue of where the data originates and where it goes. Furthermore, for the server, the single-port and reverse connection technology directly transforms a single-port, connectionless channel into a manageable client connection channel, making it easier for the server to manage multiple clients.

[0061] An embodiment of the present application further provides a non-volatile storage medium, in which a program is stored. When the program is running, a method for implementing the above intercom service is controlled to execute the device where the non-volatile storage medium is located.

[0062] The storage medium is used to store a program that performs the following functions: starting a server port on the server side and receiving multiple data packets sent by multiple clients through the server port; parsing the multiple data packets to obtain the network addresses of the multiple clients and the multiple client ports that send the multiple data packets; establishing a communication channel based on the network address, wherein the communication channel is used to transmit data between the server port and the multiple client ports; and transmitting data packets for implementing an intercom service between the multiple clients based on the communication channel.

[0063] An embodiment of the present application further provides an electronic device, including: a memory and a processor, wherein the processor is configured to run a program stored in the memory, wherein the program executes the above-mentioned method for implementing the intercom service when running.

[0064] The electronic device is used to process a program that performs the following functions: starting a server port on the server side and receiving multiple data packets sent by multiple clients through the server port; parsing the multiple data packets to obtain the network addresses of the multiple clients and the multiple client ports that send the multiple data packets; establishing a communication channel based on the network address, wherein the communication channel is used to transmit data between the server port and the multiple client ports; and transmitting data packets for implementing intercom services between the multiple clients based on the communication channel.

[0065] It should be noted that the various modules in the above-mentioned intercom service implementation device can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.

[0066] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0067] In the above embodiments of the present application, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0068] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0069] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0070] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0071] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the relevant technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0072] The above is only a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for implementing an intercom service, characterized in that: include: Starting a server port on the server, and receiving multiple data packets sent by multiple clients through the server port; Parsing the plurality of data packets to obtain the network addresses of the plurality of clients and the plurality of client ports for sending the plurality of data packets; Establishing a communication channel according to the network address includes: determining a client corresponding to the network address and determining a client port through which the client sends the data packet; determining a socket according to the network address and the client port; reversely connecting the client port according to the socket to establish the communication channel between the server port and the client port, wherein the communication channel is used to transmit data between the server port and the plurality of client ports; According to the communication channel, a data packet for implementing an intercom service is transmitted between multiple clients, including: parsing a transmission protocol for transmitting the data packet to obtain a protocol header, wherein the protocol header includes: a synchronization source identifier; determining a target user identifier and multiple group user identifiers based on the synchronization source identifier, wherein the target user identifier and multiple group user identifiers are recorded in the synchronization source identifier, the target user identifier is used to indicate one of the multiple clients that send the data packet, and the group user identifier is used to indicate multiple clients that receive the target data packet, and the target data packet is sent by the client indicated by the target user identifier; starting a thread pool, and forwarding the data packet to the client indicated by the group user identifier through the thread pool, wherein the thread task executed by the thread pool is dedicated to receiving the data packet, and forwarding the data packet to the group member indicated by the group user identifier.

2. The method according to claim 1, characterized in that The socket is a UDP socket.

3. The method according to claim 1, characterized in that The synchronization source identifier is also used to identify a target data stream, wherein the target data stream is composed of data packets sent by the client indicated by the target user identifier.

4. The method according to claim 1, wherein After establishing the communication channel according to the network address, the method further includes: monitoring the communication channel; If the data packet is detected in the communication channel, determining that the client initiates the intercom service; If it is monitored that the data packet does not exist in the communication channel, it is determined that the client does not initiate the intercom service.

5. An intercom service system, characterized in that: The system includes: a client and a server, The client includes a plurality of client ports for sending data packets to the server; The server is used to execute the method for implementing the intercom service as described in any one of claims 1 to 4.

6. A device for implementing an intercom service, characterized in that: include: A startup module, configured to start a server port on the server and receive multiple data packets sent by multiple clients through the server port; A parsing module, configured to parse the plurality of data packets to obtain network addresses of the plurality of clients and a plurality of client ports for sending the plurality of data packets; A creation module is configured to establish a communication channel according to the network address, comprising: determining a client corresponding to the network address and determining a client port through which the client sends the data packet; determining a socket according to the network address and the client port; and reversely connecting the client port according to the socket to establish the communication channel between the server port and the client port, wherein the communication channel is used to transmit data between the server port and a plurality of the client ports; A transmission module is used to transmit data packets for implementing intercom services between multiple clients according to the communication channel, including: parsing the transmission protocol for transmitting the data packets to obtain a protocol header, wherein the protocol header includes: a synchronization source identifier; determining a target user identifier and multiple group user identifiers based on the synchronization source identifier, wherein the target user identifier and multiple group user identifiers are recorded in the synchronization source identifier, the target user identifier is used to indicate one of the multiple clients that send the data packet, and the group user identifier is used to indicate multiple clients that receive the target data packet, and the target data packet is sent by the client indicated by the target user identifier; starting a thread pool, and forwarding the data packet to the client indicated by the group user identifier through the thread pool, wherein the thread task executed by the thread pool is dedicated to receiving the data packet, and forwarding the data packet to the group member indicated by the group user identifier.

7. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the method for implementing the intercom service according to any one of claims 1 to 4.

8. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the method for implementing the intercom service according to any one of claims 1 to 4 when running.

Citation Information

Patent Citations

  • Communication method and system for intelligent community, talkback terminal for intelligent community, and core switch for intelligent community

    CN105959425A