Voice message decompression method and device, decompression equipment and storage medium
By obtaining the sequence number and timestamp parameters of the voice message, and calculating the timestamp parameters after packet loss for decompression, the packet loss problem during the transition between the silent and active periods of the voice message is solved, improving decompression efficiency and bandwidth utilization.
Patent Information
- Application Number
- CN202410752252.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2025-12-12
AI Technical Summary
In existing technologies, when voice messages switch between silent and active periods, lost notification messages cause decompression failures, leading to a rollback of the compression and decompression contexts, which reduces bandwidth utilization and decompression efficiency.
By obtaining the sequence number and timestamp parameters of two consecutively received voice messages, it is determined whether packet loss has occurred. In the case of packet loss, the timestamp parameters of the subsequent message are calculated based on the timestamp parameters of the previously received voice message for decompression, thus avoiding resynchronization.
It enables voice message recovery in the event of packet loss, improves decompression efficiency, avoids packet loss and resynchronization processes, and improves bandwidth utilization.
Smart Images

Figure CN121125703A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of communication, and particularly relates to a voice message decompression method and device, a decompression equipment and a storage medium. BACKGROUND
[0002] In an LTE (Long-Term Evolution) or NR (New Radio) mobile communication network, a voice message of VOLTE (Voice over Long-Term Evolution) or VONR (Voice over New Radio) has the characteristics of periodic arrival and relatively fixed packet size. For example, a wideband voice message with a maximum rate of 23.85 Kbps (kilobit per second) is 61 bytes, but the message header (message header RTP (Real-time Transport Protocol) / UDP (User Datagram Protocol) / IPv6 (Internet Protocol Version 6) or IPv4 (Internet Protocol version 4)) of the voice message is 60 bytes, so the actual utilization rate of the air bandwidth is only about 50%, and the size of the voice content in the silence period is only 7 bytes, but the message header is 60 bytes, so the bandwidth utilization rate is as low as 10%. Therefore, in order to improve the bandwidth utilization rate, the compression end can use the ROHC (Robust Header Compression) algorithm to compress the message header of the voice message to 1-3 bytes, at this time, the bandwidth utilization can reach more than 90%.
[0003] In the related art, when the voice is converted between the silence period and the active period, the TS (Timestamp) field in the message header of the voice message is incremented very irregularly, so the compression end needs to send a longer compressed packet to inform the decompression end of the change of the related information, at this time, if such a notification message is lost, the decompression end will fail to decompress the voice message subsequently, causing the compression end and the decompression context to back off and then re-synchronize.
[0004] That is, the decompression end feeds back NACK (Negative Acknowledgement) to the compression end, the decompression end retransmits the UOR-2 (Unidirectional-Optimistic-Reliable-2) or IR-DYN (Initialization and Refresh-Dynamic) message for re-synchronization of the contexts of the two ends, which causes packet loss and reduces the decompression efficiency. SUMMARY
[0005] The application provides a voice message decompression method and device, a decompression equipment and a storage medium.
[0006] According to an aspect of the application, a voice message decompression method is provided, which comprises the following steps: obtaining a first sequence number of a first voice message and a second sequence number of a second voice message received successively twice; wherein the receiving time of the second voice message is later than the receiving time of the first voice message; determining whether packet loss occurs between the first voice message and the second voice message according to the first sequence number and the second sequence number; in the case of packet loss, determining a second timestamp parameter corresponding to the second sequence number according to the first sequence number, the second sequence number and a first timestamp parameter corresponding to the first sequence number; wherein the first timestamp parameter is used for decompressing the first voice message; and decompressing the second voice message based on the second timestamp parameter.
[0007] According to another aspect of the application, a decompression equipment is provided, which comprises a memory, a transceiver and a processor.
[0008] The memory is used for storing a computer program; the transceiver is used for transceiving data under the control of the processor; and the processor is used for reading the computer program in the memory and performing the following operations: obtaining a first sequence number of a first voice message and a second sequence number of a second voice message received successively twice; wherein the receiving time of the second voice message is later than the receiving time of the first voice message; determining whether packet loss occurs between the first voice message and the second voice message according to the first sequence number and the second sequence number; in the case of packet loss, determining a second timestamp parameter corresponding to the second sequence number according to the first sequence number, the second sequence number and a first timestamp parameter corresponding to the first sequence number; wherein the first timestamp parameter is used for decompressing the first voice message; and decompressing the second voice message based on the second timestamp parameter.
[0009] According to another aspect of this application, a voice message decompression apparatus is provided. The apparatus includes: an acquisition unit, configured to acquire a first sequence number of a first voice message and a second sequence number of a second voice message received twice consecutively; wherein the reception time of the second voice message is later than the reception time of the first voice message; a judgment unit, configured to determine whether packet loss has occurred between the first voice message and the second voice message based on the first sequence number and the second sequence number; a determination unit, configured to determine a second timestamp parameter corresponding to the second sequence number based on the first sequence number, the second sequence number, and a first timestamp parameter corresponding to the first sequence number in the event of packet loss; wherein the first timestamp parameter is used to decompress the first voice message; and a decompression unit, configured to decompress the second voice message based on the second timestamp parameter.
[0010] According to another aspect of this application, a processor-readable storage medium is provided that stores a computer program for causing the processor to execute a decompression method for the aforementioned voice message.
[0011] According to another aspect of this application, a computer program product is provided that, when an instruction processor in the computer program product is executed, performs a decompression method for the aforementioned voice message.
[0012] This application has the following technical effects: In the event of packet loss, the decompression device calculates the second timestamp parameter based on the SN and first timestamp parameter of the first voice message received before the packet loss, and the SN of the second voice message received after the packet loss, and decompresses the second voice message based on the second timestamp parameter. This can recover the second voice message that cannot be decompressed, avoid packet loss caused by discarding the second voice message, and the decompression device does not need to resynchronize the context with the compression device or send a NACK to the compression device, which can improve the decompression efficiency of the voice message.
[0013] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description
[0014] The accompanying drawings are provided for a better understanding of this solution and do not constitute a limitation of this application. Wherein:
[0015] Figure 1 This is a schematic diagram of the existing RTP protocol header structure;
[0016] Figure 2 This is a schematic diagram illustrating the changes in voice messages during the silent and active periods in a voice call, as provided in this application.
[0017] Figure 3 This is a flowchart illustrating a method for decompressing voice messages provided in an embodiment of this application;
[0018] Figure 4 This is a flowchart illustrating another method for decompressing voice messages provided in an embodiment of this application;
[0019] Figure 5 This is a flowchart illustrating another method for decompressing voice messages provided in an embodiment of this application;
[0020] Figure 6 This is a flowchart illustrating another method for decompressing voice messages provided in an embodiment of this application;
[0021] Figure 7 This is a schematic diagram of a decompression device provided according to an embodiment of this application;
[0022] Figure 8 This is a schematic diagram of the structure of a voice message decompression device provided in an embodiment of this application. Detailed Implementation
[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0024] In this application's embodiments, the term "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0025] Currently, voice message format is generally IPv6. The IP (Internet Protocol) header is 40 bytes. During a voice call, the non-checksum fields in the IP and UDP headers rarely change. In the initial stage of the voice call, the compression end notifies the decompression end through IR (Initialization and Refresh) or IR-DYN messages. During the continuous voice call, there is no need for special display of the data being transmitted from the compression end to the decompression end.
[0026] The structure of the RTP protocol header is as follows: Figure 1As shown, SN (Sequence Number) occupies 16 bits; TS (Timestamp) occupies 32 bits, and TS is used to indicate the sampling time of voice data; V (version) occupies 2 bits, used to define the RTP version, such as the current protocol version number being 2; P (padding) occupies 1 bit, used to indicate whether there is padding at the end of the message; X (extension) occupies 1 bit, used to indicate whether there is an extension header after the RTP protocol header; CC is short for CSRC (Contributing Source) Count, CC occupies 4 bits, used to indicate the number of CSRC identifiers; the CSRC identifier is marked by CC and is generally not carried; M (Marker) occupies 1 bit, used to record the meaning of different payloads; PT (payload type) occupies 7 bits, used to indicate the type of payload in the RTP message; SSRC is short for synchronization source.
[0027] The TS encoding in the RTP protocol header is as follows:
[0028] TS = TS_SCALED * TS_STRIDE + TS_OFFSET; (1)
[0029] Among them, TS_SCALED refers to the timestamp scale, TS_STRIDE refers to the timestamp stride, and TS_OFFSET refers to the timestamp offset.
[0030] Figure 1 The functional relationship between SN and TS in the equation can be expressed as:
[0031] f(SN i )=(1 + TS_SCALED i-1 )* TS_STRIDE + TS_OFFSET; (2)
[0032] Among them, SN i This refers to the SN in the RTP header of the i-th received voice message, TS_SCALED. i-1 This refers to the proportion of timestamps used to encode the TS in the (i-1)th received voice message (Timestamp SCALE). Here, i is a positive integer greater than 1.
[0033] During voice activity periods, the TS increment for wideband voice is typically 320 (where 320 = 16000 * 0.02, 320 refers to 320 sampling points per voice frame, and 16000 refers to a sampling rate of 16 kHz), while the TS increment for narrowband voice is typically 160 (where 160 = 8000 * 0.02, 160 refers to 160 sampling points per voice frame, and 8000 refers to a sampling rate of 8 kHz). During voice silence periods, some sampling points are discarded, and the TS increment becomes 8 * 320 or 8 * 160. However, at the instant of transition between voice silence and activity periods, the TS increment is x * 320 or x * 160, where x = 1, 2, 3, ..., 8. Therefore, when switching between a voice silence period and an active period, the compression end needs to send a UOR-2 (Unidirectional-Optimistic-Reliable-2) message with an extension 3 (EXT-3) to notify the decompression end that this increment has changed. This increment is called the timestamp stride (TS_Stride).
[0034] As an example, let's take a UE (User Equipment) with device identifier 191 as an example, where the compression end (or sender) is a device. Figure 2 As shown, during a voice call, the voice message changes multiple times between the silent and active periods. For example, the transition from the silent to the active period occurs at SN=0x1312, 0x1313, 0x1314, and 0x1315 in the voice message. The TS stride between SN=0x1312 and 0x1313 is 0x00000640, the TS stride between SN=0x1314 and 0x1313 is 0x00000140, the TS stride between SN=0x1315 and 0x1314 is 0x00000140, and the TS stride after SN=0x1315 is 0x00000140.
[0035] The transition from the activation period to the quiescent period occurs at SN = 0x1324, 0x1325, 0x1326, and 0x1327. The TS stride between SN = 0x1325 and 0x1324 is 0x00000140, the TS stride between SN = 0x1326 and 0x1325 is 0x000003c0, the TS stride between SN = 0x1327 and 0x1326 is 0x00000a00, and the TS stride after SN = 0x1327 is 0x00000a00.
[0036] It should be noted that, Figure 2In this context, PDCP stands for Packet Data Convergence Protocol; RHC stands for ROHC; DL stands for Down Link; CellBbu refers to the BBU (Baseband Unit) serving the UE in the serving cell; Time refers to the system time of the access network device; Dlen refers to the message length or packet length; and BbId refers to the Radio Bearer Identifier.
[0037] exist Figure 2 During the speech process shown, the TS stride will change as described above: x*320 (where x = 1, 2, 3, ..., 8). Normally, the compression end will notify the decompression end of the changed TS and TS_Stride via UOR-2 carrying EXT-3. Subsequent packets use UO-1 (Unidirectional-Optimistic-1) and UO-0 (Unidirectional-Optimistic-0) without carrying these fields to save on field overhead.
[0038] However, if a bit error occurs at this point, the UOR-2 message carrying EXT-3 will be lost, and subsequent UO-1 and UO-0 messages will fail to decode. In other words, in related technologies, if the decompression end fails to decompress voice messages according to section 5.4.2 of RFC3095 and loses these messages, the decompression end will send a NACK to the compression end, and the decompression end will resend the UOR-2 or IR-DYN message to resynchronize the context at both ends. This can lead to message loss and reduced decompression efficiency.
[0039] In order to address at least one of the aforementioned problems, this application provides a method, apparatus, decompression device, and storage medium for decompressing voice messages.
[0040] The following description, with reference to the accompanying drawings, details the voice message decompression method, apparatus, decompression device, and storage medium of this embodiment. Before specifically explaining the embodiments of this application, for ease of understanding, the technical terms involved in this application will first be introduced:
[0041] The first voice message refers to the voice message received earlier in a series of two consecutive compressed voice messages received by the decompression device.
[0042] The first sequence number refers to the serial number (SN) of the first voice message. The first sequence number can be the SN of the PDCP protocol header or the SN of the RTP protocol header of the first voice message.
[0043] The second voice message refers to the latter of two consecutive compressed voice messages received by the decompression device. That is, the second voice message is received later than the first voice message.
[0044] The second sequence number refers to the SN of the second voice message. The second sequence number can be the SN of the PDCP protocol header or the SN of the RTP protocol header of the second voice message.
[0045] The first timestamp parameter is used to decompress the first voice message. For example, the first timestamp parameter can be used to decompress the TS encoded value in the first voice message. The TS encoded value refers to the encoded value obtained by encoding the TS in the header of the first voice message using an encoding algorithm or compression algorithm. The TS in the header is used to indicate the actual sampling time of the voice content in the first voice message.
[0046] Similarly, the second timestamp parameter is used to decompress the second voice message. For example, the second timestamp parameter can be used to decompress the TS encoded value (denoted as the target encoded value in this application) in the second voice message. The target encoded value is obtained by encoding the actual timestamp, which indicates the actual sampling time of the voice content in the second voice message.
[0047] Silence, or a period of silence, refers to a phase in which there is little or no meaningful speech content in a voice message (or voice signal). This usually occurs during brief periods of silence or pause between participants in a call.
[0048] Activation, or activation period, refers to the stage in which a voice message (or voice signal) contains valid voice content. This is the state when a participant in a call is actually speaking or making sounds.
[0049] The first set value is a pre-set or configured value, for example, the first set value can be 8.
[0050] The second setting value is also a pre-set or configured value, and the second setting value is less than the first setting value. For example, the second setting value can be 1.
[0051] The predicted timestamp is the calculated timestamp TS, which is used to indicate the predicted or estimated sampling time of the speech content in the second speech message.
[0052] Candidate values are pre-configured positive integers, for example, multiple candidate values are: 1, 2, 3, 4, 5, 6, 7, 8.
[0053] Figure 3This is a flowchart illustrating a method for decompressing voice messages provided in an embodiment of this application.
[0054] The voice message decompression method of this application embodiment can be applied to a decompression device (or decompression end). The decompression device includes, but is not limited to, access network devices and terminal devices. For example, when the compression device (or compression end) is a terminal device, the compression end can send the compressed voice message to the access network device; that is, the decompression device can be an access network device. Similarly, when the compression device is an access network device, the access network device can send the compressed voice message to the terminal device; that is, the decompression device can be a terminal device.
[0055] This example uses an access network device as a base station. A base station can include multiple cells providing services to terminal devices. Depending on the specific application, a base station may also be called an access point, or a device in the access network that communicates with wireless terminal devices via one or more sectors on the air interface, or other names. The access network device can be used to exchange received air frames with Internet Protocol (IP) packets, acting as a router between the wireless terminal device and the rest of the access network, which may include an IP communication network. The access network device can also coordinate the attribute management of the air interface. For example, the access network equipment involved in the embodiments of this application can be the Base Transceiver Station (BTS) in Global System for Mobile communications (GSM) or Code Division Multiple Access (CDMA), or the NodeB in Wide-band Code Division Multiple Access (WCDMA). It can also be the evolved Node B (eNB or e-NodeB) in a long-term evolution (LTE) system, a 5G base station (gNB) in a next-generation system, or a Home evolved Node B (HeNB), relay node, femto, pico, etc., and is not limited in the embodiments of this application. In some network structures, the base station can include Centralized Unit (CU) nodes and Distributed Unit (DU) nodes, and the Centralized Unit and Distributed Unit can also be geographically separated.
[0056] Terminal devices can be devices that provide voice and / or data connectivity to users, handheld devices with wireless connectivity, or other processing devices connected to a wireless modem. The name of the terminal device may differ in different systems; for example, in a 5G system, the terminal device can be called User Equipment (UE). Wireless terminal devices can communicate with one or more core networks (CNs) via a Radio Access Network (RAN). Wireless terminal devices can be mobile terminal devices, such as mobile phones (or "cellular" phones) and computers with mobile terminal devices, for example, portable, pocket-sized, handheld, computer-embedded, or vehicle-mounted mobile devices. They exchange voice and / or data with the RAN. Examples include Personal Communication Service (PCS) phones, cordless phones, Session Initiated Protocol (SIP) phones, Wireless Local Loop (WLL) stations, and Personal Digital Assistants (PDAs). Wireless terminal equipment can also be referred to as a system, subscriber unit, subscriber station, mobile station, mobile station, remote station, access point, remote terminal, access terminal, user terminal, user agent, or user device, but this application does not limit the terminology.
[0057] like Figure 3 As shown, the decompression method for the voice message may include the following steps S301 to S304:
[0058] Step S301: Obtain the first sequence number of the first voice message and the second sequence number of the second voice message received in two consecutive transactions.
[0059] Both the first and second voice messages are compressed voice messages. For example, the headers of both the first and second voice messages are compressed using the ROHC algorithm. Furthermore, both the first and second voice messages are sent by the same compression device.
[0060] The second voice message is received later than the first voice message. For example, the second voice message may be the voice message received by the decompression device this time or currently, and the first voice message may be the voice message received by the decompression device previously or most recently.
[0061] In the embodiments of this application, the decompression device can determine the first voice message and the second voice message received twice consecutively, and obtain the SN of the first voice message (referred to as the first sequence number in this application) and the SN of the second voice message (referred to as the second sequence number in this application).
[0062] Step S302: Determine whether packet loss has occurred between the first voice message and the second voice message based on the first sequence number and the second sequence number.
[0063] In this embodiment of the application, the decompression device can determine whether packet loss has occurred between the first voice message and the second voice message based on the difference between the second sequence number and the first sequence.
[0064] For example, if the difference is relatively small, the decompression device can determine that no packet loss has occurred between the first voice message and the second voice message; if the difference is relatively large, the decompression device can determine that packet loss has occurred between the first voice message and the second voice message.
[0065] As one possible implementation, the decompression device can calculate the difference between the second sequence number and the first sequence number, and determine whether the difference is greater than a set value (referred to as the second set value in this application). If the difference is greater than the second set value, the decompression device can determine that packet loss has occurred between the first voice message and the second voice message; if the difference is less than or equal to the second set value, the decompression device can determine that no packet loss has occurred between the first voice message and the second voice message.
[0066] In this embodiment of the application, if no packet loss occurs between the first voice message and the second voice message, the decompression device can use an existing decompression algorithm to decompress the second voice message. If packet loss occurs between the first voice message and the second voice message, the decompression device can perform subsequent steps.
[0067] Step S303: In the event of packet loss, determine the second timestamp parameter corresponding to the second sequence number based on the first sequence number, the second sequence number, and the first timestamp parameter corresponding to the first sequence number.
[0068] The first timestamp parameter is used to decompress the first voice message.
[0069] In this embodiment of the application, when packet loss occurs between the first voice message and the second voice message, the decompression device can obtain or query the first timestamp parameter corresponding to the first sequence number, and calculate the second timestamp parameter corresponding to the second sequence number based on the first sequence number, the second sequence number and the first timestamp parameter.
[0070] Step S304: Decompress the second voice message based on the second timestamp parameter.
[0071] In this embodiment of the application, the decompression device can decompress the second voice message based on the second timestamp parameter.
[0072] The voice message decompression method of this application embodiment, in the event of packet loss, calculates a second timestamp parameter based on the SN and first timestamp parameter of the first voice message received before packet loss and the SN of the second voice message received after packet loss, and decompresses the second voice message based on the second timestamp parameter. This can recover the second voice message that cannot be decompressed, avoid packet loss caused by discarding the second voice message, and the decompression device does not need to resynchronize the context with the compression device or send a NACK to the compression device, which can improve the decompression efficiency of voice messages.
[0073] To clearly illustrate how the decompression end determines the second timestamp parameter corresponding to the second sequence number based on the first sequence number, the second sequence number, and the first timestamp parameter corresponding to the first sequence number in the above embodiments, this application also proposes a method for decompressing voice messages.
[0074] Figure 4 This is a flowchart illustrating another method for decompressing voice messages provided in an embodiment of this application.
[0075] like Figure 4 As shown, the decompression method for the voice message may include the following steps S401 to S406:
[0076] Step S401: Obtain the first sequence number of the first voice message and the second sequence number of the second voice message received in two consecutive transactions.
[0077] The second voice message was received later than the first voice message.
[0078] Step S402: Determine whether packet loss has occurred between the first voice message and the second voice message based on the first sequence number and the second sequence number.
[0079] The explanation of steps S401 to S402 can be found in the relevant description in any embodiment of this application, and will not be repeated here.
[0080] Step S403: In the event of packet loss, obtain the first message type corresponding to the first sequence number and the second message type corresponding to the second sequence number.
[0081] The first message type or the second message type includes, but is not limited to: silent, active.
[0082] In this embodiment, in the event of packet loss, the decompression device can obtain the message type corresponding to the first sequence number (referred to as the first message type in this application), that is, the first message type is the message type of the first voice message. Furthermore, the decompression device can also obtain the message type corresponding to the second sequence number (referred to as the second message type in this application), that is, the second message type is the message type of the second voice message.
[0083] Step S404: If the first message type and the second message type are different, determine the target value based on the difference between the second sequence number and the first sequence number, and obtain the first timestamp parameter corresponding to the first sequence number.
[0084] The first timestamp parameter is used to decompress the first voice message.
[0085] In this embodiment, when the first message type and the second message type are different (for example, the first message type is silent and the second message type is active, or the first message type is active and the second message type is silent), the decompression device can determine the target value based on the difference between the second sequence number and the first sequence number. For example, the target value = second sequence number - first sequence number - 1. Furthermore, the decompression device can also obtain or query the first timestamp parameter corresponding to the first sequence number.
[0086] Step S405: Determine the second timestamp parameter based on the first message type, the second message type, the target value, and the first timestamp parameter.
[0087] In this embodiment of the application, the decompression device can determine the second timestamp parameter by comprehensively considering the first message type, the second message type, the target value, and the first timestamp parameter.
[0088] Step S406: Decompress the second voice message based on the second timestamp parameter.
[0089] The explanation of step S406 can be found in the relevant description in any embodiment of this application, and will not be repeated here.
[0090] The voice message decompression method of this application embodiment can realize the following when different message types are converted and packet loss occurs: based on the converted message type, the difference between the SN of the second voice message received after packet loss and the SN of the first voice message received before packet loss, and the first timestamp parameter, a second timestamp parameter is calculated, and the second voice message that cannot be decompressed is recovered based on the second timestamp parameter. This can avoid packet loss caused by discarding the second voice message and improve the decompression efficiency of the second voice message.
[0091] To clearly illustrate how the decompression device in the above embodiments of this application determines the second timestamp parameter based on the first message type, the second message type, the target value, and the first timestamp parameter, this application also proposes a method for decompressing voice messages.
[0092] Figure 5 This is a flowchart illustrating another method for decompressing voice messages provided in an embodiment of this application.
[0093] like Figure 5 As shown, the decompression method for the voice message may include the following steps S501 to S509:
[0094] Step S501: Obtain the first sequence number of the first voice message and the second sequence number of the second voice message received in two consecutive transactions.
[0095] The second voice message was received later than the first voice message.
[0096] Step S502: Determine whether packet loss has occurred between the first voice message and the second voice message based on the first sequence number and the second sequence number.
[0097] Step S503: In the event of packet loss, obtain the first message type corresponding to the first sequence number and the second message type corresponding to the second sequence number.
[0098] Step S504: If the first message type and the second message type are different, determine the target value based on the difference between the second sequence number and the first sequence number, and obtain the first timestamp parameter corresponding to the first sequence number.
[0099] The explanation of steps S501 to S504 can be found in the relevant description in any embodiment of this application, and will not be repeated here.
[0100] In any embodiment of this application, the first timestamp parameter is used to decompress the first voice message. The first timestamp parameter may include a first timestamp ratio (e.g., marked as TS Scale0), a first timestamp multiple (e.g., marked as TS Stride0), and a first timestamp offset (e.g., marked as TS offset0).
[0101] Similarly, the second timestamp parameter used to decompress the second voice message may include a second timestamp scale (e.g., labeled TS Scale1), a second timestamp multiple (e.g., labeled TS Stride1), and a second timestamp offset (e.g., labeled TS offset1).
[0102] Step S505: When the first message type is silent and the second message type is active, the ratio of the first timestamp multiple to the first set value is used as the second timestamp multiple in the second timestamp parameter.
[0103] In this embodiment of the application, when the first message type is silent and the second message type is active, the decompression device can directly use the ratio of the first timestamp multiple to the first set value as the second timestamp multiple in the second timestamp parameter.
[0104] Taking the first setting value of 8 as an example, when the first message type is silent and the second message type is active, the first timestamp multiple TS Stride0 can also be marked as Stride-Sil, and the second timestamp multiple TS Stride1 can also be marked as Stride-Act. At this time, we have: TS Stride0 = Stride-Sil = 8 * Stride-Act, that is, Stride-Act = Stride-Sil / 8.
[0105] Step S506: Calculate the initial timestamp ratio corresponding to the second sequence number based on the target value and the first timestamp ratio.
[0106] In this embodiment of the application, the decompression device can calculate the initial timestamp ratio corresponding to the second sequence number based on the target value and the first timestamp ratio.
[0107] In any embodiment of this application, the decompression device may employ steps A to D to calculate the initial timestamp ratio corresponding to the second sequence number:
[0108] Step A: Obtain or calculate the product of the first timestamp ratio and the first set value (referred to as the first product in this application).
[0109] Step B: Iterate through multiple candidate values in sequence, and substitute the currently iterated candidate value, the first product, and the target value into the first expression to obtain the first candidate timestamp ratio.
[0110] The first expression indicates the mapping relationship between the candidate values and the timestamp ratio when the message type changes from silent to active.
[0111] Among them, multiple candidate values are less than or equal to the first set value.
[0112] As an example, taking the second sequence number as SN1, the first sequence number as SN0, the target value as SN1 – SN0 – 1, and the first set value as 8, the first expression can be:
[0113] TS Scale1 = (SN1- SN0 - 1)+(TS Scale0 * 8)+ x; (3)
[0114] In this application, the candidate values of the current traversal can be substituted into x in formula (3) to obtain the specific value of TS Scale1, which is the first candidate timestamp ratio.
[0115] Step C: Determine the first candidate timestamp based on the proportion of the first candidate timestamp, the multiple of the second timestamp, and the offset of the first timestamp.
[0116] For example, the first candidate timestamp can be calculated using the following formula:
[0117] TS = TS Scale1 * TS Stride1 + TS offset0; (4)
[0118] That is, the specific value of TS can be obtained by substituting the first candidate timestamp ratio into TS Scale1 in formula (4), the second timestamp multiple into TS Stride1 in formula (4), and the first timestamp offset into TS offset0 in formula (4).
[0119] Step D: Determine the initial timestamp ratio based on the first candidate timestamp.
[0120] As an example, a decompression device can use the following steps D-1 through D-5 to calculate the initial timestamp ratio:
[0121] Step D-1: Update the target encoding value in the second voice message according to the first candidate timestamp to obtain the updated second voice message.
[0122] The target encoded value is obtained by encoding the actual timestamp, which is used to indicate the actual sampling time of the voice content in the second voice message.
[0123] That is, the target encoding value in the message header or protocol header of the second voice message can be replaced with the first candidate timestamp to obtain the updated second voice message.
[0124] Step D-2: Perform CRC (Cyclic Redundancy Check) on the updated second voice message to obtain the first CRC value.
[0125] Step D-3: Determine whether the first CRC value is consistent with the second CRC value carried in the second voice message. If yes, proceed to step D-4; otherwise, proceed to step D-5.
[0126] Step D-4: Stop the traversal and use the first candidate timestamp ratio as the initial timestamp ratio.
[0127] It is understandable that if the calculated first CRC value is consistent with the second CRC value carried in the second voice message, it indicates that the second voice message is decompressed correctly. At this time, the first candidate timestamp ratio can be used as the initial timestamp ratio.
[0128] Step D-5: Continue traversing the candidate values until the third CRC value determined based on the second candidate timestamp ratio corresponding to the candidate value being traversed matches the second CRC value. Stop traversing then and use the second candidate timestamp ratio as the initial timestamp ratio.
[0129] Understandably, if the calculated first CRC value is inconsistent with the second CRC value carried in the second voice message, it indicates that the second voice message is decompressed incorrectly. At this time, it is necessary to continue traversing the candidate values until the third CRC value determined based on the proportion of the second candidate timestamp corresponding to the candidate values being traversed is consistent with the second CRC value. Then, the traversal stops, and the proportion of the second candidate timestamp is used as the initial timestamp proportion.
[0130] The calculation method for the proportion of the second candidate timestamp is similar to that for the proportion of the first candidate timestamp. That is, the candidate values to be traversed, the first product, and the target value can be substituted into the first expression to obtain the proportion of the second candidate timestamp.
[0131] The calculation method for the third CRC value is similar to that for the first CRC value, and will not be elaborated here.
[0132] Step S507: Determine the predicted timestamp based on the initial timestamp ratio, the second timestamp multiple, and the first timestamp offset.
[0133] In this embodiment of the application, the decompression device can calculate the predicted timestamp based on the initial timestamp ratio, the second timestamp multiple, and the first timestamp offset; wherein, the predicted timestamp is used to indicate the estimated sampling time of the voice content in the second voice message.
[0134] As an example, the predicted timestamp = initial timestamp ratio * second timestamp multiple + first timestamp offset.
[0135] Step S508: Determine the second timestamp ratio and the second timestamp offset based on the multiple of the predicted timestamp and the second timestamp.
[0136] In this embodiment of the application, the decompression device can calculate the second timestamp ratio and the second timestamp offset based on the multiple of the predicted timestamp and the second timestamp.
[0137] As an example, a decompression device can round down the ratio of the predicted timestamp to the second timestamp multiple to obtain the second timestamp ratio.
[0138] For example, if the predicted timestamp is 0x00224340 and the second timestamp multiple is 0x140, the second timestamp ratio TS Scale1 = INT(0x00224340 / 0x140) = 0x1b69; where INT means rounding down.
[0139] As an example, the decompression device can perform a modulo operation on the predicted timestamp by a second timestamp multiple to obtain the second timestamp offset.
[0140] Using the example above, the second timestamp offset Ts offset1 = 0x00224340 mod 0x140 = 0.
[0141] Step S509: Decompress the second voice message based on the second timestamp parameter.
[0142] The explanation of step S509 can be found in the relevant description in any embodiment of this application, and will not be repeated here.
[0143] In any embodiment of this application, the decompression method of the second voice message may include, for example, the following steps 1 to 3:
[0144] Step 1: Obtain or calculate the product of the second timestamp ratio and the second timestamp multiple in the second timestamp parameter (referred to as the third product in this application).
[0145] Step 2: Determine the actual timestamp corresponding to the target encoding value in the second voice message based on the sum of the third product and the second timestamp offset in the second timestamp parameter.
[0146] The target encoded value is obtained by encoding the actual timestamp, which is used to indicate the actual sampling time of the voice content in the second voice message.
[0147] As an example, the sum of the third product and the second timestamp offset can be used as the actual timestamp.
[0148] Step 3: Decompress the target encoded value in the second voice message based on the actual timestamp. For example, the target encoded value in the second voice message can be replaced with the actual timestamp to obtain the decompressed second voice message.
[0149] The voice message decompression method of this application embodiment can recover undecompressable voice messages when a voice message transitions from a silent period to an active period and packet loss occurs, thus avoiding packet loss caused by discarding the voice message.
[0150] The following, with reference to Example A, details the implementation principle of recovering voice messages when a transition from a silent period to an active period occurs and packet loss occurs.
[0151] Example A: When a voice transitions from a silent period to an active period, if the decompression device receives a UO-1 or UO-0 message and packet loss occurs in between, decompression will fail. In this case, the decompression device will attempt to recover the voice message by calculating the TS (Transmission Time), instead of relying on packet loss and NACK (Non-Acknowledgement) feedback as in existing technologies. The implementation principle mainly includes the following steps:
[0152] Step a: Determine if packet loss has occurred: This is determined based on the difference in the serial number (SN) between two consecutively received packets. For example, the SN in the PDCP header or the RTP header of the two packets can be used to determine if packet loss has occurred. Specifically, for the PDCP header, if the difference in the SN between the PDCP headers of two consecutively received packets equals the number of packets lost, then packet loss has occurred. For the RTP header, if the difference in the SN between the RTP headers of two consecutively received packets equals the number of packets lost, then packet loss has occurred.
[0153] For ease of understanding, this application will use voice messages as an example of RTP messages in the following description.
[0154] Assume the sequence number of the previously received first voice message is SN0, and the sequence number of the currently received second voice message is SN1. SN1 - SN0 > 1, the TS stride of SN1 is TS stride1, the TS scale of SN1 is TS scale1, and the TS offset of SN1 is TS offset0. Similarly, the TS stride of SN0 is TS stride0, the TS scale of SN0 is TS scale0, and the TS offset of SN0 is TS offset0. The first voice message corresponding to SN0 is either UO-1 or UO-0, and the second voice message corresponding to SN1 is either UO-1 or UO-0. Both messages are of different types: silent or active.
[0155] The TS Stride for a voice message of type Activated (hereinafter referred to as Activated Message) is Stride-Act, and the TS Stride for a voice message of type Silent (hereinafter referred to as Silent Message) is Stride-Sil.
[0156] Step b: When speech transitions from a silent period to an active period, the following condition is met:
[0157] TS Stride0 of SN0=Stride-Sil=8*Stride-Act;
[0158] TS of SN0=TS Scale0*TS Stride0+TS offset=(TS Scale0*8)*Stride-Act+TSoffset0;
[0159] That is, the Ts Scale of the current silent message is transformed according to the Ts Stride of the active message, and the TS values of the received silent messages are transformed according to the Stride-Act of the active message. Based on the transformation, the following calculations are performed:
[0160] By looping through x = 1 to 8, we can obtain a suitable x:
[0161] {
[0162] TS Scale1 of SN1=(SN1-SN0-1)+(TS Scale0*8)+x;
[0163] TS of SN1=TS Scale1*TS stride1+TS offset0;
[0164] }
[0165] The acquisition of x involves calculating the TS of 8 SN1 packets, and then checking the CRC of the received SN1 packets (i.e., voice messages with sequence number SN1). Only one x satisfies the requirement.
[0166] by Figure 2 The example shown illustrates this: A transition from silent to active occurs at Sn = 0x1312, 0x1313, 0x1314, and 0x1315 on the sender (i.e., the compression device). The TS stride between Sn = 0x1312 and 0x1313 is 0x00000640, between Sn = 0x1314 and 0x1313 is 0x00000140, between Sn = 0x1315 and 0x1314 is 0x00000140, and the TS stride after Sn = 0x1315 is 0x00000140.
[0167] At this point, the UOR-2 packets with extension 3 of Sn=0x1313 and 0x1314 are lost. Sn=0x1315 receives the packet and can recover 0x1315 based on 0x1312. At this time, the TS stride0 corresponding to Sn=0x1312 is Stride-Sil=320*8=2560=0xa00, TS Scale0=0x36c, TS offset0=0x280, and the TS of Sn=0x1312 is TS Scale0*TS Stride0+TS offset0=0x36c*0xa00+0x280=0x00223a80=0x36c*(0x140*8)+0x280=0x1b60*0x140+0x280. Among them, TS Stride1=Stride-Act=0x140.
[0168] TS Scale1 of SN1 = (0x1315 – 0x1312 – 1) + 0x1b60 + x (x = 5) = 0x1b67;
[0169] SN1's TS = 0x1b67 * 0x140 + 0x280 = 0x00224340 (from...) Figure 2 It can be seen that when SN1 = 0x1315, the actual TS is 0x00224340. Therefore, the method provided in this application can decode the correct TS.
[0170] Recalculate TS Scale1, TS Stride1, and Tsoffset1 for the new activation message (Sn = 0x1315 - 0x1324). For example, for Sn = 0x1315, TS Scale1 = INT(0x00224340 / 0x140) = 0x1b69, and Ts offset1 = 0. Where Ts Stride1 for Sn = 0x1315 = 0x140.
[0171] For example, formula (2) can be used to encode SN=0x1324 as: (0x1324–0x1315+0x1b69)*0x140+0=0x00225600. Therefore, SN=0x1315 and the subsequent voice messages are all UO-0 packet compressed, requiring only 1 byte, and there is no need to send ACK and NACK feedback to the compression end.
[0172] In summary, the loss of voice messages with SN=0x1313 and 0x1314 does not affect the decompression processing of the voice message with SN=0x1315.
[0173] To clearly illustrate how the decompression device determines the second timestamp parameter based on the first message type, the second message type, the target value, and the first timestamp parameter in any embodiment of this application, this application also proposes a method for decompressing voice messages.
[0174] Figure 6 This is a flowchart illustrating another method for decompressing voice messages provided in an embodiment of this application.
[0175] like Figure 6 As shown, the decompression method for the voice message may include the following steps S601 to S608:
[0176] Step S601: Obtain the first sequence number of the first voice message and the second sequence number of the second voice message received in two consecutive transactions.
[0177] The second voice message was received later than the first voice message.
[0178] Step S602: Determine whether packet loss has occurred between the first voice message and the second voice message based on the first sequence number and the second sequence number.
[0179] Step S603: In the event of packet loss, obtain the first message type corresponding to the first sequence number and the second message type corresponding to the second sequence number.
[0180] Step S604: If the first message type and the second message type are different, determine the target value based on the difference between the second sequence number and the first sequence number, and obtain the first timestamp parameter corresponding to the first sequence number.
[0181] The first timestamp parameter is used to decompress the first voice message; the first timestamp parameter includes a first timestamp ratio (e.g., marked as TS Scale0), a first timestamp multiple (e.g., marked as TS Stride0), and a first timestamp offset (e.g., marked as TS offset0).
[0182] In any embodiment of this application, the second timestamp parameter used to decompress the second voice message may include a second timestamp ratio (e.g., labeled TS Scale1), a second timestamp multiple (e.g., labeled TSStride1), and a second timestamp offset (e.g., labeled TS offset1).
[0183] The explanation of steps S601 to S604 can be found in the relevant description in any embodiment of this application, and will not be repeated here.
[0184] Step S605: When the first message type is active and the second message type is silent, the first timestamp multiple is used as the second timestamp multiple in the second timestamp parameter.
[0185] In this embodiment of the application, when the first message type is active and the second message type is silent, the decompression device can directly use the first timestamp multiple as the second timestamp multiple in the second timestamp parameter.
[0186] Step S606: Use the first timestamp offset as the second timestamp offset in the second timestamp parameter.
[0187] In this embodiment of the application, when the first message type is active and the second message type is silent, the decompression device can directly use the first timestamp offset as the second timestamp offset in the second timestamp parameter.
[0188] Step S607: Determine the second timestamp ratio in the second timestamp parameter based on the target value, the first set value, and the first timestamp ratio.
[0189] In this embodiment of the application, when the first message type is active and the second message type is silent, the decompression device can calculate the second timestamp ratio in the second timestamp parameter based on the target value, the first set value, and the first timestamp ratio.
[0190] In any embodiment of this application, the decompression device may employ the following steps A' to D' to calculate the initial timestamp ratio corresponding to the second sequence number:
[0191] Step A': Obtain or calculate the second product between the target value and the first set value.
[0192] Step B': Iterate through multiple candidate values in sequence, and substitute the currently iterated candidate value, the second product, and the first timestamp ratio into the second expression to obtain the third candidate timestamp ratio.
[0193] The second expression indicates the mapping relationship between the candidate values and the timestamp ratio when the message type changes from active to silent.
[0194] Among them, multiple candidate values are less than or equal to the first set value.
[0195] As an example, taking the second sequence number as SN1, the first sequence number as SN0, the target value as SN1 – SN0 – 1, and the first set value as 8, the second expression can be:
[0196] TS Scale1 = (SN1- SN0 - 1)* 8 + TS Scale0 + x: (5)
[0197] In this application, the candidate values of the current traversal can be substituted into x in formula (5) to obtain the specific value of TS Scale1, which is the third candidate timestamp ratio.
[0198] Step C': Determine the second candidate timestamp based on the proportion of the third candidate timestamp, the multiple of the second timestamp, and the offset of the second timestamp.
[0199] For example, the second candidate timestamp can be calculated using the following formula:
[0200] TS = TS Scale1 * TS Stride1 + TS offset1; (6)
[0201] That is, the proportion of the third candidate timestamp can be substituted into TS Scale1 in formula (6), the multiple of the second timestamp can be substituted into TS Stride1 in formula (6), and the offset of the second timestamp can be substituted into TS offset1 in formula (6). The specific value of TS obtained is the second candidate timestamp.
[0202] Step D': Determine the proportion of the second timestamp based on the second candidate timestamp.
[0203] As an example, a decompression device can use the following steps D-1' to D-5' to calculate the second timestamp ratio:
[0204] Step D-1': Update the target encoding value in the second voice message according to the second candidate timestamp to obtain the updated second voice message.
[0205] The target encoded value is obtained by encoding the actual timestamp, which is used to indicate the actual sampling time of the voice content in the second voice message.
[0206] That is, the target encoding value in the message header or protocol header of the second voice message can be replaced with the second candidate timestamp to obtain the updated second voice message.
[0207] Step D-2': Perform CRC on the updated second voice message to obtain the fourth CRC value.
[0208] Step D-3': Determine whether the fourth CRC value is consistent with the fifth CRC value in the second voice message. If yes, proceed to step D-4'; otherwise, proceed to step D-5'.
[0209] Step D-4': Stop the traversal and use the proportion of the third candidate timestamp as the proportion of the second timestamp.
[0210] Understandably, if the calculated fourth CRC value matches the fifth CRC value carried in the second voice message, it indicates that the second voice message was decompressed correctly. In this case, the third candidate timestamp ratio can be used as the second timestamp ratio.
[0211] Step D-5': Continue traversing the candidate values until the sixth CRC value determined based on the fourth candidate timestamp ratio corresponding to the candidate values being traversed matches the fifth CRC value. Stop traversing then and use the fourth candidate timestamp ratio as the second timestamp ratio.
[0212] Understandably, if the calculated fourth CRC value is inconsistent with the fifth CRC value carried in the second voice message, it indicates that the second voice message is decompressed incorrectly. At this point, it is necessary to continue traversing the candidate values until the sixth CRC value determined based on the fourth candidate timestamp ratio corresponding to the continued traversal of the candidate values is consistent with the fifth CRC value. Then, the traversal is stopped, and the fourth candidate timestamp ratio is used as the second timestamp ratio.
[0213] The calculation method for the fourth candidate timestamp ratio is similar to that for the third candidate timestamp ratio. That is, the candidate values that will continue to be traversed, the second product, and the first timestamp ratio can be substituted into the second expression to obtain the fourth candidate timestamp ratio.
[0214] The calculation method for the sixth CRC value is similar to that for the fourth CRC value, and will not be elaborated here.
[0215] Step S608: Decompress the second voice message based on the second timestamp parameter.
[0216] The explanation of step S608 can be found in the relevant description in any embodiment of this application, and will not be repeated here.
[0217] The voice message decompression method of this application embodiment can recover undecompressable voice messages when the voice transmission transitions from the active period to the silent period and packet loss occurs, thus avoiding packet loss caused by discarding the voice message.
[0218] The following, with reference to Embodiment B, details the implementation principle of recovering voice messages when the voice transitions from the active period to the silent period and packet loss occurs.
[0219] Example B: When a voice transitions from an active to a silent period, if the decompression device receives a UO-1 or UO-0 message and packet loss occurs in between, decompression will fail. In this case, the decompression device will attempt to recover the voice message by calculating the TS (Transmission Time), instead of relying on packet loss and NACK (Non-Acknowledgement) feedback as in existing technologies. The implementation principle mainly includes the following steps:
[0220] Step 1: Same as step a in Example A.
[0221] Step 2: When speech transitions from an active phase to a silent phase, the following conditions are met:
[0222] TS Stride0 of SN0=Stride-Act;
[0223] By looping through x = 1 to 8, we can obtain a suitable x:
[0224] {
[0225] TS Scale1 of SN1=(SN1-SN0-1)*8+TS Scale0+x;
[0226] TS of SN1=TS Scale1*TS Stride0+TS offset0;
[0227] }
[0228] The x is obtained by calculating the TS of 8 SN1s respectively, and then checking the CRC of the received SN1 packet (i.e., the voice message with sequence number SN1) and finding that only one x meets the requirements.
[0229] Continue with Figure 2The example shown illustrates this: the transition from activation to silence occurs at Sn = 0x1324, 0x1325, 0x1326, and 0x1327. The TS stride between Sn = 0x1325 and 0x1324 is 0x00000140, the TS stride between Sn = 0x1326 and 0x1325 is 0x000003c0, the TS stride between Sn = 0x1327 and 0x1326 is 0x00000a00, and the TS stride after Sn = 0x1327 is 0x00000a00.
[0230] At this point, the receiver (i.e., the decompression device) loses the UOR2 message with extension 3 for Sn=0x1326 and 0x1327. The decompression device then receives a voice message with Sn=0x1328 as UO-0, which is only one byte long and carries no TSStride information, making decompression impossible. Using the method provided in this application, the calculation is as follows:
[0231] The voice message with Sn=0x1325 has TS Stride0=0x140, Ts Scale0=0x1b79, and TS offset0=0;
[0232] The TS Scale1 of the voice message with Sn=0x1328 is (0x1328–0x1325–1)*8+x(x=3)+0x1b79=0x1b8c.
[0233] Sn = 0x1328, TS = 0x1b8c * 0x140 + 0 = 0x00226f00 (from...) Figure 2 It can be seen that when SN = 0x1328, the actual TS is 0x00226f00. Therefore, the method provided in this application can decode the correct TS.
[0234] At this point, the TS (Timestamp) recovery of the voice message Sn=0x1328 is successful. Subsequent voice messages can continue to be recovered based on the timestamp parameter Sn=0x1328 without needing to send a NACK to the compression device. Therefore, the loss of voice messages Sn=0x1326 and 0x1327 does not affect the decompression processing of the voice message Sn=0x1328.
[0235] In summary, the voice message decompression method provided in this application has at least the following advantages:
[0236] 1) When compressing the header of a voice message in an NR or LTE system, if a switch between silence and activation occurs and the notification message of the TS Stride change is lost, the method provided in this application can be used to automatically recover the TS value of subsequent voice messages.
[0237] 2) When a silent packet is converted to an active packet and packet loss occurs, the TS Scale of the previous silent packet is converted according to the TS Stride of the active packet, the silent packet is treated as an active packet, and the TS Scale of the active packet is recalculated.
[0238] 3) When an active-to-silent transition occurs and packets are lost, the TS Scale of the silent packets can be recalculated directly by multiplying the number of active TS Strides.
[0239] 4) After calculating the TS Scale, the TS can be calculated, and the voice message can be decompressed correctly.
[0240] The advantages of this application over related technologies include at least the following:
[0241] 1. When silent activation and packet loss occur, uncompressible voice messages can be recovered, avoiding packet loss caused by dropping.
[0242] 2. When silent activation switching occurs and packet loss happens, voice messages that cannot be decompressed can be recovered without NACK feedback, thus improving the decompression efficiency of voice messages.
[0243] The technical solutions provided in this application can be applied to various systems, especially 5G systems. For example, applicable systems include Global System for Mobile Communication (GSM), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA) General Packet Radio Service (GPRS), Long Term Evolution (LTE), LTE Frequency Division Duplex (FDD), LTE Time Division Duplex (TDD), Long Term Evolution Advanced (LTE-A), Universal Mobile Telecommunication System (UMTS), Worldwide Interoperability for Microwave Access (WiMAX), and 5G New Radio (NR). All of these systems include terminals and network equipment. The system may also include a core network component, such as the Evolved Packet System (EPS) or the 5G system (5GS).
[0244] To implement the above embodiments, this application also provides a decompression device.
[0245] Figure 7 This is a schematic diagram of a decompression device provided according to an embodiment of this application.
[0246] like Figure 7 As shown, the decompression device may include a transceiver 700, a processor 710, and a memory 720, wherein:
[0247] Transceiver 700 is used to receive and send data under the control of processor 710.
[0248] Among them, Figure 7In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits together, represented by one or more processors (processor 710) and memory (memory 720). The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 700 can be multiple elements, including transmitters and receivers, providing units for communicating with various other devices over transmission media, including wireless channels, wired channels, optical fibers, etc. The processor 710 is responsible for managing the bus architecture and general processing, and the memory 720 can store data used by the processor 710 during operation.
[0249] The processor 710 can be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or a complex programmable logic device (CPLD). The processor can also adopt a multi-core architecture.
[0250] The processor 710 calls a computer program stored in memory and performs the following operations: obtaining the first sequence number of a first voice message and the second sequence number of a second voice message received twice consecutively; wherein the reception time of the second voice message is later than the reception time of the first voice message; determining whether packet loss has occurred between the first and second voice messages based on the first and second sequence numbers; in the case of packet loss, determining the second timestamp parameter corresponding to the second sequence number based on the first sequence number, the second sequence number, and the first timestamp parameter corresponding to the first sequence number; wherein the first timestamp parameter is used to decompress the first voice message; and decompressing the second voice message based on the second timestamp parameter.
[0251] As one possible implementation, the processor 710, in the event of packet loss, determines the second timestamp parameter corresponding to the second sequence number based on the first sequence number, the second sequence number, and the first timestamp parameter corresponding to the first sequence number. Specifically, in the event of packet loss, it obtains the first message type corresponding to the first sequence number and the second message type corresponding to the second sequence number; if the first message type and the second message type are different, it determines the target value based on the difference between the second sequence number and the first sequence number, and obtains the first timestamp parameter corresponding to the first sequence number; and determines the second timestamp parameter based on the first message type, the second message type, the target value, and the first timestamp parameter.
[0252] As one possible implementation, the first timestamp parameter includes a first timestamp ratio, a first timestamp multiple, and a first timestamp offset; the second timestamp parameter includes a second timestamp ratio, a second timestamp multiple, and a second timestamp offset. The processor 710 executes the following steps to determine the second timestamp parameter based on the first message type, the second message type, the target value, and the first timestamp parameter: When the first message type is silent and the second message type is active, the ratio of the first timestamp multiple to the first set value is used as the second timestamp multiple; the initial timestamp ratio corresponding to the second sequence number is calculated based on the target value and the first timestamp ratio; the predicted timestamp is determined based on the initial timestamp ratio, the second timestamp multiple, and the first timestamp offset; wherein the predicted timestamp is used to indicate the estimated sampling time of the speech content in the second speech message; and the second timestamp ratio and the second timestamp offset are determined based on the predicted timestamp and the second timestamp multiple.
[0253] As one possible implementation, the processor 710 performs the following steps: calculating the initial timestamp ratio corresponding to the second sequence number based on the target value and the first timestamp ratio. Specifically, this involves: obtaining the first product of the first timestamp ratio and the first set value; sequentially traversing multiple candidate values and substituting the currently traversed candidate value, the first product, and the target value into a first expression to obtain the first candidate timestamp ratio; wherein, the first expression is used to indicate the mapping relationship between the candidate values and the timestamp ratio when the message type changes from silent to active; all candidate values are less than or equal to the first set value; determining the first candidate timestamp based on the first candidate timestamp ratio, the second timestamp multiple, and the first timestamp offset; and determining the initial timestamp ratio based on the first candidate timestamp.
[0254] As one possible implementation, the processor 710 performs the following steps: First, it determines an initial timestamp ratio based on a first candidate timestamp. Specifically, it updates the target encoded value in the second voice message according to the first candidate timestamp to obtain an updated second voice message. The target encoded value is obtained by encoding the actual timestamp, which indicates the actual sampling time of the voice content in the second voice message. Then, it performs a Cyclic Redundancy Check (CRC) on the updated second voice message to obtain a first CRC value. Next, it determines whether the first CRC value matches the second CRC value in the second voice message. If yes, it stops iterating and uses the first candidate timestamp ratio as the initial timestamp ratio. If no, it continues iterating through the candidate values until the third CRC value determined based on the second candidate timestamp ratio corresponding to the continued iterating candidate values matches the second CRC value. Then, it stops iterating and uses the second candidate timestamp ratio as the initial timestamp ratio.
[0255] As one possible implementation, the processor 710 performs the following steps: determining the second timestamp ratio and the second timestamp offset based on the multiple of the predicted timestamp and the second timestamp. Specifically, the ratio of the predicted timestamp to the multiple of the second timestamp is rounded down to obtain the second timestamp ratio; and the predicted timestamp is moduloed by the multiple of the second timestamp to obtain the second timestamp offset.
[0256] As one possible implementation, the first timestamp parameter includes a first timestamp ratio, a first timestamp multiple, and a first timestamp offset; the second timestamp parameter includes a second timestamp ratio, a second timestamp multiple, and a second timestamp offset. The processor 710 executes the following steps to determine the second timestamp parameter based on the first message type, the second message type, the target value, and the first timestamp parameter: when the first message type is active and the second message type is silent, the first timestamp multiple is used as the second timestamp multiple; the first timestamp offset is used as the second timestamp offset; and the second timestamp ratio is determined based on the target value, the first set value, and the first timestamp ratio.
[0257] As one possible implementation, the processor 710 executes the following steps to determine a second timestamp ratio based on the target value, a first set value, and a first timestamp ratio: obtaining a second product between the target value and the first set value; sequentially traversing multiple candidate values and substituting the currently traversed candidate value, the second product, and the first timestamp ratio into a second expression to obtain a third candidate timestamp ratio; wherein the second expression indicates the mapping relationship between the candidate values and the timestamp ratio when the message type changes from active to silent; multiple candidate values are all less than or equal to the first set value; determining a second candidate timestamp based on the third candidate timestamp ratio, the second timestamp multiple, and the second timestamp offset; and determining a second timestamp ratio based on the second candidate timestamp.
[0258] As one possible implementation, the processor 710 performs the following steps: First, it determines a second timestamp ratio based on a second candidate timestamp. Specifically, it updates the target encoded value in the second voice message according to the second candidate timestamp to obtain an updated second voice message. The target encoded value is obtained by encoding the actual timestamp, which indicates the actual sampling time of the voice content in the second voice message. Then, it performs a CRC check on the updated second voice message to obtain a fourth CRC value. Next, it determines whether the fourth CRC value matches the fifth CRC value in the second voice message. If yes, it stops iterating and uses the third candidate timestamp ratio as the second timestamp ratio. If no, it continues iterating through the candidate values until the sixth CRC value determined based on the fourth candidate timestamp ratio of the continued iterating candidate values matches the fifth CRC value. Then, it stops iterating and uses the fourth candidate timestamp ratio as the second timestamp ratio.
[0259] As one possible implementation, the processor 710 performs the following steps: determining whether packet loss has occurred between the first voice message and the second voice message based on the first sequence number and the second sequence number. Specifically, this involves: obtaining the difference between the second sequence number and the first sequence number; determining whether the difference is greater than a second preset value; if the difference is greater than the second preset value, determining that packet loss has occurred between the first voice message and the second voice message; and if the difference is less than or equal to the second preset value, determining that no packet loss has occurred between the first voice message and the second voice message.
[0260] As one possible implementation, the processor 710 performs decompression of the second voice message based on the second timestamp parameter, specifically: obtaining the third product of the second timestamp ratio and the second timestamp multiple in the second timestamp parameter; determining the actual timestamp corresponding to the target encoded value in the second voice message based on the sum of the third product and the second timestamp offset in the second timestamp parameter; wherein, the actual timestamp is used to indicate the actual sampling time of the voice content in the second voice message; and decompressing the target encoded value in the second voice message based on the actual timestamp.
[0261] It should be noted that the decompression device provided in this application embodiment is capable of achieving the above-mentioned... Figures 3 to 6 All method steps implemented in the method embodiment can achieve the same technical effect. Therefore, the parts that are the same as those in the method embodiment and their beneficial effects will not be described in detail here.
[0262] To implement the above embodiments, this application also proposes a voice message decompression device.
[0263] Figure 8This is a schematic diagram of the structure of a voice message decompression device provided in an embodiment of this application.
[0264] like Figure 8 As shown, the voice message decompression device 800 includes: an acquisition unit 810, a judgment unit 820, a determination unit 830, and a decompression unit 840.
[0265] The acquisition unit 810 is used to acquire the first sequence number of the first voice message and the second sequence number of the second voice message received twice consecutively; wherein the reception time of the second voice message is later than the reception time of the first voice message.
[0266] The judgment unit 820 is used to determine whether packet loss has occurred between the first voice message and the second voice message based on the first sequence number and the second sequence number.
[0267] The determining unit 830 is used to determine the second timestamp parameter corresponding to the second sequence number based on the first sequence number, the second sequence number, and the first timestamp parameter corresponding to the first sequence number in the event of packet loss; wherein, the first timestamp parameter is used to decompress the first voice message;
[0268] The decompression unit 840 is used to decompress the second voice message based on the second timestamp parameter.
[0269] As one possible implementation, the determining unit 830 is specifically used for: in the event of packet loss, obtaining the first message type corresponding to the first sequence number and the second message type corresponding to the second sequence number; if the first message type and the second message type are different, determining the target value based on the difference between the second sequence number and the first sequence number, and obtaining the first timestamp parameter corresponding to the first sequence number; and determining the second timestamp parameter based on the first message type, the second message type, the target value, and the first timestamp parameter.
[0270] As one possible implementation, the first timestamp parameter includes a first timestamp ratio, a first timestamp multiple, and a first timestamp offset; the second timestamp parameter includes a second timestamp ratio, a second timestamp multiple, and a second timestamp offset. The determining unit 830 is specifically used for: when the first message type is silent and the second message type is active, using the ratio of the first timestamp multiple to a first set value as the second timestamp multiple; calculating the initial timestamp ratio corresponding to the second sequence number based on the target value and the first timestamp ratio; determining the predicted timestamp based on the initial timestamp ratio, the second timestamp multiple, and the first timestamp offset; wherein the predicted timestamp is used to indicate the estimated sampling time of the speech content in the second speech message; and determining the second timestamp ratio and the second timestamp offset based on the predicted timestamp and the second timestamp multiple.
[0271] As one possible implementation, the determining unit 830 is specifically used for: obtaining the first product of the first timestamp ratio and the first set value; sequentially traversing multiple candidate values and substituting the currently traversed candidate value, the first product, and the target value into the first expression to obtain the first candidate timestamp ratio; wherein, the first expression is used to indicate the mapping relationship between the candidate value and the timestamp ratio when the message type changes from silent to active; multiple candidate values are all less than or equal to the first set value; determining the first candidate timestamp based on the first candidate timestamp ratio, the second timestamp multiple, and the first timestamp offset; and determining the initial timestamp ratio based on the first candidate timestamp.
[0272] As one possible implementation, the determining unit 830 is specifically used to: update the target encoding value in the second voice message according to the first candidate timestamp to obtain the updated second voice message; wherein, the target encoding value is obtained by encoding the actual timestamp, and the actual timestamp is used to indicate the actual sampling time of the voice content in the second voice message; perform cyclic redundancy check (CRC) on the updated second voice message to obtain a first CRC value; determine whether the first CRC value is consistent with the second CRC value in the second voice message; if yes, stop traversing and use the proportion of the first candidate timestamp as the initial timestamp proportion; if no, continue traversing the candidate values until the third CRC value determined based on the proportion of the second candidate timestamp corresponding to the continued traversal of the candidate values is consistent with the second CRC value, then stop traversing and use the proportion of the second candidate timestamp as the initial timestamp proportion.
[0273] As one possible implementation, the determining unit 830 is specifically used to: round down the ratio of the predicted timestamp to the second timestamp multiple to obtain the second timestamp ratio; and perform a modulo operation on the predicted timestamp to obtain the second timestamp offset.
[0274] As one possible implementation, the first timestamp parameter includes a first timestamp ratio, a first timestamp multiple, and a first timestamp offset; the second timestamp parameter includes a second timestamp ratio, a second timestamp multiple, and a second timestamp offset. The determining unit 830 is specifically used to: when the first message type is active and the second message type is silent, use the first timestamp multiple as the second timestamp multiple; use the first timestamp offset as the second timestamp offset; and determine the second timestamp ratio based on the target value, the first set value, and the first timestamp ratio.
[0275] As one possible implementation, the determining unit 830 is specifically used for: obtaining the second product between the target value and the first set value; sequentially traversing multiple candidate values, and substituting the currently traversed candidate value, the second product, and the first timestamp ratio into the second expression to obtain the third candidate timestamp ratio; wherein, the second expression is used to indicate the mapping relationship between the candidate value and the timestamp ratio when the message type changes from active to silent; multiple candidate values are all less than or equal to the first set value; determining the second candidate timestamp based on the third candidate timestamp ratio, the second timestamp multiple, and the second timestamp offset; and determining the second timestamp ratio based on the second candidate timestamp.
[0276] As one possible implementation, the determining unit 830 is specifically used to: update the target encoding value in the second voice message according to the second candidate timestamp to obtain the updated second voice message; wherein, the target encoding value is obtained by encoding the actual timestamp, and the actual timestamp is used to indicate the actual sampling time of the voice content in the second voice message; perform CRC on the updated second voice message to obtain a fourth CRC value; determine whether the fourth CRC value is consistent with the fifth CRC value in the second voice message; if yes, stop traversing and use the third candidate timestamp ratio as the second timestamp ratio; if no, continue traversing the candidate values until the sixth CRC value determined based on the fourth candidate timestamp ratio corresponding to the continued traversal of the candidate values is consistent with the fifth CRC value, then stop traversing and use the fourth candidate timestamp ratio as the second timestamp ratio.
[0277] As one possible implementation, the judgment unit 820 is specifically used to: obtain the difference between the second sequence number and the first sequence number; determine whether the difference is greater than a second preset value; if the difference is greater than the second preset value, determine that packet loss has occurred between the first voice message and the second voice message; if the difference is less than or equal to the second preset value, determine that no packet loss has occurred between the first voice message and the second voice message.
[0278] As one possible implementation, the decompression unit 840 is specifically used to: obtain the third product of the second timestamp ratio and the second timestamp multiple in the second timestamp parameter; determine the actual timestamp corresponding to the target encoded value in the second voice message based on the sum of the third product and the second timestamp offset in the second timestamp parameter; wherein the actual timestamp is used to indicate the actual sampling time of the voice content in the second voice message; and decompress the target encoded value in the second voice message based on the actual timestamp.
[0279] It should be noted that the voice message decompression device provided in this application embodiment can achieve the above-mentioned... Figures 3 to 6All method steps implemented in the method embodiment can achieve the same technical effect. Therefore, the parts that are the same as those in the method embodiment and their beneficial effects will not be described in detail here.
[0280] It should be noted that the division of units in the embodiments of this application is illustrative and only represents one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units described above can be implemented in hardware or as software functional units.
[0281] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a processor-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network-side device, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0282] It should be noted that the apparatus provided in this application embodiment can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiment and the beneficial effects will not be described in detail.
[0283] On the other hand, embodiments of this application also provide a processor-readable storage medium storing a computer program for causing a processor to execute this application. Figures 3 to 6 The method shown in the embodiment.
[0284] The processor-readable storage medium can be any available medium or data storage device that the processor can access, including but not limited to magnetic storage (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disk (MO)), optical storage (e.g., CD, DVD, BD, HVD), and semiconductor storage (e.g., ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)).
[0285] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.
[0286] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-executable instructions. These computer-executable instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0287] These processor-executable instructions may also be stored in a processor-readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the processor-readable memory produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0288] These processors can execute instructions that can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0289] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for decompressing voice messages, characterized in that, include: Obtain the first sequence number of the first voice message and the second sequence number of the second voice message received in two consecutive transactions; wherein the reception time of the second voice message is later than the reception time of the first voice message. Based on the first sequence number and the second sequence number, determine whether packet loss occurred between the first voice message and the second voice message; In the event of packet loss, the second timestamp parameter corresponding to the second sequence number is determined based on the first sequence number, the second sequence number, and the first timestamp parameter corresponding to the first sequence number; wherein, the first timestamp parameter is used to decompress the first voice message; The second voice message is decompressed based on the second timestamp parameter.
2. The method according to claim 1, characterized in that, In the event of packet loss, determining the second timestamp parameter corresponding to the second sequence number based on the first sequence number, the second sequence number, and the first timestamp parameter corresponding to the first sequence number includes: In the event of packet loss, obtain the first message type corresponding to the first sequence number and the second message type corresponding to the second sequence number; When the first message type is different from the second message type, the target value is determined based on the difference between the second sequence number and the first sequence number, and the first timestamp parameter corresponding to the first sequence number is obtained; The second timestamp parameter is determined based on the first message type, the second message type, the target value, and the first timestamp parameter.
3. The method according to claim 2, characterized in that, The first timestamp parameter includes a first timestamp ratio, a first timestamp multiple, and a first timestamp offset; the second timestamp parameter includes a second timestamp ratio, a second timestamp multiple, and a second timestamp offset. The step of determining the second timestamp parameter based on the first message type, the second message type, the target value, and the first timestamp parameter includes: When the first message type is silent and the second message type is active, the ratio of the first timestamp multiple to the first set value is used as the second timestamp multiple. Calculate the initial timestamp ratio corresponding to the second sequence number based on the target value and the first timestamp ratio; The predicted timestamp is determined based on the initial timestamp ratio, the second timestamp multiple, and the first timestamp offset; wherein the predicted timestamp is used to indicate the estimated sampling time of the voice content in the second voice message; The second timestamp ratio and the second timestamp offset are determined based on the predicted timestamp and the multiple of the second timestamp.
4. The method according to claim 3, characterized in that, The step of calculating the initial timestamp ratio corresponding to the second sequence number based on the target value and the first timestamp ratio includes: Obtain the first product of the first timestamp ratio and the first set value; Multiple candidate values are sequentially traversed, and the currently traversed candidate value, the first product, and the target value are substituted into the first expression to obtain the first candidate timestamp ratio; wherein, the first expression is used to indicate the mapping relationship between the candidate value and the timestamp ratio when the message type changes from silent to active; all of the multiple candidate values are less than or equal to the first set value; The first candidate timestamp is determined based on the first candidate timestamp ratio, the second timestamp multiple, and the first timestamp offset; The initial timestamp ratio is determined based on the first candidate timestamp.
5. The method according to claim 4, characterized in that, Determining the initial timestamp ratio based on the first candidate timestamp includes: The target encoding value in the second voice message is updated according to the first candidate timestamp to obtain the updated second voice message; wherein the target encoding value is obtained by encoding the actual timestamp, and the actual timestamp is used to indicate the actual sampling time of the voice content in the second voice message; Perform a cyclic redundancy check (CRC) on the updated second voice message to obtain a first CRC value; Determine whether the first CRC value is consistent with the second CRC value in the second voice message; If so, stop the traversal and use the first candidate timestamp ratio as the initial timestamp ratio; If not, continue traversing the candidate values until the third CRC value determined based on the second candidate timestamp ratio corresponding to the candidate values being traversed matches the second CRC value, at which point the traversal stops, and the second candidate timestamp ratio is used as the initial timestamp ratio.
6. The method according to claim 3, characterized in that, The step of determining the second timestamp ratio and the second timestamp offset based on the multiple of the predicted timestamp and the second timestamp includes: The ratio of the predicted timestamp to the second timestamp multiple is rounded down to obtain the second timestamp ratio; Perform a modulo operation on the predicted timestamp to obtain the second timestamp offset.
7. The method according to claim 2, characterized in that, The first timestamp parameter includes a first timestamp ratio, a first timestamp multiple, and a first timestamp offset; the second timestamp parameter includes a second timestamp ratio, a second timestamp multiple, and a second timestamp offset. The step of determining the second timestamp parameter based on the first message type, the second message type, the target value, and the first timestamp parameter includes: When the first message type is active and the second message type is silent, the first timestamp multiple is used as the second timestamp multiple. Use the offset of the first timestamp as the offset of the second timestamp; The second timestamp ratio is determined based on the target value, the first set value, and the first timestamp ratio.
8. The method according to claim 7, characterized in that, Determining the second timestamp ratio based on the target value, the first set value, and the first timestamp ratio includes: Obtain the second product between the target value and the first set value; The process iterates through multiple candidate values, and substitutes the currently iterated candidate value, the second product, and the first timestamp ratio into the second expression to obtain the third candidate timestamp ratio. The second expression indicates the mapping relationship between the candidate value and the timestamp ratio when the message type changes from active to silent. All of the multiple candidate values are less than or equal to the first set value. The second candidate timestamp is determined based on the ratio of the third candidate timestamp, the multiple of the second timestamp, and the offset of the second timestamp. The proportion of the second timestamp is determined based on the second candidate timestamp.
9. The method according to claim 8, characterized in that, The step of determining the proportion of the second timestamp based on the second candidate timestamp includes: The target encoding value in the second voice message is updated according to the second candidate timestamp to obtain the updated second voice message; wherein the target encoding value is obtained by encoding the actual timestamp, and the actual timestamp is used to indicate the actual sampling time of the voice content in the second voice message; Perform a CRC operation on the updated second voice message to obtain a fourth CRC value; Determine whether the fourth CRC value is consistent with the fifth CRC value in the second voice message; If so, stop the traversal and use the third candidate timestamp ratio as the second timestamp ratio; If not, continue traversing the candidate values until the sixth CRC value determined based on the fourth candidate timestamp ratio corresponding to the candidate values being traversed matches the fifth CRC value. Then stop traversing and use the fourth candidate timestamp ratio as the second timestamp ratio.
10. The method according to any one of claims 1-9, characterized in that, The step of determining whether packet loss has occurred between the first voice message and the second voice message based on the first sequence number and the second sequence number includes: Obtain the difference between the second sequence number and the first sequence number; Determine whether the difference is greater than a second preset value; If the difference is greater than the second set value, it is determined that packet loss has occurred between the first voice message and the second voice message; If the difference is less than or equal to the second set value, it is determined that no packet loss has occurred between the first voice message and the second voice message.
11. The method according to any one of claims 1-9, characterized in that, The step of decompressing the second voice message based on the second timestamp parameter includes: Obtain the third product of the second timestamp ratio and the second timestamp multiple in the second timestamp parameter; The actual timestamp corresponding to the target encoded value in the second voice message is determined based on the sum of the third product and the second timestamp offset in the second timestamp parameter; wherein, the actual timestamp is used to indicate the actual sampling time of the voice content in the second voice message; Based on the actual timestamp, the target encoded value in the second voice message is decompressed.
12. A decompression device, characterized in that, Includes memory, transceiver, and processor; A memory for storing computer programs; a transceiver for sending and receiving data under the control of the processor; and a processor for reading the computer programs from the memory and performing the following operations: Obtain the first sequence number of the first voice message and the second sequence number of the second voice message received in two consecutive transactions; wherein the reception time of the second voice message is later than the reception time of the first voice message. Based on the first sequence number and the second sequence number, determine whether packet loss occurred between the first voice message and the second voice message; In the event of packet loss, the second timestamp parameter corresponding to the second sequence number is determined based on the first sequence number, the second sequence number, and the first timestamp parameter corresponding to the first sequence number; wherein, the first timestamp parameter is used to decompress the first voice message; The second voice message is decompressed based on the second timestamp parameter.
13. The decompression device according to claim 12, characterized in that, In the event of packet loss, the processor determines the second timestamp parameter corresponding to the second sequence number based on the first sequence number, the second sequence number, and the first timestamp parameter corresponding to the first sequence number, specifically as follows: In the event of packet loss, obtain the first message type corresponding to the first sequence number and the second message type corresponding to the second sequence number; When the first message type is different from the second message type, the target value is determined based on the difference between the second sequence number and the first sequence number, and the first timestamp parameter corresponding to the first sequence number is obtained; The second timestamp parameter is determined based on the first message type, the second message type, the target value, and the first timestamp parameter.
14. The decompression device according to claim 13, characterized in that, The first timestamp parameter includes a first timestamp ratio, a first timestamp multiple, and a first timestamp offset; the second timestamp parameter includes a second timestamp ratio, a second timestamp multiple, and a second timestamp offset. The processor executes the following steps to determine the second timestamp parameter based on the first message type, the second message type, the target value, and the first timestamp parameter: When the first message type is silent and the second message type is active, the ratio of the first timestamp multiple to the first set value is used as the second timestamp multiple. Calculate the initial timestamp ratio corresponding to the second sequence number based on the target value and the first timestamp ratio; The predicted timestamp is determined based on the initial timestamp ratio, the second timestamp multiple, and the first timestamp offset; wherein the predicted timestamp is used to indicate the estimated sampling time of the voice content in the second voice message; The second timestamp ratio and the second timestamp offset are determined based on the predicted timestamp and the multiple of the second timestamp.
15. The decompression apparatus according to claim 14, characterized in that, The processor performs the following steps: Calculates the initial timestamp ratio corresponding to the second sequence number based on the target value and the first timestamp ratio. Obtain the first product of the first timestamp ratio and the first set value; Multiple candidate values are sequentially traversed, and the currently traversed candidate value, the first product, and the target value are substituted into the first expression to obtain the first candidate timestamp ratio; wherein, the first expression is used to indicate the mapping relationship between the candidate value and the timestamp ratio when the message type changes from silent to active; all of the multiple candidate values are less than or equal to the first set value; The first candidate timestamp is determined based on the first candidate timestamp ratio, the second timestamp multiple, and the first timestamp offset; The initial timestamp ratio is determined based on the first candidate timestamp.
16. The decompression apparatus according to claim 15, characterized in that, The processor executes the determination of the initial timestamp ratio based on the first candidate timestamp, specifically as follows: The target encoding value in the second voice message is updated according to the first candidate timestamp to obtain the updated second voice message; wherein the target encoding value is obtained by encoding the actual timestamp, and the actual timestamp is used to indicate the actual sampling time of the voice content in the second voice message; Perform a cyclic redundancy check (CRC) on the updated second voice message to obtain a first CRC value; Determine whether the first CRC value is consistent with the second CRC value in the second voice message; If so, stop the traversal and use the first candidate timestamp ratio as the initial timestamp ratio; If not, continue traversing the candidate values until the third CRC value determined based on the second candidate timestamp ratio corresponding to the candidate values being traversed matches the second CRC value, at which point the traversal stops, and the second candidate timestamp ratio is used as the initial timestamp ratio.
17. The decompression apparatus according to claim 14, characterized in that, The processor executes the process of determining the second timestamp ratio and the second timestamp offset based on the multiple of the predicted timestamp and the second timestamp, specifically as follows: The ratio of the predicted timestamp to the second timestamp multiple is rounded down to obtain the second timestamp ratio; Perform a modulo operation on the predicted timestamp to obtain the second timestamp offset.
18. The decompression apparatus according to claim 13, characterized in that, The first timestamp parameter includes a first timestamp ratio, a first timestamp multiple, and a first timestamp offset; the second timestamp parameter includes a second timestamp ratio, a second timestamp multiple, and a second timestamp offset. The processor executes the following steps to determine the second timestamp parameter based on the first message type, the second message type, the target value, and the first timestamp parameter: When the first message type is active and the second message type is silent, the first timestamp multiple is used as the second timestamp multiple. Use the offset of the first timestamp as the offset of the second timestamp; The second timestamp ratio is determined based on the target value, the first set value, and the first timestamp ratio.
19. The decompression apparatus according to claim 18, characterized in that, The processor executes the process of determining the second timestamp ratio based on the target value, the first preset value, and the first timestamp ratio, specifically as follows: Obtain the second product between the target value and the first set value; The process iterates through multiple candidate values, and substitutes the currently iterated candidate value, the second product, and the first timestamp ratio into the second expression to obtain the third candidate timestamp ratio. The second expression indicates the mapping relationship between the candidate value and the timestamp ratio when the message type changes from active to silent. All of the multiple candidate values are less than or equal to the first set value. The second candidate timestamp is determined based on the ratio of the third candidate timestamp, the multiple of the second timestamp, and the offset of the second timestamp. The proportion of the second timestamp is determined based on the second candidate timestamp.
20. The decompression apparatus according to claim 19, characterized in that, The processor executes the determination of the second timestamp ratio based on the second candidate timestamp, specifically as follows: The target encoding value in the second voice message is updated according to the second candidate timestamp to obtain the updated second voice message; wherein the target encoding value is obtained by encoding the actual timestamp, and the actual timestamp is used to indicate the actual sampling time of the voice content in the second voice message; Perform a CRC operation on the updated second voice message to obtain a fourth CRC value; Determine whether the fourth CRC value is consistent with the fifth CRC value in the second voice message; If so, stop the traversal and use the third candidate timestamp ratio as the second timestamp ratio; If not, continue traversing the candidate values until the sixth CRC value determined based on the fourth candidate timestamp ratio corresponding to the candidate values being traversed matches the fifth CRC value. Then stop traversing and use the fourth candidate timestamp ratio as the second timestamp ratio.
21. The decompression apparatus according to any one of claims 12-20, characterized in that, The processor executes a process to determine whether packet loss has occurred between the first voice message and the second voice message based on the first sequence number and the second sequence number, specifically: Obtain the difference between the second sequence number and the first sequence number; Determine whether the difference is greater than a second preset value; If the difference is greater than the second set value, it is determined that packet loss has occurred between the first voice message and the second voice message; If the difference is less than or equal to the second set value, it is determined that no packet loss has occurred between the first voice message and the second voice message.
22. The decompression apparatus according to any one of claims 12-20, characterized in that, The processor performs decompression of the second voice message based on the second timestamp parameter, specifically as follows: Obtain the third product of the second timestamp ratio and the second timestamp multiple in the second timestamp parameter; The actual timestamp corresponding to the target encoded value in the second voice message is determined based on the sum of the third product and the second timestamp offset in the second timestamp parameter; wherein, the actual timestamp is used to indicate the actual sampling time of the voice content in the second voice message; Based on the actual timestamp, the target encoded value in the second voice message is decompressed.
23. A decompression device for voice messages, characterized in that, include: The acquisition unit is used to acquire the first sequence number of the first voice message and the second sequence number of the second voice message received twice consecutively; wherein the reception time of the second voice message is later than the reception time of the first voice message. The judgment unit is used to determine whether packet loss has occurred between the first voice message and the second voice message based on the first sequence number and the second sequence number. The determining unit is configured to, in the event of packet loss, determine the second timestamp parameter corresponding to the second sequence number based on the first sequence number, the second sequence number, and the first timestamp parameter corresponding to the first sequence number; wherein, the first timestamp parameter is used to decompress the first voice message; The decompression unit is used to decompress the second voice message based on the second timestamp parameter.
24. A processor-readable storage medium, characterized in that, The processor-readable storage medium stores a computer program for causing the processor to perform the method of any one of claims 1-11.