Projection screen connection method and device, storage medium and terminal
By using audio signal broadcasting and demodulation in the ultrasonic frequency band in screen projection technology, the problems of low screen connection efficiency and short reception distance are solved, and a more efficient screen connection and longer-distance transmission are achieved.
Patent Information
- Application Number
- CN202310335175.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2024-10-01
AI Technical Summary
Existing screen projection technology is inefficient when establishing a connection and is prone to miscasts. In addition, the reception distance of ultrasonic broadcasts in practical applications is short, making it difficult to break through the 3m transmission limit.
The first terminal modulates the screen projection code, generates an audio signal and broadcasts it in the form of ultrasound. The second terminal receives and demodulates it to establish a screen projection connection, uses the ultrasonic frequency band to avoid noise effects, and determines the continuous transmission time of the frequency point. Solve the problem of short receiving distance.
The efficiency of the screen projection connection is improved, miscasting is avoided, and the transmission distance of the ultrasonic broadcast exceeds the 3m limit, reducing audible noise.
Smart Images

Figure CN118732971A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of screen projection control technology, and in particular to a screen projection connection method, device, storage medium and terminal. Background Art
[0002] Nowadays, screen projection technology has greatly facilitated people's work and daily life needs. For example, after a mobile device (such as a laptop, mobile phone, tablet, etc.) is connected to another device (such as a projector, conference tablet, TV, etc.), the content in the mobile device can be displayed on the other device synchronously. Summary of the invention
[0003] The present application provides a screen projection connection method, device, storage medium and terminal, which can at least improve the efficiency of device screen projection.
[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0005] In the first aspect, a screen projection connection method is provided, which is applied to a first terminal, and the method includes: receiving a request message sent by a second terminal, and determining a data frame corresponding to a screen projection code, and determining the frequency of parameters in the above data frame; determining a first audio signal corresponding to the above data frame according to the frequency of the above parameters; determining a continuous transmission duration of a frequency point in the above first audio signal, wherein the above continuous transmission duration is determined according to a spectrum analysis duration of the above second terminal and a length of a maximum reflection path in a space where the above first terminal is located; determining a second audio signal according to a continuous transmission duration of a frequency point in the above first audio signal; broadcasting the above second audio signal in the form of ultrasound so that the above second terminal receives the above second audio signal, and demodulating the above second audio signal to obtain the above screen projection code, and enabling the above second terminal to establish a screen projection connection with the above first terminal according to the above screen projection code.
[0006] In one embodiment of the present application, the above-mentioned determination of the frequency of the parameters in the above-mentioned data frame includes: determining the frequency resolution of the short-time Fourier transform according to the spectrum analysis duration of the above-mentioned second terminal and the sampling frequency of the above-mentioned second terminal; determining the frequency of the parameters in the above-mentioned data frame according to an integer multiple of the frequency resolution of the above-mentioned short-time Fourier transform, wherein the frequency difference between two adjacent parameters in the above-mentioned data frame is an integer multiple of the frequency resolution of the above-mentioned short-time Fourier transform.
[0007] In one embodiment of the present application, the above-mentioned parameters include a sign bit, and one or more of a synchronization bit, a check bit and a stop bit; wherein the above-mentioned synchronization bit is used to identify the starting position of the above-mentioned data frame, and is used to realize the slow-in of the above-mentioned second audio signal; the above-mentioned sign bit includes one or more data values obtained by converting the above-mentioned projection code; the above-mentioned check bit includes one or more check values determined according to the above-mentioned first data value; the above-mentioned stop bit is used to identify the end position of the above-mentioned data frame, and is used to realize the slow-out of the above-mentioned second audio signal.
[0008] In one embodiment of the present application, after determining the continuous transmission duration of the frequency point in the first audio signal, the method further includes: smoothing the frequency point in the first audio signal that causes a sudden frequency change by using a bandpass filter.
[0009] According to the second aspect, a screen projection connection method is provided, which is applied to a second terminal, and the method includes: sending a request message to the first terminal so that the first terminal determines the data frame corresponding to the screen projection code and determines the frequency of the parameters in the data frame; and, the first terminal determines the first audio signal corresponding to the data frame according to the frequency of the parameters; and, the first terminal determines the continuous sending duration of the frequency point in the first audio signal, wherein the continuous sending duration is determined according to the spectrum analysis duration of the second terminal and the length of the maximum reflection path in the space where the first terminal is located; and, the first terminal determines the second audio signal according to the continuous sending duration of the frequency point in the first audio signal, and broadcasts the second audio signal in the form of ultrasound; receives the second audio signal sent by the first terminal, and obtains the screen projection code according to the second audio signal; and establishes a screen projection connection with the first terminal according to the screen projection code.
[0010] In one embodiment of the present application, the receiving of the second audio signal sent by the first terminal includes: receiving a third audio signal, and determining the second audio signal based on the third audio signal, wherein the length of the third audio signal is twice the length of the second audio signal; the determining of the second audio signal based on the third audio signal includes: converting the frequency points of the third audio signal within a preset time length to obtain parameters corresponding to the frequency points within the preset time length, and determining whether there is a synchronization bit in the parameters; if there is a synchronization bit in the parameters, determining whether the next parameter adjacent to the synchronization bit is a sign bit; if the next parameter adjacent to the synchronization bit is a sign bit, starting with the synchronization bit, determining the second audio signal from the third audio signal.
[0011] In one embodiment of the present application, obtaining the screen projection code according to the second audio signal includes: filtering out the synchronization bit in the second audio signal; and converting one or more data values included in the sign bit to obtain the screen projection code.
[0012] In one embodiment of the present application, establishing a screen projection connection with the first terminal according to the screen projection code includes: converting the frequency point in the second audio signal to obtain a check bit corresponding to the frequency point in the second audio signal; judging whether the data value in the second audio signal is correct according to the check bit; and when the data value in the second audio signal is correct, establishing a screen projection connection with the first terminal according to the screen projection code.
[0013] In one embodiment of the present application, before converting one or more data values included in the sign bit, the method further includes: determining whether a first data value corresponding to a first frequency point and a second data value corresponding to a second frequency point in the second audio signal are the same, wherein the second frequency point is a frequency point with the largest amplitude in the second audio signal; when the first data value and the second data value are the same, determining a third frequency point with the second largest amplitude in the second audio signal; determining a difference between the amplitude of the third frequency point and the amplitude of the second frequency point, and determining whether the difference is greater than a preset value; when the difference is greater than the preset value, converting the third frequency point to obtain a third data value corresponding to the third frequency point; and determining the third data value to be the data value in the sign bit.
[0014] According to the third aspect, a screen projection connection device is provided, which is configured at a first terminal and includes: a determination module, which is used to: receive the request information sent by the second terminal, and determine the data frame corresponding to the screen projection code, and determine the frequency of the parameters in the above data frame; determine the first audio signal corresponding to the above data frame according to the frequency of the parameters in the above data frame; determine the continuous sending duration of the frequency point in the above first audio signal, wherein the above continuous sending duration is determined according to the spectrum analysis duration of the above second terminal and the length of the maximum reflection path in the space where the above first terminal is located; determine the second audio signal according to the continuous sending duration of the frequency point in the above first audio signal; a first sending module, which is used to: broadcast the above second audio signal in the form of ultrasound, so that the above second terminal receives the above second audio signal, and demodulates the above second audio signal to obtain the above screen projection code, and enables the above second terminal to establish a screen projection connection with the above first terminal according to the above screen projection code.
[0015] In a fourth aspect, a screen projection connection device is provided, which is configured at a second terminal, and the device includes: a second sending module, used to: send a request message to the first terminal, so that the first terminal determines the data frame corresponding to the screen projection code, and determines the frequency of the parameters in the data frame; and, the first terminal determines the first audio signal corresponding to the data frame according to the frequency of the parameters; and, the first terminal determines the continuous sending duration of the frequency point in the first audio signal, wherein the continuous sending duration is determined according to the spectrum analysis duration of the second terminal and the length of the maximum reflection path in the space where the first terminal is located; and, the first terminal determines the second audio signal according to the continuous sending duration of the frequency point in the first audio signal, and broadcasts the second audio signal in the form of ultrasound; a receiving module, used to: receive the second audio signal sent by the first terminal, and demodulate the second audio signal to obtain the screen projection code; a connection module, used to: establish a screen projection connection with the first terminal according to the screen projection code.
[0016] In a fifth aspect, a terminal is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the terminal executes the screen projection connection method as described in the first aspect, and executes the screen projection connection method as described in the second aspect.
[0017] In a sixth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the screen projection connection method described in the first aspect, and implements the screen projection connection method described in the second aspect.
[0018] The screen projection connection method, device, storage medium and terminal provided in this application have the following technical effects:
[0019] In the present application, after the first terminal receives the request information sent by the second terminal, it determines the data frame corresponding to the projection code and determines the frequency of the parameters in the data frame. Afterwards, according to the frequency of the parameters, the first audio signal corresponding to the data frame is determined. Next, the continuous transmission time of the frequency point in the first audio signal is determined. Among them, the continuous transmission time is determined according to the spectrum analysis duration of the second terminal and the length of the maximum reflection path in the space where the first terminal is located. Then, according to the continuous transmission time of the frequency point in the first audio signal, the second audio signal is determined. The second audio signal is then sent to the second terminal via ultrasonic broadcasting. After the second terminal receives the above-mentioned second audio signal, the second audio signal is demodulated to obtain the projection code. The second terminal can establish a projection connection with the first terminal according to the projection code.
[0020] This application uses ultrasonic broadcast communication to establish a screen projection connection between the first terminal and the second terminal, which can improve the efficiency of screen projection. In addition, this application can also solve the problem of short receiving distance of ultrasonic broadcast in practical application by determining the above-mentioned continuous transmission time according to the spectrum analysis duration of the second terminal and the length of the maximum reflection path in the space where the first terminal is located.
[0021] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 This is an interactive diagram of an example screen projection connection method provided by this application;
[0024] Figure 2 This is a schematic diagram of an example of audio signal transmission in space provided by the present application;
[0025] Figure 3 is a schematic diagram of an example of signal aliasing provided by the present application;
[0026] Figure 4 is a time domain diagram of an example of a first audio signal provided by the present application;
[0027] Figure 5a to Figure 5c is a schematic diagram of an example of smoothing a first audio signal provided by the present application;
[0028] Figure 6 is a time-frequency diagram of an example of a second audio signal provided by the present application;
[0029] Figure 7 is a flowchart of an example of demodulating a second audio signal provided by the present application;
[0030] Figure 8 is a schematic diagram of an example of a third audio signal provided by the present application;
[0031] Fig. 9 This is a flowchart of an example of determining a data value corresponding to a frequency point in a second audio signal provided by the present application;
[0032] Fig.10 This is a structural diagram of an example of a screen projection connection device provided by the present application;
[0033] Fig.11 is a structural diagram of another example of a screen projection connection device provided by the present application;
[0034] Fig.12 is a structural diagram of another example of a screen projection connection device provided by the present application;
[0035] Fig.13 This is a block diagram of an example terminal provided in this application. DETAILED DESCRIPTION
[0036] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0037] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0038] In the description of the present application, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship.
[0039] When projecting the display content in a mobile device (hereinafter referred to as the second terminal) to another device (hereinafter referred to as the first terminal), multiple second terminals may simultaneously project the screen in the same local area network. At this time, the first terminal will receive multiple projection requests, which may cause the wrong projection.
[0040] For example, assume that the second terminal A, the second terminal B, the first terminal A and the first terminal B are networked devices in the same local area network. User A needs to project the content of the second terminal A to the first terminal A, and sends a projection connection request through the second terminal A; user B needs to project the content of the second terminal B to the first terminal B, and sends a projection connection request through the second terminal B. If the projection connection request first received by the first terminal A is sent by the second terminal B, the first terminal A will establish a projection connection with the second terminal B, and display the content of the second terminal B instead of the content of the second terminal A, resulting in a misprojection.
[0041] To avoid the above situation, when the first terminal establishes a screen projection connection with the second terminal, a verification operation needs to be performed on the second terminal. In the related art, the usual solution is that the user manually enters the screen projection code (or screen transmission code, etc.) of the first terminal on the second terminal.
[0042] For example, after the second terminal A and the second terminal B send the screen projection request, user A enters the screen projection code of the first terminal A in the second terminal A, and user B enters the screen projection code of the first terminal B in the second terminal B, so that the second terminal A / second terminal B can establish a screen projection connection with the corresponding first terminal, avoiding the occurrence of accidental projection.
[0043] However, the operation of manually inputting the screen projection code in the second terminal by the user is prone to input errors and will result in reduced screen transmission efficiency.
[0044] The present application proposes a screen projection connection method, device, storage medium and terminal, which can solve the problem of low screen transmission efficiency in related technologies.
[0045] Below, each step of the screen projection connection method in this example implementation will be described in more detail with reference to the accompanying drawings and embodiments.
[0046] Figure 1 This is an interactive diagram of an example of a screen projection connection method provided in this application.
[0047] In an exemplary embodiment, if Figure 1 As shown, the first terminal 10 may be a terminal device such as a projector, a conference tablet, a television, etc.; the second terminal 11 may be a terminal device such as a laptop computer, a mobile phone, a tablet, etc.
[0048] The main idea of the screen projection connection method provided in this application is: the first terminal 10 modulates the screen projection code to obtain an audio signal, and broadcasts the audio signal in the form of ultrasound. After the second terminal 11 receives the audio signal, it demodulates it to obtain the corresponding screen projection code. Thus, the second terminal 11 establishes a screen projection connection with the first terminal 10 according to the demodulated screen projection code.
[0049] Among them, the main reason for transmitting the screen projection code in the form of an audio signal is that the audio signal has poor wall penetration. For example, in a general conference room scene, even if tempered glass is used as a partition, the audio signal cannot penetrate. As a result, the audio signal emitted by the first terminal 10 will not be mistakenly received by the second terminal 11 in other rooms (for example, the next door conference room) like a Bluetooth signal.
[0050] In addition, the main reason for using the ultrasonic frequency band (the frequency in actual use is above 18.5kHz) is that the higher the frequency of the audio signal, the weaker its wall penetration performance; at the same time, the actual audible frequency of the human ear is generally lower than 18.5kHz, so the use of the ultrasonic frequency band can also avoid the impact of noise on the human ear.
[0051] The following is a detailed introduction to the process of establishing the above-mentioned screen projection connection.
[0052] For example, continue to refer to Figure 1 , assuming that the first terminal 10 and the second terminal 11 are devices in the same local area network, and / or a Bluetooth communication connection is established between the first terminal 10 and the second terminal 11. When implementing the screen projection connection between the second terminal 11 and the first terminal 10, the second terminal 11 first sends a request message to the first terminal 10 via Bluetooth or wireless communication technology (Wi-Fi), thereby requesting a screen projection code from the first terminal 10, that is, the second terminal 11 executes S110: sending a request message.
[0053] The second terminal 11 sending the request information to the first terminal 10 may include: the second terminal 11 sending a beacon frame corresponding to the request information to the first terminal 10. The beacon frame is a periodic frame that sends a beacon signal to the outside world at regular intervals to announce the existence of its own wireless network.
[0054] For example, continue to refer to Figure 1 After the first terminal 10 receives the beacon frame corresponding to the above request information via Bluetooth or Wi-Fi, it modulates the screen projection code. The screen projection code can be randomly generated by the first terminal 10, or manually set in advance, etc. This application does not limit the method for determining the screen projection code.
[0055] The following is a detailed introduction to the process of the first terminal 10 modulating the screen projection code.
[0056] In an exemplary embodiment, continue to refer to Figure 1 The first terminal 10 executes S120: receiving the request information, and determining the data frame corresponding to the projection code and the frequency of the parameters in the data frame, and S130: determining the first audio signal corresponding to the data frame according to the frequency of the parameters.
[0057] First, the first terminal 10 determines the data frame corresponding to the screen projection code:
[0058] For example, the projection code may be modulated by using a multiple frequency-shift keying (MFSK) method, wherein MFSK is a modulation method that can use multiple different carrier frequencies to represent a variety of digital information.
[0059] Exemplarily, the projection code may be modulated by decimal frequency shift keying: Assuming that the projection code of the first terminal 10 is "MA27ZX", the data frame corresponding to the obtained projection code is shown in Table 1:
[0060] Table 1
[0061]
[0062] Referring to Table 1, the method of converting the projection code into a decimal number can be implemented using the American Standard Code for Information Interchange (ASCII). As shown in Table 1, each bit in the decimal ASCII corresponding to the projection code is the data value in the sign bit. For example, the decimal ASCII corresponding to "M" is "77", where "7" and "7" are the two data values in the sign bit; the decimal ASCII corresponding to "2" is "50", where "5" and "0" are the two data values in the sign bit.
[0063] The checksum is a cumulative check, that is, the sum of the ASCII corresponding to the projection code is taken after taking the last two digits. As shown in Table 1, the sum of the ASCII of "MA27ZX" is 77+65+50+55+90+88=425, then the last two digits of 425 are taken, and the obtained checksum is "25", where "2" and "5" are the two data values in the checksum.
[0064] Among them, the check bit can be used for the second terminal 11 to check the projection code: the second terminal 11 uses the check bit in the received data frame to determine whether the data value in the sign bit is correct, so that when erroneous data is received, the data frame is discarded and received again.
[0065] The synchronization bit "start" is used to identify the starting position of the data frame, and the stop bit "stop" is used to identify the end position of the data frame.
[0066] Afterwards, the first terminal 10 determines the frequency of the parameter in the data frame:
[0067] Exemplarily, the first terminal 10 uses the parameters in the data frame (the parameters include the synchronization bit, the data value in the sign bit, the check value in the check bit, and the stop bit) as the frequency point, and maps the frequency of the frequency point.
[0068] According to the Nyquist sampling theorem, the frequency of audio should not exceed 22kHz, while the audible range of the human ear is generally below 18.5kHz. Therefore, the frequency range used by MSFK should be within the range of [18.5kHz, 22kHz].
[0069] For example, for the synchronization bit "start", the frequency of the corresponding frequency point can be taken as: start_freq = 18502 Hz; for the stop bit "stop", the frequency of the corresponding frequency point can be taken as: stop_freq = 20660 Hz.
[0070] Considering that the time for the first terminal 10 to transmit the first audio signal is as short as possible, and combining the actual accuracy requirement of short-time Fourier transform (STFT), the time length T for the second terminal 11 to slice the audio signal and perform spectrum analysis can be set to 6ms.
[0071] It should be noted that the above-mentioned sampling duration of the second terminal 11 is only an example and is not limited in this embodiment. The sampling duration is also related to the computing power of the central processing unit (CPU) in the second terminal 11. The higher the computing power of the CPU, the shorter the sampling duration is generally.
[0072] Assuming that the sampling rate of the second terminal 11 is 48kHz, 6ms contains 48kHz*0.006s=288 frequency points. Therefore, the frequency resolution of STFT is F=48kHz / 288=166.6666666667Hz. Therefore, when the first terminal 10 maps the frequency points to the corresponding frequencies, an integer multiple of the frequency resolution F of STFT can be selected, that is, the frequency Freq=N*F.
[0073] The frequency mapped by the frequency point is taken as an integer multiple of the STFT resolution, which can improve the reception accuracy of the second terminal 11 and increase the transmission distance of the audio signal.
[0074] For example, the frequencies corresponding to the data values 0 to 9 in the sign bit may be mapped to: data_freq=[19000, 19166, 19332, 19498, 19664, 19830, 19996, 20162, 20328, 20494].
[0075] Next, after the first terminal 10 determines the frequency of the frequency point corresponding to the above parameters, it can convert the data frame into the corresponding first audio signal through MSFK.
[0076] In an exemplary embodiment, continue to refer to Figure 1Next, the first terminal 10 executes S140: determining a continuous sending time of a frequency point in the first audio signal.
[0077] In an exemplary embodiment, there is a problem when using the ultrasonic frequency band to broadcast the audio signal: the transmission distance of ultrasonic waves is short and it is difficult to exceed the transmission distance of 3m.
[0078] refer to Figure 2 The schematic diagram of the audio signal transmission in space is shown, and Figure 3 Schematic diagram of signal aliasing shown.
[0079] like Figure 2 As shown, after the first terminal 10 broadcasts the audio signal, part of the audio signal that does not encounter obstacles in the space (for example, walls) is received by the second terminal 11 as a direct signal, while part of the audio signal is reflected and delayed due to encountering obstacles, and is thus received by the second terminal 11 as a reflected signal (or delayed signal).
[0080] like Figure 3 As shown, the main reason for the shorter transmission distance of ultrasonic waves is similar to the multipath effect in wireless transmission: since the speed of sound waves is relatively low, only 340m / s, as long as the reflection path of the reflected signal is 1m longer than the direct path of the direct signal, the reflected signal will be delayed by 3ms to reach the second terminal 11 and superimposed on the direct signal, resulting in signal aliasing.
[0081] Therefore, for common transmission spaces (e.g., conference rooms, classrooms, living rooms, etc.), it is necessary to evaluate the maximum delay distance (i.e., the maximum reflection path). Through engineering tests, this application sets the maximum delay distance d to 14m, so the maximum delay time is 14m*3ms=42ms. That is, when the difference between the reflection path and the direct path is not greater than 14m, the transmission time of the frequency point in the first audio signal is extended by 42ms (or the sampling delay of the second terminal 11 is 42ms), which can avoid the influence of the aliasing of the reflected signal.
[0082] Assume that the transmission space of the audio signal is a conference room with a length of 10m, a width of 4m, and a height of 3.5m. Since the intensity attenuation of the audio signal is inversely proportional to the square of the transmission distance, even at the maximum direct distance r 直达 =10m, compared with the direct signal, the attenuation of the reflected signal is: That is, when the transmission distance is the largest, the difference in signal strength between the reflected signal and the direct signal is also relatively large. In this way, the second terminal 11 can easily distinguish the reflected signal from the direct signal.
[0083] The sampling duration of the second terminal 11 can be set according to the frequency resolution, bandwidth, data frame length, etc. of the short-time Fourier transform, for example, the sampling duration is set to 6ms. The value of the sampling duration is not limited in this embodiment.
[0084] In addition, in order to avoid the position deviation of the second terminal 11 when sampling the received audio signal, the holding time (Hold time) of the frequency point in the first audio signal can be set to 6ms. Among them, the holding time can be determined according to the actual engineering debugging value, and the value of the holding time is not limited in this embodiment.
[0085] In summary, when the first terminal 10 transmits the first audio signal, the continuous transmission duration of each frequency point can be: maximum delay time + sampling duration + holding time = 42 + 6 + 6 = 54ms. In other words, different parameters in the data frame correspond to different signal segments, and the duration of each signal segment is the continuous transmission duration, and each signal segment includes at least one frequency point. For example, after modulating the data value "7" in the sign bit, a signal segment with a duration of 54ms is obtained, in which the frequency of the frequency point is 20162Hz.
[0086] It should be noted that the above-mentioned continuous transmission duration values of each frequency point are only examples, and the continuous transmission durations obtained according to different sampling durations and holding times are also different. The selection of the maximum delay time can also be carried out according to engineering measurements in actual space. In this embodiment, the value of the continuous transmission duration is not limited.
[0087] For example, continue to refer to Figure 1 After determining the above continuous transmission time, the second audio signal can be determined according to the continuous transmission time, that is, the first terminal 10 executes S150: determining the second audio signal according to the continuous transmission time of the frequency point in the first audio signal.
[0088] In an exemplary embodiment, there is another problem when using the ultrasonic frequency band to broadcast the audio signal: when the transmission power of the first terminal 10 is increased (that is, when the volume of the first audio signal transmitted by the first terminal 10 is increased), severe audible noise will be generated.
[0089] There are two main reasons for the occurrence of severe audible noise when the first terminal 10 performs ultrasonic broadcasting: first, when the broadcasting is stopped and the first audio signal is started, low-frequency sound components are generated due to sudden changes in the sound; second, when different parameters in the data frame are modulated, frequency inconsistencies may occur, resulting in sudden changes in the frequency.
[0090] refer to Figure 4 The time domain diagram of the first audio signal is shown.
[0091] like Figure 4 As shown, to solve the first problem, it is necessary to add slow-in and slow-out parts at the frame head and frame tail of the data frame, respectively, so that the strength of the first audio signal gradually increases at the starting position and gradually decreases at the end position. The synchronization bit and stop bit in the above data frame respectively realize the slow-in and slow-out functions.
[0092] refer to Figure 5a to Figure 5c The schematic diagram of smoothing the first audio signal is shown in FIG. 1 , wherein the horizontal axis represents time t, in ms, and the vertical axis represents amplitude, in decibel db.
[0093] like Figure 5a As shown in FIG. 1 , it is assumed that when two adjacent data values "5" and "0" in the above data frame are modulated, a frequency mutation occurs, and the frequency point causing the frequency mutation is the frequency point corresponding to "0". Figure 5b As shown, after the frequency mutation point is magnified, it can be clearly seen that the amplitude of this frequency point has a large difference compared with the amplitude of the adjacent frequency points.
[0094] Therefore, in order to solve the second problem mentioned above, it is necessary to process the frequency points in the first audio signal that cause the frequency mutation. Figure 5c As shown, the frequency points of frequency mutation can be smoothed by means of a bandpass filter, thereby avoiding serious frequency mutation.
[0095] In addition, the first audio signal is sent in a continuous mode (ie, non-breakpoint mode), that is, the continuity of the first audio signal is maintained in the sampling delay region, thereby avoiding the generation of noise caused by the discontinuity of the first audio signal.
[0096] Therefore, in addition to determining the continuous transmission time of the frequency point, the first audio signal can also be smoothed and transmitted in a continuous mode. The time-frequency diagram of the second audio signal finally obtained can be referred to. Figure 6 As shown. The horizontal axis represents time t, the unit is ms, and the vertical axis represents frequency, the unit is Hz (the frequency in the figure is in reverse order).
[0097] like Figure 6 As shown in the figure, different frequency bands correspond to different parameters in the data frame. For example, frequency band A corresponds to the synchronization bit "start" (frequency is 18502Hz), frequency band B corresponds to the data value "7" in the sign bit (frequency is 20162Hz), and frequency band C corresponds to the data value "6" in the sign bit (frequency is 19996Hz), and the continuous transmission time of each parameter is 54ms.
[0098] Through the above solution, the transmission distance of the final second audio signal can break through the limit of 3m, and even when the transmission power of the first terminal 10 reaches the maximum value, the audible noise when sending the second audio signal will be very weak.
[0099] In an exemplary embodiment, continue to refer to Figure 1 After the first terminal 10 determines the second audio signal, S160 is performed: broadcasting the second audio signal in the form of ultrasound.
[0100] In an exemplary embodiment, after receiving the second audio signal broadcast by the first terminal 10, the second terminal 11 demodulates the second audio signal to obtain a screen projection code. That is, the second terminal 11 executes step S170: demodulating the second audio signal to obtain a screen projection code. The process of demodulating the second audio signal by the second terminal 11 is described in detail below.
[0101] refer to Figure 7 The flowchart of demodulating the second audio signal is shown.
[0102] For example, Figure 7 As shown, the second terminal 11 first executes S701: receiving a third audio signal, wherein the length of the third audio signal is greater than or equal to twice that of the second audio signal.
[0103] refer to Figure 8 Schematic diagram of the third audio signal shown in FIG. Figure 8 As shown, assuming that the overall duration of the second audio signal is TS (i.e., starting from the synchronization bit "start" and ending at the stop bit "stop"), then if the receiving duration of the second terminal 11 is set to be greater than or equal to 2TS, then it can be ensured that the second terminal 11 receives the complete second audio signal.
[0104] For example, continue to refer to Figure 7 After receiving the third audio signal, the second terminal 11 may traverse the third audio signal in steps with a preset duration, and detect whether the parameters corresponding to the frequency points contain a synchronization bit.
[0105] The preset duration can be determined according to actual conditions, for example, the preset duration is set to 1 ms, etc., and the value of the preset duration is not limited in this embodiment. The parameter is the parameter in the above data frame.
[0106] Specifically, each time the step detection is performed, the second terminal 11 executes S702: converts the frequency points of the third audio signal within the preset time length to obtain parameters corresponding to the frequency points within the preset time length, and executes S730: determines whether there is a synchronization bit in the parameter. If there is no synchronization bit, continue to execute S702.
[0107] For example, assuming that the above preset duration is 1ms, a signal segment of 1ms length is taken from the starting position of the third audio signal, and the frequency points in the signal segment are converted into corresponding parameters, and it is determined whether the parameters contain a synchronization bit; if there is no synchronization bit in the signal segment, the step is continued to be 1ms, and the frequency points in the next signal segment of 1ms length are similarly converted into corresponding parameters, and it is determined whether the parameters contain a synchronization bit. And so on, until the first synchronization bit in the third audio signal is detected.
[0108] For example, continue to refer to Figure 7 If the execution result of S703 is that there is a synchronization bit, the second terminal 11 executes S704: determining whether the next parameter adjacent to the synchronization bit is a sign bit. If it is not a sign bit, continue to execute S702.
[0109] Specifically, after detecting the synchronization bit in the third audio signal, the second terminal 11 converts the next frequency point adjacent to it into a corresponding parameter, and determines whether the parameter is any integer value from 0 to 9. If not, S702 is continued to be executed until the first sign bit in the third audio signal is detected.
[0110] For example, continue to refer to Figure 7 If the result of S704 is a sign bit, the second audio signal can be directly determined from the third audio signal according to the length TS. That is, the second terminal 11 executes S705: starting with the synchronization bit, determining the second audio signal from the third audio signal.
[0111] For example, continue to refer to Figure 7 After obtaining the second audio signal, the synchronization bit is filtered out, that is, the second terminal 11 executes S706: filtering out the synchronization bit in the second audio signal. After filtering out the synchronization bit, execute S707: converting one or more data values included in the sign bit to obtain a projection code.
[0112] Afterwards, the second terminal 11 executes S708: converting the frequency point in the second audio signal to obtain a check bit corresponding to the frequency point in the second audio signal.
[0113] Exemplarily, when executing S707 to S708, the second terminal 11 can convert the frequency points in the second audio signal in sequence, and determine whether the parameters obtained after the conversion are stop bits and check bits. If they are not stop bits or check bits, they are converted into corresponding characters according to ASCII. For example, the corresponding character obtained by decoding the data values "7" and "7" is "M".
[0114] As to why the corresponding character is not determined according to a data value, the reason is that the characters corresponding to ASCII values 0 to 9 are control characters, and they have different functions. For example, the character corresponding to ASCII value 3 is ETX, which means the end of the text (End of Text), used to mark the end of the header; the character corresponding to ASCII value 6 is ACK, which means the confirmation message (Acknowledgement), used in data communication. Therefore, the second terminal 11 can directly combine the two data values and then decode them.
[0115] Exemplarily, if the obtained parameter is a stop bit, the second terminal 11 executes S709: judging whether the data value in the second audio signal is correct according to the check bit. If correct, execute S710: establish a screen projection connection with the first terminal according to the screen projection code; if incorrect, continue to execute S701.
[0116] For example, if the data value received by the second terminal 11 is "7, 7, 6, 5, 5, 0, 5, 5, 9, 0, 8, 8", it can be judged that the data value is correct according to the check bit "25", then the second terminal 11 can establish a screen projection connection with the first terminal 10 according to the projection code "MA27ZX" obtained by decoding the data value; and if the data value received by the second terminal 11 is "7, 8, 6, 5, 5, 0, 5, 5, 9, 0, 8, 8", it can be judged that the data value is wrong according to the check bit "25", then the second terminal 11 receives the third audio signal again.
[0117] In an exemplary embodiment, due to some complex environments, the sampling delay added in the first terminal 10 may not completely avoid the aliasing of the reflected signal. Therefore, the second terminal 11 can detect the frequency point in the second audio signal to determine whether the frequency point is a reflected signal or a direct signal, and filter the frequency point corresponding to the reflected signal, and retain the frequency point corresponding to the direct signal.
[0118] refer to Fig. 9 The flowchart of determining the data value corresponding to the frequency point in the second audio signal is shown in the figure. The above determination process is introduced in detail below.
[0119] Exemplarily, the second terminal 11 receives the first frequency point (denoted as the first frequency point F n ), convert it; next, the second terminal 11 receives the second frequency point (denoted as, the second frequency point F n+1 ). The second frequency point is a frequency point with the largest amplitude in the second audio signal.
[0120] like Fig. 9As shown, therefore, the second terminal 11 first executes S901: determining whether a first data value corresponding to a first frequency point and a second data value corresponding to a second frequency point in the second audio signal are the same.
[0121] Assume that the first frequency point F n The corresponding first data value is "7". If the first data value is different from the second data value (for example, the second data value is "6"), the second terminal 11 executes S906': determine that the second data value is the data value in the sign bit. That is, if the first data value is different from the second data value, the second frequency point F n+1 The corresponding second data value is saved as the real data value.
[0122] If the second frequency point F is obtained n+1 The corresponding second data value is still "7", so it is necessary to determine whether the second data value "7" is a direct signal or a reflected signal generated when the first data value is sent.
[0123] Therefore, if the first data value is the same as the second data value, the second terminal 11 executes S902: determining a third frequency point having the second largest amplitude in the second audio signal, and executes S903: determining a difference between the amplitude of the third frequency point and the amplitude of the second frequency point.
[0124] The second terminal 11 needs to determine the frequency point with the second largest amplitude in the second audio signal (denoted as the third frequency point F n+1_temp ), and calculate the third frequency point F n+1_temp Amplitude A n+1_temp With the second frequency F n+1 Amplitude A n+1 The difference between .
[0125] Next, the second terminal 11 executes S904: determining whether the difference is greater than a preset value. The preset value may be determined according to an engineering debugging value. For example, if the length of the transmission space of the audio signal is 10m, the preset value may be a value between [0db, 7.6db], for example, the preset value is 3db.
[0126] It should be noted that if the preset value is too large, when the first terminal 10 sends continuous identical signals, the strength difference between the direct signal and the reflected signal will not be obvious due to the blocking of the direct signal, resulting in the direct signal being erroneously filtered out.
[0127] If the difference is less than the preset value, the second terminal 11 executes S906'. If the difference is less than the preset value, it means that the second frequency point F n+1 The intensity of the second frequency F n+1 For a direct signal, the second frequency point F n+1The corresponding second data value is saved as the real data value.
[0128] If the difference is greater than the preset value, the second terminal 11 executes S905: converts the third frequency point to obtain a third data value corresponding to the third frequency point, and executes S906: determines that the third data value is a data value in the sign bit.
[0129] If the difference is greater than the preset value, it means that the second frequency point F n+1 The intensity of the second frequency point F is not strong enough, and it is most likely a reflected signal. n+1 Filter out and make the third frequency F n+1_temp The corresponding third data value is saved as the real data value.
[0130] This application adopts ultrasonic broadcast communication to establish a screen projection connection between the first terminal and the second terminal, which can improve the efficiency of screen projection. In addition, this application proposes that the first terminal should have a certain continuous sending time when sending an audio signal, so as to solve the problem of short receiving distance of ultrasonic broadcast in actual application, so that the transmission distance of the final second audio signal exceeds the limit of 3m.
[0131] Furthermore, the present application realizes the slow entry and slow exit of the audio signal through the synchronization bit and stop bit of the data frame, and smoothes the frequency points of the frequency mutation, so that the audible noise when the first terminal sends the second audio signal is very weak.
[0132] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0133] in, Fig.10 A structural diagram of an example of a screen projection connection device provided in the present application is shown, and the device is configured at a first terminal.
[0134] The screen projection connection device 1000 provided in the present application includes: a determination module 1001 and a first sending module 1002.
[0135] The determination module 1001 is used to: receive the request information sent by the second terminal, and determine the data frame corresponding to the screen projection code, and determine the frequency of the parameters in the data frame;
[0136] Determine a first audio signal corresponding to the data frame according to the frequency of the parameter in the data frame;
[0137] Determine a continuous transmission duration of the frequency point in the first audio signal, wherein the continuous transmission duration is determined according to a spectrum analysis duration of the second terminal and a length of a maximum reflection path in a space where the first terminal is located;
[0138] The second audio signal is determined according to a continuous sending duration of the frequency point in the first audio signal.
[0139] The first sending module 1002 is used to: broadcast the second audio signal in the form of ultrasound so that the second terminal receives the second audio signal, and demodulates the second audio signal to obtain a screen projection code, and enable the second terminal to establish a screen projection connection with the first terminal according to the screen projection code.
[0140] in, Fig.11 A structural diagram of another example of a screen projection connection device provided in the present application is shown, and the device is configured at a first terminal.
[0141] In one possible implementation, the above-mentioned determination module 1001 is specifically used to: determine the frequency resolution of the short-time Fourier transform based on the spectrum analysis duration of the second terminal and the sampling frequency of the second terminal; determine the frequency of the parameter in the data frame based on an integer multiple of the frequency resolution of the short-time Fourier transform, wherein the frequency difference between two adjacent parameters in the data frame is an integer multiple of the frequency resolution of the short-time Fourier transform.
[0142] In an exemplary embodiment, based on the aforementioned scheme, the parameters include a sign bit, and one or more of a synchronization bit, a check bit and a stop bit; wherein the synchronization bit is used to identify the starting position of the data frame, and is used to achieve the slow-in of the second audio signal; the sign bit includes one or more data values obtained by converting the projection code; the check bit includes one or more check values determined based on the first data value; the stop bit is used to identify the end position of the data frame, and is used to achieve the slow-out of the second audio signal.
[0143] Optionally, the device further comprises: a smoothing processing module 1003. The smoothing processing module 1003 is configured to: perform smoothing processing on the frequency points causing frequency mutation in the first audio signal through a bandpass filter.
[0144] in, Fig.12 A structural diagram of another example of a screen projection connection device provided in the present application is shown, and the device is configured at the second terminal.
[0145] The screen projection connection device 1200 provided in the present application includes: a second sending module 1201, a receiving module 1202, and a connection module 1203.
[0146] The second sending module 1201 is used to: send a request message to the first terminal so that the first terminal determines the data frame corresponding to the projection code and the frequency of the parameters in the data frame; and, enable the first terminal to determine the first audio signal corresponding to the data frame according to the frequency of the parameters; and, enable the first terminal to determine the continuous sending duration of the frequency point in the first audio signal, wherein the continuous sending duration is determined according to the spectrum analysis duration of the second terminal and the length of the maximum reflection path in the space where the first terminal is located; and, enable the first terminal to determine the second audio signal according to the continuous sending duration of the frequency point in the first audio signal, and broadcast the second audio signal in the form of ultrasound.
[0147] The receiving module 1202 is used to: receive the second audio signal sent by the first terminal, and demodulate the second audio signal to obtain the screen projection code.
[0148] The connection module 1203 is used to establish a screen projection connection with the first terminal according to the screen projection code.
[0149] In a possible implementation, the receiving module 1202 is specifically configured to: receive a third audio signal, and determine a second audio signal according to the third audio signal, wherein a length of the third audio signal is twice a length of the second audio signal.
[0150] In a possible implementation, the above-mentioned receiving module 1202 is specifically used to: convert the frequency points of the third audio signal within a preset time length, obtain parameters corresponding to the frequency points within the preset time length, and determine whether there is a synchronization bit in the parameter; when there is a synchronization bit in the parameter, determine whether the next parameter adjacent to the synchronization bit is a sign bit; when the next parameter adjacent to the synchronization bit is a sign bit, start with the synchronization bit and determine the second audio signal from the third audio signal.
[0151] In a possible implementation, the above-mentioned receiving module 1202 is specifically used to: filter out the synchronization bit in the second audio signal; convert one or more data values included in the sign bit to obtain the screen projection code.
[0152] In one possible implementation, the above-mentioned connection module 1203 is specifically used to: convert the frequency point in the second audio signal to obtain the check bit corresponding to the frequency point in the second audio signal; judge whether the data value in the second audio signal is correct according to the check bit; when the data value in the second audio signal is correct, establish a screen projection connection with the first terminal according to the screen projection code.
[0153] In a possible implementation, the receiving module 1202 is further used to: determine whether a first data value corresponding to a first frequency point in the second audio signal is the same as a second data value corresponding to a second frequency point, wherein the second frequency point is a frequency point with the largest amplitude in the second audio signal; when the first data value and the second data value are the same, determine a third frequency point with the second largest amplitude in the second audio signal; determine a difference between the amplitude of the third frequency point and the amplitude of the second frequency point, and determine whether the difference is greater than a preset value; when the difference is greater than the preset value, convert the third frequency point to obtain a third data value corresponding to the third frequency point; and determine that the third data value is the data value in the sign bit.
[0154] It should be noted that the screen projection connection device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when executing the screen projection connection method. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the screen projection connection device provided in the above embodiment belongs to the same concept as the screen projection connection method embodiment. Therefore, for details not disclosed in the device embodiment of the present application, please refer to the above-mentioned screen projection connection method embodiment of the present application, which will not be repeated here.
[0155] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0156] An embodiment of the present application also provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-mentioned method embodiments when executing the program.
[0157] Fig.13 1 shows a structural diagram of an example terminal provided by this application. Fig.13 As shown, the terminal 1300 includes: a processor 1301 and a memory 1302 .
[0158] In the embodiment of the present application, the processor 1301 is the control center of the computer system, which can be the processor of a physical machine or the processor of a virtual machine. The processor 1301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1301 can be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor 1301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake-up state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state.
[0159] In this application, the processor 1301 is used for:
[0160] Receive the request information sent by the second terminal, and determine the data frame corresponding to the projection code, and determine the frequency of the parameters in the above data frame; determine the first audio signal corresponding to the above data frame according to the frequency of the above parameters; determine the continuous sending duration of the frequency point in the above first audio signal, wherein the above continuous sending duration is determined according to the spectrum analysis duration of the above second terminal and the length of the maximum reflection path in the space where the above first terminal is located; determine the second audio signal according to the continuous sending duration of the frequency point in the above first audio signal; broadcast the above second audio signal in the form of ultrasound, so that the above second terminal receives the above second audio signal, and demodulates the above second audio signal to obtain the above projection code, and enables the above second terminal to establish a projection connection with the above first terminal according to the above projection code.
[0161] Furthermore, the processor 1301 is specifically used to: determine the frequency resolution of the short-time Fourier transform according to the spectrum analysis duration of the second terminal and the sampling frequency of the second terminal; determine the frequency of the parameter in the data frame according to an integer multiple of the frequency resolution of the short-time Fourier transform, wherein the frequency difference between two adjacent parameters in the data frame is an integer multiple of the frequency resolution of the short-time Fourier transform.
[0162] In an exemplary embodiment, based on the aforementioned scheme, the above-mentioned parameters include a sign bit, and one or more of a synchronization bit, a check bit and a stop bit; wherein the above-mentioned synchronization bit is used to identify the starting position of the above-mentioned data frame, and is used to realize the slow-in of the above-mentioned second audio signal; the above-mentioned sign bit includes one or more data values obtained by converting the above-mentioned projection code; the above-mentioned check bit includes one or more check values determined according to the above-mentioned first data value; the above-mentioned stop bit is used to identify the end position of the above-mentioned data frame, and is used to realize the slow-out of the above-mentioned second audio signal.
[0163] Optionally, the processor 1301 is further configured to: perform smoothing processing on frequency points causing frequency mutation in the first audio signal by using a bandpass filter.
[0164] In the present application, the processor 1301 is also used for:
[0165] Send a request message to the first terminal so that the first terminal determines the data frame corresponding to the projection code and the frequency of the parameters in the data frame; and, the first terminal determines the first audio signal corresponding to the data frame according to the frequency of the parameters; and, the first terminal determines the continuous sending duration of the frequency point in the first audio signal, wherein the continuous sending duration is determined according to the spectrum analysis duration of the second terminal and the length of the maximum reflection path in the space where the first terminal is located; and, the first terminal determines the second audio signal according to the continuous sending duration of the frequency point in the first audio signal, and broadcasts the second audio signal in the form of ultrasound; receives the second audio signal sent by the first terminal, and obtains the projection code according to the second audio signal; and establishes a projection connection with the first terminal according to the projection code.
[0166] Further, the processor 1301 is specifically configured to: receive a third audio signal, and determine the second audio signal according to the third audio signal, wherein a length of the third audio signal is twice a length of the second audio signal.
[0167] Optionally, the processor 1301 is specifically used to: convert the frequency of the third audio signal within a preset time length, obtain parameters corresponding to the frequency within the preset time length, and determine whether there is a synchronization bit in the parameters; if there is a synchronization bit in the parameters, determine whether the next parameter adjacent to the synchronization bit is a sign bit; if the next parameter adjacent to the synchronization bit is a sign bit, determine the second audio signal from the third audio signal starting with the synchronization bit.
[0168] Optionally, the processor 1301 is specifically used to: filter out the synchronization bit in the second audio signal; convert one or more data values included in the sign bit to obtain the screen projection code.
[0169] Optionally, the processor 1301 is specifically used to: convert the frequency point in the second audio signal to obtain the check bit corresponding to the frequency point in the second audio signal; determine whether the data value in the second audio signal is correct according to the check bit; and when the data value in the second audio signal is correct, establish a screen projection connection with the first terminal according to the screen projection code.
[0170] Optionally, the processor 1301 is further used to: determine whether a first data value corresponding to a first frequency point in the second audio signal is the same as a second data value corresponding to a second frequency point, wherein the second frequency point is a frequency point with the largest amplitude in the second audio signal; when the first data value is the same as the second data value, determine a third frequency point with the second largest amplitude in the second audio signal; determine a difference between the amplitude of the third frequency point and the amplitude of the second frequency point, and determine whether the difference is greater than a preset value; when the difference is greater than the preset value, convert the third frequency point to obtain a third data value corresponding to the third frequency point; and determine that the third data value is the data value in the sign bit.
[0171] The memory 1302 may include one or more computer-readable storage media, which may be non-transitory. The memory 1302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage terminals, flash memory storage terminals. In some embodiments of the present application, the non-transitory computer-readable storage medium in the memory 1302 is used to store at least one instruction, and the at least one instruction is used to be executed by the processor 1301 to implement the method in the embodiment of the present application.
[0172] In some embodiments, the terminal 1300 further includes: a peripheral device interface 1303 and at least one peripheral device. The processor 1301, the memory 1302 and the peripheral device interface 1303 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 1303 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a display screen 1304, a camera 1305 and an audio circuit 1306.
[0173] The peripheral device interface 1303 may be used to connect at least one peripheral device related to input / output (I / O) to the processor 1301 and the memory 1302. In some embodiments of the present application, the processor 1301, the memory 1302, and the peripheral device interface 1303 are integrated on the same chip or circuit board; in some other embodiments of the present application, any one or two of the processor 1301, the memory 1302, and the peripheral device interface 1303 may be implemented on a separate chip or circuit board. The embodiments of the present application are not specifically limited to this.
[0174] The display screen 1304 is used to display a user interface (UI). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 1304 is a touch display screen, the display screen 1304 also has the ability to collect touch signals on the surface or above the surface of the display screen 1304. The touch signal can be input to the processor 1301 as a control signal for processing. At this time, the display screen 1304 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments of the present application, the display screen 1304 can be one, and the front panel of the terminal 1300 is set; in other embodiments of the present application, the display screen 1304 can be at least two, which are respectively set on different surfaces of the terminal 1300 or are folded; in some other embodiments of the present application, the display screen 1304 can be a flexible display screen, which is set on the curved surface or folded surface of the terminal 1300. Even, the display screen 1304 can also be set to a non-rectangular irregular figure, that is, a special-shaped screen. The display screen 1304 can be made of materials such as a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
[0175] Camera 1305 is used to capture images or videos. Optionally, camera 1305 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and virtual reality (VR) shooting function or other fusion shooting functions. In some embodiments of the present application, camera 1305 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.
[0176] The audio circuit 1306 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 1301 for processing. For the purpose of stereo sound collection or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 1300. The microphone may also be an array microphone or an omnidirectional collection microphone.
[0177] The power supply 1307 is used to power various components in the terminal 1300. The power supply 1307 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 1307 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0178] The terminal structure block diagram shown in the embodiment of the present application does not constitute a limitation on the terminal 1300. The terminal 1300 may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0179] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the method of any of the above embodiments are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.
[0180] In this application, the terms "first", "second", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or order; the term "plurality" refers to two or more, unless otherwise expressly defined. The terms "installed", "connected", "connected", "fixed", etc. should be understood in a broad sense. For example, "connected" can be a fixed connection, a detachable connection, or an integral connection; "connected" can be a direct connection or an indirect connection through an intermediate medium. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to the specific circumstances.
[0181] In the description of the present application, it is necessary to understand that the terms "upper", "lower", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or unit referred to must have a specific direction, be constructed and operated in a specific orientation. Therefore, it should not be understood as a limitation on the present application.
[0182] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A screen projection connection method, characterized in that: Applied to the first terminal, comprising: Receive the request information sent by the second terminal, determine the data frame corresponding to the screen projection code, and determine the frequency of the parameters in the data frame; determining, according to the frequency of the parameter, a first audio signal corresponding to the data frame; Determine a continuous transmission duration of a frequency point in the first audio signal, wherein the continuous transmission duration is determined according to a spectrum analysis duration of the second terminal and a length of a maximum reflection path in a space where the first terminal is located; Determine a second audio signal according to a continuous transmission duration of a frequency point in the first audio signal; The second audio signal is broadcast in the form of ultrasound, so that the second terminal receives the second audio signal, demodulates the second audio signal, obtains the screen projection code, and enables the second terminal to establish a screen projection connection with the first terminal according to the screen projection code.
2. The screen projection connection method according to claim 1, characterized in that: The determining the frequency of the parameter in the data frame comprises: Determining a frequency resolution of a short-time Fourier transform according to a spectrum analysis duration of the second terminal and a sampling frequency of the second terminal; The frequency of the parameter in the data frame is determined according to an integer multiple of the frequency resolution of the short-time Fourier transform, wherein the frequency difference between two adjacent parameters in the data frame is an integer multiple of the frequency resolution of the short-time Fourier transform.
3. The screen projection connection method according to claim 1 or 2, characterized in that: The parameters include a sign bit, and one or more of a synchronization bit, a check bit, and a stop bit; The synchronization bit is used to identify the starting position of the data frame and to implement slow-in of the second audio signal; The sign bit includes one or more data values obtained by converting the screen projection code; The check bit includes one or more check values determined according to the first data value; The stop bit is used to identify the end position of the data frame and to achieve slow-out of the second audio signal.
4. The screen projection connection method according to claim 1 or 2, characterized in that: After determining the duration of continuous transmission of the frequency point in the first audio signal, the method further includes: The frequency points causing frequency mutation in the first audio signal are smoothed by using a bandpass filter.
5. A screen projection connection method, characterized in that: Applied to the second terminal, including: Sending a request message to a first terminal, so that the first terminal determines a data frame corresponding to a screen projection code and determines the frequency of a parameter in the data frame; and, the first terminal determines a first audio signal corresponding to the data frame according to the frequency of the parameter; and, the first terminal determines a continuous transmission duration of a frequency point in the first audio signal, wherein the continuous transmission duration is determined according to a spectrum analysis duration of the second terminal and a length of a maximum reflection path in a space where the first terminal is located; and, the first terminal determines a second audio signal according to a continuous transmission duration of a frequency point in the first audio signal, and broadcasts the second audio signal in the form of ultrasound; receiving the second audio signal sent by the first terminal, and obtaining the screen projection code according to the second audio signal; Establish a screen projection connection with the first terminal according to the screen projection code.
6. The screen projection connection method according to claim 5, characterized in that: The receiving the second audio signal sent by the first terminal includes: receiving a third audio signal, and determining the second audio signal according to the third audio signal, wherein a length of the third audio signal is twice a length of the second audio signal; The determining the second audio signal according to the third audio signal comprises: Converting the frequency points of the third audio signal within a preset time length to obtain parameters corresponding to the frequency points within the preset time length, and determining whether there is a synchronization bit in the parameters; In the case where a synchronization bit exists in the parameter, determining whether the next parameter adjacent to the synchronization bit is a sign bit; In the case that the next parameter adjacent to the synchronization bit is a sign bit, the second audio signal is determined from the third audio signal starting with the synchronization bit.
7. The screen projection connection method according to claim 6, characterized in that: The obtaining the screen projection code according to the second audio signal includes: filtering out synchronization bits in the second audio signal; One or more data values included in the sign bit are converted to obtain the screen projection code.
8. The screen projection connection method according to claim 6, characterized in that: The establishing a screen projection connection with the first terminal according to the screen projection code includes: Converting the frequency point in the second audio signal to obtain a check bit corresponding to the frequency point in the second audio signal; determining whether a data value in the second audio signal is correct according to the check bit; When the data value in the second audio signal is correct, a screen projection connection is established with the first terminal according to the screen projection code.
9. The screen projection connection method according to claim 7, characterized in that: Prior to converting the one or more data values included in the sign bit, the method further comprises: determining whether a first data value corresponding to a first frequency point and a second data value corresponding to a second frequency point in the second audio signal are the same, wherein the second frequency point is a frequency point with the largest amplitude in the second audio signal; When the first data value is the same as the second data value, determining a third frequency point having a second largest amplitude in the second audio signal; Determine a difference between the amplitude of the third frequency point and the amplitude of the second frequency point, and determine whether the difference is greater than a preset value; When the difference is greater than the preset value, converting the third frequency point to obtain a third data value corresponding to the third frequency point; The third data value is determined to be a data value in the sign bit.
10. A screen projection connection device, characterized in that: The device is configured at the first terminal and includes: A determination module, used to: receive the request information sent by the second terminal, and determine the data frame corresponding to the screen projection code, and determine the frequency of the parameters in the data frame; Determining a first audio signal corresponding to the data frame according to the frequency of the parameter in the data frame; Determine a continuous transmission duration of a frequency point in the first audio signal, wherein the continuous transmission duration is determined according to a spectrum analysis duration of the second terminal and a length of a maximum reflection path in a space where the first terminal is located; Determine a second audio signal according to a continuous transmission duration of a frequency point in the first audio signal; The first sending module is used to: broadcast the second audio signal in the form of ultrasound so that the second terminal receives the second audio signal, and demodulates the second audio signal to obtain the screen projection code, and enable the second terminal to establish a screen projection connection with the first terminal according to the screen projection code.
11. A screen projection connection device, characterized in that: The second terminal is configured to include: A second sending module is used to: send a request message to the first terminal so that the first terminal determines the data frame corresponding to the screen projection code and determines the frequency of the parameters in the data frame; and, the first terminal determines the first audio signal corresponding to the data frame according to the frequency of the parameters; and, the first terminal determines the continuous sending duration of the frequency point in the first audio signal, wherein the continuous sending duration is determined according to the spectrum analysis duration of the second terminal and the length of the maximum reflection path in the space where the first terminal is located; and, the first terminal determines the second audio signal according to the continuous sending duration of the frequency point in the first audio signal, and broadcasts the second audio signal in the form of ultrasound; A receiving module, used to: receive the second audio signal sent by the first terminal, and demodulate the second audio signal to obtain the screen projection code; A connection module is used to establish a screen projection connection with the first terminal according to the screen projection code.
12. A terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the screen projection connection method according to any one of claims 1 to 4 is implemented; And implement the screen projection connection method as described in any one of claims 5 to 9.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the processor, the screen projection connection method according to any one of claims 1 to 4 is implemented; And implement the screen projection connection method as described in any one of claims 5 to 9.
