Disclosure of Invention
An object of the embodiments of the present application is to provide a signal control method for a cable and an electronic device, where the signal control method can transmit a corresponding signal to a target cable connected to the electronic device based on a specific condition of the target cable, so that the signal is adapted to the target cable, and it is ensured that the signal passing through the target cable can be well used.
In order to solve the technical problem, the embodiment of the application adopts the following technical scheme: a signal control method of a cable, comprising:
under the condition that a trigger signal for representing target cable access is acquired, responding to the trigger signal, and starting a detection process of parameters of the target cable, wherein the parameters of the target cable comprise the length of the target cable;
acquiring a parameter of the target cable, and determining a first output signal for driving the target cable based on the parameter of the target cable, wherein the signal strength of the first output signal corresponds to the parameter of the target cable;
using the first output signal as an input to the target cable.
Optionally, the determining a first output signal for driving the target cable based on the parameter of the target cable includes:
based on the parameter of the target cable, selecting a first signal strength corresponding to the parameter of the target cable within a preset protocol range, so as to determine the first output signal according to the first signal strength.
Optionally, the acquiring the parameter of the target cable includes:
transmitting a test signal to a first interface of the target cable, and acquiring feedback information of the target cable for the test signal;
and obtaining the parameters of the target cable according to the feedback information.
Optionally, when the parameter of the target cable is the length of the target cable, the acquiring the parameter of the target cable specifically includes:
transmitting the test signal to the first interface, acquiring a feedback signal formed based on the test signal, and recording corresponding feedback time, wherein the feedback signal is a signal formed after the test signal reaches a second interface of the target cable and returns to the first interface from the second interface;
and calculating the length of the target cable based on the feedback time.
Optionally, the acquiring the parameter of the target cable further includes:
transmitting the test signal to the first interface, and acquiring a feedback signal formed based on the test signal;
and comparing the test signal with the feedback signal, and acquiring the attenuation parameter of the target cable according to the comparison result.
Optionally, the method further comprises:
detecting the access state of the target cable based on a preset time interval;
and adjusting the input of the target cable according to the access state.
Optionally, the target cable comprises a cable with a high definition multimedia interface.
An embodiment of the present application further provides an electronic device, including:
the response module is configured to respond to a trigger signal for representing target cable access and start a detection process of a parameter of the target cable under the condition that the trigger signal is acquired, wherein the parameter of the target cable comprises the length of the target cable;
a processing module configured to acquire a parameter of the target cable, and determine a first output signal for driving the target cable based on the parameter of the target cable, wherein a signal strength of the first output signal corresponds to the parameter of the target cable;
using the first output signal as an input to the target cable.
Optionally, the processing module is further configured to: based on the parameter of the target cable, selecting a first signal strength corresponding to the parameter of the target cable within a preset protocol range, so as to determine the first output signal according to the first signal strength.
Optionally, the processing module is further configured to:
transmitting a test signal to a first interface of the target cable, and acquiring feedback information of the target cable for the test signal;
and calculating the parameters of the target cable according to the feedback information.
The signal control method can transmit corresponding signals to the target cable based on the specific conditions (including the form parameters and physical characteristic parameters of the target cable) of the target cable connected to the electronic equipment, so that the signals are matched with the target cable, the signals passing through the target cable can be well used, data transmission failure caused by the fact that the signals are not matched with the cable is avoided, for example, the black screen phenomenon of a display is avoided, or a user spends a great deal of energy and cannot find out specific reasons of the data transmission failure, and benefits of the user are guaranteed.
Detailed Description
Various aspects and features of the present application are described herein with reference to the drawings.
It will be understood that various modifications may be made to the embodiments of the present application. Accordingly, the foregoing description should not be construed as limiting, but merely as exemplifications of embodiments. Those skilled in the art will envision other modifications within the scope and spirit of the application.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the application and, together with a general description of the application given above and the detailed description of the embodiments given below, serve to explain the principles of the application.
These and other characteristics of the present application will become apparent from the following description of preferred forms of embodiment, given as non-limiting examples, with reference to the attached drawings.
It should also be understood that, although the present application has been described with reference to some specific examples, a person of skill in the art shall certainly be able to achieve many other equivalent forms of application, having the characteristics as set forth in the claims and hence all coming within the field of protection defined thereby.
The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it is to be understood that the disclosed embodiments are merely exemplary of the application, which can be embodied in various forms. Well-known and/or repeated functions and constructions are not described in detail to avoid obscuring the application of unnecessary or unnecessary detail. Therefore, specific structural and functional details disclosed herein are not to be interpreted as limiting, but merely as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present application in virtually any appropriately detailed structure.
The specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may each refer to one or more of the same or different embodiments in accordance with the application.
Fig. 1 is a flowchart of a signal control method of a cable according to an embodiment of the present application; the method for controlling the signal of the cable can be applied to electronic equipment such as an intelligent terminal and the like and is used for controlling the signal transmission to a target cable, and the electronic equipment can use the cable to transmit data, but the signals sent by different cable electronic equipment are different. The cable may be a cable used by the electronic device, such as a video and/or audio cable, connected to the main body of the electronic device, and other desired cables through which the electronic device (or a component in the electronic device) may transmit signals to other devices (or other components in the electronic device) for communication or data interaction. As shown in fig. 1, the signal control method includes the steps of:
s1, under the condition that a trigger signal for representing the access of a target cable is acquired, responding to the trigger signal, and starting a detection process of parameters of the target cable, wherein the parameters of the target cable comprise the length of the target cable.
When the target cable is used, the target cable is connected to the electronic device, for example, the target cable is connected to a display card of a computer as a data transmission line, so that the display card can send a display signal to a display through the target cable. In this embodiment, after the target cable is connected to the electronic device, a trigger signal may be generated to indicate that the target cable has been connected to the electronic device, and after the trigger signal is acquired, the electronic device starts a response to start a detection process for parameters of the target cable, where the parameters of the target cable include parameters of various characteristics of the target cable, including morphological parameters, physical characteristic parameters, and the like.
The parameter of the target wire includes a length of the target wire. The difference in length results in different performance of the target cable. For example, a longer target cable may eventually cause greater signal loss, while a shorter target cable may cause less signal loss to be transmitted. The present embodiment can detect various parameters of the target cable including the length, so as to obtain the characteristics of the target cable, and of course, what kind of detection parameters can be set according to the actual use condition, or can be changed according to the actual use condition.
S2, acquiring the parameter of the target cable, and determining a first output signal for driving the target cable based on the parameter of the target cable, wherein the signal strength of the first output signal corresponds to the parameter of the target cable.
The mode of the electronic device for acquiring the parameters of the target cable can be directly acquired by the electronic device, and can also be indirectly acquired by other devices. For example, it can be obtained by a component mounted on a graphic card, or can be obtained by a device provided on a cable. The parameter of the target cable corresponds to the first output signal or corresponds to a signal intensity range, and the parameter of the specific target cable corresponds to the signal intensity of the first output signal or corresponds to a signal intensity range. The first output signal can be selected in the signal strength range according to a predetermined specification, for example, a signal with the greatest or smallest signal strength in the signal range can be selected as the first output signal.
S3, using the first output signal as the input of the target cable.
Since the determined first output signal is adapted to the target cable, the target cable is able to withstand the first output signal. The electronic device can use the first output signal as an input signal of the target cable, and thus can effectively use the target cable for data transmission.
The signal control method can transmit corresponding signals to the target cable based on the specific conditions of the target cable connected to the electronic equipment (including morphological parameters, physical characteristic parameters and the like of the target cable), and enables the target cable to normally transmit the signals, so that data transmission failure caused by improper matching of the signals and the cable is avoided, for example, the phenomenon of black screen of a display is avoided, or a user expends a great deal of energy and cannot find out the specific reason of the data transmission failure, and the benefit of the user is ensured.
In an embodiment of the present application, the determining a first output signal for driving the target cable based on the parameter of the target cable includes:
s21, selecting a first signal strength corresponding to the parameter of the target cable within a preset protocol range based on the parameter of the target cable, and determining the first output signal according to the first signal strength.
The preset protocol range may have a corresponding relationship with a parameter of the cable, and is a protocol range preset according to the parameter of the cable, for example, when the parameter of the target cable is a first value, a first preset protocol range (which may be a range of signal strength) corresponds to the preset protocol range, and when the parameter of the target cable is a second value, a second preset protocol range (which may be a range of signal strength) corresponds to the preset protocol range, for example, when the length of the target cable is 1 meter, the first preset protocol range corresponds to the preset protocol range; and if the length of the target cable is 10 meters, a second preset protocol range corresponds to the target cable. The first signal strength may be selected within the above range. The method comprises the steps of selecting from a first preset protocol range when the parameter of the target cable is a first numerical value, and selecting from a second preset protocol range when the parameter of the target cable is a second numerical value. In one embodiment, the maximum value of the signal strength can be selected from a preset protocol range as the first signal strength, and a signal corresponding to the first signal strength is used as the first output signal, so that the signal quality can be improved under the condition of meeting a preset data transmission protocol.
In an embodiment of the present application, as shown in fig. 2, the acquiring the parameter of the target cable includes:
s22, transmitting a test signal to a first interface of the target cable, and acquiring feedback information of the target cable for the test signal;
and S23, obtaining the parameters of the target cable according to the feedback information.
Specifically, the target cable has a first interface and one or more other interfaces, the first interface is an interface through which the target cable is connected to the electronic device, the electronic device may transmit a test signal to the first interface, the test signal is used to test parameters of the target cable, and the test signal may be adjusted accordingly according to different parameters that need to be obtained. After transmitting the test signal to the first interface, the target cable reacts to the test signal. In one embodiment, the test signal is transmitted inside the target cable and returns to the first interface after reaching other interfaces, so that feedback information is formed, and the electronic equipment calculates the parameters of the target cable according to the feedback information, such as the length of the target cable according to the feedback time; in another embodiment, a response module is disposed on the target cable (for example, the response module may be disposed at another interface), the response module prestores a plurality of kinds of prestored information related to the target cable, and after the response module receives the test signal, feedback information is determined based on the test signal and the prestored information, and the feedback information is sent to the electronic device, so that the electronic device calculates a parameter of the target cable according to the feedback information, for example, calculates a length of the target cable according to the feedback time. In addition, the response module can also directly store various parameters of the target cable, and after the test signal is received, the parameters corresponding to the test signal can be sent to the electronic equipment based on the test signal.
In an embodiment of the application, as shown in fig. 3 and with reference to fig. 6, when the parameter of the target cable is the length of the target cable, the acquiring the parameter of the target cable specifically includes:
s24, transmitting the test signal to the first interface, acquiring a feedback signal formed based on the test signal, and recording corresponding feedback time, wherein the feedback signal is formed after the test signal reaches the second interface of the target cable and returns to the first interface from the second interface;
and S25, calculating the length of the target cable based on the feedback time.
Specifically, the target cable has a first interface that is an interface through which the target cable is connected to the electronic device or a main body of the electronic device, and a second interface for connecting other devices. For example, the first interface is connected with a display card, the second interface is connected with a display, and the display card sends a display signal to the display through the target cable so that the display can display. After the test signal is transmitted to the first interface, the test signal reaches the second interface through the first interface, the distance between the first interface and the second interface is the length of the target cable, the test signal returns to the first interface along the original path after reaching the second interface, the returned signal is a feedback signal, and the time difference between the transmission of the test signal and the reception of the feedback signal is feedback time. The electronic equipment can calculate the length of the target cable according to the feedback signal and the feedback time.
In one embodiment, a test signal is transmitted to the first interface, a feedback signal formed based on the test signal is obtained, corresponding feedback time is recorded, and the length of the target cable is calculated based on the feedback time. It can also be implemented using Time Domain Reflectometry TDR (Time Domain Reflectometry).
In an embodiment of the present application, the parameter of the target cable further includes an attenuation parameter of the target cable, and the attenuation parameter represents a state of attenuation of the signal after a certain transmission, including an electrical signal, an optical signal, and the like. For example, one signal is attenuated after passing through the transmission medium, forming another signal. As shown in fig. 4 and in conjunction with fig. 6, the acquiring the parameter of the target cable further includes the following steps:
s26, transmitting the test signal to the first interface, and acquiring a feedback signal formed based on the test signal;
and S27, comparing the test signal with the feedback signal, and acquiring the attenuation parameter of the target cable according to the comparison result.
Specifically, a component (such as a video card) of the electronic device transmits a test signal to a first interface of a target cable, the test signal is attenuated in signal intensity when being transmitted by the target cable, the test signal can return to the first interface through the first interface, a body of the target cable, other interfaces and the body of the target cable respectively to form a feedback signal, and after the feedback signal is obtained, the original test signal and the feedback signal can be compared, so that attenuation parameters of the target cable are obtained according to a comparison result. A first output signal for driving the target cable may then be determined from the attenuation parameter to use the first output signal as an input to the target cable. Since the attenuation parameter represents the actual attenuation condition of the target cable, which is very accurate, the first output signal determined based on the attenuation parameter for driving the target cable will be very accurate, especially the signal strength of the first output signal will be adapted to the target cable, so that the first output signal is reasonable and accurate for inputting the target cable.
In one embodiment of the present application, as shown in fig. 5, the method further comprises the steps of:
and S4, detecting the access state of the target cable based on a preset time interval. Specifically, the user may remove or replace a different target cable as needed during the use of the target cable, for example, the target cable may be a cable with a high definition multimedia interface (HDMI cable). If the HDMI cable connected between the display card and the display is removed, wireless transmission is used instead, or other image transmission cables are used, the change of the access state of the target cable can cause the original signal input to the target cable not to be adapted to other replaced target cables, the access state of the target cable is detected based on a preset time interval in the embodiment, and the preset time interval can be set or adjusted according to specific use conditions. In another embodiment, a detection module may be disposed at a connection between the target cable and the electronic device, and once the access state of the target cable changes, the detection module sends out detection information, so that the electronic device can adjust the input of the target cable according to the new state.
And S5, adjusting the input of the target cable according to the access state. The access state changes, the same target cable may be plugged or replaced for a user, the electronic device may perform testing again according to the current target cable, obtain parameters of a new target cable, and determine a current first output signal based on the newly obtained parameters of the target cable. In one embodiment, the target cable may be removed by the user and is no longer used, for example, the display card no longer outputs a display signal to a specific display, and at this time, the electronic device may cut off the input to the target cable in time and no longer detects the target cable, thereby avoiding waste of resources and saving power.
An embodiment of the present application further provides an electronic device, where the electronic device may be an intelligent terminal such as a computer, for example, a desktop computer, a notebook computer, and as shown in fig. 7, the electronic device includes:
the response module is configured to respond to a trigger signal for representing target cable access and start a detection process of a parameter of the target cable when the trigger signal is acquired, wherein the parameter of the target cable comprises the length of the target cable.
Specifically, the target cable is connected to the electronic device when in use, for example, the target cable is connected to a display card of a computer as a data transmission line, so that the display card can send a display signal to a display through the target cable. In this embodiment, after the target cable is connected to the electronic device, a trigger signal may be generated to indicate that the target cable has been connected to the electronic device, and after the trigger signal is acquired, the response module starts to respond, and starts a detection process for parameters of the target cable, where the parameters of the target cable include parameters of various characteristics of the target cable, including morphological parameters, physical characteristic parameters, and the like.
The parameter of the target wire includes a length of the target wire. The difference in length results in different performance of the target cable. For example, a longer target cable may eventually cause greater signal loss, while a shorter target cable may cause less signal loss to be transmitted. The response module of this embodiment can detect various parameters of the target cable including the length, so as to obtain the characteristics of the target cable, and of course, what kind of detection parameters can be set according to the actual use condition, or can be changed according to the actual use condition.
A processing module configured to acquire a parameter of the target cable, and determine a first output signal for driving the target cable based on the parameter of the target cable, wherein a signal strength of the first output signal corresponds to the parameter of the target cable.
Using the first output signal as an input to the target cable.
Specifically, the mode of acquiring the parameter of the target cable by the processing module may be directly acquired by itself, or may be indirectly acquired by using other devices. For example, it can be obtained by a component mounted on a graphic card, or can be obtained by a device provided on a cable. The parameter of the target cable corresponds to the first output signal or corresponds to a signal intensity range, and the parameter of the specific target cable corresponds to the signal intensity of the first output signal or corresponds to a signal intensity range. The processing module can select the first output signal in the signal strength range according to a preset specification, for example, select the signal with the maximum or minimum signal strength in the signal range as the first output signal.
Since the determined first output signal is adapted to the target cable, the target cable is able to withstand the first output signal. The processing module can use the first output signal as an input signal of a target cable, so that the target cable can be effectively utilized for data transmission.
The electronic equipment can transmit corresponding signals to the target cable based on the specific conditions of the target cable connected to the electronic equipment (including morphological parameters, physical characteristic parameters and the like of the target cable), and enables the target cable to normally transmit the signals, so that data transmission failure caused by improper matching of the signals and the cable is avoided, for example, the black screen phenomenon of a display is avoided, or a user expends a great deal of energy and cannot find out the specific reason of the data transmission failure, and the user benefit is ensured.
In one embodiment of the present application, the processing module is further configured to: based on the parameter of the target cable, selecting a first signal strength corresponding to the parameter of the target cable within a preset protocol range, so as to determine the first output signal according to the first signal strength.
The preset protocol range may have a corresponding relationship with a parameter of the cable, and is a protocol range preset according to the parameter of the cable, for example, when the parameter of the target cable is a first value, a first preset protocol range (which may be a range of signal strength) corresponds to the preset protocol range, and when the parameter of the target cable is a second value, a second preset protocol range (which may be a range of signal strength) corresponds to the preset protocol range, for example, when the length of the target cable is 1 meter, the first preset protocol range corresponds to the preset protocol range; and if the length of the target cable is 10 meters, a second preset protocol range corresponds to the target cable. The processing module may select the first signal strength within the above range. The method comprises the steps of selecting from a first preset protocol range when the parameter of the target cable is a first numerical value, and selecting from a second preset protocol range when the parameter of the target cable is a second numerical value. In one embodiment, the processing module may select a maximum value of the signal strength from a preset protocol range as the first signal strength, and use a signal corresponding to the first signal strength as the first output signal, so that the signal quality can be improved under the condition of meeting a preset data transmission protocol.
In one embodiment of the present application, the processing module is further configured to:
transmitting a test signal to a first interface of the target cable, and acquiring feedback information of the target cable for the test signal;
and calculating the parameters of the target cable according to the feedback information.
Specifically, the target cable has a first interface and one or more other interfaces, the first interface is an interface through which the target cable is connected to the electronic device, the processing module may transmit a test signal to the first interface, the test signal is used to test parameters of the target cable, and the test signal may be adjusted according to different parameters that need to be obtained. After transmitting the test signal to the first interface, the target cable reacts to the test signal. In one embodiment, the processing module transmits the test signal in the target cable, and returns the test signal to the first interface after reaching other interfaces, so as to form feedback information, and the processing module calculates the parameter of the target cable according to the feedback information, such as calculating the length of the target cable according to the feedback time; in another embodiment, a response module is disposed on the target cable (for example, the response module may be disposed at another interface), the response module prestores a plurality of kinds of prestored information related to the target cable, and after the response module receives the test signal sent by the processing module, the response module determines feedback information based on the test signal and the prestored information, and sends the feedback information to the processing module, so that the processing module calculates a parameter of the target cable according to the feedback information, for example, calculates the length of the target cable according to the feedback time. In addition, the response module can also directly store various parameters of the target cable, and after the test signal is received, the parameters corresponding to the test signal can be sent to the processing module based on the test signal.
In an embodiment of the application, when the parameter of the target cable is a length of the target cable, the processing module is specifically configured to:
transmitting the test signal to the first interface, acquiring a feedback signal formed based on the test signal, and recording corresponding feedback time, wherein the feedback signal is a signal formed after the test signal reaches a second interface of the target cable and returns to the first interface from the second interface;
and calculating the length of the target cable based on the feedback time.
In one embodiment of the present application, the parameters of the target cable further include attenuation parameters of the target cable, and the processing module is further configured to:
transmitting the test signal to the first interface, and acquiring a feedback signal formed based on the test signal;
and comparing the test signal with the feedback signal, and acquiring the attenuation parameter of the target cable according to the comparison result.
In one embodiment of the present application, the electronic device further includes a detection module configured to: and detecting the access state of the target cable based on a preset time interval so as to enable a processing module to adjust the input of the target cable according to the access state.
In one embodiment of the present application, the target cable comprises a cable having a high definition multimedia interface.
The above embodiments are only exemplary embodiments of the present application, and are not intended to limit the present application, and the protection scope of the present application is defined by the claims. Various modifications and equivalents may be made by those skilled in the art within the spirit and scope of the present application and such modifications and equivalents should also be considered to be within the scope of the present application.