CN111200692B - Voice equipment, processing method, device and storage medium for network telephone - Google Patents

Voice equipment, processing method, device and storage medium for network telephone Download PDF

Info

Publication number
CN111200692B
CN111200692B CN201911345718.3A CN201911345718A CN111200692B CN 111200692 B CN111200692 B CN 111200692B CN 201911345718 A CN201911345718 A CN 201911345718A CN 111200692 B CN111200692 B CN 111200692B
Authority
CN
China
Prior art keywords
voice
shared memory
stream
processing module
sent
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911345718.3A
Other languages
Chinese (zh)
Other versions
CN111200692A (en
Inventor
陈友川
邓学杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Gaoke Communications Technology Co ltd
Original Assignee
Guangzhou Gaoke Communications Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Gaoke Communications Technology Co ltd filed Critical Guangzhou Gaoke Communications Technology Co ltd
Priority to CN201911345718.3A priority Critical patent/CN111200692B/en
Publication of CN111200692A publication Critical patent/CN111200692A/en
Application granted granted Critical
Publication of CN111200692B publication Critical patent/CN111200692B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M7/00Arrangements for interconnection between switching centres
    • H04M7/006Networks other than PSTN/ISDN providing telephone service, e.g. Voice over Internet Protocol (VoIP), including next generation networks with a packet-switched transport layer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a network telephone voice device, which creates a shared memory in a kernel module and enables a voice processing module and the kernel module to access the shared memory; during the call, the voice processing module stores the voice stream in the shared memory, and enables the kernel module to access the shared memory and forward the voice stream to the voice service platform; meanwhile, the kernel module stores the voice stream fed back by the voice service platform in the shared memory, and enables the voice processing module to access the shared memory to take out the voice stream fed back by the voice service platform for voice processing, thereby solving the problems that the forwarding of the voice stream needs to pass through an equipment IP layer of the kernel module every time during voice communication in the prior art, so that the communication is abnormal or blocked and the like. The invention also discloses a network telephone voice processing method, a device and a storage medium.

Description

Voice equipment, processing method, device and storage medium for network telephone
Technical Field
The present invention relates to network phones, and in particular, to a network phone voice device, a voice processing method, an apparatus, and a storage medium.
Background
At present, for a voice device in a network telephone, generally, during a call, a voice stream is sent through a socket packet sending interface after being processed by a voice Protocol through a voice processing module, and the socket packet sending interface is sent to a voice server platform through a network device interface and a kernel IP (Internet Protocol) layer through a network; and voice data returned by the voice server platform is processed by a voice protocol, then returned to the kernel IP layer receiving packet through the network equipment interface, and then fed back to the voice processing module through the network equipment interface layer. That is, as shown in fig. 1, the first to the second represent that the voice processing module sends a voice stream to the voice service platform; and the second to the fourth represent that the voice service platform feeds back the voice stream to the voice processing module.
That is, the voice stream of each voice call is forwarded through the kernel IP interface. When a plurality of voice calls exist at the same time, a large amount of voice stream processing is involved, and the forwarding performance of the voice stream is poor due to the fact that an inner core IP interface is involved in forwarding, so that the CPU utilization rate is high; in severe cases, problems such as call jamming or other module function abnormality may be caused.
Disclosure of Invention
In order to overcome the defects of the prior art, an object of the present invention is to provide a voice over ip device, which can solve the problem in the prior art that when there are multiple voice calls, the forwarding performance of the voice stream is poor, which is likely to cause hang-up or abnormality.
The second objective of the present invention is to provide a voice processing method for a network telephone, which can solve the problem in the prior art that when there are multiple voice calls, the forwarding performance of the voice stream is poor, which is likely to cause hang-up or abnormal.
The invention also provides a voice processing device for a network telephone, which can solve the problems that the forwarding performance of voice stream is poor and the problem of blocking or abnormity is easily caused when multi-path voice communication exists in the prior art.
The fourth objective of the present invention is to provide a storage medium, which can solve the problem in the prior art that the forwarding performance of voice stream is poor and is easy to cause hang-up or abnormal when there are multiple voice calls.
One of the purposes of the invention is realized by adopting the following technical scheme:
a voice device of network telephone comprises a voice processing module, a shared memory and a kernel module; the shared memory is used for storing a voice stream to be sent generated by the voice processing module and a voice stream to be processed returned by the voice service platform received by the kernel module when each voice call is carried out; in the voice call process, the voice processing module stores the generated voice stream to be sent in a corresponding area of the shared memory, so that the kernel module takes the voice stream to be sent out of the shared memory and forwards the voice stream to be sent to the voice service platform; the kernel module stores the corresponding area of the shared memory by receiving the voice stream to be processed fed back by the voice service platform, so that the voice processing module takes the voice stream to be processed out of the shared memory and performs voice processing; the shared memory is dynamically established by the kernel module, and the physical address of the shared memory is mapped into the virtual memory address of the voice processing module, so that the kernel module and the voice processing module access the shared memory; the voice stream to be sent is generated by the voice processing module and forwarded to the voice service platform by the kernel module, and the voice stream to be processed is the voice stream fed back by the voice service platform.
Further, when the voice call starts, the voice processing module sends one or more initialization data packets to the kernel module, so that the kernel module analyzes the initialization data packets to obtain IP header information of the voice call and stores the IP header information in an area corresponding to the voice call in the shared memory; wherein the IP header information comprises a protocol type, a source IP address, a destination IP address, a source port and a destination port.
Furthermore, when the kernel module takes out the voice stream to be sent from the shared memory, the kernel module also takes out the corresponding IP header information, generates a data packet to be sent according to the IP header information and the voice stream to be sent, and forwards the data packet to be sent to the voice service platform; when the kernel module receives a data packet to be processed sent by the voice service platform, analyzing the data packet to be processed to obtain a voice stream to be processed and a voice call corresponding to the voice stream to be processed, and storing the voice stream to be processed in a region corresponding to the voice call corresponding to the shared memory; the data packet to be sent is generated by the voice processing module and is forwarded to the data packet of the voice service platform by the kernel module; the data packet to be processed is a data packet which is received by the kernel module and fed back by the voice service platform.
Furthermore, the kernel module is used for dynamically creating a shared memory, obtaining a physical address of the shared memory by calling a virt _ to _ phys interface, and sending the physical address of the shared memory to the voice processing module, so that the voice processing module calls the mmap interface to map the physical address to a virtual address of the voice processing module; the shared memory is located in a mapping area of the physical memory and is continuous.
The second purpose of the invention is realized by adopting the following technical scheme:
the first scheme is as follows:
a voice processing method for a voice device of a network telephone, which is adopted as one of the objects of the present invention, the voice processing method comprising:
a request step: when the voice processing module is connected with the kernel module, the voice processing module receives a physical address of the shared memory sent by the kernel module and maps the physical address of the shared memory to a virtual address of the voice processing module, so that the voice processing module accesses the shared memory;
an initial connection step: when a voice call starts, the voice processing module sends an initialization data packet to the kernel module, so that the kernel module analyzes the initialization data packet to obtain IP header information of the voice call and stores the IP header information in an area corresponding to the voice call in a shared memory;
voice stream storage step: the voice processing module stores a voice stream to be sent in a region corresponding to the voice call in a shared memory;
voice stream processing step: the voice processing module detects whether the voice stream to be processed is updated in the shared memory at regular time, if yes, the voice stream to be processed is taken out from the shared memory and is subjected to voice processing; the voice stream to be sent is generated by the voice processing module and forwarded to the voice service platform by the kernel module, and the voice stream to be processed is the voice stream fed back by the voice service platform.
Scheme II:
a voice stream processing method for a voice over internet protocol device as one of the objects of the present invention, the voice stream processing method comprising:
a creating step: the kernel module dynamically creates a shared memory and sends a physical address of the shared memory to the voice processing module, so that the voice processing module maps the physical address of the shared memory to a virtual memory address of the voice processing module;
and acquiring an IP (Internet protocol): when a voice call starts, the kernel module receives an initialization data packet sent by the voice processing module and analyzes the initialization data packet to obtain IP header information of the voice call, and the IP header information of the voice call is stored in an area corresponding to the voice call in a shared memory;
a forwarding step: the kernel module regularly detects whether the shared memory is to be updated with the voice stream to be sent, if so, the voice stream to be sent and the corresponding IP header information are taken out from the shared memory to generate a data packet to be sent, and the data packet is forwarded to the voice service platform;
a step of unloading: the kernel module receives the data packet to be processed fed back by the voice service platform, analyzes the data packet to be processed to obtain a voice stream to be processed and a corresponding voice call, and stores the voice stream to be processed in a region corresponding to the corresponding voice call in the shared memory.
The third purpose of the invention is realized by adopting the following technical scheme:
the first scheme is as follows:
a voice processing device for network telephone, comprising a memory and a processor, wherein the memory stores a voice processing program capable of running on the processor, the voice processing program is a computer program, and the processor executes the voice processing program to realize the following steps:
a request step: when the voice processing module is connected with the kernel module, the voice processing module receives a physical address of the shared memory sent by the kernel module and maps the physical address of the shared memory to a virtual address of the voice processing module, so that the voice processing module accesses the shared memory;
an initial connection step: when a voice call starts, the voice processing module sends an initialization data packet to the kernel module, so that the kernel module analyzes the initialization data packet to obtain IP header information of the voice call and stores the IP header information in an area corresponding to the voice call in a shared memory;
voice stream storage step: the voice processing module generates a voice stream to be sent and stores the voice stream to be sent in a region corresponding to the voice call in the shared memory;
voice stream processing step: the voice processing module detects whether the voice stream to be processed is updated in the shared memory at regular time, if yes, the voice stream to be processed is taken out from the shared memory and is subjected to voice processing; the voice stream to be sent is generated by the voice processing module and forwarded to the voice service platform by the kernel module, and the voice stream to be processed is the voice stream fed back by the voice service platform.
Scheme II:
a voice processing device for network telephone, comprising a memory and a processor, wherein the memory stores a voice processing program capable of running on the processor, the voice processing program is a computer program, and the processor executes the voice processing program to realize the following steps:
a creating step: the kernel module dynamically creates a shared memory and sends a physical address of the shared memory to the voice processing module, so that the voice processing module maps the physical address of the shared memory to a virtual memory address of the voice processing module;
and acquiring an IP (Internet protocol): when a voice call starts, the kernel module receives an initialization data packet sent by the voice processing module and analyzes the initialization data packet to obtain IP header information of the voice call, and the IP header information of the voice call is stored in an area corresponding to the voice call in a shared memory;
a forwarding step: the kernel module regularly detects whether the shared memory is to be updated with the voice stream to be sent, if so, the voice stream to be sent and the corresponding IP header information are taken out from the shared memory to generate a data packet to be sent, and the data packet is forwarded to the voice service platform;
a step of unloading: the kernel module receives the data packet to be processed fed back by the voice service platform, analyzes the data packet to be processed to obtain a voice stream to be processed and a corresponding voice call, and stores the voice stream to be processed in a region corresponding to the corresponding voice call in the shared memory.
The fourth purpose of the invention is realized by adopting the following technical scheme:
the first scheme is as follows:
a storage medium being a computer readable storage medium having stored thereon a speech processing program being a computer program which when executed by a processor implements the steps of:
a request step: when the voice processing module is connected with the kernel module, the voice processing module receives a physical address of the shared memory sent by the kernel module and maps the physical address of the shared memory to a virtual address of the voice processing module, so that the voice processing module accesses the shared memory;
an initial connection step: when a voice call starts, the voice processing module sends an initialization data packet to the kernel module, so that the kernel module analyzes the initialization data packet to obtain IP header information of the voice call and stores the IP header information in an area corresponding to the voice call in a shared memory;
voice stream storage step: the voice processing module generates a voice stream to be sent and stores the voice stream to be sent in a region corresponding to the voice call in the shared memory;
voice stream processing step: the voice processing module detects whether the voice stream to be processed is updated in the shared memory at regular time, if yes, the voice stream to be processed is taken out from the shared memory and is subjected to voice processing; the voice stream to be sent is generated by the voice processing module and forwarded to the voice service platform by the kernel module, and the voice stream to be processed is the voice stream fed back by the voice service platform.
Scheme II:
a storage medium being a computer readable storage medium having stored thereon a speech processing program being a computer program which when executed by a processor implements the steps of:
a creating step: the kernel module dynamically creates a shared memory and sends a physical address of the shared memory to the voice processing module, so that the voice processing module maps the physical address of the shared memory to a virtual memory address of the voice processing module;
and acquiring an IP (Internet protocol): when a voice call starts, the kernel module receives an initialization data packet sent by the voice processing module and analyzes the initialization data packet to obtain IP header information of the voice call, and the IP header information of the voice call is stored in an area corresponding to the voice call in a shared memory;
a forwarding step: the kernel module regularly detects whether the shared memory is to be updated with the voice stream to be sent, if so, the voice stream to be sent and the corresponding IP header information are taken out from the shared memory to generate a data packet to be sent, and the data packet is forwarded to the voice service platform;
a step of unloading: the kernel module receives the data packet to be processed fed back by the voice service platform, analyzes the data packet to be processed to obtain a voice stream to be processed and a corresponding voice call, and stores the voice stream to be processed in a region corresponding to the corresponding voice call in the shared memory.
Compared with the prior art, the invention has the beneficial effects that:
the invention creates a shared memory in the voice processing module and the kernel module of the voice device, so that the voice processing module and the kernel module can access the shared memory at the same time; when the voice call is carried out, the voice processing module stores the generated voice stream in the shared memory, and the kernel module can automatically acquire the voice stream from the shared memory and forward the voice stream to the voice service platform; similarly, the kernel module stores the received voice stream returned by the voice service platform in the shared memory, and the voice processing module can automatically acquire the voice stream fed back by the voice service platform from the shared memory for processing. The invention realizes the storage of the voice stream in the multi-path voice call by sharing the memory, solves the problems of poor voice call forwarding performance and the like caused by the simultaneous existence of the multi-path call due to the fact that the IP layer of the kernel module is needed to pass in the voice call process in the prior art, solves the problems of blocking and the like of the voice call in the prior art, greatly improves the efficiency of the voice call, and brings good experience to users.
Drawings
Fig. 1 is a schematic diagram of voice stream forwarding of a conventional network telephone device provided in the present invention;
FIG. 2 is a schematic diagram of forwarding voice stream of voice over IP device provided by the present invention;
fig. 3 is a flowchart of a voice processing method for a network telephone according to an embodiment;
fig. 4 is a flowchart of a voice processing method for a network telephone according to the second embodiment;
fig. 5 is a schematic diagram of a voice processing apparatus module for a network telephone according to the present invention.
In the figure: 11. a memory; 12. a processor; 13. a communication bus; 14. a network interface.
Detailed Description
The present invention will be further described with reference to the accompanying drawings and the detailed description, and it should be noted that any combination of the embodiments or technical features described below can be used to form a new embodiment without conflict.
Example one
The invention provides a voice device of a network telephone, which is characterized in that a shared memory is created in the voice device as shown in figure 2. The shared memory is used for receiving and transmitting voice stream data during voice communication, so that the problems that in the prior art, when a voice device has multi-path voice communication, the forwarding performance is poor, even jamming is caused and the like are solved.
Generally, a voice device includes at least a voice processing module and a kernel module. When the voice calls, the voice processing module forwards the generated voice stream to the external voice service platform through the kernel module. Similarly, the kernel module also forwards the received voice stream fed back by the external voice service platform to the voice processing module for voice processing.
The shared memory is created in the voice equipment, and the kernel module and the voice equipment can access the shared memory.
Specifically, the method comprises the following steps: in the voice call process, the voice processing module stores the voice stream in the shared memory, and the kernel module can take out the voice stream and forward the voice stream to an external voice service platform through accessing the shared memory. Meanwhile, the kernel module stores the received voice stream returned by the voice service platform in the shared memory, and the voice processing module takes out the voice stream fed back by the voice service platform from the shared memory through accessing the shared memory to perform voice processing. As shown in fig. 2, in a specific application, the voice processing module is connected to the kernel module through the network device interface layer of the kernel module, and therefore, the voice processing module stores the voice stream in the shared memory through the network device interface layer. Similarly, the network device interface layer of the kernel module fetches the voice stream and forwards the voice stream to the voice service platform through accessing the shared memory, and stores the received voice stream of the voice service platform in the shared memory. The method comprises the following steps that firstly, a shared memory built by a voice processing module to a kernel module stores voice streams, and secondly, the kernel module forwards the voice streams stored in the shared memory to a voice service platform; otherwise, the voice service platform feeds back the voice stream to the kernel module and stores the voice stream in the shared memory through the kernel module, and the voice processing module takes out the voice stream from the shared memory of the kernel module and performs voice processing.
Further, in the network telephone, since there may be multiple voice calls, the present invention also provides that the voice streams stored in the shared memory are stored separately for each voice call. That is, each voice call is divided into corresponding storage areas for storing the voice stream during the voice call.
Therefore, the invention realizes the storage of voice stream by sharing the memory, avoids the need of passing through the IP (Internet Protocol) layer of the kernel module every conversation, solves the problem of high utilization rate of a Central Processing Unit (CPU) caused by a large amount of voice stream Processing when multiple paths of voice are simultaneously conversed in the prior art, and solves the problem of abnormal functions of conversation blockage or other modules, such as network management operation blockage and the like.
In addition, the invention also provides a process for establishing the shared memory:
firstly, a kernel module creates a shared memory by a dynamic memory application mode. The shared memory is located in a mapping region of the physical memory and is contiguous.
Then the kernel module calls a virt _ to _ phys interface to obtain a physical address of the shared memory and sends the physical address to the voice processing module, so that the voice processing module maps the physical address of the shared memory to a virtual memory address of the voice processing module by using a mmap interface. At this time, the voice processing module and the kernel module can simultaneously access the shared memory. Wherein, the virt _ to _ phys interface is a function interface which maps the virtual address into the physical address. mmap is a method of mapping a file or other data to a memory, that is, in this embodiment, a physical address of a shared memory is mapped to a virtual memory address of a voice processing module through a mmap interface, so as to implement access of the voice processing module to the shared memory.
In addition, in order to ensure the recognition of the voice stream in the multi-path voice call, the invention divides each path of voice call into corresponding areas in the shared memory for storage. Specifically, the present embodiment takes 4-way voice call as an example to describe the definition of the data structure of the shared memory:
Figure BDA0002333287590000101
Figure BDA0002333287590000111
the invention realizes the data interaction between the voice processing module and the kernel module through the data updating in the shared memory. In addition, since there are multiple voice calls simultaneously during the call, a corresponding data storage area is set in the shared memory for each call, as defined in the data structure.
That is, when the voice processing module and the kernel module store the voice stream, the voice processing module and the kernel module will store the voice stream in the corresponding area according to the communication channel to which the voice stream belongs, so as to avoid confusion of the voice streams of different paths.
In addition, when the core module forwards the voice stream, the core module needs to obtain IP header information of the voice stream, that is, the IP header information includes a Protocol type, a source IP Address (Internet Protocol Address), a destination IP Address, a source port, and a destination port.
But the voice stream stored in the shared memory does not have IP header information. Therefore, in order to ensure that the voice stream taken out from the shared memory by the kernel module can be correctly forwarded, the IP header information of each voice call needs to be acquired.
In order to ensure that the kernel module can acquire the data, when the voice call starts, the invention also provides that the voice processing module sends a data packet to the kernel module in advance, and the kernel module can acquire the IP header information of the voice call through the data packet and store the IP header information in the area corresponding to the voice call in the shared memory.
That is, when a call starts, the voice processing module adopts a traditional call mode, for example, a data packet is sent to the kernel module through a socket mode, and at this time, the kernel module can obtain corresponding IP header information from the data packet; and then storing the IP header information in the area corresponding to the corresponding path of voice call in the shared memory. That is, the voice processing module sends a data packet to the network device interface layer of the kernel module, so that the network device interface layer analyzes the data packet to obtain the IP header information of the voice call, and stores the IP header information in the area corresponding to the voice call in the shared memory. Therefore, when the kernel module takes out the voice stream from the shared memory, the IP header information of the voice call is obtained, and then a corresponding data packet is generated according to the voice stream of the voice call and the IP header information and forwarded to the corresponding voice service platform.
Similarly, when the kernel module receives a data packet returned by the voice service platform, the data packet is analyzed to obtain a voice call corresponding to the voice stream, and then the voice call is stored in a region corresponding to a corresponding path of voice call in the shared memory, so that a subsequent voice processing module can obtain the voice stream returned by the voice service platform from the region.
Specifically, this embodiment further provides a data structure of each parameter when the IP header information is stored in the shared memory:
Figure BDA0002333287590000121
Figure BDA0002333287590000131
in addition, the present embodiment also indicates whether the current IP header information is updated by the value of the parameter complete. For example, when the complete value is 1, the IP header information indicating the current voice call is updated.
Further, in order to ensure that the core module obtains correct IP header information, when the voice processing module sends a data packet to the core module in advance, multiple data packets, for example, 2 or 3 data packets, may be sent to ensure that the IP header information is correct.
Example two
As shown in fig. 3, the present invention provides a preferred embodiment, a network call voice processing method, which is applied to a voice processing module of a voice device in the first embodiment, and includes the following steps:
step S11, when the voice processing module is connected to the kernel module, the voice processing module receives the physical address of the shared memory sent by the kernel module, and maps the physical address of the shared memory to the virtual address of the voice processing module, so that the voice processing module accesses the shared memory.
Wherein the shared memory is dynamically created by the kernel module. The voice processing module and the kernel module can simultaneously access the shared memory. For example, the voice processing module is connected with the kernel module through a network device interface layer of the kernel module, so as to access the shared memory.
Step S12, when the voice call starts, the voice processing module sends an initialization packet to the kernel module, so that the kernel module analyzes the initialization packet to obtain the IP header information of the voice call and stores the IP header information in the shared memory in the area corresponding to the voice call.
The IP header information includes a protocol type, a source IP address, a destination IP address, a source port, and a destination port.
In addition, since there may be a multi-way voice call or a change in information of a voice call, it is necessary to update the IP header information thereof in advance every time a voice call is started.
Step S13, in the voice call process, the voice processing module stores the voice stream to be sent in the shared memory and stores the voice stream to be sent in the area corresponding to the voice call. Specifically, for example, the voice processing module stores the voice stream in the corresponding region of the shared memory through the network device interface layer.
Step S14, the voice processing module detects whether the to-be-processed voice stream in the shared memory is updated at regular time, and if yes, the to-be-processed voice stream is taken out from the shared memory and is subjected to voice processing. For example, the voice processing module detects whether the shared memory is updated by the voice stream to be processed at regular time through the network device interface layer.
The voice stream to be sent is generated by the voice processing module and forwarded to the voice service platform by the kernel module, and the voice stream to be processed is the voice stream fed back by the voice service platform.
EXAMPLE III
As shown in fig. 4, this embodiment further provides an embodiment, which is a network voice stream processing method applied to the kernel module of the voice device in the first embodiment, and includes the following steps:
step S21, the kernel module dynamically creates a shared memory, and sends the physical address of the shared memory to the voice processing module, so that the voice processing module maps the physical address of the shared memory to the virtual memory address of the voice processing module.
Step S22, when the voice call starts, the kernel module receives the initialization packet sent by the voice processing module and parses the initialization packet to obtain the IP header information of the voice call, and stores the IP header information of the voice call in the area corresponding to the voice call in the shared memory.
Step S23, the kernel module detects whether the shared memory is to be updated with the voice stream, if yes, the voice stream to be sent and the corresponding IP header information are fetched from the shared memory to generate a data packet to be sent, and the data packet is forwarded to the voice service platform. Step S24, the kernel module receives the to-be-processed data packet fed back by the voice service platform and analyzes the to-be-processed data packet to obtain a to-be-processed voice stream and a corresponding voice call, and stores the to-be-processed voice stream in a region corresponding to the corresponding voice call in the shared memory. For example, the network device interface layer of the kernel module realizes forwarding of the voice stream to be sent and storage of the voice stream to be processed by accessing the shared memory.
The data packet to be sent is generated by the voice processing module and is forwarded to the data packet of the voice service platform by the kernel module; the data packet to be processed is a data packet which is received by the kernel module and fed back by the voice service platform.
From the above, in the voice call process of the present invention: the voice processing module only stores the voice stream to be sent in a corresponding area of the shared memory, or takes the voice stream to be processed out of the shared memory for voice processing and the like, and relates to the kernel module and other interface modules. The kernel module acquires voice flow of voice call and IP header information through accessing the shared memory to generate a corresponding data packet and forwards the data packet to an external voice service platform; or analyzing the received data packet of the voice service platform to obtain a voice stream and storing the voice stream in a corresponding area of the shared memory. That is, in the whole voice call process, the voice processing module and the kernel module can be realized only by accessing the shared memory, without involving the IP layer, the network interface layer and the like of the kernel module,
example four
The invention provides a voice processing device for a network telephone. As shown in fig. 5, an internal structure of a voice processing apparatus for a network phone according to an embodiment of the present invention is schematically illustrated.
In this embodiment, the voice processing device of the network telephone may be a PC (Personal Computer), or may be a terminal device such as a smart phone, a tablet Computer, or a mobile Computer. The voice processing device for the network telephone at least comprises: a processor 12, a communication bus 13, a network interface 14, and a memory 11.
The memory 11 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may be an internal storage unit of a voice processing device of a network phone in some embodiments, such as a hard disk of the voice processing device of the network phone. The memory 11 may be an external storage device of the voice processing apparatus of the network telephone in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the voice processing apparatus of the network telephone. Further, the memory 11 may also include both an internal storage unit of a network telephone voice processing apparatus and an external storage device. The memory 11 can be used not only for storing application software installed in a voice processing apparatus of a network telephone and various kinds of data such as codes of a voice processing program, etc., but also for temporarily storing data that has been output or is to be output.
The processor 12 may be, in some embodiments, a Central Processing Unit (CPU), controller, microcontroller, microprocessor or other data Processing chip for executing program codes stored in the memory 11 or Processing data, such as executing a voice Processing program.
The communication bus 13 is used to realize connection communication between these components.
The network interface 14 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), and is typically used to establish a communication link between the voice processing apparatus of the network telephone and other electronic devices.
Optionally, the voice processing device of the network telephone may further comprise a user interface, the user interface may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface may further comprise a standard wired interface and a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in a voice processing device of a network telephone and for displaying a visual user interface.
While fig. 5 shows only one voice processing device of a network telephone having components 11-14 and a voice processing program, those skilled in the art will appreciate that the configuration shown in fig. 5 is not intended to be limiting of a network telephone voice processing device and may include fewer or more components than shown, or some components may be combined, or a different arrangement of components.
In an embodiment of the voice processing apparatus for a network telephone shown in fig. 5, a voice processing program is stored in the memory 11; the processor 12, when executing the speech processing program stored in the memory 11, implements the following steps:
step S11, when the voice call starts, the voice processing module sends an initialization packet to the kernel module, so that the kernel module analyzes the initialization packet to obtain the IP header information of the voice call and stores the IP header information in the shared memory in the area corresponding to the voice call.
Step S12, when the voice call starts, the voice processing module sends an initialization packet to the kernel module, so that the kernel module analyzes the initialization packet to obtain the IP header information of the voice call and stores the IP header information in the shared memory in the area corresponding to the voice call.
Step S13, in the voice call process, the voice processing module stores the voice stream to be sent in the shared memory and stores the voice stream to be sent in the area corresponding to the voice call.
Step S14, the voice processing module detects whether the to-be-processed voice stream in the shared memory is updated at regular time, and if yes, the to-be-processed voice stream is taken out from the shared memory and is subjected to voice processing.
Alternatively, in the embodiment of the voice processing apparatus for internet phone shown in fig. 5, the memory 11 stores a voice processing program; the processor 12, when executing the speech processing program stored in the memory 11, implements the following steps:
step S21, the kernel module dynamically creates a shared memory, and sends the physical address of the shared memory to the voice processing module, so that the voice processing module maps the physical address of the shared memory to the virtual memory address of the voice processing module.
Step S22, when the voice call starts, the kernel module receives the initialization packet sent by the voice processing module and parses the initialization packet to obtain the IP header information of the voice call, and stores the IP header information of the voice call in the area corresponding to the voice call in the shared memory.
Step S23, the kernel module detects whether the shared memory is to be updated with the voice stream, if yes, the voice stream to be sent and the corresponding IP header information are fetched from the shared memory to generate a data packet to be sent, and the data packet is forwarded to the voice service platform.
Step S24, the kernel module receives the to-be-processed data packet fed back by the voice service platform and analyzes the to-be-processed data packet to obtain a to-be-processed voice stream and a corresponding voice call, and stores the to-be-processed voice stream in a region corresponding to the corresponding voice call in the shared memory.
EXAMPLE five
The present invention also provides a storage medium, which is a computer-readable storage medium having a speech processing program stored thereon, the speech processing program being a computer program, which when executed by a processor implements the steps of:
step S11, when the voice processing module is connected to the kernel module, the voice processing module receives the physical address of the shared memory sent by the kernel module, and maps the physical address of the shared memory to the virtual address of the voice processing module, so that the voice processing module accesses the shared memory.
Step S12, when the voice call starts, the voice processing module sends an initialization packet to the kernel module, so that the kernel module analyzes the initialization packet to obtain the IP header information of the voice call and stores the IP header information in the shared memory in the area corresponding to the voice call.
Step S13, in the voice call process, the voice processing module stores the voice stream to be sent in the shared memory and stores the voice stream to be sent in the area corresponding to the voice call.
Step S14, the voice processing module detects whether the to-be-processed voice stream in the shared memory is updated at regular time, and if yes, the to-be-processed voice stream is taken out from the shared memory and is subjected to voice processing.
Alternatively, the storage medium is a computer-readable storage medium, on which a speech processing program is stored, the speech processing program being a computer program, and the speech processing program, when executed by a processor, implements the steps of:
step S21, the kernel module dynamically creates a shared memory, and sends the physical address of the shared memory to the voice processing module, so that the voice processing module maps the physical address of the shared memory to the virtual memory address of the voice processing module.
Step S22, when the voice call starts, the kernel module receives the initialization packet sent by the voice processing module and parses the initialization packet to obtain the IP header information of the voice call, and stores the IP header information of the voice call in the area corresponding to the voice call in the shared memory.
Step S23, the kernel module detects whether the shared memory is to be updated with the voice stream, if yes, the voice stream to be sent and the corresponding IP header information are fetched from the shared memory to generate a data packet to be sent, and the data packet is forwarded to the voice service platform.
Step S24, the kernel module receives the to-be-processed data packet fed back by the voice service platform and analyzes the to-be-processed data packet to obtain a to-be-processed voice stream and a corresponding voice call, and stores the to-be-processed voice stream in a region corresponding to the corresponding voice call in the shared memory.
The above embodiments are only preferred embodiments of the present invention, and the protection scope of the present invention is not limited thereby, and any insubstantial changes and substitutions made by those skilled in the art based on the present invention are within the protection scope of the present invention.

