Data synchronization method and device, receiving equipment and storage medium
By establishing a synchronous transmission connection on the receiving device and determining the startup time of the data processing function, the problem of large delay in CIS transmission of audio data is solved, and more efficient data synchronization is achieved.
Patent Information
- Application Number
- CN202411675072.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-21
AI Technical Summary
When using CIS to transmit audio data, there is a large delay, which affects the user's experience.
By establishing a synchronous transmission connection with the sending device on the receiving device, the start time of the data processing function is determined, and the data processing function is activated based on the time to process the received data to be synchronized.
It shortens the waiting time for data processing, reduces latency, and improves the accuracy and efficiency of data synchronization.
Smart Images

Figure CN119496789A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication transmission technology, and in particular to a data synchronization method, a data synchronization device, a receiving device and a computer-readable storage medium. Background Art
[0002] CIS (Connected Isochronous Stream) is a time-dependent data transmission channel and transmission strategy that supports one-to-one connection mode and is suitable for application scenarios such as headphones, where the left and right ears can work synchronously as independent CIS to provide users with a richer and higher-quality audio experience. However, when CIS is applied to headphone projects, it is often placed with high hopes. Manufacturers use new technologies not only to bring customers a high-quality audio experience, but also to have lower full-link transmission delays to promote product highlights and enhance users' audio-visual experience.
[0003] In the scenario of transmitting audio data through CIS, there is a large delay from the time the sending device sends data to the time the receiving device completes data processing and plays it, which affects the user experience. Summary of the invention
[0004] In order to overcome the problems existing in the related art, an exemplary embodiment of the present disclosure provides a data synchronization method, which is applied to a receiving device, and the method includes: establishing a synchronous transmission connection between a receiving device and a sending device, and the sending device is used to send the data to be synchronized; in response to the completion of the establishment of the synchronous transmission connection, determining the start time of a data processing function, and the data processing function is used to process the data to be synchronized; based on the start time, starting the data processing function to process the data to be synchronized received after the synchronous transmission connection is established.
[0005] In some embodiments, in response to the completion of the establishment of the synchronous transmission connection, determining the start time of the data processing function includes: in response to the completion of the establishment of the synchronous transmission connection, obtaining the data sending parameters of the sending device; and determining the start time of the data processing function based on the data sending parameters.
[0006] In some embodiments, the start time of the data processing function is determined based on the data sending parameters, including: determining the transmission delay for data synchronization with the sending device based on the data sending parameters; determining the reception time when the first data packet of the data to be synchronized is received according to the transmission delay, and the data to be synchronized is transmitted in the form of data packets; determining the start time of the data processing function according to the reception time.
[0007] In some embodiments, based on the data sending parameters, the transmission delay for data synchronization with the sending device is determined, including: determining the transmission quantity of the data to be synchronized, the number of data packets corresponding to each data to be synchronized, and the maximum length of all data packets according to the data sending parameters; based on the transmission quantity, the number of data packets and the maximum length, determining the transmission delay for data synchronization with the sending device.
[0008] In some embodiments, the start time of the data processing function is determined based on the receiving time, including: using the same time as the receiving time as the start time of the data processing function; or based on the receiving time, using a time that is a specified period of time earlier than the receiving time as the start time of the data processing function.
[0009] In some embodiments, in response to the completion of establishing the synchronous transmission connection, determining the start time of the data processing function includes: in response to the completion of establishing the synchronous transmission connection, using the current time as the start time of the data processing function.
[0010] In some embodiments, the method further includes: receiving a first data packet of data to be synchronized; in response to the data processing function being in an activated state, processing the first data packet; in response to completion of processing the first data packet, sequentially processing other received data packets of data to be synchronized.
[0011] In some embodiments, the data to be synchronized is audio data to be played; after the first data packet is processed, the method further includes: playing the audio data to be played; and completing the playback in response to the last data packet of the data to be synchronized being processed.
[0012] In the second aspect, the present disclosure also provides a data synchronization device, which is applied to a receiving device, and the device includes: a connection module, which is used to establish a synchronous transmission connection with a sending device, and the sending device is used to send the data to be synchronized; a first processing module, which is used to determine the start time of a data processing function in response to the completion of the establishment of the synchronous transmission connection, and the data processing function is used to process the data to be synchronized; a control module, which is used to start the data processing function based on the start time to process the data to be synchronized received after the synchronous transmission connection is established.
[0013] In a third aspect, the present disclosure further provides a receiving device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the data synchronization method provided in any one of the above aspects by executing the computer instructions.
[0014] In a fourth aspect, the present disclosure further provides a computer-readable storage medium, which stores the following program, and the program is used to execute the data synchronization method provided in any one of the above aspects.
[0015] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
[0016] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: According to the data synchronization method provided by the present disclosure, when the synchronous transmission connection with the sending device is established, it is possible to timely determine the start time of the data processing function that needs to be started before the sending device sends the data to be synchronized, thereby shortening the waiting time for data processing, so that the receiving device can perform data processing in a timely manner when receiving the data to be synchronized, thereby reducing delays and improving the accuracy and efficiency of data synchronization without losing or changing the data to be synchronized. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The present invention may be better understood by describing exemplary embodiments of the present invention in conjunction with the accompanying drawings, in which:
[0018] Figure 1 A flowchart of a data synchronization method according to an exemplary embodiment of the present disclosure is shown;
[0019] Figure 2 A flowchart of another data synchronization method shown in an exemplary embodiment of the present disclosure;
[0020] Figure 3 The present invention is a flowchart of another data synchronization method according to an exemplary embodiment of the present invention.
[0021] Figure 4 A timing diagram of data processing shown in an exemplary embodiment of the present disclosure;
[0022] Figure 5 It is a structural schematic diagram of a data synchronization device shown in an exemplary embodiment of the present disclosure;
[0023] Figure 6 It is a schematic diagram of the structure of a receiving device shown in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] The specific embodiments of the present invention will be described below. It should be noted that in the specific description of these embodiments, in order to provide a concise description, it is impossible for this specification to provide a detailed description of all the features of the actual embodiments. It should be understood that in the actual implementation of any embodiment, just as in the process of any engineering project or design project, in order to achieve the specific goals of the developer and to meet system-related or business-related restrictions, various specific decisions are often made, and this will also change from one embodiment to another. In addition, it can also be understood that although the efforts made in this development process may be complex and lengthy, for ordinary technicians in the field related to the content disclosed by the present invention, some changes such as design, manufacturing or production based on the technical content disclosed in this disclosure are just conventional technical means, and should not be understood as insufficient content of this disclosure.
[0025] Unless otherwise defined, the technical or scientific terms used in the claims and the specification shall have the usual meaning understood by persons with ordinary skills in the technical field to which the invention belongs. The words "first", "second" and similar words used in the patent application specification and the claims of the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "One" or "one" and other similar words do not indicate a quantitative limitation, but indicate the existence of at least one. "Include" or "comprises" and other similar words mean that the elements or objects appearing before "include" or "comprises" include the elements or objects listed after "include" or "comprises" and their equivalent elements, and do not exclude other elements or objects. "Connected" or "connected" and other similar words are not limited to physical or mechanical connections, nor are they limited to direct or indirect connections.
[0026] In some related technologies, data transmission based on CIS generally first establishes a connection between a sending device and a receiving device based on CIS. After the connection is established, the sending device processes the data and sends data packets to the receiving device in sequence. After receiving the data packet, the receiving device sets the start time of the data processing function, waits for the data processing function to start, and then processes the data packet, resulting in a large delay.
[0027] In some related technologies, in order to reduce transmission delay, optimization is performed in the following two ways: one is to reduce the amount of single data transmission by modifying the amount of data and the number of retransmissions, thereby achieving the purpose of reducing delayed transmission. The other is to shorten the decoding time by decoding optimization, thereby achieving the purpose of reducing delayed transmission.
[0028] Among them, the optimization using the first method will affect the key parameters of transmission delay and decoding delay. Since these parameters are related to the quality of audio, the optimization using this method is likely to affect the audio quality, resulting in the audio effect not meeting the user's expectations. The optimization using the second method may increase resource consumption, and when the decoding optimization is not thorough or over-optimized, the audio quality will be affected.
[0029] To solve the above problems, Figure 1 As shown, an exemplary embodiment of the present disclosure provides a data synchronization method applied to a receiving device, where the receiving device may be a headset, a smart speaker, a mobile phone, etc. The data synchronization method may include the following steps S110 to S130:
[0030] Step S110: establishing a synchronous transmission connection with a sending device.
[0031] Establish a synchronous transmission connection with the sending device so that the receiving device can achieve synchronous transmission with the sending device and receive the data to be synchronized sent by the sending device. The synchronous transmission connection between the receiving device and the sending device can be established through Bluetooth, Wi-Fi, USB or other communication protocols, and the communication mechanisms relied on may include: connected isochronous streams (Continuous Integration System, CIS, a mechanism to ensure that data streams are transmitted at a constant rate), synchronous serial communication or time division multiplexing (TDM, Time Division Multiplexing). In some examples, the data to be synchronized may include but is not limited to: audio data, video data, call data, etc. The sending device may include but is not limited to: mobile phones, tablets, computers, etc.
[0032] Step S120: In response to the completion of establishing the synchronous transmission connection, determining the start time of the data processing function.
[0033] The data processing function is a function that allows peripherals to directly process local data without the control of a central processing unit (CPU), for example, direct memory access (DMA). The data processing function may include but is not limited to decoding, format conversion, error detection and correction of received data. Through the data processing function, data processing can be directly performed on the received data to be synchronized to achieve data synchronization.
[0034] In response to the completion of the establishment of the synchronous transmission connection, it indicates that the sending device is able to transmit data with the receiving device. In order to enable the data to be synchronized to be processed in time, the start time of the data processing function is determined when the synchronous transmission connection is established to shorten the waiting time for decoding after receiving the data packet, so that when the receiving device receives the data to be synchronized, it can directly process the data to be synchronized, thereby ensuring real-time data transmission while improving the overall data transmission efficiency.
[0035] Step S130: based on the start time, start the data processing function to process the to-be-synchronized data received after the synchronous transmission connection is established.
[0036] When the time reaches the start time, the data processing function is activated and started to put the data processing function into working state, and the received data to be synchronized can be directly processed to meet the corresponding data processing requirements, thereby ensuring the timeliness of the processing of the data to be synchronized.
[0037] According to the data synchronization method provided by the present invention, when the synchronous transmission connection with the sending device is established, the start time of the data processing function that needs to be started can be determined in time before the sending device sends the data to be synchronized, thereby shortening the waiting time for data processing, so that when the data to be synchronized is received, the data can be processed in time, thereby reducing delays and improving the accuracy and efficiency of data synchronization without losing or changing the data to be synchronized.
[0038] In some embodiments, Figure 2 As shown, the above step S120 may include:
[0039] Step S121, in response to the completion of the establishment of the synchronous transmission connection, obtaining the data transmission parameters of the sending device.
[0040] In response to the completion of the establishment of the synchronous transmission connection, it indicates that synchronous data transmission can be performed with the sending device. In order to understand the data transmission status of the data to be synchronized so that the data to be synchronized can be received and processed in time, the data transmission parameters of the sending device are obtained, and the data transmission status is analyzed in a targeted manner through the data transmission parameters, thereby helping to improve the reliability of synchronous transmission, ensure the reception quality of the data to be synchronized, and reduce the occurrence of delays and errors. Among them, the data transmission parameters include but are not limited to: the number of data to be synchronized, the number of data packets corresponding to each data to be synchronized, and the maximum length of all data packets.
[0041] Step S122: determining the start time of the data processing function based on the data sending parameters.
[0042] Through the data transmission parameters, the data transmission status when the sending device sends the data to be synchronized can be clearly understood, and then the startup time of the data processing function can be predicted in a targeted manner to obtain a startup time that can reasonably process the data to be synchronized. For example, if the data transmission parameters predict that the time to receive the data to be synchronized is after 10ms, then the startup time can be set to start when the communication duration reaches 10ms or before 10ms, so that when the data to be synchronized is received, the data to be synchronized can be processed in time, which can effectively reduce the occurrence of delays and packet loss, thereby helping to optimize the performance of the overall system and ensure the transmission quality and real-time performance of data synchronization.
[0043] In some optional examples, the above step S122 may include the following steps a1 to a3:
[0044] Step a1: determining a transmission delay for data synchronization with a transmitting device based on data transmission parameters.
[0045] Transmission delay refers to the time required for the synchronized data to be transmitted from the sending device to the receiving device based on the synchronous transmission connection between the sending device and the receiving device.
[0046] Through the data sending parameters, the delay that the data to be synchronized may encounter during the transmission process can be determined, so that targeted analysis can be performed based on the delay situation, and the transmission delay for data synchronization with the sending device can be determined to ensure the timeliness of data reception.
[0047] For example, the data transmission parameters may include: the size of the data packet, network bandwidth, network congestion, data transmission rate, processing capacity of the router, and any possible delay of intermediate nodes. Among them, the size of the data packet affects the data transmission time. The larger the data packet, the longer the transmission time. The network bandwidth determines the amount of data that can be transmitted by the network per unit time. The larger the bandwidth, the faster the data transmission speed. Network congestion will cause data packets to queue up during the transmission process, thereby increasing the transmission delay. The data transmission rate refers to the actual transmission speed of data in the network. The processing capacity of the router affects the data transmission time. If the processing capacity of the router is poor, it will cause transmission delay. Too many intermediate nodes will increase the delay. Therefore, by determining the basic transmission time of the data to be synchronized from the sending device to the receiving device based on the size of the data packet and the network bandwidth, and then combining factors such as network congestion, the processing capacity of the router, and any possible delay of the intermediate nodes, the impact of the network environment on data synchronization can be determined, thereby obtaining the final required transmission delay.
[0048] In some optional embodiments, the above step a1 may include:
[0049] Step a11, determining the transmission quantity of the data to be synchronized, the quantity of data packets corresponding to each data to be synchronized, and the maximum length of all data packets according to the data transmission parameters;
[0050] Step a12, determining the transmission delay for data synchronization with the sending device based on the transmission quantity, the number of data packets and the maximum length.
[0051] Specifically, during the synchronous data transmission process, the data to be synchronized is transmitted in the form of data packets. Through the data sending parameters, the number of data to be synchronized to be sent by the sending device, the number of data packets corresponding to each data to be synchronized, and the maximum length of all data packets can be clearly defined. Among them, the number of data to be synchronized (num_cis) refers to the number of existing CIS. The number of data packets corresponding to each data to be synchronized (Num of Subevent, NSE) refers to the number of data packets into which the data to be synchronized is divided for transmission during the data transmission process. The number of data packets is at least one. The maximum length (payload) of all data packets refers to the maximum length of data that can be transmitted in a data packet. This is the maximum capacity of the actual data (i.e., the data to be synchronized) excluding the data packet header information.
[0052] Since the transmission quantity of the above-mentioned data to be synchronized, the number of data packets corresponding to each data to be synchronized, and the data corresponding to the maximum length of all data packets depend on the corresponding data to be synchronized, determining the above-mentioned parameters through data sending parameters can improve the accuracy and reliability of determining the transmission delay.
[0053] After determining the number of transmissions, the number of data packets, and the maximum length, the principle of determining the transmission delay CIG_delay can be expressed by the following formula:
[0054] Transmission delay = overall transmission time of data packet (PDU_long) * number of data packets * number of transmissions;
[0055] Among them, the overall transmission time of the data packet (PDU_long) = sending time (Tx) + minimum data sending time interval (T_IFS) + receiving time (Rx) + maximum segment size (Maximum Segment Size, T_MSS, the maximum data payload size of the TCP segment);
[0056] Transmission time (Tx) = Preamble + Access Code + Actual transmission data of the data packet (PDU) + Cyclic Redundancy Check;
[0057] The actual transmission data of the data packet (PDU) = the header of the data packet + the maximum payload + the message authentication code.
[0058] In some examples, in the above formula, except for the number of transmissions, the number of data packets, and the maximum length, other parameters can be determined based on theoretical values, thereby helping to improve the efficiency of determining the transmission delay. In other examples, in the above formula, each parameter can be determined based on the data transmission parameters, thereby ensuring the accuracy and reliability of the transmission delay.
[0059] By determining the transmission delay in the above manner, the actual transmission situation of the data to be synchronized can be comprehensively considered, so that the time consumption in the entire data transmission process can be more accurately evaluated, and the accuracy and reliability of the determination of the transmission delay can be guaranteed.
[0060] Step a2: determining the receiving time when the first data packet of the data to be synchronized is received according to the transmission delay.
[0061] According to the transmission delay, it is possible to determine the time it takes for the first packet of data to be synchronized to arrive at the receiving device during the transmission of the data to be synchronized. Therefore, according to the transmission delay, the reception time when the first packet of data to be synchronized is received can be predicted. For example, if the current time is 12:00:00 and the transmission delay is 1 second, the reception time will be 12:00:01.
[0062] Step a3: Determine the start time of the data processing function according to the receiving time.
[0063] By determining the start time of the data processing function based on the estimated receiving time, the effectiveness of determining the start time can be improved, so that the receiving device can start the data processing function before the first data packet arrives. Then, when processing the data to be synchronized later, the possibility of data loss or duplication can be reduced, the delay in data processing can be reduced, and the receiving device and the sending device can be guaranteed to remain synchronized in data transmission, thereby helping to improve the response speed of the system.
[0064] In some examples, the same time as the receiving time can be used as the start time of the data processing function, thereby ensuring that the data processing function can be started at the same time when the data to be synchronized is received, which helps to achieve real-time data processing and reduce unnecessary waste of resources. In other examples, based on the receiving time, a time that is a specified period of time earlier than the receiving time can be used as the start time of the data processing function to leave preparation time for the start of the data processing function, and then when the first data packet of the data to be synchronized is subsequently received, it can be ensured that the data processing function can be used normally or is already in operation. Then, by starting data in advance, data processing can reduce data loss or errors caused by processing delays, improve the response efficiency of data processing, and thus help to ensure the efficiency and reliability of synchronous data processing.
[0065] By determining the start time in the above manner, the waiting time for data processing can be optimized so that data processing can be synchronized with data reception, which can improve the overall efficiency of the system and reduce resource waste. In subsequent data processing, it is beneficial to ensure the integrity and accuracy of the data to be synchronized.
[0066] In other embodiments, the process of determining the start time of the data processing function in step S120 may include: in response to the completion of the establishment of the synchronous transmission connection, using the current time as the start time of the data processing function. In this embodiment, after the synchronous transmission connection is established, the data processing function is immediately started, so that data processing can be started after receiving data, which improves the efficiency of determining the start time on the one hand, and ensures the synchronization of data processing and data transmission on the other hand, reduces the delay of data in the transmission and processing process, and reduces the risk of data loss or error, thereby effectively improving the transmission integrity and processing accuracy of the data to be synchronized, and ensuring the overall performance.
[0067] like Figure 3 As shown, the present disclosure also provides a data synchronization method, which may include the following steps:
[0068] Step S210: establishing a synchronous transmission connection with a sending device, where the sending device is used to send data to be synchronized.
[0069] Step S220: In response to the synchronous transmission connection being established, determining a start time of the data processing function.
[0070] Step S230: based on the start time, start the data processing function to process the to-be-synchronized data received after the synchronous transmission connection is established.
[0071] Step S240, receiving the first data packet of the data to be synchronized.
[0072] Step S250, in response to the data processing function being in the activated state, processing the first data packet.
[0073] In response to the data processing function being in the startup state, it is characterized that the startup time of the data processing function is earlier than or equal to the actual reception time of the first data packet. Therefore, when the data processing function is in the startup state, the first received data packet is processed, which saves the waiting time of data processing and reduces the delay, thereby helping to ensure the consistency and integrity of data synchronization and laying a foundation for the processing of subsequent data packets.
[0074] Step S260 , in response to the completion of processing the first data packet, other received data packets of the data to be synchronized are processed in sequence.
[0075] After the first data packet is processed, the system continues to process subsequently received data packets in sequence until all data packets to be synchronized are processed, thereby ensuring the continuity and consistency of the data processing process, avoiding data errors or losses caused by incorrect processing order, and helping to ensure the stability and reliability of synchronous transmission.
[0076] According to the data synchronization method provided by the present invention, after the synchronous transmission connection is completed, the start time of the data processing function is synchronously determined, which can ensure that during the data synchronous transmission process, the data processing function of the receiving device can be started in time and process the data packets in sequence, thereby enhancing the response speed and stability of data processing, thereby effectively reducing data processing delays and ensuring the timeliness and accuracy of data synchronization.
[0077] In some optional implementation scenarios, when the data to be synchronized is audio data to be played, after the processing of the first data packet is completed, the data synchronization method further includes: playing the audio data to be played; and completing the playback in response to the last data packet of the data to be synchronized being processed. By synchronizing the playback of audio data with data processing, the synchronization of audio playback and data can be guaranteed to prevent playback interruptions or incompleteness. In addition, after the processing of the first data packet is completed, the audio data to be played is started to be played, which can reduce playback errors caused by data processing delays, and the playback is stopped after the data processing is completed, which helps to manage system resources and avoid unnecessary audio processing, thereby helping to enhance the user experience.
[0078] In some other optional implementation scenarios, the sending device may be a mobile phone, the receiving device may be a headset, the data to be synchronized may be audio data to be played, and the headset may be connected to the mobile phone through synchronous transmission, and the timing diagram of data synchronization of the audio data to be played may be as follows: Figure 4As shown. Among them, time 1 is the time when the headset and the mobile phone establish a synchronous transmission connection, time 2 is the sending time of the first data packet of the audio data to be played, time 3 is the actual receiving time of the first data packet, time 4 is the start time of the determined data processing function, and time 5 is the playing time of the audio data to be played. The headset establishes a synchronous transmission connection with the mobile phone at time 1, and at the same time as the establishment is completed, obtains the data transmission parameters of the mobile phone, and determines the start time of the data processing function based on the data transmission parameters, that is, time 4. Since the mobile phone still needs to make some preparations for sending the audio data to be played after the synchronous transmission connection is completed, the first data packet of the audio data to be played is sent at time 2, and other data packets are transmitted to the headset in sequence according to the data sending time interval of the mobile phone. The actual receiving time when the headset receives the first data packet is time 3. The mobile phone starts the data processing function at time 4. In response to time 3 being later than or equal to time 4, the first data packet is directly processed, and the audio data to be played is played at time 5 after the first data packet is processed. Since the data processing function is always in operation, the mobile phone will continue to process other data packets of the received data to be synchronized in sequence, and complete the playback in response to the last data packet of the data to be synchronized being processed.
[0079] The data synchronization method provided by the present invention can improve the optimization of the entire link delay, effectively reduce the delay, and improve data synchronization performance.
[0080] In some other optional implementation scenarios, the image synchronization transmission processing is performed by the data synchronization method provided by the present disclosure, which can improve the optimization of the ISO interval time (the exposure interval time of the image sensor) by two times. For example, if the interval is 5ms now, then the data synchronization method provided by the present disclosure can be optimized to about 10ms, thereby effectively reducing the exposure frequency and improving the image quality.
[0081] Based on the same inventive concept, Figure 5 As shown, an embodiment of the present disclosure provides a data synchronization device, which is applied to a receiving device. The device 400 may include:
[0082] A connection module 410 is used to establish a synchronous transmission connection with a sending device, and the sending device is used to send data to be synchronized;
[0083] A first processing module 420, configured to determine a start time of a data processing function in response to completion of establishing the synchronous transmission connection, where the data processing function is configured to process data to be synchronized;
[0084] The control module 430 is used to start the data processing function based on the start time to process the to-be-synchronized data received after the synchronous transmission connection is established.
[0085] In some embodiments, the first processing module 420 may include:
[0086] an acquisition unit, configured to acquire data transmission parameters of a transmitting device in response to completion of establishment of a synchronous transmission connection;
[0087] The first determining unit is used to determine a start time of a data processing function based on a data sending parameter.
[0088] In some embodiments, the first determining unit includes:
[0089] A first processing unit, configured to determine a transmission delay for data synchronization with a transmitting device based on a data transmission parameter;
[0090] A second processing unit, for determining, based on the transmission delay, a reception time when a first data packet of data to be synchronized is received, the data to be synchronized being transmitted in the form of data packets;
[0091] The third processing unit is used to determine the start time of the data processing function according to the receiving time.
[0092] In some embodiments, the first processing unit may include:
[0093] A parameter determination unit, used to determine the transmission quantity of the data to be synchronized, the quantity of data packets corresponding to each data to be synchronized, and the maximum length of all data packets according to the data transmission parameters;
[0094] The time determination unit is used to determine the transmission delay for data synchronization with the sending device based on the transmission quantity, the number of data packets and the maximum length.
[0095] In some embodiments, the third processing unit may include:
[0096] A first execution unit is configured to use the same time as the receiving time as the start time of the data processing function; or
[0097] The second execution unit is used to use, according to the receiving time, a time earlier than the receiving time by a specified period of time as the start time of the data processing function.
[0098] In some embodiments, the first processing module 420 may include:
[0099] The second determining unit is configured to use the current time as the start time of the data processing function in response to the completion of establishing the synchronous transmission connection.
[0100] In some embodiments, the apparatus 400 may further include:
[0101] A receiving module, used for receiving a first data packet of data to be synchronized;
[0102] A second processing module, configured to process a first data packet in response to the data processing function being in an activated state;
[0103] The third processing module is used to process other received data packets of the to-be-synchronized data in sequence in response to the completion of processing the first data packet.
[0104] In some embodiments, the data to be synchronized is audio data to be played; after the first data packet is processed, the apparatus 400 may further include:
[0105] A fourth processing module, used for playing the audio data to be played;
[0106] The fifth processing module is used to complete the playback in response to the last data packet of the data to be synchronized being processed.
[0107] Based on the same inventive concept, Figure 6 As shown, an embodiment of the present disclosure provides a receiving device 500. The receiving device 500 includes a memory 510, a processor 520, and an input / output (I / O) interface 530. The memory 510 is used to store instructions. The processor 520 is used to call the instructions stored in the memory 510 to execute the data synchronization method of the embodiment of the present disclosure. The processor 520 is connected to the memory 510 and the I / O interface 530, respectively, for example, through a bus system and / or other forms of connection mechanisms (not shown). The memory 510 can be used to store programs and data, including the program of the data synchronization method involved in the embodiment of the present disclosure, and the processor 520 executes various functional applications and data processing of the receiving device 500 by running the program stored in the memory 510.
[0108] In the embodiment of the present disclosure, the processor 520 can be implemented in at least one hardware form of a digital signal processor (DSP), a field programmable gate array (FPGA), and a programmable logic array (PLA). The processor 520 can be a central processing unit (CPU) or one or a combination of other forms of processing units with data processing capabilities and / or instruction execution capabilities.
[0109] The memory 510 in the embodiment of the present disclosure may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.
[0110] In the embodiment of the present disclosure, the I / O interface 530 may be used to receive input instructions (such as digital or character information, and generate key signal input related to user settings and function control of the receiving device 500, etc.), and may also output various information to the outside (such as images or sounds, etc.). In the embodiment of the present disclosure, the I / O interface 530 may include one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a mouse, a joystick, a trackball, a microphone, a speaker, and a touch panel, etc.
[0111] Based on the same inventive concept, the present disclosure also provides a computer-readable storage medium, which stores the following program, and the program is used to execute the data synchronization method of any of the aforementioned embodiments.
[0112] The present application uses specific words to describe the embodiments of the present application. For example, "one embodiment", "an embodiment", and / or "some embodiments" refer to a certain feature, structure or characteristic related to at least one embodiment of the present application. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or multiple times in different positions in this specification does not necessarily refer to the same embodiment. In addition, some features, structures or characteristics in one or more embodiments of the present application can be appropriately combined.
[0113] In the context of this application, unless the context clearly indicates an exception, the words "a", "an", "a kind" and / or "the" do not refer to the singular, but may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list, and the method or device may also include other steps or elements.
[0114] Similarly, it should be noted that in order to simplify the description of the disclosure of this application and thus help understand one or more application embodiments, in the above description of the embodiments of this application, multiple features are sometimes merged into one embodiment, figure or description thereof. However, this disclosure method does not mean that the features required by the object of this application are more than the features mentioned in the claims. In fact, the features of the embodiments are less than all the features of the single embodiment disclosed above.
[0115] The basic concepts have been described above. Obviously, for those skilled in the art, the above disclosure is only for example and does not constitute a limitation of the present application. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements and amendments to the present application. Such modifications, improvements and amendments are suggested in the present application, so such modifications, improvements and amendments still belong to the spirit and scope of the embodiments of the present application.
Claims
1. A data synchronization method, applied to a receiving device, the method comprising: Establishing a synchronous transmission connection with a sending device, wherein the sending device is used to send data to be synchronized; In response to the completion of establishing the synchronous transmission connection, determining a start time of a data processing function, the data processing function being used to process the data to be synchronized; Based on the start time, the data processing function is started to process the to-be-synchronized data received after the synchronous transport connection is established.
2. The data synchronization method according to claim 1, wherein: In response to the synchronous transmission connection being established, determining the start time of the data processing function includes: In response to the synchronous transmission connection being established, acquiring data transmission parameters of the sending device; Based on the data transmission parameters, a start time of the data processing function is determined.
3. The data synchronization method according to claim 2, wherein: The determining, based on the data sending parameter, the start time of the data processing function includes: Determining a transmission delay for data synchronization with the sending device based on the data sending parameter; Determining, according to the transmission delay, a reception time when a first data packet of the data to be synchronized is received, the data to be synchronized being transmitted in the form of a data packet; A start time of the data processing function is determined according to the receiving time.
4. The data synchronization method according to claim 3, wherein: The determining, based on the data transmission parameter, a transmission delay for performing data synchronization with the transmitting device comprises: Determine, according to the data transmission parameters, the transmission quantity of the data to be synchronized, the quantity of data packets corresponding to each data to be synchronized, and the maximum length of all data packets; A transmission delay for data synchronization with the sending device is determined based on the transmission quantity, the data packet quantity, and the maximum length.
5. The data synchronization method according to claim 3 or 4, wherein: The step of determining the start time of the data processing function according to the receiving time includes: Using the same time as the receiving time as the start time of the data processing function; or According to the receiving time, a time earlier than the receiving time by a specified time period is used as the start time of the data processing function.
6. The data synchronization method according to claim 1, wherein: In response to the synchronous transmission connection being established, determining the start time of the data processing function includes: In response to the completion of establishing the synchronous transmission connection, the current time is used as the start time of the data processing function.
7. The data synchronization method according to claim 1, wherein: The method further comprises: Receiving a first data packet of the data to be synchronized; In response to the data processing function being in an activated state, processing the first data packet; In response to the completion of processing the first data packet, other received data packets of the data to be synchronized are processed in sequence.
8. The data synchronization method according to claim 7, wherein: The data to be synchronized is audio data to be played; In response to the first data packet being processed, the method further includes: Play the audio data to be played; In response to the last data packet of the data to be synchronized being processed, the playing is completed.
9. A data synchronization device, applied to a receiving device, the device comprising: A connection module, used to establish a synchronous transmission connection with a sending device, wherein the sending device is used to send data to be synchronized; A first processing module, configured to determine a start time of a data processing function in response to completion of establishment of the synchronous transmission connection, wherein the data processing function is configured to process the data to be synchronized; The control module is used to start the data processing function based on the start time to process the to-be-synchronized data received after the synchronous transmission connection is established.
10. A receiving device, comprising: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the data synchronization method according to any one of claims 1 to 8 by executing the computer instructions.
11. A computer-readable storage medium storing the following program, wherein the program is used to execute the data synchronization method according to any one of claims 1 to 8.