Lin communication control method and smart device
By calculating and compensating for time interval deviations in the LIN communication network in real time, the problem of excessive total scheduling time deviation in the LIN communication network is solved, communication stability and synchronization are improved, and the information transmission performance requirements of intelligent vehicles are met.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NIO TECH ANHUI CO LTD
- Filing Date
- 2024-12-20
- Publication Date
- 2026-06-23
Smart Images

Figure CN122268518A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, specifically to a LIN communication control method and a smart device. Background Technology
[0002] LIN (Local Interconnect Network) is a low-cost serial communication network widely used in automotive distributed electronic systems. When the master device in a LIN communication network performs communication control based on the pre-stored LDF (LIN Description File), time fluctuations inevitably occur due to slave device response time deviations, clock errors, and other reasons. The accumulation of these time interval deviations may lead to excessive overall scheduling time deviations in LIN communication, thereby affecting the implementation of related functions.
[0003] Currently, the time interval deviations in LIN communication control generally receive little attention; achieving basic LIN communication functionality is sufficient, with relatively low performance requirements. However, with the development of intelligent vehicle technology, the performance requirements for information transmission from various vehicle control platforms are increasing, consequently demanding higher stability and synchronization of the LIN communication scheduling cycle. Therefore, determining in real-time the duration of deviation compensation based on the deviations generated by each time interval, and performing deviation compensation to ensure that the total deviation of the LIN communication control time remains within a set range, has become an urgent problem to be solved.
[0004] Accordingly, there is a need in the field for a new LIN communication control scheme to solve the above problems. Summary of the Invention
[0005] In order to overcome the above-mentioned deficiencies, this application is made to solve, or at least partially solve, the technical problem of how to determine in real time the duration of the deviation that needs to be compensated based on the deviation generated by each time interval, and to perform deviation compensation.
[0006] In a first aspect, a LIN communication control method is provided, the method comprising: Obtain the actual value of the nth time interval after executing the communication control for the nth time interval; Based on the preset design value of the nth time interval and the actual value of the nth time interval, the deviation value of the nth time interval is obtained; Based on the nth time interval deviation value, the nth time interval design value, and the preset scheduling allowable deviation range, the cumulative scheduling compensation time is updated to obtain the expected compensation time; Based on the expected compensation time, the allowable deviation range of the scheduling, and the preset design value of the (n+1)th time interval, obtain the control value of the (n+1)th time interval; Based on the (n+1)th time interval control value, communication control for the (n+1)th time interval is executed.
[0007] In one technical solution of the above-mentioned LIN communication control method, the method further includes: The deviation range of the (n+1)th time interval is obtained based on the design value of the (n+1)th time interval and the allowable deviation range of the scheduling. Determine whether the expected compensation time belongs to the (n+1)th time interval deviation interval; In response to the fact that the expected compensation time does not belong to the deviation interval of the (n+1)th time interval, the control value of the (n+1)th time interval is obtained based on the design value of the (n+1)th time interval and the left or right endpoint of the deviation interval of the (n+1)th time interval.
[0008] In one technical solution of the above LIN communication control method, in response to the expected compensation time not belonging to the (n+1)th time interval deviation interval, the method further includes: Determine whether the expected compensation time is greater than 0 or less than 0; In response to the expected compensation time being greater than 0, the control value of the (n+1)th time interval is the absolute value of the left endpoint of the deviation interval of the (n+1)th time interval minus the design value of the (n+1)th time interval. In response to the expected compensation time being less than 0, the control value of the (n+1)th time interval is the design value of the (n+1)th time interval plus the right endpoint of the deviation interval of the (n+1)th time interval.
[0009] In one technical solution of the above LIN communication control method, in response to the expected compensation time being greater than 0, the method further includes: Compare the absolute values of the left endpoint of the expected compensation time and the deviation interval of the (n+1)th time interval; In response to the fact that the expected compensation time is less than the absolute value of the left endpoint of the deviation interval of the (n+1)th time interval, the control value of the (n+1)th time interval is updated to the design value of the (n+1)th time interval minus the expected compensation time.
[0010] In one technical solution of the above LIN communication control method, in response to the expected compensation time being less than 0, the method further includes: Compare the absolute value of the expected compensation time with the right endpoint of the (n+1)th time interval deviation interval; In response to the absolute value of the expected compensation time being less than the right endpoint of the deviation interval of the (n+1)th time interval, the control value of the (n+1)th time interval is updated to the design value of the (n+1)th time interval plus the absolute value of the expected compensation time.
[0011] In one technical solution of the above-mentioned LIN communication control method, the method further includes: In response to the expected compensation time falling within the deviation range of the (n+1)th time interval, the control value of the (n+1)th time interval is obtained based on the design value of the (n+1)th time interval and the expected compensation time.
[0012] In one technical solution of the above-mentioned LIN communication control method, the method further includes: Determine whether the expected compensation time is greater than 0 or less than 0; In response to the expected compensation time being greater than 0, the control value of the (n+1)th time interval is the design value of the (n+1)th time interval minus the expected compensation time; In response to the expected compensation time being less than 0, the control value of the (n+1)th time interval is the absolute value of the (n+1)th time interval design value plus the expected compensation time.
[0013] In one technical solution of the above-mentioned LIN communication control method, the method further includes: Determine whether the (n+1)th time interval control value belongs to the (n+1)th time interval design allowable range, wherein the (n+1)th time interval design allowable range is determined based on the (n+1)th time interval design value and the scheduling allowable deviation range; In response to the fact that the (n+1)th time interval control value does not belong to the (n+1)th time interval design allowable range, the (n+1)th time interval control value is updated based on the left or right endpoint of the (n+1)th time interval design allowable range.
[0014] In one technical solution of the above-mentioned LIN communication control method, the method further includes: In response to the expected compensation time being greater than 0, the (n+1)th time interval control value is updated to the left endpoint of the (n+1)th time interval design allowable interval; In response to the expected compensation time being less than 0, the (n+1)th time interval control value is updated to the right endpoint of the (n+1)th time interval design allowable interval.
[0015] In one technical solution of the above-mentioned LIN communication control method, the method further includes: Based on the design value of the nth time interval and the allowable deviation interval of the scheduling, the deviation interval of the nth time interval is obtained; Determine whether the deviation value of the nth time interval belongs to the deviation interval of the nth time interval; In response to the fact that the nth time interval deviation value does not belong to the nth time interval deviation interval, the nth time interval compensation time is obtained based on the nth time interval deviation value and the left or right endpoint of the nth time interval deviation interval; Based on the compensation time of the nth time interval, the cumulative compensation time of the scheduling is updated to obtain the expected compensation time.
[0016] In one technical solution of the above-mentioned LIN communication control method, the method further includes: Determine whether the deviation value of the nth time interval is greater than 0 or less than 0; In response to the nth time interval deviation value being greater than 0, the nth time interval compensation time is the nth time interval deviation value minus the right endpoint of the nth time interval deviation interval; In response to the nth time interval deviation value being less than 0, the nth time interval compensation time is the nth time interval deviation value minus the left endpoint of the nth time interval deviation interval.
[0017] In one technical solution of the above-mentioned LIN communication control method, the method further includes: Based on the (n+1)th time interval control value and the (n+1)th time interval design value, the expected compensation time is updated to obtain the cumulative scheduling compensation time.
[0018] In a second aspect, a smart device is provided, the smart device comprising at least one processor; and a memory communicatively connected to said at least one processor; The memory stores a computer program, which, when executed by the at least one processor, implements the method described in any of the above-described technical solutions for the LIN communication control method.
[0019] In one technical solution of the aforementioned intelligent device, the intelligent device is a vehicle.
[0020] Solution 1. A LIN communication control method, the method comprising: Obtain the actual value of the nth time interval after executing the communication control for the nth time interval; Based on the preset design value of the nth time interval and the actual value of the nth time interval, the deviation value of the nth time interval is obtained; Based on the nth time interval deviation value, the nth time interval design value, and the preset scheduling allowable deviation range, the cumulative scheduling compensation time is updated to obtain the expected compensation time; Based on the expected compensation time, the allowable deviation range of the scheduling, and the preset design value of the (n+1)th time interval, obtain the control value of the (n+1)th time interval; Based on the (n+1)th time interval control value, communication control for the (n+1)th time interval is executed.
[0021] Solution 2. The LIN communication control method according to Solution 1, the method further includes: The deviation range of the (n+1)th time interval is obtained based on the design value of the (n+1)th time interval and the allowable deviation range of the scheduling. Determine whether the expected compensation time belongs to the (n+1)th time interval deviation interval; In response to the fact that the expected compensation time does not belong to the deviation interval of the (n+1)th time interval, the control value of the (n+1)th time interval is obtained based on the design value of the (n+1)th time interval and the left or right endpoint of the deviation interval of the (n+1)th time interval.
[0022] Solution 3. According to the LIN communication control method described in Solution 2, in response to the expected compensation time not falling within the (n+1)th time interval deviation interval, the method further includes: Determine whether the expected compensation time is greater than 0 or less than 0; In response to the expected compensation time being greater than 0, the control value of the (n+1)th time interval is the absolute value of the left endpoint of the deviation interval of the (n+1)th time interval minus the design value of the (n+1)th time interval. In response to the expected compensation time being less than 0, the control value of the (n+1)th time interval is the design value of the (n+1)th time interval plus the right endpoint of the deviation interval of the (n+1)th time interval.
[0023] Solution 4. According to the LIN communication control method described in Solution 3, in response to the expected compensation time being greater than 0, the method further includes: Compare the absolute values of the left endpoint of the expected compensation time and the deviation interval of the (n+1)th time interval; In response to the fact that the expected compensation time is less than the absolute value of the left endpoint of the deviation interval of the (n+1)th time interval, the control value of the (n+1)th time interval is updated to the design value of the (n+1)th time interval minus the expected compensation time.
[0024] Solution 5. According to the LIN communication control method described in Solution 3, in response to the expected compensation time being less than 0, the method further includes: Compare the absolute value of the expected compensation time with the right endpoint of the (n+1)th time interval deviation interval; In response to the absolute value of the expected compensation time being less than the right endpoint of the deviation interval of the (n+1)th time interval, the control value of the (n+1)th time interval is updated to the design value of the (n+1)th time interval plus the absolute value of the expected compensation time.
[0025] Solution 6. The LIN communication control method according to Solution 2, further comprising: In response to the expected compensation time falling within the deviation range of the (n+1)th time interval, the control value of the (n+1)th time interval is obtained based on the design value of the (n+1)th time interval and the expected compensation time.
[0026] Solution 7. The LIN communication control method according to Solution 6, further comprising: Determine whether the expected compensation time is greater than 0 or less than 0; In response to the expected compensation time being greater than 0, the control value of the (n+1)th time interval is the design value of the (n+1)th time interval minus the expected compensation time; In response to the expected compensation time being less than 0, the control value of the (n+1)th time interval is the absolute value of the (n+1)th time interval design value plus the expected compensation time.
[0027] Solution 8. The LIN communication control method according to Solution 7, further comprising: Determine whether the (n+1)th time interval control value belongs to the (n+1)th time interval design allowable range, wherein the (n+1)th time interval design allowable range is determined based on the (n+1)th time interval design value and the scheduling allowable deviation range; In response to the fact that the (n+1)th time interval control value does not belong to the (n+1)th time interval design allowable range, the (n+1)th time interval control value is updated based on the left or right endpoint of the (n+1)th time interval design allowable range.
[0028] Solution 9. The LIN communication control method according to Solution 8, further comprising: In response to the expected compensation time being greater than 0, the (n+1)th time interval control value is updated to the left endpoint of the (n+1)th time interval design allowable interval; In response to the expected compensation time being less than 0, the (n+1)th time interval control value is updated to the right endpoint of the (n+1)th time interval design allowable interval.
[0029] Solution 10. The LIN communication control method according to Solution 1, the method further includes: Based on the design value of the nth time interval and the allowable deviation interval of the scheduling, the deviation interval of the nth time interval is obtained; Determine whether the deviation value of the nth time interval belongs to the deviation interval of the nth time interval; In response to the fact that the nth time interval deviation value does not belong to the nth time interval deviation interval, the nth time interval compensation time is obtained based on the nth time interval deviation value and the left or right endpoint of the nth time interval deviation interval; Based on the compensation time of the nth time interval, the cumulative compensation time of the scheduling is updated to obtain the expected compensation time.
[0030] Solution 11. The LIN communication control method according to Solution 10, the method further includes: Determine whether the deviation value of the nth time interval is greater than 0 or less than 0; In response to the nth time interval deviation value being greater than 0, the nth time interval compensation time is the nth time interval deviation value minus the right endpoint of the nth time interval deviation interval; In response to the nth time interval deviation value being less than 0, the nth time interval compensation time is the nth time interval deviation value minus the left endpoint of the nth time interval deviation interval.
[0031] Solution 12. The LIN communication control method according to Solution 1, the method further includes: Based on the (n+1)th time interval control value and the (n+1)th time interval design value, the expected compensation time is updated to obtain the cumulative scheduling compensation time.
[0032] Option 13. A smart device, comprising: At least one processor; and a memory communicatively connected to said at least one processor; The memory stores a computer program, which, when executed by the at least one processor, implements the LIN communication control method as described in any one of schemes 1 to 12.
[0033] Option 14. The intelligent device according to Option 13, wherein the intelligent device is a vehicle.
[0034] The above-described technical solutions of this application have at least one or more of the following beneficial effects: In implementing the LIN communication control technical solution provided in this application, by compensating only for time deviations exceeding the time range set within each time interval (i.e., the portion exceeding the time interval deviation range), it is possible to ensure that the performance of the entire scheduling cycle meets the design requirements, while also reducing unnecessary time deviation compensation operations and lowering system resource consumption. When the expected compensation time is too large, smooth compensation is performed in multiple time intervals according to the allowable scheduling deviation range, ensuring the stability and consistency of LIN communication. Attached Figure Description
[0035] The disclosure of this application will become more readily understood with reference to the accompanying drawings. It will be readily understood by those skilled in the art that these drawings are for illustrative purposes only and are not intended to limit the scope of protection of this application.
[0036] Figure 1 This is a schematic flowchart of the main steps of a LIN communication control method according to an embodiment of this application.
[0037] Figure 2 This is a timing diagram of LIN communication scheduling control according to an embodiment of this application.
[0038] Figure 3 This is a detailed flowchart illustrating step S103 according to an embodiment of this application.
[0039] Figure 4 This is a detailed flowchart illustrating step S104 according to an embodiment of this application.
[0040] Figure 5 This is a detailed flowchart illustrating the steps for updating the (n+1)th time interval control value according to an embodiment of this application.
[0041] Figure 6 This is a detailed flowchart illustrating the steps for updating the (n+1)th time interval control value according to another embodiment of this application.
[0042] Figure 7 This is a schematic diagram of the main structure of a smart device according to an embodiment of this application. Detailed Implementation
[0043] Some embodiments of this application are described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are merely illustrative of the technical principles of this application and are not intended to limit the scope of protection of this application.
[0044] In the description of this application, "module" and "processor" can include hardware, software, or a combination of both. A module can include hardware circuitry, various suitable sensors, communication ports, memory, and may also include software components, such as program code, or a combination of software and hardware. A processor can be a central processing unit, microprocessor, image processor, digital signal processor, or any other suitable processor. The processor has data and / or signal processing capabilities. The processor can be implemented in software, in hardware, or a combination of both. Computer-readable storage media includes any suitable medium capable of storing program code, such as magnetic disks, hard disks, optical disks, flash memory, read-only memory, random access memory, etc. The term "A and / or B" means all possible combinations of A and B, such as only A, only B, or A and B. The terms "at least one A or B" or "at least one of A and B" have a similar meaning to "A and / or B" and can include only A, only B, or A and B. The singular terms "a" or "this" can also include plural forms.
[0045] See appendix Figure 1 , Figure 1 This is a schematic flowchart illustrating the main steps of a LIN communication control method according to an embodiment of this application. Figure 1 As shown, the master device applied to LIN communication, the LIN communication control method in this embodiment includes: Step S101: Obtain the actual value of the nth time interval after executing the communication control for the nth time interval; Step S102: Based on the preset design value and actual value of the nth time interval, obtain the deviation value of the nth time interval; Step S103: Based on the deviation value of the nth time interval, the design value of the nth time interval, and the preset allowable deviation range for scheduling, update the cumulative compensation time for scheduling to obtain the expected compensation time; Step S104: Based on the expected compensation time, the allowable deviation range of the scheduling, and the preset design value of the (n+1)th time interval, obtain the control value of the (n+1)th time interval; Step S105: Update the expected compensation time based on the design value of the (n+1)th time interval and the control value of the (n+1)th time interval to obtain the cumulative compensation time for scheduling; Step S106: Based on the control value of the (n+1)th time interval, perform communication control for the (n+1)th time interval.
[0046] Continue reading the appendix Figure 2 , combined Figure 2 illustrate Figure 1 The flowchart shows the main steps of the LIN communication control method of this application. Figure 2This is a timing diagram of LIN communication scheduling control according to an embodiment of this application.
[0047] Figure 2 (a) A LIN communication scheduling control timing diagram designed for the user. One scheduling cycle includes multiple time intervals. The design value of each time interval is Tn_delaytime, which represents the design value of the preset time length corresponding to the nth time interval, also known as the nth time interval design value. Figure 2 As shown in (a), for the first time interval (n=1), the preset time length is designed to be T1_delaytime; for the second time interval (n=2), the preset time length is designed to be T2_delaytime, and so on. It should be understood that "n" is a positive integer. The scheduling cycle of LIN communication can be designed and transmitted through the LDF file pre-stored in the LIN communication master device.
[0048] It should be noted that in LIN communication, due to differences in the responses of slave devices and the different content of the master device frame header ID, the design value Tn_delaytime for each time interval can be the same or different; and each time interval can include only one frame of data or multiple frames of data.
[0049] Therefore, this application does not limit the specific frame format of each time interval in LIN communication scheduling control. As an example, each time interval includes only one frame of data, and the content of each frame header ID is different.
[0050] Figure 2 (b) Execute for LIN communication master device Figure 2 (a) shows the actual scheduling control timing diagram generated after the LIN communication scheduling control timing diagram. The actual time interval value corresponding to each time interval is Tn_delaytrue, which represents the actual time length used to execute the communication control of the nth time interval, and can also be called the actual value of the nth time interval. Figure 2 As shown in (b), for the first time interval (n=1), the actual time length for executing its communication control is T1_delaytrue; for the second time interval (n=2), the actual time length for executing its communication control is T2_delaytrue, and so on. It should be understood that "n" is a positive integer. Figure 2 (b) t0, t1, t2, ..., t n These are the timing points in each time interval, i.e., the start and end times of each time interval executed by the LIN communication master device. For example, t1 is both the end time of the actual value of the first time interval and the start time of the actual value of the second time interval.
[0051] In step S101, the master device can calculate the actual time length when the LIN communication master device executes communication control for the nth time interval by calculating the time difference between the timing points set in two adjacent time intervals, i.e., the actual value of the nth time interval Tn_delaytrue. As an example, Tn_delaytrue = t n -(t n-1 ).
[0052] This application does not limit the specific location of the timing points within the time interval. As an example, the timing points can all be set at the falling edge of the first frame header break field in each time interval, or at the falling edge of the start bit of the first frame header synchronization field in each time interval. Those skilled in the art can set the location of the timing points within each time interval according to the actual situation.
[0053] In step S102, for the nth time interval, based on the preset design value Tn_delaytime of the nth time interval in the LDF file, or based on the control value Tn_delaycontrol of the nth time interval, after executing the communication control for the nth time interval, the actual value Tn_delaytrue of the nth time interval is obtained according to the timing point of the LIN communication master device, and then the time interval deviation Tn_delta corresponding to each time interval can be obtained. For the nth time interval, the difference in time length between the actual value of the nth time interval and the design value of the nth time interval can also be called the nth time interval deviation value Tn_delta, that is: Tn_delta=Tn_delaytrue-Tn_delaytime (Formula 1).
[0054] The time interval deviation value corresponding to the first time interval is T1_delta, the time interval deviation value corresponding to the second time interval is T2_delta (not shown), and so on. It should be understood that "n" is a positive integer. When Tn_delta is greater than 0, it indicates that a positive deviation occurs after executing the communication control for the nth time interval, and the actual execution time exceeds the pre-designed or calculated time length; when Tn_delta is less than 0, it indicates that a negative deviation occurs after executing the communication control for the nth time interval, and the actual execution time does not reach the pre-designed or calculated time length.
[0055] like Figure 2 (a) and Figure 2As shown in (b), T1_delta = T1_delaytrue - T1_delaytime. T1_delta is greater than 0, which means that the actual value of the first time interval T1_delaytrue exceeds the design value of the first time interval T1_delaytime, resulting in a positive deviation after the communication control of the first time interval is executed.
[0056] In this embodiment of the application, the preset allowable deviation range for the scheduling period in the LDF file is [-q%, +q%], that is, the maximum allowable positive deviation for the total execution time of each scheduling period is q%, and the maximum allowable negative deviation is -q%.
[0057] Since a scheduling cycle comprises multiple time intervals, considering that if the deviation of each time interval's execution time is within [-q%, +q%], then the deviation of the total execution time of the scheduling cycle will also be within [-q%, +q%]. Therefore, [-q%, +q%] can also be used as the allowable deviation range for each time interval in this embodiment. Based on this range, it is determined whether, after executing communication control for a certain time interval, additional time deviations (new deviations) exceeding this range will occur and require compensation. When a new deviation exceeding the allowable deviation range occurs, the new deviation exceeding this range is compensated and offset by executing communication control for subsequent time intervals, thereby ensuring that the total execution time of the scheduling cycle is within the allowable deviation range.
[0058] Next, combine Figure 3 This explains the specific steps and methods of step S103. Figure 3 This is a detailed flowchart illustrating step S103 according to an embodiment of this application.
[0059] In step S1030, it is determined whether the deviation of the nth time interval Tn_delta belongs to the deviation interval of the nth time interval. The deviation interval of the nth time interval is determined based on the design value of the nth time interval Tn_delaytime and the preset allowable deviation interval of scheduling [-q%, +q%]. The deviation interval of the nth time interval is [-Tn_delaytime*q%, Tn_delaytime*q%.
[0060] Where -Tn_delaytime*q% is the left endpoint of the nth time interval deviation interval, denoted as Endpoint_Ln; Tn_delaytime*q% is the right endpoint of the nth time interval deviation interval, denoted as Endpoint_Rn.
[0061] In step S1031, in response to the nth time interval deviation value Tn_delta exceeding the nth time interval deviation range [-Tn_delaytime*q%, Tn_delaytime*q%], that is, Tn_delta is less than (-Tn_delaytime*q%) or Tn_delta is greater than (Tn_delaytime*q%), the cumulative compensation time T_comp of the scheduling needs to be updated.
[0062] It should be noted that the cumulative scheduling compensation time T_comp before the update is the cumulative time length generated by the previous n-1 time intervals before the communication control of the nth time interval is executed (the communication control of the n-1th time interval has been completed), which still needs to be compensated and offset by the execution of communication control in subsequent time intervals. After the communication control of the nth time interval is executed, if a new deviation (the compensation time of the nth time interval T_comp) is generated that exceeds the deviation range of the nth time interval [-Tn_delaytime*q%, Tn_delaytime*q%], since this new deviation also needs to be compensated and offset by the execution of communication control in subsequent time intervals, the cumulative scheduling compensation time T_comp also needs to be updated according to this new deviation.
[0063] The updated cumulative compensation time T_comp is the total time expected to be compensated by executing communication control of one or more time intervals after the completion of communication control in the nth time interval. Therefore, the updated T_comp can also be called the expected compensation time TC_comp.
[0064] The updated cumulative compensation time T_comp (expected compensation time TC_comp) can be less than 0, equal to 0, or greater than 0. When the expected compensation time TC_comp is 0, it means that after executing the communication control in the nth time interval, the new deviation is opposite to the previous cumulative compensation time T_comp, completely offsetting the cumulative compensation time T_comp before the nth time interval, and no further compensation is needed through the (n+1)th time interval. When the expected compensation time TC_comp is less than 0 or greater than 0, it indicates that there is still a time deviation that needs to be compensated when executing communication control in subsequent time intervals (the (n+1)th time interval and the time intervals after the (n+1)th time interval). Accordingly, the expected compensation time TC_comp is the basis for calculating the control value of the (n+1)th time interval (relative to the nth time interval, the (n+1)th time interval is the next time interval).
[0065] Specifically, the compensation time Tn_comp of the nth time interval is obtained based on the deviation value Tn_delta of the nth time interval and the left endpoint Endpoint_Ln or right endpoint Endpoint_Rn of the deviation interval of the nth time interval.
[0066] Determine whether Tn_delta > 0 or Tn_delta < 0, and obtain the compensation time Tn_comp for the nth time interval based on the comparison result between Tn_delta and 0.
[0067] In response to Tn_delta > 0, the compensation time Tn_comp for the nth time interval is the deviation value Tn_delta for the nth time interval minus the right endpoint Endpoint_Rn of the deviation interval for the nth time interval, that is: Tn_comp=Tn_delta-Endpoint_Rn =Tn_delta-(Tn_delaytime*q%) (Formula 2).
[0068] In response to Tn_delta<0, the compensation time Tn_comp for the nth time interval is the deviation value Tn_delta for the nth time interval minus the left endpoint Endpoint_Ln of the deviation interval for the nth time interval, that is: Tn_comp=Tn_delta-Endpoint_Ln =Tn_delta-(-Tn_delaytime*q%) (Formula 3).
[0069] In other words, for the deviation generated after executing the communication control of the nth time interval, it is only necessary to compensate for the part that exceeds the deviation range of the nth time interval [-Tn_delaytime*q%, Tn_delaytime*q%].
[0070] In step S1032, based on the nth time interval compensation time Tn_comp, the cumulative scheduling compensation time T_comp is updated to obtain the expected compensation time TC_comp, that is: TC_comp=T_comp+Tn_comp (Formula 4) When each LIN communication scheduling cycle begins, the initial value of T_comp is 0.
[0071] In step S1033, the deviation value Tn_delta of the nth time interval belongs to the deviation interval [-Tn_delaytime*q%, Tn_delaytime*q%], which means that there is no newly generated deviation value that needs to be compensated after the communication control of the nth time interval is executed, that is, the compensation time Tn_comp of the nth time interval is 0.
[0072] Since the deviation value Tn_delta of the nth time interval belongs to the deviation interval [-Tn_delaytime*q%, Tn_delaytime*q%], it is not necessary to update the value of the cumulative compensation time T_comp. In other words, although T_comp has been updated, its value has not changed because Tn_comp = 0. That is, when the deviation value Tn_delta of the nth time interval belongs to the deviation interval [-Tn_delaytime*q%, Tn_delaytime*q%], T_comp is the total time expected to be compensated and offset by executing communication control of one or more time intervals when executing communication control in subsequent time intervals. It is also the basis for calculating the control value of the (n+1)th time interval, i.e., T_comp is the expected compensation time TC_comp (TC_comp = T_comp).
[0073] Based on the above method for obtaining the cumulative compensation time T_comp (expected compensation time TC_comp), it can be seen that when communication control is performed on each time interval, deviations not exceeding the time interval deviation range are allowed. Only when a new deviation exceeding the time interval deviation range exists in a certain time interval, compensation is performed to offset the new deviation value exceeding the time interval deviation range when performing communication control on that time interval. This ensures that the entire scheduling cycle does not exceed the allowable deviation range of the total scheduling time and reduces unnecessary new deviation compensation operations, thereby reducing the occupation of system resources.
[0074] In step S104, based on the expected compensation time TC_comp, the scheduling allowable deviation interval [-q%, q%], and the preset design value of the (n+1)th time interval Tn+1_delaytime, the control value of the (n+1)th time interval Tn+1_delaycontrol is obtained, so as to compensate and offset the expected compensation time TC_comp generated by the first n time intervals before the (n+1)th time interval when the communication control of the (n+1)th time interval is executed.
[0075] Continue reading Figure 4 , combined Figure 4 illustrate Figure 1 The specific steps and methods for step S104. Figure 4This is a detailed flowchart illustrating step S104 according to an embodiment of this application.
[0076] In step S1040, it is determined whether the expected compensation time TC_comp belongs to the deviation interval of the (n+1)th time interval, so as to determine whether the expected compensation time TC_comp can be fully compensated and offset by executing the communication control of the (n+1)th time interval. The deviation interval of the (n+1)th time interval is determined based on the design value of the (n+1)th time interval Tn+1_delaytime and the preset allowable deviation interval of scheduling [-q%, q%]. The deviation interval of the (n+1)th time interval is [-Tn+1_delaytime*q%, Tn+1_delaytime*q%.
[0077] Where -Tn+1_delaytime*q% is the left endpoint of the (n+1)th time interval deviation interval, denoted as Endpoint_Ln+1; Tn+1_delaytime*q% is the right endpoint of the (n+1)th time interval deviation interval, denoted as Endpoint_Rn+1.
[0078] In step S1041, in response to the expected compensation time TC_comp belonging to the deviation interval of the (n+1)th time interval [-Tn+1_delaytime*q%, Tn+1_delaytime*q%], the control value Tn+1_delaycontrol of the (n+1)th time interval is obtained based on the design value Tn+1_delaytime of the (n+1)th time interval and the expected compensation time TC_comp. At this time, the control value Tn+1_delaycontrol of the (n+1)th time interval will belong to the design allowable interval of the (n+1)th time interval [Tn+1_delaytime*(1-q%), Tn+1_delaytime*(1+q%)] (i.e., the range of possible values for the (n+1)th time interval). Therefore, ideally (when executing the communication control of the (n+1)th time interval, the actual value Tn+1_delaytime of the (n+1)th time interval is equal to the control value Tn+1_delaycontrol of the (n+1)th time interval), the expected compensation time TC_comp can be completely compensated and offset by executing the communication control of the (n+1)th time interval.
[0079] Further, in step S1042, it is determined whether TC_comp>0 or TC_comp<0, so as to calculate the (n+1)th time interval control value Tn+1_delaycontrol that can compensate for and offset TC_comp.
[0080] In step S1043, in response to TC_comp > 0, the control value of the (n+1)th time interval Tn+1_delaycontrol is the design value of the (n+1)th time interval Tn+1_delaytime minus the expected compensation time TC_comp, that is: Tn+1_delaycontrol=Tn+1_delaytime-TC_comp (Equation 5).
[0081] In step S1044, in response to TC_comp < 0, the control value Tn+1_delaycontrol for the (n+1)th time interval is the design value Tn+1_delaytime for the (n+1)th time interval plus the absolute value of the expected compensation time TC_comp, that is: Tn+1_delaycontrol=Tn+1_delaytime+abs(TC_comp) (Formula 6) Here, abs represents the absolute value function.
[0082] The calculation method for the (n+1)th time interval control value Tn+1_delaycontrol in steps S1043 and S1044 can also be uniformly expressed as: Tn+1_delaycontrol=Tn+1_delaytime-TC_comp (Equation 7).
[0083] In other words, when performing communication control for the (n+1)th time interval, reverse time compensation is applied to TC_comp. If TC_comp is greater than 0, the design value Tn+1_delaytime for the (n+1)th time interval is reduced based on TC_comp to obtain the control value Tn+1_delaycontrol for the (n+1)th time interval. That is, when performing communication control for the (n+1)th time interval based on Tn+1_delaycontrol, the actual value of the (n+1)th time interval is adjusted by reducing it to apply reverse compensation to TC_comp that is greater than 0 (the actual compensation value corresponding to Tn+1_delaycontrol is less than 0). If TC_comp is less than 0, the design value Tn+1_delaytime for the (n+1)th time interval is increased based on TC_comp to obtain the control value Tn+1_delaycontrol for the (n+1)th time interval. That is, when performing communication control for the (n+1)th time interval based on Tn+1_delaycontrol, the actual value of the (n+1)th time interval is adjusted by increasing it to apply reverse compensation to TC_comp that is less than 0 (the actual compensation value corresponding to Tn+1_delaycontrol is greater than 0). Therefore, as described by “-TC_comp” in Equation 7, the sign of the positive or negative value of the actual compensation value corresponding to Tn+1_delaycontrol is opposite to the sign of the positive or negative value of TC_comp.
[0084] In step S1045, in response to the expected compensation time TC_comp not belonging to the deviation interval of the (n+1)th time interval [-Tn+1_delaytime*q%, Tn+1_delaytime*q%], if the control value Tn+1_delaycontrol of the (n+1)th time interval is directly obtained based on TC_comp, Tn+1_delaycontrol will not belong to the deviation interval of the (n+1)th time interval [Tn+1_delaytime*(1-q%), Tn+1_delaytime*(1+q%)] (i.e., the range of possible values for the (n+1)th time interval). In other words, the expected compensation time TC_comp cannot be fully compensated and offset by executing the communication control of the (n+1)th time interval. Therefore, based on the design value Tn+1_delaytime of the (n+1)th time interval and the left endpoint Endpoint_Ln+1 or right endpoint Endpoint_Rn+1 of the deviation interval of the (n+1)th time interval, the control value Tn+1_delaycontrol of the (n+1)th time interval is obtained, so that the communication control of the (n+1)th time interval belongs to the deviation interval of the (n+1)th time interval [Tn+1_delaytime*(1-q%), Tn+1_delaytime*(1+q%)].
[0085] In step S1046, it is determined whether TC_comp > 0 or TC_comp < 0.
[0086] In step S1047, in response to TC_comp>0, based on the design value Tn+1_delaytime of the (n+1)th time interval and the left endpoint Endpoint_Ln+1 of the deviation interval of the (n+1)th time interval, the control value Tn+1_delaycontrol of the (n+1)th time interval is obtained, that is: Tn+1_delaycontrol=Tn+1_delaytime-abs(Endpoint_Ln+1) =Tn+1_delaytime-abs(-Tn+1_delaytime*q%) (Equation 8).
[0087] In step S1048, in response to TC_comp < 0, based on the design value Tn+1_delaytime of the (n+1)th time interval and the right endpoint Endpoint_Rn+1 of the deviation interval of the (n+1)th time interval, the control value Tn+1_delaycontrol of the (n+1)th time interval is obtained, that is: Tn+1_delaycontrol=Tn+1_delaytime+(Endpoint_Rn+1) =Tn+1_delaytime+(Tn+1_delaytime*q%) (Formula 9).
[0088] As can be seen from steps S1047 and S1048, after executing the communication control of the nth time interval, if the expected compensation time TC_comp to be compensated is too large and cannot be fully compensated at once by executing the communication control of the (n+1)th time interval (the next time interval), the expected compensation time TC_comp can be compensated in batches through the communication control of multiple subsequent time intervals after the nth time interval. Since each of these multiple subsequent time intervals "shares" the expected compensation time TC_comp, the time length of each time interval fluctuates less, which can avoid the situation where the time length of a single time interval fluctuates drastically due to the one-time full compensation of a large value of the expected compensation time TC_comp. Therefore, the embodiment in this application, by performing smooth compensation of the expected compensation time TC_comp, achieves full compensation of the expected compensation time TC_comp, so that the total execution time of the scheduling cycle in which the above time intervals are located is within the allowable deviation range of the scheduling, and can also achieve the stability and consistency of each time interval.
[0089] Continue back Figure 1 After obtaining the control value Tn+1_delaycontrol of the (n+1)th time interval in step S104, in step S105, it is also necessary to update the expected compensation time TC_comp based on the design value Tn+1_delaytime and the control value Tn+1_delaycontrol of the (n+1)th time interval, and obtain the updated cumulative compensation time T_comp of the scheduling. That is, the cumulative compensation time T_comp of the scheduling is updated again based on the difference between the design value Tn+1_delaytime and the control value Tn+1_delaycontrol of the (n+1)th time interval.
[0090] The updated T_comp will be passed from the nth time interval to the (n+1)th time interval. This is used, after executing the communication control for the (n+1)th time interval, to determine, in conjunction with the actual communication control result of the (n+1)th time interval (the deviation value Tn+1_delta of the (n+1)th time interval), whether there is still a cumulative time length in the (n+2)th time interval that needs to be compensated for by executing communication control in subsequent time intervals (the (n+2)th time interval and the time intervals after the (n+2)th time interval). The method for updating T_comp again is as follows: T_comp=TC_comp-(Tn+1_delaytime-(Tn+1_delaycontrol)) (Equation 10).
[0091] In step S106, based on the (n+1)th time interval control value Tn+1_delaycontrol, communication control for the (n+1)th time interval is executed to compensate for the expected compensation time TC_comp.
[0092] After the communication control for the (n+1)th time interval is completed, the (n+1)th time interval will become the "nth time interval" in step S101, and the (n+2)th time interval will become the "n+1th time interval" in step S104. Steps S101 to S106 are repeated until the communication control for all time intervals in the LDF file is completed.
[0093] In other embodiments, the maximum negative deviation value in the preset allowable deviation range of the LDF file can be -q1% and the maximum positive deviation value can be q2%. The values of the maximum negative deviation value and the maximum positive deviation value are different. abs(-q1%) can be greater than q2% and abs(-q1%) can be less than q2%.
[0094] When abs(-q1%) is not equal to q2%, if the method described in steps S1040 to S1048 of the above embodiment is directly used to obtain the control value Tn+1_delaycontrol of the (n+1)th time interval, regardless of whether the expected compensation time TC_comp belongs to or does not belong to the deviation interval of the (n+1)th time interval, the calculated control value Tn+1_delaycontrol of the (n+1)th time interval may not belong to the design allowable interval of the (n+1)th time interval (i.e., the range of possible values of the (n+1)th time interval), or the calculated control value Tn+1_delaycontrol of the (n+1)th time interval may exceed the expected compensation time TC_comp that needs to be compensated and offset.
[0095] At this point, the user can choose whether to adjust and update the (n+1)th time interval control value Tn+1_delaycontrol according to their needs, ensuring it falls within the allowable range of the (n+1)th time interval design and does not exceed the expected compensation time TC_comp required for compensation. When communication control for the (n+1)th time interval is executed based on the adjusted and updated Tn+1_delaycontrol, under the aforementioned ideal condition, additional time deviations caused by directly executing communication control for the (n+1)th time interval based on the unadjusted and unupdated Tn+1_delaycontrol value can be avoided.
[0096] The following describes how to adjust the control value Tn+1_delaycontrol of the (n+1)th time interval to make it fall within the design allowable range of the (n+1)th time interval and not exceed the expected compensation time TC_comp required for compensation offset. As mentioned earlier, the maximum negative deviation value in the preset allowable deviation range of the scheduling in the LDF file can be -q1% and the maximum positive deviation value can be q2%. At this time, the design allowable range of the (n+1)th time interval is determined based on the design value Tn+1_delaytime of the (n+1)th time interval and the allowable deviation range of the scheduling [-q1%, q2%]. The design allowable range of the (n+1)th time interval is [Tn+1_delaytime*(1-q1%), Tn+1_delaytime*(1+q2%)].
[0097] Where Tn+1_delaytime*(1-q1%) is the left endpoint of the allowable interval for the (n+1)th time interval, denoted as A_Endpoint_Ln+1; Tn+1_delaytime*(1+q2%) is the right endpoint of the allowable interval for the (n+1)th time interval, denoted as A_Endpoint_Rn+1.
[0098] Combination Figure 5This indicates that when the maximum negative deviation value and the maximum positive deviation value in the preset allowable deviation range of the LDF file are different, Figure 1 In step S104, how to obtain the (n+1)th time interval control value based on the expected compensation time, the allowable deviation range of the scheduling, and the preset design value of the (n+1)th time interval? Next, in response to the expected compensation time TC_comp belonging to the deviation range of the (n+1)th time interval [-Tn+1_delaytime*q1%, Tn+1_delaytime*q2%], the execution... Figure 4 After obtaining the (n+1)th time interval control value Tn+1_delaycontrol through step S1041 and related steps S1042, S1043 or S1044, how to further adjust the (n+1)th time interval control value Tn+1_delaycontrol so that it falls within the allowable range of the (n+1)th time interval design [Tn+1_delaytime*(1-q1%), Tn+1_delaytime*(1+q2%)] and does not exceed the compensation time required by the expected compensation time TC_comp, thereby avoiding additional time deviations caused by overcompensation when performing communication control of the (n+1)th time interval.
[0099] In step S501, it is determined whether the (n+1)th time interval control value Tn+1_delaycontrol belongs to the design allowable interval of the (n+1)th time interval [Tn+1_delaytime*(1-q1%), Tn+1_delaytime*(1+q2%)], that is, [A_Endpoint_Ln+1, A_Endpoint_Rn+1].
[0100] In step S502, in response to Tn+1_delaycontrol belonging to [A_Endpoint_Ln+1, A_Endpoint_Rn+1], it means that Tn+1_delaycontrol has not exceeded the allowable deviation range of the design for the (n+1)th time interval, so there is no need to update Tn+1_delaycontrol.
[0101] In step S503, in response to Tn+1_delaycontrol not belonging to [A_Endpoint_Ln+1, A_Endpoint_Rn+1], it indicates that Tn+1_delaycontrol has exceeded the allowable deviation range of the design for the (n+1)th time interval. That is, Tn+1_delaycontrol is less than A_Endpoint_Ln+1 or greater than A_Endpoint_Rn+1. In this case, Tn+1_delaycontrol needs to be updated based on A_Endpoint_Ln+1 or A_Endpoint_Rn+1.
[0102] In step S504, in response to TC_comp>0, the (n+1)th time interval control value Tn+1_delaycontrol is updated to the left endpoint A_Endpoint_Ln+1 of the (n+1)th time interval design allowable interval, that is: Tn+1_delaycontrol=A_Endpoint_Ln+1.
[0103] In step S505, in response to TC_comp<0, the (n+1)th time interval control value Tn+1_delaycontrol is updated to the right endpoint A_Endpoint_Rn+1 of the (n+1)th time interval design allowable interval, that is: Tn+1_delaycontrol=A_Endpoint_Rn+1.
[0104] As an example, the designed value of the (n+1)th time interval Tn+1_delaytime is 10ms, and the preset allowable deviation range of the scheduling in the LDF file is [-10%, 5%]. In this case, the designed allowable range of the (n+1)th time interval is [9ms, 10.5ms], that is, A_Endpoint_Ln+1 is 9ms and A_Endpoint_Rn+1 is 10.5ms.
[0105] like Figure 4 As shown in steps S1041, S1042 and S1044, if the expected compensation time TC_comp = -0.8ms, and TC_comp belongs to the deviation interval of the (n+1)th time interval [-1ms, 0.5ms], in response to TC_comp < 0, according to Equation 6, Tn+1_delaycontrol = Tn+1_delaytime + abs(TC_comp) = 10 + 0.8 = 10.8 (ms).
[0106] like Figure 5As shown in steps S501 and S502, at this point, Tn+1_delaycontrol = 10.8ms has exceeded the design allowable range [9ms, 10.5ms] for the (n+1)th time interval. In response to TC_comp < 0, according to... Figure 5 In step S505, the control value Tn+1_delaycontrol for the (n+1)th time interval is updated to the right endpoint A_Endpoint_Rn+1 of the allowable interval for the (n+1)th time interval, resulting in Tn+1_delaycontrol = 10.5ms.
[0107] Combination Figure 6 This indicates that when the maximum negative deviation value and the maximum positive deviation value in the preset allowable deviation range of the LDF file are different, Figure 1 In step S104, how to obtain the control value of the (n+1)th time interval based on the expected compensation time, the allowable deviation range of the scheduling, and the preset design value of the (n+1)th time interval? Next, in response to the expected compensation time TC_comp not belonging to the deviation range of the (n+1)th time interval [-Tn+1_delaytime*q1%, Tn+1_delaytime*q2%], the execution... Figure 4 After obtaining the (n+1)th time interval control value Tn+1_delaycontrol in step S1045 and related steps S1046, S1047 or S1048, how to further adjust the (n+1)th time interval control value Tn+1_delaycontrol so that it falls within the allowable range of the (n+1)th time interval design [Tn+1_delaytime*(1-q1%), Tn+1_delaytime*(1+q2%)] and does not exceed the compensation time required by the expected compensation time TC_comp, thereby avoiding additional time deviations caused by overcompensation when performing communication control of the (n+1)th time interval.
[0108] As described above, in response to the expected compensation time TC_comp > 0, the duration of the (n+1)th time interval needs to be reduced based on the expected compensation time TC_comp and the design value Tn+1_delaytime of the (n+1)th time interval to compensate for TC_comp. According to user needs, after obtaining Tn+1_delaycontrol in step S1047, step S601 further compares the absolute value abs(Endpoint_Ln+1) of the left endpoint of the deviation interval between the expected compensation time TC_comp and the (n+1)th time interval.
[0109] In step S602, in response to TC_comp < abs(Endpoint_Ln+1), it indicates that the expected compensation time TC_comp that actually needs to be compensated is less than the compensation value abs(Endpoint_Ln+1) in Tn+1_delaycontrol calculated according to Equation 8. The (n+1)-th time interval control value Tn+1_delaycontrol will introduce an additional time deviation and there is overcompensation. At this time, TC_comp should be used as the compensation basis, and Tn+1_delaycontrol is updated to: Tn+1_delaycontrol = Tn+1_delaytime - TC_comp.
[0110] As an example of step S602, the designed value Tn+1_delaytime of the (n+1)-th time interval is 10 ms, and the scheduling allowable deviation range is [-10%, 5%]. At this time, the deviation range of the (n+1)-th time interval is [-1 ms, 0.5 ms], that is, Endpoint_Ln+1 is -1 ms and Endpoint_Rn+1 is 0.5 ms.
[0111] As Figure 4 shown in steps S1045 and S1047 of
[0112] However, at this time, TC_comp < abs(Endpoint_Ln+1). If the communication control of the (n+1)-th time interval is executed according to the calculated (n+1)-th interval control value Tn+1_delaycontrol (9 ms), the actual duration for compensating and offsetting the expected compensation time TC_comp will be 1 ms. Since the expected compensation time TC_comp is 0.7 ms, after the communication control of the (n+1)-th time interval is executed at this time, not only the 0.7 ms of the expected compensation time TC_comp is completely compensated at once, but also an additional 0.3 ms is compensated, resulting in overcompensation. To avoid the overcompensation caused by calculating the (n+1)-th interval control value Tn+1_delaycontrol only based on Endpoint_Ln+1, it can be based on Figure 6In step S602, update the control value Tn+1_delaycontrol for the (n + 1)-th time interval to: Tn+1_delaycontrol = Tn+1_delaytime - TC_comp = 10 - 0.7 = 9.3 (ms). When obtaining the control value Tn+1_delaycontrol for the (n + 1)-th time interval, it not only fully compensates and offsets the expected compensation time TC_comp, but also avoids the overcompensation problem that may occur when calculating the control value for the (n + 1)-th interval only based on Endpoint_Ln+1.
[0113] In step S603, in response to TC_comp > abs(Endpoint_Ln+1), it indicates that the expected compensation time TC_comp to be compensated and offset is greater than the compensation offset value abs(Endpoint_Ln+1) corresponding to the calculated control value Tn+1_delaycontrol for the (n + 1)-th time interval. At this time, the expected compensation time TC_comp is not fully compensated and offset during the communication control for the (n + 1)-th time interval, that is, there is no overcompensation in the (n + 1)-th time interval, so there is no need to update Tn+1_delaycontrol.
[0114] As described above, in response to the expected compensation time TC_comp < 0, it is necessary to increase the duration of the (n + 1)-th time interval according to TC_comp and based on the designed value Tn+1_delaytime for the (n + 1)-th time interval to compensate and offset TC_comp in terms of time. According to user requirements, after obtaining Tn+1_delaycontrol through step S1048, it is necessary to further compare the absolute value of the expected compensation time TC_comp and the right endpoint Endpoint_Rn+1 of the deviation interval for the (n + 1)-th time interval in step S604.
[0115] In step S605, in response to abs(TC_comp) < Endpoint_Rn+1, it indicates that the actual expected compensation time TC_comp to be compensated and offset is less than the compensation offset value Endpoint_Rn+1 corresponding to Tn+1_delaycontrol calculated according to Equation 9. The control value Tn+1_delaycontrol for the (n + 1)-th time interval has an additional time deviation, resulting in overcompensation. At this time, the actual abs(TC_comp) should be used as the compensation basis, and update Tn+1_delaycontrol to: Tn+1_delaycontrol = Tn+1_delaytime + abs(TC_comp).
[0116] In step S606, in response to abs(TC_comp) > Endpoint_Rn+1, it indicates that the TC_comp that needs to be compensated is greater than the compensation offset value Endpoint_Rn+1 corresponding to the calculated (n+1)th time interval control value Tn+1_delaycontrol. At this time, the expected compensation time TC_comp has not been fully compensated during the communication control of the (n+1)th time interval, meaning that overcompensation will not occur in the (n+1)th time interval, and therefore, there is no need to update Tn+1_delaycontrol.
[0117] It should be noted that when the maximum negative deviation and maximum positive deviation values in the preset allowable deviation range of the LDF file are different, whether to execute... Figure 5 and / or Figure 6 The step of updating the (n+1)th time interval control value Tn+1_delaycontrol shown can be set by those skilled in the art according to actual conditions. For example, in some embodiments, considering that even if there is a situation in a certain scheduling time interval that exceeds the allowable deviation range of that scheduling time interval, it usually will not have a significant impact on the total time period of each round of scheduling, this step can be skipped. Figure 5 and Figure 6 The steps shown for updating the (n+1)th time interval control value Tn+1_delaycontrol can also be performed under only one or more of these conditions. These adjusted solutions are equivalent to the technical solutions described in this application and will also fall within the protection scope of this application.
[0118] It should be noted that although the steps in the above embodiments are described in a specific order, those skilled in the art will understand that in order to achieve the effect of this application, different steps do not necessarily have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders. These adjusted solutions are equivalent to the technical solutions described in this application and therefore will also fall within the protection scope of this application.
[0119] Those skilled in the art will understand that all or part of the processes in the method of the above-described embodiment can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable storage medium can include any entity or device capable of carrying the computer program code, a medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory, a random access memory, an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc.
[0120] Another aspect of this application provides a smart device.
[0121] In one embodiment of a smart device according to this application, the smart device may include at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program, which, when executed by the at least one processor, implements the LIN communication control method described in any of the above embodiments. (See appendix) Figure 7 , Figure 7 The illustration exemplarily shows a smart device 7 including a memory 71 and a processor 72, which are connected via a bus. The smart device 7 described in this application can be a vehicle, a mobile robot, or the like.
[0122] In some embodiments of this application, the smart device may further include at least one sensor for sensing information, such as a temperature sensor. The sensor is communicatively connected to any type of processor mentioned in this application.
[0123] In some embodiments of this application, the smart device may further include at least one actuator for responding to processor commands, such as an in-vehicle air conditioning unit. The actuator is communicatively connected to any type of processor mentioned in this application.
[0124] The technical solution of this application has been described above with reference to one embodiment shown in the accompanying drawings. However, it will be readily understood by those skilled in the art that the scope of protection of this application is obviously not limited to these specific embodiments. Without departing from the principles of this application, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the scope of protection of this application.
Claims
1. A LIN communication control method, characterized in that, The method includes: Obtain the actual value of the nth time interval after executing the communication control for the nth time interval; Based on the preset design value of the nth time interval and the actual value of the nth time interval, the deviation value of the nth time interval is obtained; Based on the nth time interval deviation value, the nth time interval design value, and the preset scheduling allowable deviation range, the cumulative scheduling compensation time is updated to obtain the expected compensation time; Based on the expected compensation time, the allowable deviation range of the scheduling, and the preset design value of the (n+1)th time interval, obtain the control value of the (n+1)th time interval; Based on the (n+1)th time interval control value, communication control for the (n+1)th time interval is executed.
2. The LIN communication control method according to claim 1, characterized in that, The method further includes: The deviation range of the (n+1)th time interval is obtained based on the design value of the (n+1)th time interval and the allowable deviation range of the scheduling. Determine whether the expected compensation time belongs to the (n+1)th time interval deviation interval; In response to the fact that the expected compensation time does not belong to the deviation interval of the (n+1)th time interval, the control value of the (n+1)th time interval is obtained based on the design value of the (n+1)th time interval and the left or right endpoint of the deviation interval of the (n+1)th time interval.
3. The LIN communication control method according to claim 2, characterized in that, In response to the fact that the expected compensation time does not fall within the (n+1)th time interval deviation interval, the method further includes: Determine whether the expected compensation time is greater than 0 or less than 0; In response to the expected compensation time being greater than 0, the control value of the (n+1)th time interval is the absolute value of the left endpoint of the deviation interval of the (n+1)th time interval minus the design value of the (n+1)th time interval. In response to the expected compensation time being less than 0, the control value of the (n+1)th time interval is the design value of the (n+1)th time interval plus the right endpoint of the deviation interval of the (n+1)th time interval.
4. The LIN communication control method according to claim 3, characterized in that, In response to the expected compensation time being greater than 0, the method further includes: Compare the absolute values of the left endpoint of the expected compensation time and the deviation interval of the (n+1)th time interval; In response to the fact that the expected compensation time is less than the absolute value of the left endpoint of the deviation interval of the (n+1)th time interval, the control value of the (n+1)th time interval is updated to the design value of the (n+1)th time interval minus the expected compensation time.
5. The LIN communication control method according to claim 3, characterized in that, In response to the expected compensation time being less than 0, the method further includes: Compare the absolute value of the expected compensation time with the right endpoint of the (n+1)th time interval deviation interval; In response to the absolute value of the expected compensation time being less than the right endpoint of the deviation interval of the (n+1)th time interval, the control value of the (n+1)th time interval is updated to the design value of the (n+1)th time interval plus the absolute value of the expected compensation time.
6. The LIN communication control method according to claim 2, characterized in that, The method further includes: In response to the expected compensation time falling within the deviation range of the (n+1)th time interval, the control value of the (n+1)th time interval is obtained based on the design value of the (n+1)th time interval and the expected compensation time.
7. The LIN communication control method according to claim 6, characterized in that, The method further includes: Determine whether the expected compensation time is greater than 0 or less than 0; In response to the expected compensation time being greater than 0, the control value of the (n+1)th time interval is the design value of the (n+1)th time interval minus the expected compensation time; In response to the expected compensation time being less than 0, the control value of the (n+1)th time interval is the absolute value of the (n+1)th time interval design value plus the expected compensation time.
8. The LIN communication control method according to claim 7, characterized in that, The method further includes: Determine whether the (n+1)th time interval control value belongs to the (n+1)th time interval design allowable range, wherein the (n+1)th time interval design allowable range is determined based on the (n+1)th time interval design value and the scheduling allowable deviation range; In response to the fact that the (n+1)th time interval control value does not belong to the (n+1)th time interval design allowable range, the (n+1)th time interval control value is updated based on the left or right endpoint of the (n+1)th time interval design allowable range.
9. The LIN communication control method according to claim 8, characterized in that, The method further includes: In response to the expected compensation time being greater than 0, the (n+1)th time interval control value is updated to the left endpoint of the (n+1)th time interval design allowable interval; In response to the expected compensation time being less than 0, the (n+1)th time interval control value is updated to the right endpoint of the (n+1)th time interval design allowable interval.
10. The LIN communication control method according to claim 1, characterized in that, The method further includes: Based on the design value of the nth time interval and the allowable deviation interval of the scheduling, the deviation interval of the nth time interval is obtained; Determine whether the deviation value of the nth time interval belongs to the deviation interval of the nth time interval; In response to the fact that the nth time interval deviation value does not belong to the nth time interval deviation interval, the nth time interval compensation time is obtained based on the nth time interval deviation value and the left or right endpoint of the nth time interval deviation interval; Based on the compensation time of the nth time interval, the cumulative compensation time of the scheduling is updated to obtain the expected compensation time.