Claims (10)

1. The voice equipment of the network telephone is characterized by comprising a voice processing module, a shared memory and a kernel module; the shared memory is used for storing a voice stream to be sent generated by the voice processing module and a voice stream to be processed returned by the voice service platform received by the kernel module when each voice call is carried out; in the voice call process, the voice processing module stores the generated voice stream to be sent in a corresponding area of the shared memory, so that the kernel module takes the voice stream to be sent out of the shared memory and forwards the voice stream to be sent to the voice service platform; the kernel module stores the corresponding area of the shared memory by receiving the voice stream to be processed fed back by the voice service platform, so that the voice processing module takes the voice stream to be processed out of the shared memory and performs voice processing; the shared memory is dynamically established by the kernel module, and the physical address of the shared memory is mapped into the virtual memory address of the voice processing module, so that the kernel module and the voice processing module access the shared memory; the voice stream to be sent is generated by the voice processing module and forwarded to the voice service platform by the kernel module, and the voice stream to be processed is the voice stream fed back by the voice service platform.
2. The voice device of claim 1, wherein when the voice call starts, the voice processing module sends one or more initialization packets to the kernel module, so that the kernel module parses the initialization packet to obtain IP header information of the voice call and stores the IP header information of the voice call in a region corresponding to the voice call in the shared memory; wherein the IP header information comprises a protocol type, a source IP address, a destination IP address, a source port and a destination port.
3. The voice over internet phone device according to claim 1, wherein when the kernel module extracts the voice stream to be sent from the shared memory, the kernel module further extracts corresponding IP header information, generates a data packet to be sent according to the IP header information and the voice stream to be sent, and forwards the data packet to the voice service platform; when the kernel module receives a data packet to be processed sent by the voice service platform, analyzing the data packet to be processed to obtain a voice stream to be processed and a voice call corresponding to the voice stream to be processed, and storing the voice stream to be processed in a region corresponding to the voice call corresponding to the shared memory; the data packet to be sent is generated by the voice processing module and is forwarded to the data packet of the voice service platform by the kernel module; the data packet to be processed is a data packet which is received by the kernel module and fed back by the voice service platform.
4. The voice device of claim 1, wherein the kernel module is configured to dynamically create a shared memory, obtain a physical address of the shared memory by calling a virt _ to _ phys interface, and send the physical address of the shared memory to the voice processing module, so that the voice processing module calls a mmap interface to map the physical address to a virtual address of the voice processing module; the shared memory is located in a mapping area of the physical memory and is continuous.
5. A voice processing method for a network telephone, which is applied to a voice device of a network telephone according to any one of claims 1-4, wherein the voice processing method comprises:
a request step: when the voice processing module is connected with the kernel module, the voice processing module receives a physical address of the shared memory sent by the kernel module and maps the physical address of the shared memory to a virtual address of the voice processing module, so that the voice processing module accesses the shared memory;
an initial connection step: when a voice call starts, a voice processing module sends an initialization data packet to a kernel module, so that the kernel module analyzes the initialization data packet to obtain IP header information of the voice call and stores the IP header information of the voice call in an area corresponding to the voice call in a shared memory;
voice stream storage step: the voice processing module stores a voice stream to be sent in a region corresponding to the voice call in a shared memory;
voice stream processing step: the voice processing module detects whether the voice stream to be processed is updated in the shared memory at regular time, if yes, the voice stream to be processed is taken out from the shared memory and is subjected to voice processing; the voice stream to be sent is generated by the voice processing module and forwarded to the voice service platform by the kernel module, and the voice stream to be processed is the voice stream fed back by the voice service platform.
6. A voice processing apparatus for a network telephone, comprising a memory and a processor, wherein the memory stores a voice processing program operable on the processor, and the voice processing program is a computer program, characterized in that: the processor implements the following steps when executing the speech processing program:
a request step: when the voice processing module is connected with the kernel module, the voice processing module receives a physical address of the shared memory sent by the kernel module and maps the physical address of the shared memory to a virtual address of the voice processing module, so that the voice processing module accesses the shared memory;
an initial connection step: when a voice call starts, a voice processing module sends an initialization data packet to a kernel module, so that the kernel module analyzes the initialization data packet to obtain IP header information of the voice call and stores the IP header information of the voice call in an area corresponding to the voice call in a shared memory;
voice stream storage step: the voice processing module generates a voice stream to be sent and stores the voice stream to be sent in a region corresponding to the voice call in the shared memory;
voice stream processing step: the voice processing module detects whether the voice stream to be processed is updated in the shared memory at regular time, if yes, the voice stream to be processed is taken out from the shared memory and is subjected to voice processing; the voice stream to be sent is generated by the voice processing module and forwarded to the voice service platform by the kernel module, and the voice stream to be processed is the voice stream fed back by the voice service platform.
7. A storage medium which is a computer-readable storage medium having a speech processing program stored thereon, the speech processing program being a computer program, characterized in that: the speech processing program when executed by a processor implements the steps of:
a request step: when the voice processing module is connected with the kernel module, the voice processing module receives a physical address of the shared memory sent by the kernel module and maps the physical address of the shared memory to a virtual address of the voice processing module, so that the voice processing module accesses the shared memory;
an initial connection step: when a voice call starts, a voice processing module sends an initialization data packet to a kernel module, so that the kernel module analyzes the initialization data packet to obtain IP header information of the voice call and stores the IP header information of the voice call in an area corresponding to the voice call in a shared memory;
voice stream storage step: the voice processing module generates a voice stream to be sent and stores the voice stream to be sent in a region corresponding to the voice call in the shared memory;
voice stream processing step: the voice processing module detects whether the voice stream to be processed is updated in the shared memory at regular time, if yes, the voice stream to be processed is taken out from the shared memory and is subjected to voice processing; the voice stream to be sent is generated by the voice processing module and forwarded to the voice service platform by the kernel module, and the voice stream to be processed is the voice stream fed back by the voice service platform.
8. A voice stream processing method for a network telephone, applied to a voice device of a network telephone according to any one of claims 1 to 4, the voice stream processing method comprising:
a creating step: the kernel module dynamically creates a shared memory and sends a physical address of the shared memory to the voice processing module, so that the voice processing module maps the physical address of the shared memory to a virtual memory address of the voice processing module;
and acquiring an IP (Internet protocol): when a voice call starts, the kernel module receives an initialization data packet sent by the voice processing module and analyzes the initialization data packet to obtain IP header information of the voice call, and the IP header information of the voice call is stored in an area corresponding to the voice call in a shared memory;
a forwarding step: the kernel module regularly detects whether the shared memory is to be updated with the voice stream to be sent, if so, the voice stream to be sent and the corresponding IP header information are taken out from the shared memory to generate a data packet to be sent, and the data packet is forwarded to the voice service platform;
a step of unloading: the kernel module receives the data packet to be processed fed back by the voice service platform, analyzes the data packet to be processed to obtain a voice stream to be processed and a corresponding voice call, and stores the voice stream to be processed in a region corresponding to the corresponding voice call in the shared memory.
9. A voice processing apparatus for a network telephone, comprising a memory and a processor, wherein the memory stores a voice processing program operable on the processor, and the voice processing program is a computer program, characterized in that: the processor implements the following steps when executing the speech processing program:
a creating step: the kernel module dynamically creates a shared memory and sends a physical address of the shared memory to the voice processing module, so that the voice processing module maps the physical address of the shared memory to a virtual memory address of the voice processing module;
and acquiring an IP (Internet protocol): when a voice call starts, the kernel module receives an initialization data packet sent by the voice processing module and analyzes the initialization data packet to obtain IP header information of the voice call, and the IP header information of the voice call is stored in an area corresponding to the voice call in a shared memory;
a forwarding step: the kernel module regularly detects whether the shared memory is to be updated with the voice stream to be sent, if so, the voice stream to be sent and the corresponding IP header information are taken out from the shared memory to generate a data packet to be sent, and the data packet is forwarded to the voice service platform;
a step of unloading: the kernel module receives the data packet to be processed fed back by the voice service platform, analyzes the data packet to be processed to obtain a voice stream to be processed and a corresponding voice call, and stores the voice stream to be processed in a region corresponding to the corresponding voice call in the shared memory.
10. A storage medium which is a computer-readable storage medium having a speech processing program stored thereon, the speech processing program being a computer program, characterized in that: the speech processing program when executed by a processor implements the steps of:
a creating step: the kernel module dynamically creates a shared memory and sends a physical address of the shared memory to the voice processing module, so that the voice processing module maps the physical address of the shared memory to a virtual memory address of the voice processing module;
and acquiring an IP (Internet protocol): when a voice call starts, the kernel module receives an initialization data packet sent by the voice processing module and analyzes the initialization data packet to obtain IP header information of the voice call, and the IP header information of the voice call is stored in an area corresponding to the voice call in a shared memory;
a forwarding step: the kernel module regularly detects whether the shared memory is to be updated with the voice stream to be sent, if so, the voice stream to be sent and the corresponding IP header information are taken out from the shared memory to generate a data packet to be sent, and the data packet is forwarded to the voice service platform;
a step of unloading: the kernel module receives the data packet to be processed fed back by the voice service platform, analyzes the data packet to be processed to obtain a voice stream to be processed and a corresponding voice call, and stores the voice stream to be processed in a region corresponding to the corresponding voice call in the shared memory.
CN201911345718.3A 2019-12-24 2019-12-24 Voice equipment, processing method, device and storage medium for network telephone Active CN111200692B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911345718.3A CN111200692B (en) 2019-12-24 2019-12-24 Voice equipment, processing method, device and storage medium for network telephone

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911345718.3A CN111200692B (en) 2019-12-24 2019-12-24 Voice equipment, processing method, device and storage medium for network telephone

