Abstract:
Disclosed are a dimming method, a dimming device and a computer storage medium. The method comprises: segmenting, on a Media Access Control (MAC) layer, a MAC Service Data Unit (MSDU) into multiple sub-MSDUs of the same length; encapsulating the sub-MSDUs after the segmentation into separate MAC Protocol Data Units (MPDUs), and separately generating a Compensation Frame (CF) for each MPDU according to a target brightness value of a light source; and aggregating the MPDUs and the CFs into a Physical Layer Service Data Unit (PSDU) of a Physical Layer Protocol Data Unit (PPDU) and transmitting the PPDU.

Description:
TECHNICAL FIELD 
       [0001]    The disclosure relates to a dimming technology in the field of optical communications, and in particular to a dimming method, a dimming device and a computer storage medium. 
       BACKGROUND 
       [0002]    A Visible Light Communication (VLC) technology refers to a technology for short-distance light wireless communication with light which is visible for human eyes and has a wavelength ranged from 400 nm to 700 nm. The VLC technology has the advantages of being immune to electromagnetic interference, being immune to interference related to a Radio Frequency (RF) system and the like, and adopting a spectrum range which falls into unlicensed spectra. When visible light is adopted for data transmission, a visible light source (such as a light-emitting diode) may be rapidly turned on and turned off or luminance of the visible light source may be modulated at a sender; and at a receiver, a modulated light signal is converted into data which may be processed by the receiver after being received. 
         [0003]    When visible light is adopted for communication, it is necessary to ensure that there is no influence on normal use of illumination equipment by a user at the same time of implementing data transmission. Thus, the following two problems are required to be considered: the first is to realize a data transmission function; and the second is to ensure support to luminance regulation of a light source, i.e. dimming, on the premise of no flicker of the light source. 
         [0004]    In a related technology, the following two manners are mainly adopted for dimming: 
         [0005]    1) a sender implements dimming by virtue of an idle pattern, namely by independently sending a frame configured to regulate luminance, in an idle/receiving state, but such a manner does not provide a specific implementation solution for realizing a dimming function; and 
         [0006]    2) in a physical layer, an idle pattern closely related to a modulation manner and a channel coding scheme is adopted for dimming, and in such a manner, luminance of a light source may be regulated to a set extent only, and the luminance of the light source may not be smoothly regulated, so that such a manner is not so flexible in dimming. 
       SUMMARY 
       [0007]    The embodiment of the disclosure provides a dimming method and a dimming device, which avoid flicker of a light source at the same time of realizing a communication function and also implement flexible and user-requirement-based dimming in a VLC system. 
         [0008]    The technical solutions of the embodiment of the disclosure are implemented as follows. 
         [0009]    The embodiment of the disclosure provides a dimming method, including: 
         [0010]    a Media Access Control (MAC) Service Data Unit (MSDU) is divided into multiple sub-MSDUs with an equal length in an MAC layer; 
         [0011]    the divided sub-MSDUs are encapsulated into independent MAC Protocol Data Units (MPDUs) respectively, and a Compensatory Frames (CF) is generated for each MPDU according to a target luminance value of a light source; and 
         [0012]    each MPDU and a CF corresponding to the each MPDU are aggregated into a Physical-layer Service Data Unit (PSDU) in a Physical-layer Protocol Data Unit (PPDU), and the PPDU is transmitted. 
         [0013]    The embodiment of the disclosure further provides a dimming device, including: 
         [0014]    a division unit, configured to divide an MSDU into multiple sub-MSDUs with an equal length in an MAC layer; 
         [0015]    a compensation unit, configured to encapsulate the divided sub-MSDUs into independent MPDUs respectively, and generate a CF for each MPDU according to a target luminance value of a light source; 
         [0016]    an aggregation unit, configured to aggregate each MPDU and a CF corresponding to the each MPDU into a PSDU in a PPDU; and 
         [0017]    a light driving unit, configured to transmit the PPDU. 
         [0018]    The embodiment of the disclosure further provides a computer storage medium having stored therein a computer-executable instruction being configured to execute the abovementioned dimming method. 
         [0019]    The technical solutions for dimming in the embodiment of the disclosure are independent of a modulation manner and channel coding scheme adopted for data transmission, the sub-MSDUs divided in the MAC layer are encapsulated in the MPDUs, and the CF in each MPDU includes target luminance information of the light source, so that corresponding CFs may be generated for different target luminance of the light source, the shortcoming that luminance may be regulated to a set extent only in the related technology is overcome, the luminance of the light source may be smoothly regulated, and dimming flexibility is ensured. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0020]      FIG. 1  is a first implementation flowchart of a dimming method according to an embodiment of the disclosure; 
           [0021]      FIG. 2  is a second implementation flowchart of a dimming method according to an embodiment of the disclosure; 
           [0022]      FIG. 3  is a schematic structural diagram of a frame of an MAC layer and a physical layer in standard Institute of Electrical and Electronic Engineers (IEEE) 802.15.7; 
           [0023]      FIG. 4  is a schematic structural diagram of a PPDU according to an embodiment of the disclosure; 
           [0024]      FIG. 5  is a schematic structural diagram of a Colour Visible Dimming (CVD) frame in standard IEEE 802.15.7; and 
           [0025]      FIG. 6  is a schematic structural diagram of a dimming device according to an embodiment of the disclosure. 
       
    
    
     DETAILED DESCRIPTION 
       [0026]    The disclosure will be further described below with reference to the drawings and specific embodiments in detail, and it is important to note that the embodiments of the disclosure and characteristics in the embodiments may be combined under the condition of no conflicts. 
         [0027]    As shown in  FIG. 1 , a dimming method recorded by the embodiment of the disclosure includes the following steps: 
         [0028]    Step  101 : an MSDU is divided into multiple sub-MSDUs with an equal length in an MAC layer; 
         [0029]    Step  102 : the divided sub-MSDUs are encapsulated into independent MPDUs respectively, and CFs are generated for the MPDUs according to a target luminance value of a light source; 
         [0030]    Step  103 : each MPDU and a CF corresponding to the each MPDU are aggregated into a PSDU in a PPDU; and 
         [0031]    Step  104 : the generated PPDU is transmitted. 
         [0032]    In an embodiment, before the step that the MSDU is divided into the multiple sub-MSDUs with the equal length in the MAC layer, the method further includes: 
         [0033]    a length of the MSDU is determined to be less than or equal to a difference value between a maximum data length and a sum of a physical layer cost length and an MAC layer cost length. 
         [0034]    In an embodiment, the maximum data length is a product of a period T and a data rate of a link, and the period T is a reciprocal of a Critical Flicker Frequency (CFF). 
         [0035]    In an embodiment, when the length of the MSDU is determined to be more than the difference value between the maximum data length and the sum of the physical layer cost length and the MAC layer cost length, the method further includes: 
         [0036]    the MSDU is re-divided into multiple sub-MSDUs with an equal length until the length of each obtained sub-MSDU is determined to be less than or equal to the difference value between the maximum data length and the sum of the physical layer cost length and the MAC layer cost length. 
         [0037]    In an embodiment, the step that the CF is generated for each MPDU according to the target luminance value of the light source includes that: 
         [0038]    the CF is generated for each MPDU according to the target luminance value of the light source when an actual luminance value of the light source is determined to be different from the target luminance value of the light source. 
         [0039]    In an embodiment, the step that the CF is generated for each MPDU according to the target luminance value of the light source when the actual luminance value of the light source is determined to be different from the target luminance value of the light source includes: 
         [0040]    a length n CF  of a sequence of a Compensatory Frame Data (CFD) part of each CF is determined according to the following formula: 
         [0000]    
       
         
           
             
               
                 
                   n 
                   
                     cos 
                      
                     
                         
                     
                      
                     t 
                   
                 
                 + 
                 
                   n 
                   MSDU 
                 
                 + 
                 
                   n 
                   CF 
                 
               
               
                 
                   size 
                   
                     cos 
                      
                     
                         
                     
                      
                     t 
                   
                 
                 + 
                 
                   size 
                   MSDU 
                 
                 + 
                 
                   size 
                   CF 
                 
               
             
             = 
             α 
           
         
       
     
         [0041]    where α represents the target luminance value of the light source, n cos 1  represents the number of “1” in a cost part, n MSDU  represents the number of “1” in the MSDU, and n CF  represents the number of “1” in the CFD part; size cos1  represents a length of the cost part, size MSDU  represents the length of the MSDU, and size CF  represents a length of the CF; and cost includes a MAC-layer HeadeR (MHR) field, a MAC-layer tail field, a physical-layer preamble field, a Physical-layer HeadeR (PHR) field, a CF header field and a pad field. 
         [0042]    In an embodiment, when the actual luminance value of the light source is determined to be the same as the target luminance value of the light source, the method further includes: the divided sub-MSDUs are encapsulated into the independent MPDUs respectively; and 
         [0043]    each MPDU is determined as the PSDU of the PPDU, and the PPDU is transmitted. 
         [0044]    That is, the MPDU is encapsulated as a data part of the PPDU, and the PPDU encapsulated with the MPDU is transmitted. 
         [0045]    In an embodiment, after the step that each MPDU and the CF corresponding to the each MPDU are aggregated into the PSDU in the PPDU, the method further includes: 
         [0046]    It is determined whether a length of the PSDU obtained by aggregation is less than or equal to a difference value between the maximum data length and the physical layer cost length. 
         [0047]    In an embodiment, when the length of the PSDU obtained by aggregation is determined to be more than the difference value between the maximum data length and the physical layer cost length, the method further includes: 
         [0048]    the MSDU is re-divided into multiple sub-MSDUs with an equal length until the length of the PSDU obtained by aggregation according to the each obtained sub-MSDU and the CF corresponding to the each sub-MSDU is less than or equal to the difference value between the maximum data length and the physical layer cost length. 
         [0049]    When the length of the PSDU obtained by aggregation is less than or equal to the difference value between the maximum data length and the physical layer cost length, it is indicated that the problem of light source flicker that a user may feel may not occur during data transmission. 
         [0050]    The dimming method provided by the embodiment of the disclosure will be further described below in detail,  FIG. 2  is a second implementation flowchart of a dimming method according to an embodiment of the disclosure, and as shown in  FIG. 2 , the method includes the following steps: 
         [0051]    Step  201 : a data unit of a Logical Link Control (LLC) sub-layer is determined to enter an MAC layer and becomes a data part MSDU of an MPDU. 
         [0052]    That is, when the data unit of the LLC sub-layer enters the MAC layer and becomes the data part MSDU of the MPDU, Step  202  is executed. 
         [0053]    As shown in  FIG. 3 , the MPDU transmitted in the MAC layer includes the MSDU serving as the data part, an MAC header and a Frame Check Sequence (FCS). 
         [0054]    Step  202 : it is determined whether a length of the MSDU is less than or equal to a difference value between a maximum data length and a sum of a physical layer cost length and an MAC layer cost length, Step  203  is executed if YES, otherwise Step  210  is executed. 
         [0055]    The difference value between the maximum data length and the sum of the physical layer cost length and the MAC layer cost length refers to a difference value obtained by sequentially subtracting the physical layer cost length and the MAC layer cost length from the maximum data length. 
         [0056]    The maximum data length refers to a maximum data length which may be transmitted by a VLC sender within a period T, and is set to be size max , and a numerical value of size max  is shown in Formula (1): 
         [0000]      size max   =T ×data_rate   (1)
 
         [0057]    In Formula (1), T is a reciprocal of a CFF, and data_rate is a data rate of a link; and the CFF is a minimum repetition frequency which may not cause a flicker feeling. 
         [0058]    The physical layer cost length refers to a sum of a length of a Synchronization HeadeR (SHR) field and a length of a PHR field, and the MAC layer cost length refers to a sum of a length of an MHR field and a length of a MAC-layer tail field, i.e. an FCS field. 
         [0059]    Step  203 : it is determined whether an actual luminance value of a light source is equal to a target luminance value of the light source, Step  204  is executed if YES, otherwise Step  205  is executed. 
         [0060]    Step  204 : a PPDU is transmitted. 
         [0061]    The MPDU in Step  201  is determined as a data part of the PPDU, that is, a PSDU is encapsulated into the PPDU transmitted in a physical layer, and the PPDU is transmitted. 
         [0062]    In Step  203 , when the actual luminance value of the light source is equal to the target luminance value of the light source, it is unnecessary to regulate the luminance value of the light source, so that when Step  204  is executed, as shown in  FIG. 3 , the MPDU in Step  201  is encapsulated into the PPDU transmitted in the physical layer as the data part of the PPDU (i.e. the PSDU), the PPDU further including a preamble and a PHR. 
         [0063]    Step  205 : a length of an Aggregated-MPDU (A-MPDU) generated by aggregating the MSDU and a CF is determined. 
         [0064]    The CF and the MSDU are aggregated to generate the A-MPDU, of which the structure diagram is shown in  FIG. 4 , the A-MPDU is encapsulated into the data part of the PPDU (i.e. the PSDU) for transmission, MPDU ( 1 ) and corresponding CF ( 1 ) are aggregated into a data part of PPDU ( 1 ), i.e. PSDU ( 1 ), MPDU ( 2 ) and corresponding CF ( 2 ) are aggregated into a data part of PPDU ( 1 ), i.e. PSDU ( 2 ), and each of PPDU ( 1 ) and PPDU ( 2 ) includes a corresponding SHR field and PHR field; and each of MPDU ( 1 ) and MPDU ( 2 ) includes a corresponding MHR field, FCS field and pad field. 
         [0065]    CFD in the CF is configured to regulate the luminance of the light source, the CF is configured to increase the luminance of the light source when the actual luminance value of the light source is lower than the target luminance value of the light source, and at this moment, the CFD is an all-“1” sequence, and the number of “1” is represented by n CF ; when the actual luminance value of the light source is more than the target luminance value of the light source, the CF is configured to decrease the luminance of the light source, and at this moment, the CFD is an all-“0” sequence, and the number of “0” is represented by n CF ; and a relationship between n CF  and the target luminance value of the light source is shown in Formula (2): 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         n 
                         
                           cos 
                            
                           
                               
                           
                            
                           t 
                         
                       
                       + 
                       
                         n 
                         MSDU 
                       
                       + 
                       
                         n 
                         CF 
                       
                     
                     
                       
                         size 
                         
                           cos 
                            
                           
                               
                           
                            
                           t 
                         
                       
                       + 
                       
                         size 
                         MSDU 
                       
                       + 
                       
                         size 
                         CF 
                       
                     
                   
                   = 
                   α 
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
           
         
       
     
         [0066]    In Formula (2), parameter α represents the target luminance value of the light source, n cos1  represents the number of “1” in a cost part, n MSDU  represents the number of “1” in the MSDU, and n CF  represents the number of “1” in the CFD part; cost represents cost except effective data, including an MHR field, a MAC-layer tail field, an SHR field, a PHR field, a CF header field and a pad field; size cos1  represents a length of the cost part, size MSDU  represents a length of the MSDU, and size CF  represents a length of the CF; pad is configured to align a 32-bit boundary, and consists of “0” and “1” sequences; and since the luminance of the light source is regulated through “1” or “0” sequences with different lengths in the embodiment, smooth regulation over the luminance of the corresponding light source is supported, that is, the amplitude may be set on a per regulation basis according to a practical requirement. 
         [0067]    In the embodiment of the disclosure, the CF configured for dimming may adopt a CVD frame format in standard IEEE 802.15.7, and as shown in  FIG. 5 , the MHR field includes control information of a CVD frame, the FCS field includes check information of an MACMHR, and a data part field includes a data content of the CVD frame. With reference to  FIG. 4 , the MHR field and FCS field of the CVD frame form a Compensatory Frame Header (CFH) of the CF, and the data part field of the CVD frame corresponds to a data part, i.e. the CFD, of the CF. 
         [0068]    Determination of the CFD in the CF may be implemented by presetting all-“1” and all-“0” sequences with different lengths. When the CF is generated, a preset sequence with a corresponding length is directly endowed to the CF. If the length of the sequence is mismatched with the length of the determined CF, the preset sequences may be combined to obtain the data part of the determined CF. For example: all-“1” sequences with lengths of 100 bits, 200 bits and 400 bits are preset, and when CFs are generated, CFs with CFD lengths of 100 bits, 200 bits and 400 bits may be generated, and CF all“1” sequences with CFD lengths of 300 bits (that is, 200 bits are added to 100 bits), 500 bits (that is, 400 bits are added to 100 bits), 600 bits (that is, 400 bits are added to 200 bits) and 700 bits (that is, 200 bits and 400 bits are added to 100 bits) may also be generated. 
         [0069]    Step  206 : it is determined whether a length of the A-MPDU is less than a difference value between the maximum data length and the physical layer cost length, Step  209  is executed if YES, otherwise Step  207  is executed. 
         [0070]    During a practical application, the CF length size CF  calculated by Formula (2) is also required to meet the following formula: 
         [0000]      size cos1 +size MSDU +size CF ≦size max    (3)
 
         [0071]    In Formula (3), the maximum data length which may be transmitted every time during dimming with the CF is limited. If the CF length does not meet Formula (3), the problem of light source flicker that the user may feel may occur during transmission of the PPDU. This shows that the length of the MSDU or each sub-MSDU is excessive and the MSDU is required to be divided or the MSDU is required to be re-divided into shorter sub-MSDUs when the length of the A-MPDU is more than the difference value between the maximum data length size MSDU  and the physical layer cost length n cos1 . 
         [0072]    Step  207 : the MSDU is divided into multiple sub-MSDUs with an equal length. 
         [0073]    Step  208 : it is determined whether a length of each sub-MSDU is less than a difference value between the maximum data length and the sum of the physical layer cost length and the MAC layer cost length, Step  205  is executed if YES, otherwise Step  207  is executed. 
         [0074]    When a determination result of Step  208  is NO and Step  207  is re-executed, a length of each sub-MSDU obtained by dividing the MSDU is smaller than the length of each sub-MSDU obtained by dividing the MSDU last time, that is, the MSDU is divided into tm sub-MSDUs with an equal length when Step  207  is executed for mth time, the MSDU is divided into to sub-MSDUs with an equal length when Step  207  is executed for nth time, and when m is smaller than n, to is more than tm. 
         [0075]    Step  209 : the PPDU is transmitted. 
         [0076]    After Step  207  is executed last time, the obtained sub-MSDUs are encapsulated into independent MPDUs respectively, and a CF is generated for each MPDU; and each MPDU and a CF corresponding to the each MPDU are aggregated into the A-MPDU, the A-MPDU is determined as a data part (i.e. PSDU) of the PPDU, and the PPDU is transmitted. 
         [0077]    For example, when the MSDU in Step  201  is divided into MSDU ( 1 ) and MSDU ( 2 ) shown in  FIG. 4  and the length of the A-MPDU generated by aggregation in Step  206  is smaller than the difference value between the maximum data length and the physical layer cost length, PPDU ( 1 ) and PPDU ( 2 ) shown in  FIG. 4  are transmitted in the step. 
         [0078]    When the length of the A-MPDU in Step  206  is more than the difference value between the maximum data length size MSDU  and the physical layer cost length n cos1 , it is indicated that the problem of light source flicker that the user may feel may not occur during data transmission, so that the A-MPDU is encapsulated into the data part of the PPDU (i.e. the PSDU) in Step  209 , and the PPDU is transmitted. 
         [0079]    Step  210 : the MSDU is divided into multiple sub-MSDUs with an equal length. 
         [0080]    Step  211 : it is determined whether the length of the sub-MSDUs is smaller than the difference value between the maximum data length and the sum of the physical layer cost length and the MAC layer cost length, Step  212  is executed if YES, otherwise Step  210  is executed. 
         [0081]    When a determination result of Step  211  is NO and Step  210  is re-executed, a length of each sub-MSDU obtained by dividing the MSDU is smaller than the length of the sub-MSDUs obtained by dividing the MSDU last time, that is, the MSDU is divided into tm sub-MSDUs with an equal length when Step  210  is executed for mth time, the MSDU is divided into to sub-MSDUs with an equal length when Step  210  is executed for nth time, and when m is smaller than n, to is more than tm. 
         [0082]    Step  212 : it is determined whether the actual luminance value of the light source is equal to the target luminance value of the light source, Step  213  is executed if YES, otherwise Step  214  is executed. 
         [0083]    Step  213 : the PPDU is transmitted. 
         [0084]    When the actual luminance value of the light source is equal to the target luminance value of the light source, it is unnecessary to regulate the luminance value of the light source, so that the sub-MSDUs obtained by executing Step  210  last time are encapsulated into the independent MPDUs respectively without generating a CF for each MPDU; and each encapsulated MPDU is determined as the PSDU part of the PPDU, and the PPDU is transmitted. 
         [0085]    Step  214 : the length of the A-MPDU generated by aggregation of the MDSU and the CF is determined. 
         [0086]    Step  215 : it is determined whether the length of the A-MPDU is smaller than the difference value between the maximum data length and the physical layer cost length, Step  216  is executed if YES, otherwise Step  217  is executed. 
         [0087]    When the length of the A-MPDU is smaller than the difference value between the maximum data length and the physical layer cost length, it is indicated that the problem of light source flicker that human eyes may perceive may not occur when the A-MPDU is determined as the data part of the PPDU and the PSDU is transmittedf. 
         [0088]    Step  216 : the PPDU is transmitted. 
         [0089]    The A-MPDU is determined as the data part of the PPDU (i.e. the PSDU), and the PPDU is transmitted. 
         [0090]    Step  217 : the MSDU is divided into multiple sub-MSDUs with an equal length, and Step  215  is executed. 
         [0091]    The length of the sub-MSDUs obtained by dividing the MSDU in Step  217  is smaller than the length of each sub-MSDU obtained by dividing the MSDU before Step  217 , and when Step  217  is repeatedly executed, the length of each sub-MSDU obtained every time when Step  217  is executed is smaller than the length of each sub-MSDU obtained when Step  217  is previously executed, and Step  217  is executed repeatedly until the length of an A-MPDU is smaller than the difference value between the maximum data length and the physical layer cost length when each obtained sub-MSDU and the corresponding CF are aggregated to obtain the A-MPDU, so that the phenomenon of light source flicker is avoided when the A-MPDU is transmitted as the data part of the PPDU (i.e. the PSDU). 
         [0092]    The embodiment of the disclosure further describes a computer-readable medium having stored therein a computer-executable instruction being configured to execute the dimming method shown in  FIG. 1  or execute the dimming method shown in  FIG. 2 . 
         [0093]      FIG. 6  is a schematic structural diagram of a dimming device according to an embodiment of the disclosure, the dimming device may be arranged in a sender of a VLC system, and may also be arranged in equipment independent from the sender, and as shown in  FIG. 6 , the dimming device includes: 
         [0094]    a division unit  10 , configured to divide an MSDU into multiple sub-MSDUs with an equal length in an MAC layer; 
         [0095]    a compensation unit  20 , configured to encapsulate the divided sub-MSDUs into independent MPDUs respectively, and generate a CF for each MPDU according to a target luminance value of a light source; 
         [0096]    an aggregation unit  30 , configured to aggregate each MPDU and a CF corresponding to the each MPDU into a PSDU in a PPDU; and 
         [0097]    a light driving unit  40 , configured to transmit the generated PPDU. 
         [0098]    In an embodiment, the dimming device further includes: 
         [0099]    a determination unit  50 , configured to, when determining that a length of the MSDU is less than or equal to a difference value between a maximum data length and a sum of a physical layer cost length and an MAC layer cost length, trigger the division unit  10 . 
         [0100]    In an embodiment, the maximum data length is a product of a period T and a data rate of a link, and the period T is a reciprocal of a CFF. 
         [0101]    In an embodiment, the determination unit  50  is further configured to, when determining that the length of the MSDU is more than the difference value between the maximum data length and the sum of the physical layer cost length and the MAC layer cost length, trigger the division unit  10  to re-divide the MSDU into multiple sub-MSDUs with an equal length until the length of each obtained sub-MSDU is determined to be less than or equal to the difference value between the maximum data length and the sum of the physical layer cost length and the MAC layer cost length; and the division unit  10  is further configured to re-divide the MSDU into multiple sub-MSDUs with an equal length. 
         [0102]    In an embodiment, the compensation unit  20  is further configured to, when an actual luminance value of the light source is determined to be different from a target luminance value of the light source, generate the CF for each MPDU according to the target luminance value of the light source. 
         [0103]    In an embodiment, the compensation unit  20  is further configured to determine a length n CF  of a sequence of a CFD part of each CF according to the following formula: 
         [0000]    
       
         
           
             
               
                 
                   n 
                   
                     cos 
                      
                     
                         
                     
                      
                     t 
                   
                 
                 + 
                 
                   n 
                   MSDU 
                 
                 + 
                 
                   n 
                   CF 
                 
               
               
                 
                   size 
                   
                     cos 
                      
                     
                         
                     
                      
                     t 
                   
                 
                 + 
                 
                   size 
                   MSDU 
                 
                 + 
                 
                   size 
                   CF 
                 
               
             
             = 
             α 
           
         
       
     
         [0104]    where α represents the target luminance value of the light source, n cos1  represents the number of “1” in a cost part, n MSDU  represents the number of “1” in the MSDU, and n CF  represents the number of “1” in the CFD part; size cost1  represents a length of the cost part, size MDSU  represents the length of the MSDU, and size CF  represents a length of the CF; and cost includes an MHR field, a MAC-layer tail field, a physical-layer preamble field, a PHR field, a CF header field and a pad field. 
         [0105]    In an embodiment, the dimming device further includes: 
         [0106]    an encapsulation unit  60 , configured to, when the actual luminance value of the light source is determined to be the same as the target luminance value of the light source, encapsulate the divided sub-MSDUs into the independent MPDUs respectively; and 
         [0107]    the light driving unit  40  is further configured to determine each MPDU as the PSDU of the PPDU, and transmit the PPDU. 
         [0108]    In an embodiment, the determination unit  50  is further configured to, after each MPDU and the CF corresponding to the each MPDU are aggregated into the PSDU in the PPDU, determine whether a length of the PSDU obtained by aggregation is less than or equal to a difference value between the maximum data length and the physical layer cost length. 
         [0109]    In an embodiment, the determination unit  50  is further configured to, when the length of the PSDU obtained by aggregation is determined to be more than the difference value between the maximum data length and the physical layer cost length, trigger the division unit  10  to re-divide the MSDU into multiple sub-MSDUs with an equal length until the length of the PSDU obtained by the aggregation unit  30  through aggregation of each sub-MSDU obtained by the division unit  10  and the CF corresponding to the each sub-MSDUs is less than or equal to the difference value between the maximum data length and the physical layer cost length. 
         [0110]    During a practical application, all of the modules in the dimming device may be implemented by a Central Processing Unit (CPU), micro processing unit or Field-Programmable Gate Array (FPGA) in the dimming device. 
         [0111]    From the above, according to the technical solutions for dimming in the embodiment of the disclosure, the sub-MSDUs divided in the MAC layer are encapsulated in the MPDUs, and the CFs in each MPDU include target luminance information of the light source, so that corresponding CFs may be generated for different target luminance of the light source, the shortcoming that luminance may be regulated to a set extent only in the related technology is overcome, the luminance of the light source may be smoothly regulated, and dimming flexibility is ensured. 
         [0112]    Those skilled in the art should know that the embodiment of the disclosure may be provided as a method, a system or a computer program product. Therefore, the disclosure may adopt a form of pure hardware embodiment, pure software embodiment and combined software and hardware embodiment. Moreover, the disclosure may adopt a form of computer program product implemented on one or more computer-available storage media (including, but not limited to, a disk memory, an optical memory and the like) including computer-available program codes. 
         [0113]    The disclosure is described with reference to flowcharts and/or block diagrams of the method, equipment (system) and computer program product according to the embodiment of the disclosure. It should be understood that each flow and/or block in the flowcharts and/or the block diagrams and combinations of the flows and/or blocks in the flowcharts and/or the block diagrams may be implemented by computer program instructions. These computer program instructions may be provided for a universal computer, a dedicated computer, an embedded processor or a processor of other programmable data processing equipment to generate a machine, so that a device for realizing a function specified in one flow or more flows in the flowcharts and/or one block or more blocks in the block diagrams is generated by the instructions executed through the computer or the processor of the other programmable data processing equipment. 
         [0114]    These computer program instructions may also be stored in a computer-readable memory capable of guiding the computer or the other programmable data processing equipment to work in a specific manner, so that a product including an instruction device may be generated by the instructions stored in the computer-readable memory, the instruction device realizing the function specified in one flow or many flows in the flowcharts and/or one block or many blocks in the block diagrams. 
         [0115]    These computer program instructions may further be loaded onto the computer or the other programmable data processing equipment, so that a series of operating steps are executed on the computer or the other programmable data processing equipment to generate processing implemented by the computer, and steps for realizing the function specified in one flow or many flows in the flowcharts and/or one block or many blocks in the block diagrams are provided by the instructions executed on the computer or the other programmable data processing equipment. 
         [0116]    The above is only the preferred embodiment of the disclosure and not intended to limit the scope of patent of the disclosure.