Physical layer link state detection method and device and electronic equipment
By detecting the link state of the Ethernet physical layer based on the sampling time point array when the automotive operating system switches from the sleep state to the wake-up state, the problem of low Ethernet response speed is solved and data transmission efficiency is improved.
Patent Information
- Application Number
- CN202510060004.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-05-16
AI Technical Summary
During the process of the automotive operating system switching from sleep to wake-up, Ethernet's response speed is low, resulting in data transmission delay.
By detecting the link state of the Ethernet physical layer based on the sampling time point array during the process of switching from the sleep state to the wake state, shortening the time interval for reading the link state, and data transmission is performed when the link active state is detected.
It improves the response speed of Ethernet, shortens the time interval for the operating system to read the physical layer link state, and improves the efficiency of data transmission.
Smart Images

Figure CN120017553A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and more specifically, to a physical layer link status detection method, device and electronic device. Background Art
[0002] With the development of intelligent vehicles, the amount of data exchanged between in-vehicle components has increased exponentially. Ethernet has great advantages over CAN bus in terms of bandwidth and latency, so it is widely used in in-vehicle networks. However, in related technologies, Ethernet still has the problem of low response speed during the process of the vehicle's corresponding operating system going from sleep to wake-up. Summary of the invention
[0003] In view of this, the embodiments of the present application propose a physical layer link status detection method, device and electronic device to improve the above-mentioned problem.
[0004] In a first aspect, an embodiment of the present application provides a physical layer link status detection method, the method comprising: in a process in which an operating system switches from a sleep state to a wake-up state, detecting the link status of the physical layer corresponding to the Ethernet of the operating system based on a sampling time point array, wherein the sampling time point array is determined according to a first time range and a second time range, the first time range being a time range in which a corresponding physical layer link is successfully established in a process in which a first device corresponding to the operating system switches from a sleep state to a wake-up state, and the second time range being a time range in which a corresponding physical layer link is successfully established in a process in which a second device corresponding to the operating system switches from a sleep state to a wake-up state; if it is detected based on the sampling time point array that the link status is in a link active state, data transmission is performed based on the Ethernet.
[0005] In the second aspect, an embodiment of the present application provides a physical layer link status detection device, the device comprising: a link status detection module and a data transmission module. The link status detection module is used to detect the link status of the physical layer corresponding to the Ethernet of the operating system based on the sampling time point array during the process of the operating system switching from the sleep state to the wake-up state, wherein the sampling time point array is determined according to the first time range and the second time range, the first time range is the time range in which the corresponding physical layer link is successfully established during the process of the first device corresponding to the operating system switching from the sleep state to the wake-up state, and the second time range is the time range in which the corresponding physical layer link is successfully established during the process of the second device corresponding to the operating system switching from the sleep state to the wake-up state; the data transmission module is used to perform data transmission based on the Ethernet if it is detected that the link status is in the link active state based on the sampling time point array.
[0006] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor executes the above method.
[0007] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored, and the program code can be called by a processor to execute the above method.
[0008] In the scheme of the present application, the electronic device reads the link status of the physical layer corresponding to the Ethernet of the operating system based on the sampling time points included in the determined sampling time point array during the process of the operating system switching from the sleep state to the wake-up state, thereby shortening the time interval for the operating system to read the link status of the physical layer; in addition, when the electronic device detects that the link status of the physical layer is in the link active state based on the sampling time point array, it can transmit data based on Ethernet, thereby shortening the time interval for the operating system to read the link status of the physical layer and improving the response speed of Ethernet. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0010] Figure 1 A schematic diagram of a flow chart of a physical layer link status detection method provided by an embodiment of the present application is shown;
[0011] Figure 2 A schematic diagram of a flow chart of a physical layer link status detection method provided by an embodiment of the present application is shown;
[0012] Figure 3 A schematic diagram of a flow chart of a physical layer link status detection method provided by an embodiment of the present application is shown;
[0013] Figure 4 A module block diagram of a physical layer link status detection device provided by an embodiment of the present application is shown;
[0014] Figure 5A block diagram of an electronic device for executing a physical layer link status detection method according to an embodiment of the present application is shown;
[0015] Figure 6 A storage unit for storing or carrying program codes for implementing a physical layer link status detection method according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0016] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0017] At present, Ethernet is adopted in the in-vehicle network as a data communication method. Among them, the prerequisite for Ethernet to communicate normally is that the physical layer corresponding to Ethernet is already in the link connection state, that is, the link activity state. In the related art, there are two ways for the operating system of the electronic device to obtain the link state of the corresponding physical layer: one is that the chip of the physical layer used itself has an interrupt function; the other is that it does not have an interrupt function and reads the link state in the register of the physical layer through the management data input / output (MDIO). Among them, MDIO reads the link state in the register of the physical layer usually by setting a fixed timer to periodically read the link state of the physical layer. However, in the process of the operating system of the electronic device from sleep to wake-up, there is a situation where the link state of the physical layer is read too late by periodically reading the link activity state through a fixed timer, resulting in a low service response speed of Ethernet. Therefore, in the related art, in the process of the operating system from sleep to wake-up, Ethernet has the problem of low response speed.
[0018] In view of the above problems, the inventors have found through long-term research that a physical layer link status detection method, device, and electronic device provided in the embodiments of the present application are proposed. When the operating system switches from a sleep state to a wake-up state, the link status of the physical layer is read based on the sampling time points included in the determined sampling time point array, thereby shortening the time interval for the operating system to read the link status of the physical layer and improving the response speed of the Ethernet. The specific physical layer link status detection method is described in detail in the subsequent embodiments.
[0019] See also Figure 1 , Figure 1The flowchart of the physical layer link status detection method provided by an embodiment of the present application is shown. When the operating system of the physical layer link status detection method switches from the sleep state to the wake-up state, the link status of the physical layer is read based on the sampling time points included in the determined sampling time point array, which shortens the time interval for the operating system to read the link status of the physical layer and improves the response speed of the Ethernet. In a specific embodiment, the physical layer link status detection method can be applied to Figure 4 The physical layer link state detection device 200 and the electronic device 100 equipped with the physical layer link state detection device 200 are shown in FIG. Figure 5 ). The following will take electronic equipment as an example to illustrate the specific process of this embodiment. Of course, it can be understood that the electronic equipment used in this embodiment may include desktop computers, laptops, vehicle terminals, vehicle large screens and other devices, which are not limited here. Figure 1 The process shown in FIG. 1 is described in detail, and the physical layer link status detection method may specifically include the following steps:
[0020] Step S110: During the process of the operating system switching from a sleep state to a wake-up state, the link status of the physical layer corresponding to the Ethernet of the operating system is detected based on a sampling time point array, wherein the sampling time point array is determined according to a first time range and a second time range, the first time range is a time range in which the corresponding physical layer link is successfully established during the process of the first device corresponding to the operating system switching from a sleep state to a wake-up state, and the second time range is a time range in which the corresponding physical layer link is successfully established during the process of the second device corresponding to the operating system switching from a sleep state to a wake-up state.
[0021] In some embodiments, the electronic device includes an operating system (such as a Linux system, a QNX operating system, WindRiver, etc.), and the operating system can perform data transmission based on Ethernet. The electronic device can receive a control instruction input by a user, and the control instruction can be used to instruct the electronic device to switch from a dormant state to a wake-up state. Accordingly, the operating system of the electronic device can switch from a dormant state to a wake-up state in response to the control instruction. The operating system being in a dormant state can refer to the operating system being in a low-energy mode, and the operating system being in a wake-up state can refer to the operating system being in a normal working mode; the operating system switching from a dormant state to a wake-up state can represent the process of the operating system recovering from a low-energy mode to a normal working mode.
[0022] In some embodiments, a sampling time point array may be pre-set in the electronic device, wherein the sampling time point array may include one or more sampling time points, and the one or more sampling time point arrays may be set by the user independently or obtained through third-party experimental data. The sampling time point array may be determined based on a first time range and a second time range; wherein the first time range may be a time range in which the corresponding physical layer link is successfully established during the process of the first device corresponding to the operating system switching from a dormant state to a wake-up state; wherein the second time range may be a time range in which the corresponding physical layer link is successfully established during the process of the second device corresponding to the operating system switching from a dormant state to a wake-up state.
[0023] Wherein, the electronic device may be a vehicle; accordingly, the first device corresponding to the operating system may be one of the electronic devices in the vehicle, and the second device corresponding to the operating system may be another electronic device in the vehicle. Exemplarily, the vehicle may include an electronic control unit (ECU), wherein the ECU may receive data from sensors and then process the data according to preset algorithms and programs to control the engine, gearbox, brake system, safety system, etc. of the vehicle. Wherein, the first device may be understood as the local ECU in the vehicle, and the second device may be understood as the opposite ECU in the vehicle. Accordingly, the first time range may be the time range in which the corresponding physical layer link is successfully established during the process in which the local ECU corresponding to the operating system switches from a dormant state to a wake-up state; the second time range may be the time range in which the corresponding physical layer link is successfully established during the process in which the opposite ECU corresponding to the operating system switches from a dormant state to a wake-up state.
[0024] Optionally, the operating system can obtain the time range of the successful establishment of the corresponding physical layer link during the process of the local ECU corresponding to the operating system switching from a dormant state to a wake-up state detected by the electronic device, and can determine the time range as the first time range; the operating system can also obtain the time range of the successful establishment of the corresponding physical layer link during the process of the opposite ECU corresponding to the operating system switching from a dormant state to a wake-up state detected by the electronic device, and can determine the time range as the second time range. Among them, the electronic device can detect the link state of the physical layer corresponding to the local ECU based on a preset interval duration, and instantly obtain the change of the link state of the physical layer of the Ethernet of the local ECU; the electronic device can also detect the link state of the physical layer corresponding to the opposite ECU based on a preset interval duration, and instantly obtain the change of the link state of the physical layer of the Ethernet of the opposite ECU.
[0025] The preset interval duration can be understood as the time interval between two consecutive readings of the physical layer connection status corresponding to the first device by the electronic device, and can be pre-set in the electronic device. Exemplarily, the preset interval duration can be a preset multiple (e.g., 15, 20, 25, etc.) of the time taken for the electronic device to read the register of the physical layer corresponding to the first device once, so that the electronic device can instantly obtain the change of the physical layer link status corresponding to the first device, while also taking into account the performance of the operating system of the electronic device.
[0026] Among them, the electronic device can periodically detect the duration of the first device successfully establishing the corresponding physical layer link based on the preset interval duration during the process of the first device switching from the sleep state to the wake-up state, and determine the duration as the first duration; and can obtain the first time range based on the first durations detected multiple times. Among them, the first time range can include the time range corresponding to the minimum value of the first durations detected multiple times to the maximum value of the first durations detected multiple times, and can also include the time range corresponding to the minimum value of the first durations detected multiple times to the average value of the first durations detected multiple times, and can also include the time range corresponding to the average value of the first durations detected multiple times to the maximum value of the first durations detected multiple times, which is not limited here.
[0027] Among them, the electronic device can determine the duration of the second device successfully establishing the corresponding physical layer link based on the preset interval periodic detection in the process of the second device switching from the sleep state to the wake-up state as the second duration, and can obtain the second time range according to the second durations detected multiple times. Among them, the second time range can include the time range corresponding to the minimum value of the second durations detected multiple times to the maximum value of the second durations detected multiple times, and can also include the time range corresponding to the minimum value of the second durations detected multiple times to the average value of the second durations detected multiple times, and can also include the time range corresponding to the average value of the second durations detected multiple times to the maximum value of the second durations detected multiple times, which is not limited here.
[0028] In some embodiments, after the electronic device obtains the first time range and the second time range, it can obtain a sampling time point array according to the preset interval duration, the first time range, and the second time range. Optionally, the electronic device can obtain the union of the first time range and the second time range, and can round down the quotient of the time range corresponding to the union divided by the preset interval duration to obtain the number of samplings, and can divide the duration corresponding to the union by the number of samplings to obtain the interval interpolation. Accordingly, the electronic device can obtain the sampling time point array based on the minimum value in the time range corresponding to the union, the number of samplings, the interval interpolation, the maximum value in the time range corresponding to the union, the minimum value of the first time range, the minimum value of the second time range, the maximum value of the first time range, and the maximum value of the second time range.
[0029] Optionally, the electronic device can determine the minimum value in the time range corresponding to the union as the first number in the target arithmetic sequence, and can use the interval interpolation as the difference between two adjacent numbers in the target arithmetic sequence, and can determine the number of sampling times as the number of elements included in the target arithmetic sequence to obtain the target arithmetic sequence. Correspondingly, the electronic device can also add the minimum value of the first time range, the minimum value of the second time range, the maximum value of the first time range, and the maximum value of the second time range to the target arithmetic sequence to obtain a sampling time point array. Correspondingly, the electronic device can read the link status of the physical layer corresponding to the Ethernet of the operating system at the sampling time point included in the sampling time point array, thereby detecting the link status of the physical layer based on the changing time interval, shortening the time when the link status of the physical layer is in the link active state, and improving the speed of Ethernet service response.
[0030] Step S120: If it is detected based on the sampling time point array that the link state is in a link active state, data transmission is performed based on the Ethernet.
[0031] In some implementations, the electronic device detects the link status of the physical layer corresponding to the Ethernet of the operating system based on the sampling time point array. If the link status is detected to be in an active link state based on the sampling time point array, data transmission can be performed based on Ethernet.
[0032] Exemplarily, in the process of switching the Linux operating system of the electronic device from the sleep state to the wake-up state, if the link state of the physical layer corresponding to the Ethernet of the Linux operating system is detected to be in the link active state based on the sampling time point array, data transmission can be performed based on Ethernet. It should be noted that the network module of the Linux operating system is divided into an upper protocol stack and a bottom driver. When the application layer sends and receives data, the protocol stack needs to be in a data-transmitting state, and the transmittable state of the protocol stack is updated after the bottom driver of the control hardware reads the bottom hardware link state. The electronic device detects the link state of the physical layer corresponding to the Ethernet of the operating system based on the sampling time point array, which can be understood as the electronic device reading the bottom hardware link state based on the time point included in the sampling time point array by the bottom driver of the control hardware. Exemplarily, the electronic device reads the link state of the physical layer through MDIO at the sampling time point in the sampling time point array. The link state being in the link active state can be understood as the protocol stack being in the data-transmitting state. Accordingly, the electronic device can perform data transmission based on Ethernet when the protocol stack is in the data-transmitting state, thereby improving the performance of the electronic device.
[0033] A physical layer link status detection method provided by an embodiment of the present application detects the link status of the physical layer corresponding to the Ethernet of the operating system based on a sampling time point array during the process of the operating system switching from a sleep state to a wake-up state, wherein the sampling time point array is determined according to a first time range and a second time range, the first time range is a time range in which the corresponding physical layer link is successfully established during the process of the first device corresponding to the operating system switching from a sleep state to a wake-up state, and the second time range is a time range in which the corresponding physical layer link is successfully established during the process of the second device corresponding to the operating system switching from a sleep state to a wake-up state; if it is detected based on the sampling time point array that the link status is in a link active state, data transmission is performed based on Ethernet, and then when the operating system switches from a sleep state to a wake-up state, the link status of the physical layer is read based on the sampling time points included in the determined sampling time point array, thereby shortening the time interval for the operating system to read the link status of the physical layer and improving the response speed of the Ethernet.
[0034] See also Figure 2 , Figure 2 The flowchart of the physical layer link status detection method provided by an embodiment of the present application is shown. The method is applied to the above electronic device. Figure 2 The process shown in FIG. 1 is described in detail, and the physical layer link status detection method may specifically include the following steps:
[0035] Step S210: Determine the starting time point of the first time range as the first time point and the ending time point of the first time range as the second time point, and determine the starting time point of the second time range as the third time point and the ending time point of the second time range as the fourth time point.
[0036] In some embodiments, after the electronic device obtains a first time range in which a corresponding physical layer link is successfully established during a process in which a first device corresponding to the detected operating system switches from a sleep state to a wake-up state, and obtains a second time range in which a corresponding physical layer link is successfully established during a process in which a second device corresponding to the detected operating system switches from a sleep state to a wake-up state, the electronic device can determine the starting time point of the first time range as the first time point and the end time point of the first time range as the second time point, and can determine the starting time point of the second time range as the third time point and the end time point of the second time range as the fourth time point.
[0037] Exemplarily, if the first time range during which the first device corresponding to the detected operating system switches from a sleep state to a wake-up state and successfully establishes a corresponding physical layer link is TA1 to TA2; based on this, the electronic device can determine TA1 as the first time point and TA2 as the second time point. If the first time range during which the first device corresponding to the detected operating system switches from a sleep state to a wake-up state and successfully establishes a corresponding physical layer link is TB1 to TB2; accordingly, the electronic device can determine TB1 as the third time point and TB2 as the fourth time point.
[0038] Step S220: Obtain a first sampling point set according to the first time point, the second time point and a preset interval duration.
[0039] In some embodiments, after the electronic device determines the first time point and the second time point according to the first time range, the first sampling point set can be obtained according to the first time point, the second time point and the preset interval duration. The preset interval duration can be understood as the time interval between two consecutive times when the electronic device reads the connection status of the physical layer corresponding to the first device.
[0040] As an implementable manner, in the process of the electronic device acquiring the first sampling point set, the difference between the second time point and the first time point can be determined as the first difference, and the quotient of the first difference and the preset interval time can be determined as the first quotient, and the first quotient can be rounded down to obtain a first integer. If the electronic device determines that the first integer is greater than zero, the first sampling point set can be formed according to positive integers from 1 to the first integer; if the electronic device determines that the first integer is less than or equal to zero, it can be determined that the first sampling point set is an empty set.
[0041] Exemplarily, if the electronic device determines that the first time point is TA1, the second time point is TA2, and the preset interval duration is TAx; accordingly, the first difference (TA2-TA1), the first quotient ((TA2-TA1) / TAx), and the first integer floor ((TA2-TA1) / TAx) = CA2n can be obtained. If the electronic device determines that CA2n>0, it can generate a positive integer sequence combination GA2 of {1, ..., CA2n}, and determine GA2 as the first sampling point set; if the electronic device determines that CA2n<1, it can generate an empty set GA2, and use GA2 as the first sampling point set.
[0042] Step S230: Obtain a second sampling point set according to the first time point, the third time point and the preset interval duration.
[0043] In some embodiments, after the electronic device determines the first time point and the second time point according to the first time range, and determines the third time point and the fourth time point according to the second time range, the second sampling point set can be obtained according to the first time point, the third time point and the preset interval duration. The preset interval duration can be understood as the time interval between two consecutive readings of the connection status of the physical layer corresponding to the first device by the electronic device, and can also be understood as the time interval between two consecutive readings of the connection status of the physical layer corresponding to the second device by the electronic device.
[0044] As an implementable manner, in the process of the electronic device acquiring the second sampling point set, the difference between the third time point and the first time point can be determined as the second difference, and the quotient of the second difference and the preset interval time can be determined as the second quotient, and the second quotient can be rounded down to obtain a second integer. If the electronic device determines that the second integer is greater than zero, the second sampling point set can be formed according to positive integers from 1 to the second integer; if the electronic device determines that the second integer is less than or equal to zero, the second sampling point set can be determined to be an empty set.
[0045] Exemplarily, if the electronic device determines that the first time point is TA1, the third time point is TB1, and the preset interval duration is TAx; accordingly, the second difference (TA2-TA1), the second quotient ((TB1-TA1) / TAx), and the second integer floor((TB1-TA1) / TAx)=CB1n can be obtained. If the electronic device determines that CB1n>0, it can generate a positive integer sequence combination GB1 of {1, ..., CB1n}, and determine GB1 as the second sampling point set; if the electronic device determines that CB1n<1, it can generate an empty set GB1, and use GB1 as the second sampling point set.
[0046] Step S240: Obtain a third sampling point set according to the first time point, the fourth time point and the preset interval duration.
[0047] In some embodiments, after the electronic device determines the first time point and the second time point according to the first time range, and determines the third time point and the fourth time point according to the second time range, the third sampling point set can be obtained according to the first time point, the fourth time point and the preset interval duration. The preset interval duration can be understood as the time interval between two consecutive readings of the connection status of the physical layer corresponding to the first device by the electronic device, and can also be understood as the time interval between two consecutive readings of the connection status of the physical layer corresponding to the second device by the electronic device.
[0048] As an implementable manner, in the process of the electronic device acquiring the third sampling point set, the difference between the fourth time point and the first time point can be determined as the third difference, and the quotient of the third difference and the preset interval time can be determined as the third quotient, and the third quotient can be rounded down to obtain a third integer. If the electronic device determines that the third integer is greater than zero, the second sampling point set can be formed according to positive integers from 1 to the second integer; if the electronic device determines that the second integer is less than or equal to zero, the second sampling point set can be determined to be an empty set.
[0049] Exemplarily, if the electronic device determines that the first time point is TA1, the fourth time point is TB2, and the preset interval duration is TAx. Accordingly, the third difference (TB2-TA1), the third quotient ((TB2-TA1) / TAx), and the third integer floor((TB2-TA1) / TAx)=CB2n can be obtained. Among them, if the electronic device determines that CB2n>0, it can generate a positive integer sequence combination GB2 of {1, ..., CB2n}, and determine GB2 as the third sampling point set; if the electronic device determines that CB2n<1, it can generate an empty set GB2, and use GB2 as the third sampling point set.
[0050] Step S250: Determine a union of the first sampling point set, the second sampling point set and the third sampling point set as a fourth sampling point set.
[0051] In some implementations, after obtaining the first sampling point set, the second sampling point set, and the third sampling point set, the electronic device may determine the union of the first sampling point set, the second sampling point set, and the third sampling point set as the fourth sampling point set.
[0052] Exemplarily, after obtaining the first sampling point set GA2, the second sampling point set GB1 and the third sampling point set GB2, the electronic device may determine the union (GA2∪GB1∪GB2) of the first sampling point set, the second sampling point set and the third sampling point set as the fourth sampling point set GAB.
[0053] Step S260: Obtain the sampling time point array according to the first sampling point set, the second sampling point set, the third sampling point set and the fourth sampling point set.
[0054] In some implementations, after the electronic device obtains the first sampling point set, the second sampling point set, the third sampling point set, and the fourth sampling point set, it can obtain a sampling time point array according to the first sampling point set, the second sampling point set, the third sampling point set, and the fourth sampling point set.
[0055] As an implementable manner, if the electronic device determines that the fourth sampling point set is an empty set, it may determine the maximum value of the second time point and the fourth time point as the sampling time point array.
[0056] Exemplarily, the electronic device determines that the first time point is TA1, the second time point is TA2, the third time point is TB1, the fourth time point is TB2, and the preset interval duration is TAx. Among them, if the electronic device determines that the fourth sampling point set is an empty set, it may be determined that (max(TA2, TB2) - min(TA1, TB1) < TAx). Correspondingly, the fact that the fourth sampling point set is an empty set can be understood as that when reading the connection state of the physical layer corresponding to the first device based on the preset interval duration, during the process of the first device switching from the sleep state to the wake state, a corresponding physical layer link cannot be successfully established within the first time range, and during the process of the second device switching from the sleep state to the wake state, a corresponding physical layer link cannot be successfully established within the second time range. Correspondingly, to reduce the power consumption of the electronic device for detecting the link state of the physical layer corresponding to Ethernet, the maximum value of the second time point and the fourth time point may be determined as the sampling time point array. That is, if the electronic device determines that the fourth sampling point set GAB is an empty set, it may determine that the sampling time point array GTICK = {max(TA2, TB2)}.
[0057] As another implementable manner, if the electronic device determines that the fourth sampling point set is a non-empty set, it may obtain the sampling time point array according to the first sampling point set, the second sampling point set, and the third sampling point set.
[0058] Among them, during the process that the electronic device obtains the sampling time point array according to the first sampling point set, the second sampling point set, and the third sampling point set, it may determine the first array according to the first sampling point set, and may determine the second array according to the first relationship between the third sampling point set and the first sampling point set and the second relationship between the second sampling point set and the first sampling point set, and may obtain the sampling time point array according to the first array and the second array.
[0059] Among them, the first array can be understood as an array composed of sampling time points corresponding to the first time range, and the second array can be understood as an array composed of sampling time points corresponding to the second time range. Among them, the electronic device may determine the union of the first array and the second array as the sampling time point array.
[0060] As an implementable manner, if the electronic device determines that the first sampling point set is an empty set, the second time point can be determined as the first array. Exemplarily, if the electronic device determines that the first time point is TA1, the second time point is TA2, the third time point is TB1, the fourth time point is TB2, and the preset interval duration is TAx. The fact that the first sampling point set is an empty set can be understood as TA2 - TA1 < TAx, and TB2 > TA2, and TB2 - TA1 > TAx; correspondingly, it can be understood that during the process of the first device switching from the sleep state to the wake state, the corresponding physical layer link cannot be successfully established within the first time range, and during the process of the second device switching from the sleep state to the wake state, the corresponding physical layer link can be successfully established within the time range from the start time point of the first time range to the end time point of the second time range. Correspondingly, to improve the accuracy of the electronic device in detecting the link state of the physical layer corresponding to Ethernet, the first array composed of the sampling time points corresponding to the first time range can be determined as the second time point. That is, if the electronic device determines that the fourth sampling point set GAB is a non-empty set and determines that the first sampling point set GA2 is an empty set, then the first array GA2TICK = {TA2} can be determined.
[0061] As another implementable manner, if the electronic device determines that the first sampling point set is a non-empty set, the first array can be determined according to the number of elements included in the first sampling point set, the first time point, and the second time point. The fact that the first sampling point set is a non-empty set can be understood as the difference between the second time point (TA2) and the first time point (TA1) being greater than the preset interval duration (TAx). Based on this, the electronic device can obtain the average value of the first time range TA1~TA2, and can obtain the first array according to this average value, improving the effectiveness of the electronic device in detecting the link state of the physical layer corresponding to Ethernet based on the sampling time point array.
[0062] Among them, the electronic device can determine the difference between the second time point and the first time point as the fourth difference, and can determine the quotient of the fourth difference and the number of elements included in the first sampling point set as the first interpolation; and can multiply the elements included in the first sampling point set by the first interpolation respectively to obtain the third array; and can add the elements included in the third array to the first time point respectively to obtain the fourth array, and can add the second time point to the fourth array to obtain the first array. The first interpolation can be understood as the interpolation average value between the first time range TA1~TA2.
[0063] Exemplarily, the electronic device determines that the first time point is TA1, the second time point is TA2, the first sampling point set is GA2={1, ..., CA2n}, and the number of elements included in the first sampling point set is GA2num. Accordingly, if the electronic device determines that the fourth sampling point set GAB is a non-empty set and determines that the first sampling point set GA2 is a non-empty set, the first array GA2TICK can be determined according to the number of elements GA2num included in the first sampling point set, the first time point TA1, and the second time point TA2. Among them, the electronic device can determine the difference between the second time point and the first time point as a fourth difference (TA2-TA1), and can determine the quotient of the fourth difference and the number of elements included in the first sampling point set as a first interpolation (TA2A1x=(TA2-TA1) / GA2num), and can multiply the elements included in the first sampling point set by the first interpolation to obtain a third array, and can add the elements included in the third array to the first time point to obtain a fourth array {ta1,...,tan}, and can add the second time point to the fourth array to obtain the first array GA2TICK={ta1,...,tan,TA2}.
[0064] In some implementations, when the electronic device determines the second array based on the first relationship between the third sampling point set and the first sampling point set and the second relationship between the second sampling point set and the first sampling point set, if the third sampling point set is determined to be included in the first sampling point set based on the first relationship between the third sampling point set and the first sampling point set, the second array may be determined to be an empty set.
[0065] Among them, the fourth sampling point set GAB is a non-empty set, and the third sampling point set GB2 is included in the first sampling point set GA2. It can be understood that the fourth time point TB2 is less than the second time point TA2. Accordingly, the second array GB2TICK can be determined as an empty set, that is, the number of sampling time points included in the second array is determined to be 0, thereby improving the accuracy of the sampling time points in the sampling time point array.
[0066] In some implementations, when the electronic device determines the second array based on the first relationship between the third sampling point set and the first sampling point set and the second relationship between the second sampling point set and the first sampling point set, if it is determined based on the first relationship that the third sampling point set is not included in the first sampling point set, the second array may be determined based on the second relationship.
[0067] As an implementable manner, in the process of the electronic device determining the second array according to the second relationship, if it is determined according to the second relationship that the second sampling point set is included in the first sampling point set, the second array can be determined according to the number of elements in the third sampling point set that do not belong to the first sampling point set, the first time point, the second time point, and the fourth time point.
[0068] Among them, the fourth sampling point set is a non-empty set, and the third sampling point set is not included in the first sampling point set, and the second sampling point set is included in the first sampling point set. It can be understood that the third time point is within the first time range, the second time point is within the second time range, and the fourth time point is greater than the second time point.
[0069] Optionally, in the process of determining the second array according to the number of elements in the third sampling point set that do not belong to the first sampling point set, the first time point, the second time point, and the fourth time point, the electronic device can obtain a fifth array according to the elements in the third sampling point set that do not belong to the first sampling point set, and can determine the difference between the fourth time point and the second time point as the fifth difference, and can determine the quotient of the fifth difference and the number of elements included in the fifth array as the second interpolation, and can multiply the elements included in the fifth array by the second interpolation to obtain a sixth array, and can add the elements included in the sixth array to the first time point to obtain a seventh array, and can add the fourth time point to the seventh array to obtain the second array. The second interpolation can be understood as the interpolation mean between TA2 and TB2.
[0070] Exemplarily, if the electronic device determines that the fourth sampling point set GAB is a non-empty set, and the third sampling point set GB2 is not included in the first sampling point set GA2, and the second sampling point set GB1 is included in the first sampling point set GA2, then the elements in the third sampling point set that do not belong to the first sampling point set can be obtained to obtain a fifth array (GB2-GA2=GA2B2). Accordingly, the electronic device can determine the difference between the fourth time point TB2 and the second time point TA2 as the fifth difference (TB2-TA2); and can determine the quotient of the fifth difference and the number of elements included in the fifth array (GA2B2num) as the second interpolation value (TA2B2x=(TB2-TA2) / GA2B2num). Correspondingly, the electronic device can multiply the elements included in the fifth array by the second interpolation respectively to obtain the sixth array, and can add the elements included in the sixth array by the first time point respectively to obtain the seventh array {tb1, ..., tbn}, and can add the fourth time point TB2 to the seventh array to obtain the second array GB2TICK = {tb1, ..., tbn, TB2}.
[0071] As another implementable manner, in the process of the electronic device determining the second array according to the second relationship, if it is determined according to the second relationship that the second sampling point set is not included in the first sampling point set, the second array may be determined according to the number of elements in the third sampling point set that do not belong to the second sampling point set, the first time point, the third time point, and the fourth time point.
[0072] Among them, the fourth sampling point set is a non-empty set, the third sampling point set is not included in the first sampling point set, and the second sampling point set is not included in the first sampling point set, which can be understood as the third time point is greater than the second time point.
[0073] Optionally, in the process of determining the second array according to the number of elements in the third sampling point set that do not belong to the second sampling point set, the first time point, the third time point, and the fourth time point, the electronic device may obtain an eighth array according to the elements in the third sampling point set that do not belong to the second sampling point set. If the electronic device determines that the eighth array is an empty array, the fourth time point may be determined as the second array.
[0074] Exemplarily, if the electronic device determines that the fourth sampling point set GAB is a non-empty set, and the third sampling point set GB2 is not included in the first sampling point set GA2, and the second sampling point set GB1 is not included in the first sampling point set GA2, then the eighth array (GB1B2=GB2-GB1) can be obtained according to the elements in the third sampling point set GB2 that do not belong to the second sampling point set GB1. If the electronic device determines that the eighth array GB1B2 is an empty array, the fourth time point TB2 can be determined as the second array GB2TICK, that is, GB2TICK={TB2}.
[0075] Optionally, if the electronic device determines that the eighth array is a non-empty array, the difference between the fourth time point and the third time point may be determined as a sixth difference, and the quotient of the sixth difference and the number of elements included in the eighth array may be determined as a third interpolation, and the elements included in the eighth array may be multiplied by the third interpolation to obtain a ninth array, and the elements included in the ninth array may be added to the first time point to obtain a tenth array, and the fourth time point may be added to the tenth array to obtain a second array. The third interpolation may be understood as the interpolation mean between the second time range TB1 to TB2.
[0076] Exemplarily, if the electronic device determines that the fourth sampling point set GAB is a non-empty set, and the third sampling point set GB2 is not included in the first sampling point set GA2, and the second sampling point set GB1 is not included in the first sampling point set GA2, then the eighth array (GB1B2=GB2-GB1) can be obtained according to the elements in the third sampling point set GB2 that do not belong to the second sampling point set GB1. Among them, if the electronic device determines that the eighth array GB1B2 is a non-empty array, the number of elements included in the eighth array GB1B2num can be obtained; wherein, the electronic device can determine the difference between the fourth time point TB2 and the third time point TB1 as the sixth difference (TB2-TB1), and can determine the quotient of the sixth difference and the number of elements included in the eighth array as the third interpolation (TB1B2x=(TB2-TB1) / GB1B2num) to obtain the ninth array; and can add the elements included in the ninth array to the first time point respectively to obtain the tenth array {tb1…tbn}, and can add the fourth time point to the tenth array to obtain the second array GB2TICK={tb1…tbn, TB2}.
[0077] In this embodiment, after obtaining the first array GA2TICK and the second array GB2TICK, the electronic device may determine the union of GA2TICK and GB2TICK as the sampling time point array GTICK.
[0078] Step S270: During the process of the operating system switching from a sleep state to a wake-up state, the link status of the physical layer corresponding to the Ethernet of the operating system is detected based on a sampling time point array, wherein the sampling time point array is determined according to a first time range and a second time range, the first time range is a time range in which the corresponding physical layer link is successfully established during the process of the first device corresponding to the operating system switching from a sleep state to a wake-up state, and the second time range is a time range in which the corresponding physical layer link is successfully established during the process of the second device corresponding to the operating system switching from a sleep state to a wake-up state.
[0079] Step S280: If it is detected based on the sampling time point array that the link state is in a link active state, data transmission is performed based on the Ethernet.
[0080] For the detailed description of step S270 to step S280, please refer to the above description of step S110 to step S120, which will not be repeated here.
[0081] The physical layer link status detection method provided in an embodiment of the present application is compared with Figure 1The physical layer link status detection method shown in the figure, this embodiment can also detect the link status of the physical layer corresponding to the Ethernet of the operating system based on the sampling time point array during the process of the operating system switching from the sleep state to the wake-up state, wherein the sampling time point array is determined according to the first time range and the second time range, the first time range is the time range in which the corresponding physical layer link is successfully established during the process of the first device corresponding to the operating system switching from the sleep state to the wake-up state, and the second time range is the time range in which the corresponding physical layer link is successfully established during the process of the second device corresponding to the operating system switching from the sleep state to the wake-up state, and before the time range, the starting time point of the first time range is determined as the first time point and the ending time point of the first time range is determined as the second time point, and the starting time point of the second time range is determined as the third time point and the ending time point of the second time range is determined as the fourth time point; according to the first time point, the second time point and the preset interval duration, a first sampling point set is obtained; based on According to the first time point, the third time point and the preset interval length, a second sampling point set is obtained; according to the first time point, the fourth time point and the preset interval length, a third sampling point set is obtained; the union of the first sampling point set, the second sampling point set and the third sampling point set is determined as the fourth sampling point set; according to the first sampling point set, the second sampling point set, the third sampling point set and the fourth sampling point set, an array of sampling time points is obtained, and then the time interval for the operating system to read the link status of the physical layer corresponding to the Ethernet is determined and adjusted through the time interval for the physical layer to successfully establish a link during the process of the first device switching from the sleep state to the wake-up state detected in the early stage and the time interval for the physical layer to successfully establish a link during the process of the second device switching from the sleep state to the wake-up state, so as to shorten the time for the physical layer to read the link successfully established in the process of the operating system switching from the sleep state to the wake-up state, improve the response rate of the Ethernet, and improve the effectiveness of the time interval for reading the link status of the physical layer corresponding to the Ethernet.
[0082] See also Figure 3 , Figure 3 The flowchart of the physical layer link status detection method provided by an embodiment of the present application is shown. The method is applied to the above electronic device. Figure 3 The process shown in FIG. 1 is described in detail, and the physical layer link status detection method may specifically include the following steps:
[0083] Step S310: During the process of the operating system switching from a sleep state to a wake-up state, the link status of the physical layer corresponding to the Ethernet of the operating system is detected based on a sampling time point array, wherein the sampling time point array is determined according to a first time range and a second time range, the first time range is a time range in which the corresponding physical layer link is successfully established during the process of the first device corresponding to the operating system switching from a sleep state to a wake-up state, and the second time range is a time range in which the corresponding physical layer link is successfully established during the process of the second device corresponding to the operating system switching from a sleep state to a wake-up state.
[0084] Step S320: If it is detected based on the sampling time point array that the link state is in a link active state, data transmission is performed based on the Ethernet.
[0085] For the detailed description of step S310 to step S320, please refer to the above description of step S110 to step S120, which will not be repeated here.
[0086] Step S330: If it is not detected that the link state of the physical layer is in the link active state based on the sampling time point array, the link state of the physical layer is detected based on a preset period.
[0087] In some embodiments, when the operating system of an electronic device switches from a sleep state to a wake-up state, and in the process of detecting the link status of the physical layer corresponding to the Ethernet based on a sampling time point array, if the link status of the physical layer is still not detected to be in a link active state at the maximum sampling time point in the sampling time point array, it can switch to detecting the link status of the physical layer in a preset period to save power consumption of the link status detection of the physical layer of the electronic device.
[0088] The preset period may be pre-set in the electronic device, wherein the preset period may be understood as a period for the original MDIO to read the link status of the physical layer corresponding to the Ethernet.
[0089] The physical layer link status detection method provided in an embodiment of the present application is compared with Figure 1The physical layer link status detection method shown in the figure can also detect the link status of the physical layer based on a preset period if the link status of the physical layer is not detected to be in the link active state based on the sampling time point array, thereby reading the physical layer link status at the sampling time points included in the sampling time point array, shortening the time interval for the operating system to read the link status of the physical layer, and improving the response speed of Ethernet. At the same time, when the physical layer is not detected to be in the link active state based on the sampling time point array, the link status of the physical layer is detected based on the original period of reading the link status of the physical layer corresponding to Ethernet, thereby changing the period of reading the link status of the physical layer to save power consumption of electronic equipment.
[0090] See also Figure 4 , Figure 4 The module block diagram of the physical layer link status detection device provided by an embodiment of the present application is shown. The physical layer link status detection device 200 is applied to the above electronic device. Figure 4 The process shown in FIG. 1 is described in detail. The physical layer link status detection device 200 includes: a link status detection module 210 and a data transmission module 220, wherein:
[0091] The link status detection module 210 is used to detect the link status of the physical layer corresponding to the Ethernet of the operating system based on a sampling time point array during the process of the operating system switching from a sleep state to a wake-up state, wherein the sampling time point array is determined according to a first time range and a second time range, the first time range is a time range in which the corresponding physical layer link is successfully established during the process of the first device corresponding to the operating system switching from a sleep state to a wake-up state, and the second time range is a time range in which the corresponding physical layer link is successfully established during the process of the second device corresponding to the operating system switching from a sleep state to a wake-up state.
[0092] The data transmission module 220 is configured to perform data transmission based on the Ethernet if it is detected based on the sampling time point array that the link state is in a link active state.
[0093] Further, in the process of switching the operating system from the sleep state to the wake-up state, before detecting the link state of the physical layer corresponding to the Ethernet of the operating system based on the sampling time point array, the physical layer link state detection device 200 may include: a time point determination unit, a first sampling point set acquisition unit, a second sampling point set acquisition unit, a third sampling point set acquisition unit, a fourth sampling point set acquisition unit and a sampling time point array acquisition unit, wherein:
[0094] A time point determination unit is used to determine the starting time point of the first time range as the first time point and the ending time point of the first time range as the second time point, and to determine the starting time point of the second time range as the third time point and the ending time point of the second time range as the fourth time point.
[0095] The first sampling point set obtaining unit is configured to obtain a first sampling point set according to the first time point, the second time point and a preset interval duration.
[0096] The second sampling point set obtaining unit is configured to obtain a second sampling point set according to the first time point, the third time point and the preset interval duration.
[0097] The third sampling point set obtaining unit is configured to obtain a third sampling point set according to the first time point, the fourth time point and the preset interval duration.
[0098] The fourth sampling point set obtaining unit is configured to determine a union of the first sampling point set, the second sampling point set and the third sampling point set as a fourth sampling point set.
[0099] The sampling time point array obtaining unit is used to obtain the sampling time point array according to the first sampling point set, the second sampling point set, the third sampling point set and the fourth sampling point set.
[0100] Further, the sampling time point array obtaining unit may include: a sampling time point array obtaining first unit and a sampling time point array obtaining second unit, wherein:
[0101] The sampling time point array obtains a first unit, which is used to determine the maximum value between the second time point and the fourth time point as the sampling time point array if the fourth sampling point set is an empty set.
[0102] The sampling time point array obtaining second unit is used to obtain the sampling time point array according to the first sampling point set, the second sampling point set and the third sampling point set if the fourth sampling point set is a non-empty set.
[0103] Further, the sampling time point array obtaining second unit may include: a first array determining unit, a second array determining unit and a sampling time point array obtaining sub-unit, wherein:
[0104] The first array determining unit is configured to determine a first array according to the first sampling point set.
[0105] The second array determining unit is configured to determine a second array according to a first relationship between the third sampling point set and the first sampling point set and a second relationship between the second sampling point set and the first sampling point set.
[0106] The sampling time point array obtaining subunit is used to obtain the sampling time point array according to the first array and the second array.
[0107] Further, the first array determining unit may include: a first array determining first unit and a first array determining second unit, wherein:
[0108] The first array determines a first unit, which is used to determine the second time point as the first array if the first sampling point set is an empty set.
[0109] The first array determines the second unit, which is used to determine the first array according to the number of elements included in the first sampling point set, the first time point and the second time point if the first sampling point set is a non-empty set.
[0110] Further, the second array determining unit may include: a second array determining first unit and a second array determining second unit, wherein:
[0111] The second array determines a first unit, which is used to determine the second array as an empty set if it is determined according to the first relationship that the third sampling point set is included in the first sampling point set.
[0112] The second array determines a second unit, which is used to determine the second array according to the second relationship if it is determined according to the first relationship that the third sampling point set is not included in the first sampling point set.
[0113] Further, the second array determining second unit may include: a second array determining third unit and a second array determining fourth unit, wherein:
[0114] The second array determines a third unit, configured to determine the second array according to the number of elements in the third sampling point set that do not belong to the first sampling point set, the first time point, the second time point, and the fourth time point if it is determined according to the second relationship that the second sampling point set is included in the first sampling point set.
[0115] The second array determines a fourth unit, configured to determine the second array according to the number of elements in the third sampling point set that do not belong to the second sampling point set, the first time point, the third time point, and the fourth time point if it is determined according to the second relationship that the second sampling point set is not included in the first sampling point set.
[0116] Furthermore, the physical layer link status detection device 200 may further include: a preset period detection unit, wherein:
[0117] A preset period detection unit is used to detect the link state of the physical layer based on a preset period if the link state of the physical layer is not detected to be in a link active state based on the sampling time point array.
[0118] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0119] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0120] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0121] See also Figure 5 , which shows a structural block diagram of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may be an electronic device with processing capabilities, such as a vehicle, a tablet computer, a robot, etc. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more applications, wherein the one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110, and the one or more programs are configured to execute the method described in the aforementioned method embodiment.
[0122] Among them, the processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 110 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented separately through a communication chip.
[0123] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the electronic device 100 during use.
[0124] See also Figure 6 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 300 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0125] The computer readable storage medium 300 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 300 includes a non-transitory computer-readable storage medium. The computer readable storage medium 300 has storage space for program code 310 that performs any method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code 310 can be compressed, for example, in an appropriate form.
[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A physical layer link status detection method, characterized in that: The method comprises: In the process of the operating system switching from the sleep state to the wake-up state, the link state of the physical layer corresponding to the Ethernet of the operating system is detected based on the sampling time point array, wherein the sampling time point array is determined according to a first time range and a second time range, the first time range is a time range in which the corresponding physical layer link is successfully established in the process of the first device corresponding to the operating system switching from the sleep state to the wake-up state, and the second time range is a time range in which the corresponding physical layer link is successfully established in the process of the second device corresponding to the operating system switching from the sleep state to the wake-up state; If it is detected based on the sampling time point array that the link state is in a link active state, data transmission is performed based on the Ethernet.
2. The method according to claim 1, characterized in that In the process of switching the operating system from the sleep state to the wake-up state, before detecting the link state of the physical layer corresponding to the Ethernet of the operating system based on the sampling time point array, the method further includes: Determining a starting time point of the first time range as a first time point and an ending time point of the first time range as a second time point, and determining a starting time point of the second time range as a third time point and an ending time point of the second time range as a fourth time point; Obtaining a first sampling point set according to the first time point, the second time point, and a preset interval duration; Obtaining a second sampling point set according to the first time point, the third time point and the preset interval duration; Obtaining a third sampling point set according to the first time point, the fourth time point and the preset interval duration; Determine a union of the first sampling point set, the second sampling point set and the third sampling point set as a fourth sampling point set; The sampling time point array is obtained according to the first sampling point set, the second sampling point set, the third sampling point set and the fourth sampling point set.
3. The method according to claim 2, characterized in that The obtaining the sampling time point array according to the first sampling point set, the second sampling point set, the third sampling point set and the fourth sampling point set comprises: If the fourth sampling point set is an empty set, determining the maximum value between the second time point and the fourth time point as the sampling time point array; or If the fourth sampling point set is a non-empty set, the sampling time point array is obtained according to the first sampling point set, the second sampling point set and the third sampling point set.
4. The method according to claim 3, characterized in that The obtaining the sampling time point array according to the first sampling point set, the second sampling point set and the third sampling point set comprises: Determine a first array according to the first sampling point set; determining a second array according to a first relationship between the third sampling point set and the first sampling point set and a second relationship between the second sampling point set and the first sampling point set; The sampling time point array is obtained according to the first array and the second array.
5. The method according to claim 4, characterized in that The determining a first array according to the first sampling point set comprises: If the first sampling point set is an empty set, determining the second time point as the first array; or If the first sampling point set is a non-empty set, the first array is determined according to the number of elements included in the first sampling point set, the first time point, and the second time point.
6. The method according to claim 4, characterized in that The determining the second array according to the first relationship between the third sampling point set and the first sampling point set and the second relationship between the second sampling point set and the first sampling point set comprises: If it is determined according to the first relationship that the third sampling point set is included in the first sampling point set, then the second array is determined to be an empty set; or If it is determined according to the first relationship that the third sampling point set is not included in the first sampling point set, the second array is determined according to the second relationship.
7. The method according to claim 6, characterized in that The determining the second array according to the second relationship comprises: If it is determined according to the second relationship that the second sampling point set is included in the first sampling point set, determining the second array according to the number of elements in the third sampling point set that do not belong to the first sampling point set, the first time point, the second time point, and the fourth time point; or If it is determined according to the second relationship that the second sampling point set is not included in the first sampling point set, the second array is determined according to the number of elements in the third sampling point set that do not belong to the second sampling point set, the first time point, the third time point, and the fourth time point.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: If it is not detected based on the sampling time point array that the link state of the physical layer is in a link active state, the link state of the physical layer is detected based on a preset period.
9. A physical layer link status detection device, characterized in that: The device comprises: A link status detection module, used for detecting the link status of the physical layer corresponding to the Ethernet of the operating system based on a sampling time point array during the process of the operating system switching from a sleep state to a wake-up state, wherein the sampling time point array is determined according to a first time range and a second time range, the first time range is a time range during which the corresponding physical layer link is successfully established during the process of the first device corresponding to the operating system switching from a sleep state to a wake-up state, and the second time range is a time range during which the corresponding physical layer link is successfully established during the process of the second device corresponding to the operating system switching from a sleep state to a wake-up state; A data transmission module is used for performing data transmission based on the Ethernet if it is detected based on the sampling time point array that the link state is in a link active state.
10. An electronic device, characterized in that: include: one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1-8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 8.