Publications (2)

Publication Number Publication Date
CN111200692A CN111200692A (en) 2020-05-26
CN111200692B true CN111200692B (en) 2021-10-26

Family

ID=70747512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911345718.3A Active CN111200692B (en) 2019-12-24 2019-12-24 Voice equipment, processing method, device and storage medium for network telephone

Country Status (1)

Country Link
CN (1) CN111200692B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8645754B1 (en) * 2008-12-15 2014-02-04 Open Invention Network, Llc Method and system for providing coordinated checkpointing to a group of independent computer applications
WO2014178948A1 (en) * 2013-03-14 2014-11-06 Vonage Business Solutions, Inc. Dynamic application integration associated with telephonic communications through hosted voip pbx using client-side integration proxy
CN105589881A (en) * 2014-10-23 2016-05-18 大唐软件技术股份有限公司 Data processing method and device
CN110493145A (en) * 2019-08-01 2019-11-22 新华三大数据技术有限公司 A kind of caching method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100353352C (en) * 2003-04-15 2007-12-05 华为技术有限公司 Method of reducing data transmission delay in coding decoding process and its device
US8311817B2 (en) * 2010-11-04 2012-11-13 Audience, Inc. Systems and methods for enhancing voice quality in mobile device
US8571528B1 (en) * 2012-01-25 2013-10-29 Intuit Inc. Method and system to automatically create a contact with contact details captured during voice calls

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8645754B1 (en) * 2008-12-15 2014-02-04 Open Invention Network, Llc Method and system for providing coordinated checkpointing to a group of independent computer applications
WO2014178948A1 (en) * 2013-03-14 2014-11-06 Vonage Business Solutions, Inc. Dynamic application integration associated with telephonic communications through hosted voip pbx using client-side integration proxy
CN105589881A (en) * 2014-10-23 2016-05-18 大唐软件技术股份有限公司 Data processing method and device
CN110493145A (en) * 2019-08-01 2019-11-22 新华三大数据技术有限公司 A kind of caching method and device

Also Published As

Publication number Publication date
CN111200692A (en) 2020-05-26

Similar Documents

Publication Publication Date Title
US11240159B2 (en) Service link selection control method and device
CN108432200B (en) Method for protecting and controlling access to private personal information
US10999377B2 (en) Method, device and computer program product for protocol selection
CN104579970B (en) A kind of strategy matching device of IPv6 messages
US9065788B2 (en) Method, device and system for voice communication
WO2019104974A1 (en) Dubbo platform-based automatic server starting and stopping method , server, and storage medium
US10530726B2 (en) Email notifications
US9307555B2 (en) Method and system for mobile terminal to access the network through cell phone
US20200110633A1 (en) Method and apparatus for enhanced assertion management in cloud media processing
CN108696523B (en) Response method and device for call service
CN104601534A (en) Method and system for processing CDN system images
EP2974159B1 (en) Method, device and system for voice communication
US20150199169A1 (en) Universal serial bus-to-bluetooth audio bridging devices
CN112751812A (en) Method and device for self-adapting application protocol
CN111131439A (en) iSCSI-based message transmission method, device, equipment and storage medium
US9894117B2 (en) File transfers for virtual conferences
CN104639501A (en) Data stream transmission method, equipment and system
US10728171B2 (en) Governing bare metal guests
CN111200692B (en) Voice equipment, processing method, device and storage medium for network telephone
CN108768727A (en) Access method, electronic device and the readable storage medium storing program for executing of third party's service
US8280943B1 (en) Managing service provider messaging
CN105144658A (en) Centralized task management using a router
EP4149087A1 (en) Methods and apparatuses for shunting clustered gateways, storage medium, and electronic device
US20140344423A1 (en) Method, apparatus and system for switching function mode
CN103283185A (en) Prioritization of data communication

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant