Multi-peripheral asynchronous light effect control method based on virtual canvas partition
By generating partition mapping relationships and sampling mappings in the virtual canvas rendering space, the problem of inconsistent lighting effects in multi-device lighting effect control is solved, and the unified arrangement and stable presentation of lighting effects of multiple peripherals are realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN XINGSHAN YUEDONG TECH CO LTD
- Filing Date
- 2026-04-20
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies lack a unified spatial reference and a reproducible mapping method for controlling lighting effects across multiple devices. This results in positional shifts, inconsistent scales, and unstable boundary trimming of lighting effects on different peripherals. Configuration and maintenance costs increase when the number or placement of peripherals changes, and the ability to reuse and scalably program lighting effects is limited.
By establishing a virtual canvas rendering space, the spatial position and layout configuration parameters of peripheral lighting devices are obtained, a partition mapping relationship is generated, a lighting effect frame sequence is generated in the virtual canvas based on the lighting effect generation parameters, and the target color sequence of the light-emitting unit is generated through partition mapping and sampling mapping, and finally the control instructions of the peripheral lighting devices are generated.
It achieves a unified entry point for multi-peripheral lighting effect orchestration and a consistent data benchmark across devices, ensuring stable mapping and parallel driving of lighting effects on different topological light-emitting units, and realizing reliable and continuous presentation of multiple peripherals.
Smart Images

Figure CN122069633A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of human-computer interaction and peripheral control technology, specifically to a method for asynchronous lighting effect control of multiple peripherals based on virtual canvas partitioning. Background Technology
[0002] With the rapid popularization of peripherals with addressable light-emitting units, such as keyboards, mice, light strips, and host cases, lighting effects have evolved from "single-device decoration" to "consistent interactive expression across multiple devices," demonstrating significant product differentiation value in e-sports peripherals, content creation, smart office environments, and immersive scenarios. Existing solutions mostly focus on editing and distributing lighting effects around a single device, often relying on fixed partitions or manual alignment across devices. This lack of a unified spatial benchmark and reproducible mapping methods leads to issues such as positional shifts, inconsistent scales, and unstable boundary trimming for the same lighting effect on different peripherals. When the number of peripherals changes, their placement is altered, or different models are used, configuration and maintenance costs increase significantly, limiting the ability to reuse and scalably arrange lighting effects. Summary of the Invention
[0003] This invention provides a method for asynchronous lighting effect control of multiple peripherals based on virtual canvas partitioning, which at least solves the problem of how to extract, sample, map, and reliably distribute uniformly generated lighting effect content across multiple peripherals in a configurable partitioned manner.
[0004] This invention provides a method for controlling asynchronous lighting effects of multiple peripherals based on virtual canvas partitioning, the method comprising: Obtain the spatial position parameters and layout configuration parameters of the light-emitting units of at least two peripheral lighting devices, establish a virtual canvas rendering space based on the layout configuration parameters, determine the partition area of each peripheral lighting device in the virtual canvas rendering space, and generate a partition mapping relationship. Receive lighting effect generation parameters, generate virtual canvas lighting effect frame sequence in virtual canvas rendering space based on lighting effect generation parameters, extract partition lighting effect frame sequence from virtual canvas lighting effect frame sequence for each peripheral lighting device based on partition mapping relationship, and sample and map partition lighting effect frame sequence based on light-emitting unit spatial position parameters to generate light-emitting unit target color sequence. Control commands for peripheral lighting devices are generated based on the target color sequence of the light-emitting unit and sent to each peripheral lighting device.
[0005] In one possible implementation, the layout configuration parameters include canvas size parameters and canvas coordinate origin parameters. Establishing a virtual canvas rendering space based on the layout configuration parameters includes: establishing a two-dimensional coordinate system based on the canvas size parameters and canvas coordinate origin parameters. The two-dimensional coordinate system is used to represent the virtual canvas rendering space.
[0006] In one possible implementation, the layout configuration parameters include partition region position parameters and partition region size parameters. The partition region position parameters and partition region size parameters are used to determine the partition region boundary parameters of each peripheral lighting device in the virtual canvas rendering space. The partition region boundary parameters are used to indicate the position range of the partition region in the virtual canvas rendering space.
[0007] In one possible implementation, generating the partition mapping relationship includes: generating a peripheral lighting device identifier for each peripheral lighting device; establishing a correspondence between the peripheral lighting device identifier and the partition boundary parameters, wherein the partition mapping relationship includes the correspondence.
[0008] In one possible implementation, generating a virtual canvas lighting effect frame sequence in the virtual canvas rendering space based on lighting effect generation parameters includes: generating at least one layer lighting effect frame sequence based on the lighting effect generation parameters; and compositing the at least one layer lighting effect frame sequence to obtain a virtual canvas lighting effect frame sequence.
[0009] In one possible implementation, extracting the partitioned lighting effect frame sequence from the virtual canvas lighting effect frame sequence based on the partition mapping relationship includes: performing region truncation on the virtual canvas lighting effect frame sequence according to the partition region boundary parameters to obtain the partitioned lighting effect frame sequence.
[0010] In one possible implementation, sampling and mapping the partitioned lighting effect frame sequence based on the spatial position parameters of the light-emitting units includes: representing the spatial position parameters of the light-emitting units as the coordinate parameters of the light-emitting units in the device coordinate system; determining the coordinate transformation relationship between the device coordinate system and the virtual canvas rendering space based on the layout configuration parameters; and mapping the coordinate parameters of the light-emitting units to the virtual canvas rendering space based on the coordinate transformation relationship to obtain the coordinate parameters of the sampling points.
[0011] In one possible implementation, the sampling and mapping of the partitioned lighting effect frame sequence based on the spatial location parameters of the light-emitting units further includes: determining a set of neighboring sampling points in the partitioned lighting effect frame sequence based on the coordinate parameters of the sampling points; performing weighted interpolation on the set of neighboring sampling points to obtain a sampling point color sequence; and assembling the sampling point color sequences into a target color sequence for the light-emitting units according to the order of the light-emitting unit numbers.
[0012] In one possible implementation, generating the target color sequence of the light-emitting unit includes: obtaining the color correction parameters and brightness constraint parameters of the peripheral lighting device; performing color correction on the target color sequence of the light-emitting unit based on the color correction parameters; and limiting the brightness of the color-corrected target color sequence of the light-emitting unit based on the brightness constraint parameters.
[0013] In one possible implementation, generating peripheral lighting device control commands based on the target color sequence of the light-emitting unit and sending them to each peripheral lighting device includes: assigning a frame sequence number parameter to the target color sequence of the light-emitting unit; encapsulating the frame sequence number parameter and the target color sequence of the light-emitting unit into a control command frame; sending the control command frame, and sending the next control command frame upon receiving a confirmation message.
[0014] Compared with the prior art, the advantages and beneficial effects of the present invention are as follows: By unifying the virtual canvas coordinate definition and partition mapping relationship, a unified entry point and consistent data benchmark across devices for multi-peripheral lighting effect orchestration are achieved. Through sampling and mapping of partitioned lighting effect frame sequences, a stable mapping of continuous lighting effect content to different topological emitting units is realized, enabling feasible output. By generating and issuing control commands according to the target color sequence of the emitting units, parallel driving of multiple peripherals and continuous frame-by-frame presentation are achieved. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the execution flow of the method of the present invention. Detailed Implementation
[0016] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0017] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0018] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0019] In this invention, virtual canvas partitioning is used to decouple "content generation" from "device rendering" in multi-peripheral lighting effect control. The control unit first constructs a virtual canvas rendering space with defined coordinates, uniformly representing the lighting effects to be rendered as a time-varying sequence of canvas frames within this space. Then, a partitioned area is allocated to each peripheral lighting device within the virtual canvas rendering space to limit the range of content that the peripheral device can access from the canvas. The partitioned areas can be configured based on the type and placement of the peripheral lighting devices and the user's arrangement intentions, forming reproducible spatial constraints with boundary parameters. Through this partitioning mechanism, the same lighting effect generation logic can maintain a consistent content baseline across different peripheral combinations, and each peripheral lighting device only needs to extract and sample content around its own partitioned area to obtain the target color sequence for the emitting unit.
[0020] like Figure 1 As shown, a method for asynchronous lighting effect control of multiple peripherals based on virtual canvas partitioning is described, the method comprising: Obtain the spatial position parameters and layout configuration parameters of the light-emitting units of at least two peripheral lighting devices, establish a virtual canvas rendering space based on the layout configuration parameters, determine the partition area of each peripheral lighting device in the virtual canvas rendering space, and generate a partition mapping relationship. In one embodiment, the control terminal first enumerates at least two peripheral lighting devices and obtains the spatial position parameters and layout configuration parameters of the light-emitting units for each peripheral lighting device. The spatial position parameters describe the positional distribution of the light-emitting units within the peripheral lighting device's own coordinates, while the layout configuration parameters describe the basic definition of the virtual canvas rendering space and the partitioned area configuration of each peripheral lighting device. Based on the layout configuration parameters, the control terminal establishes a virtual canvas rendering space and determines a partitioned area for each peripheral lighting device within this space. Subsequently, a correspondence is established between the peripheral lighting devices and the partitioned areas, forming a partition mapping relationship. This partition mapping relationship is used to subsequently segment and deploy the lighting effects content in the virtual canvas rendering space according to the device, ensuring that multiple peripherals can achieve consistent arrangement and independent presentation within the same virtual canvas rendering space.
[0021] The layout configuration parameters include canvas size parameters and canvas coordinate origin parameters. Establishing a virtual canvas rendering space based on the layout configuration parameters includes: establishing a two-dimensional coordinate system based on the canvas size parameters and canvas coordinate origin parameters. The two-dimensional coordinate system is used to represent the virtual canvas rendering space.
[0022] In one embodiment, the layout configuration parameters include canvas size and canvas coordinate origin parameters, used to place the virtual canvas rendering space within a calculable and reproducible two-dimensional coordinate system. The purpose of introducing canvas size and canvas coordinate origin parameters is to ensure that the coordinate definition of the virtual canvas rendering space remains stable when the number of peripheral lighting devices changes or the partitioned areas are adjusted, thereby avoiding overall shifts in the same lighting effect across different operating cycles.
[0023] Specifically, the control terminal reads the canvas size parameters, which can be in the form of width and height, and the unit can be pixels or a proportional unit. When pixels are used, the width and height are used to limit the discrete sampling resolution of the virtual canvas rendering space. When proportional units are used, the control terminal internally converts the proportional units to discrete sampling resolution to generate the subsequent lighting effect frame sequence. The control terminal also reads the canvas coordinate origin parameter, which defines the origin position in the two-dimensional coordinate system. The origin position can be defined as the upper left corner, the center point, or any specified point in the virtual canvas rendering space.
[0024] To align with common image coordinates, the horizontal direction can be defined as positive to the right, and the vertical direction as positive downwards. When using the center point as the origin, negative coordinates are allowed to facilitate symmetrical layout at the canvas center. The control unit establishes a two-dimensional coordinate system based on the canvas size parameters and the canvas coordinate origin parameters, using this system to represent the coordinate range and direction of the virtual canvas rendering space. To ensure feasibility, layout configuration parameters can be stored in a configuration file or memory structure, including at least the canvas width, canvas height, origin x-coordinate, origin y-coordinate, and coordinate direction conventions. After loading the layout configuration parameters, the control unit performs a validity check, verifying whether the canvas size is positive and whether the canvas coordinate origin falls within an acceptable range. If the canvas coordinate origin exceeds the canvas size range, the control unit clips the canvas coordinate origin to the canvas boundary or reverts to the preset default origin. In this way, the virtual canvas rendering space has a defined two-dimensional coordinate system. The subsequent positioning of partitioned areas, boundary calculation, and clipping and mapping of lighting effects can all be performed under the same coordinate reference, thereby ensuring the consistency and repeatability of multi-peripheral lighting effect arrangement.
[0025] The layout configuration parameters include partition area position parameters and partition area size parameters. The partition area position parameters and partition area size parameters are used to determine the partition area boundary parameters of each peripheral lighting device in the virtual canvas rendering space. The partition area boundary parameters are used to indicate the position range of the partition area in the virtual canvas rendering space.
[0026] In one embodiment, the layout configuration parameters further include partition region location parameters and partition region size parameters, used to define the area occupied by each peripheral lighting device in the virtual canvas rendering space as calculable partition region boundary parameters. The purpose of introducing partition region location parameters and partition region size parameters is to transform the description of "which area of the canvas each peripheral lighting device corresponds to" from a manual description into a precise boundary constraint, avoiding ambiguity in partition region definition that could lead to unstable subsequent region truncation.
[0027] Specifically, the control terminal reads the position parameters of the partition area for each peripheral lighting device. These position parameters can be represented by a reference point, which can be the coordinates of the top-left corner, the center point, or any anchor point. The control terminal also reads the size parameters of the partition area, which can be represented by the width and height. When the top-left corner coordinates are used as the reference point, the boundary parameters are directly determined by the reference point coordinates, width, and height. When the center point coordinates are used, the control terminal first calculates the half-width and half-height based on the width and height, then combines this with the center point coordinates to obtain the top-left and bottom-right boundaries. To adapt to different peripheral lighting device shapes, the partition area boundary parameters can be rectangular or polygonal. When a rectangular boundary is used, the boundary parameters consist of the minimum x-coordinate, minimum y-coordinate, maximum x-coordinate, and maximum y-coordinate. When a polygonal boundary is used, the boundary parameters consist of a sequence of vertices, which are sequentially connected in a two-dimensional coordinate system to form a closed region.
[0028] After generating the partition region boundary parameters, the control terminal performs boundary verification. Verification includes checking whether the partition region intersects with the virtual canvas rendering space and whether the width and height of the partition region are positive values. When a partition region extends beyond the virtual canvas rendering space, the control terminal trims the partition region to ensure its boundary parameters fall within the canvas coordinate range. To avoid ambiguity caused by overlapping partition regions of different peripheral lighting devices, partition region priority or partition region hierarchy numbers can be added to the layout configuration parameters. When overlap occurs, the control terminal determines the ownership of the overlapping region based on priority, or distributes the overlapping region to multiple peripheral lighting devices according to a preset ratio. By using partition region position parameters and partition region size parameters to form partition region boundary parameters, the location range of the partition region in the virtual canvas rendering space is clearly defined. This provides a direct basis for extracting the partition lighting effect frame sequence from the virtual canvas lighting effect frame sequence and also facilitates rapid updates to the partition region configuration when peripheral lighting devices are added, removed, or rearranged.
[0029] The generation of partition mapping relationships includes: generating a peripheral lighting device identifier for each peripheral lighting device; establishing a correspondence between the peripheral lighting device identifier and the partition boundary parameters, and the partition mapping relationship includes the correspondence.
[0030] In one embodiment, the partition mapping relationship is established by linking the peripheral lighting device identifier with the partition area boundary parameters, which is used to accurately associate the partition area in the virtual canvas rendering space with a specific peripheral lighting device. The purpose of introducing the peripheral lighting device identifier is to maintain the uniqueness and traceability of the partition mapping relationship when there are multiple peripheral lighting devices of the same model or when peripheral lighting devices are dynamically connected, so as to avoid the partition area being incorrectly allocated.
[0031] Specifically, the control terminal generates an identifier for each peripheral lighting device. This identifier can directly use the device's serial number, communication address, or unique device number. When a peripheral lighting device cannot provide a stable unique number, the control terminal can generate an identifier based on the device's access port information and a timestamp, and persistently store this identifier to ensure that the same peripheral lighting device can reuse its identifier when it connects again. After obtaining the identifier, the control terminal establishes a correspondence between the identifier and the corresponding partition boundary parameters, forming a partition mapping relationship.
[0032] The partition mapping relationship can be stored using a mapping table or a key-value pair structure, where the key is the peripheral lighting device identifier and the value is the partition area boundary parameter. When using a polygon boundary, the value is the vertex sequence; when using a rectangular boundary, the value is the four boundary coordinates. To ensure feasibility, the control terminal performs conflict detection before establishing the mapping relationship. The detection includes checking for duplicate peripheral lighting device identifiers and missing partition area boundary parameters. If a peripheral lighting device identifier is duplicated, the control terminal rejects the connection of a new peripheral lighting device or regenerates the identifier. If a partition area boundary parameter is missing, the control terminal reverts to the preset default partition area or prompts for reconfiguration of the layout configuration parameters. The control terminal can also record the version number or update time of the partition mapping relationship, which is used to trigger a refresh of the partition mapping relationship after layout adjustments, preventing old configurations from continuing to participate in subsequent lighting effect distribution. Through the correspondence between peripheral lighting device identifiers and partition area boundary parameters, the partition mapping relationship forms a clear data structure boundary. Any subsequent processing only needs to use the peripheral lighting device identifier to locate the partition area, thus stably connecting the partition definition of the virtual canvas rendering space with the management of multiple peripheral devices.
[0033] Receive lighting effect generation parameters, generate virtual canvas lighting effect frame sequence in virtual canvas rendering space based on lighting effect generation parameters, extract partition lighting effect frame sequence from virtual canvas lighting effect frame sequence for each peripheral lighting device based on partition mapping relationship, and sample and map partition lighting effect frame sequence based on light-emitting unit spatial position parameters to generate light-emitting unit target color sequence. In one embodiment, the control terminal receives lighting effect generation parameters, which describe the lighting effect type, timing, color scheme, and output frame rate. The control terminal generates a virtual canvas lighting effect frame sequence frame by frame within the virtual canvas rendering space, maintaining continuous frame numbers. Based on the partition mapping relationship, the control terminal extracts partitioned lighting effect frame sequences frame by frame from the virtual canvas lighting effect frame sequence, obtaining the partitioned lighting effect frame sequences corresponding to each peripheral lighting device. Subsequently, the control terminal combines the spatial position parameters of the light-emitting units to map the partitioned lighting effect frame sequences to the target color sequences of the light-emitting units. These target color sequences are used to generate control commands for the peripheral lighting devices.
[0034] Generating a virtual canvas lighting effect frame sequence in the virtual canvas rendering space based on lighting effect generation parameters includes: generating at least one layer lighting effect frame sequence based on lighting effect generation parameters; and compositing the at least one layer lighting effect frame sequence to obtain a virtual canvas lighting effect frame sequence.
[0035] In one embodiment, the virtual canvas lighting effect frame sequence is generated using a layered approach. Compared to directly generating a single frame, the layered approach clearly defines the lighting effect composition, facilitating the overlay of multiple lighting effect elements within the same virtual canvas rendering space, without altering subsequent processes such as partition extraction and sampling mapping. Upon receiving the lighting effect generation parameters, the control unit first parses the number and order of layers. Layers may include a background layer, a main layer, and decorative layers. The background layer provides a stable background color or a slowly changing gradient field; the main layer describes primary visual elements such as ripples, breathing patterns, or particles; and the decorative layers overlay local variations such as highlighted edges or rhythmic flashing.
[0036] The lighting effect generation parameters for each layer include at least the layer duration, layer cycle mode, color set, and brightness range. The control panel establishes a layer rendering state for each layer, including the current frame number, current time progress, and local coordinates. The control panel advances the time progress according to the output frame rate and generates a layer lighting effect frame sequence frame by frame. Each frame of the layer lighting effect frame sequence can be represented using either three-channel or four-channel color, with the transparency in the four channels used to describe the degree of layer overlap.
[0037] When generating layer lighting effect frame sequences, the control unit can call the corresponding generator according to the lighting effect type. For example, gradient lighting effects obtain color by calculating the relationship between pixel position and gradient direction; particle lighting effects obtain color by maintaining particle position and velocity and drawing the particle influence range on the canvas; and beat lighting effects obtain color by reading the beat trigger state and assigning highlight colors to local areas. The control unit composites at least one layer lighting effect frame sequence to obtain a virtual canvas lighting effect frame sequence. The compositing process is performed layer by layer in order: first, the background layer is overlaid, then the main layer, and finally the decorative layer.
[0038] If four-channel color is used, the composition is blended based on transparency; if three-channel color is used, the composition is weighted and overlaid according to preset rules or the maximum value is taken for overlay. To ensure feasibility, the control unit performs time alignment on the frame sequences of each layer before composition. Time alignment methods include truncating to a common length or padding short sequences to the target length in a loop. After composition, the control unit outputs a virtual canvas lighting effect frame sequence and adds a frame number and timestamp information to each frame for subsequent partition extraction and consistency with device playback.
[0039] Extracting the partitioned lighting effect frame sequence from the virtual canvas lighting effect frame sequence based on the partitioned mapping relationship includes: performing region truncation on the virtual canvas lighting effect frame sequence according to the partitioned region boundary parameters to obtain the partitioned lighting effect frame sequence.
[0040] In one embodiment, the partitioned lighting effect frame sequence is obtained through region interception. Compared to simply recording the partitioned regions and then temporarily cropping them in later stages, region interception fixes the partitioned content of each peripheral lighting device into an independent frame sequence, facilitating subsequent sampling mapping and correction processing to be performed independently on a device-by-device basis. The control unit reads the peripheral lighting device identifier and partitioned region boundary parameters from the partitioned mapping relationship. The partitioned region boundary parameters are used to indicate the position range of the partitioned region in the virtual canvas rendering space. The control unit performs region interception frame by frame on the virtual canvas lighting effect frame sequence.
[0041] For rectangular partitioned regions, the control terminal uses the minimum, minimum, maximum, and maximum x and y coordinates defined by the partitioned region's boundary parameters as the truncation range, extracting the corresponding frame data and forming a partitioned lighting effect frame sequence. For polygonal partitioned regions, the control terminal first creates a partitioned region mask, taking valid values inside the partitioned region and invalid values outside. The control terminal then uses the partitioned region mask to extract the mask for each frame of the virtual canvas lighting effect frame sequence, obtaining the partitioned lighting effect frame sequence. To prevent partitioned regions from exceeding the virtual canvas rendering space and causing access out of bounds, the control terminal performs boundary clipping on the partitioned region's boundary parameters before truncation, restricting the partitioned region to the effective range of the virtual canvas rendering space.
[0042] Boundary clipping can be achieved using coordinate truncation, ensuring that the minimum x-coordinate is not less than the minimum x-coordinate of the canvas, and the maximum x-coordinate is not greater than the maximum x-coordinate of the canvas; the same applies to the y-coordinate. If the area of a partitioned region is zero after boundary clipping, the control terminal reverts the partitioned region to a preset default area and records a configuration anomaly. After region clipping, the control terminal binds the partitioned lighting effect frame sequence with the peripheral lighting device identifier, forming a partitioned lighting effect data set indexed by device. This partitioned lighting effect data set can be directly used as the sampling mapping input or cached in memory to reduce the computational overhead of subsequent repeated clipping. Through region clipping, the virtual canvas lighting effect frame sequence is stably decomposed into multiple partitioned lighting effect frame sequences, providing clear data boundaries for parallel mapping of multiple peripherals.
[0043] Sampling and mapping the partitioned lighting effect frame sequence based on the spatial position parameters of the light-emitting units includes: representing the spatial position parameters of the light-emitting units as the coordinate parameters of the light-emitting units in the device coordinate system; determining the coordinate transformation relationship between the device coordinate system and the virtual canvas rendering space based on the layout configuration parameters; and mapping the coordinate parameters of the light-emitting units to the virtual canvas rendering space based on the coordinate transformation relationship to obtain the coordinate parameters of the sampling points.
[0044] In one embodiment, the sampling mapping introduces a coordinate transformation relationship. Compared to simply aligning by array subscripts, the coordinate transformation relationship establishes a correspondence between the physical distribution of the light-emitting units and the virtual canvas rendering space, enabling peripheral lighting devices of different shapes to obtain colors from the same partition lighting effect frame sequence. The control terminal converts the spatial position parameters of the light-emitting units into coordinate parameters of the light-emitting units in the device coordinate system. The device coordinate system can have its origin at the top left corner of the peripheral lighting device or at its center. The coordinate parameters of the light-emitting units include at least horizontal and vertical coordinates, and establish a correspondence with the light-emitting unit number.
[0045] The control unit reads the boundary parameters of the partitioned areas of the peripheral lighting devices in the virtual canvas rendering space from the layout configuration parameters, and determines the coordinate transformation relationship between the device coordinate system and the virtual canvas rendering space accordingly. Coordinate transformation relationships can include translation, scaling, and rotation. Translation maps the origin of the device coordinate system to the reference point position of the partitioned area. Scaling matches the physical dimensions of the device with the dimensions of the partitioned area; when the distribution of the device's light-emitting units is inconsistent with the dimensions of the partitioned area, scaling maps the device coordinate range to the partitioned area coordinate range. Rotation handles situations where the placement angle of the peripheral lighting devices on the desktop is inconsistent with the definition of the virtual canvas rendering space.
[0046] The control unit maps the coordinate parameters of each luminous unit to the virtual canvas rendering space based on the coordinate transformation relationship, obtaining the sampling point coordinate parameters. These sampling point coordinate parameters indicate the sampling position within the zoned lighting effect frame sequence. To ensure the usability of the sampling point coordinate parameters, the control unit performs validity processing. This validity processing includes restricting the sampling point coordinates to within the zone boundaries and clipping or backtracking sampling points falling outside the boundaries to the nearest boundary point. If the external lighting device has multiple lighting zones, the control unit can establish different coordinate transformation relationships for different zones and obtain corresponding sets of sampling point coordinate parameters for each zone. After calculating the sampling point coordinate parameters, the control unit organizes them according to the luminous unit number order, forming a sampling point index sequence. This sampling point index sequence is used to maintain the consistency of the luminous unit order during subsequent interpolation sampling, avoiding misalignment between the color sequence and the luminous unit number.
[0047] The sampling and mapping of the partitioned lighting effect frame sequence based on the spatial location parameters of the light-emitting units also includes: determining the set of neighboring sampling points in the partitioned lighting effect frame sequence based on the coordinate parameters of the sampling points; performing weighted interpolation on the set of neighboring sampling points to obtain the color sequence of the sampling points; and assembling the color sequences of the sampling points into the target color sequence of the light-emitting units according to the order of the light-emitting unit numbers.
[0048] In one embodiment, the sampling mapping further employs neighborhood interpolation to form a continuously sampled color sequence. Compared to directly sampling the nearest color, neighborhood interpolation reduces jagged edges and jumps caused by inconsistencies between the resolution and luminous unit density of the partitioned lighting effect frame sequence, without introducing complex calculations beyond those required for conventional implementations. For each sampling point's coordinate parameters, the control unit determines a set of neighboring sampling points in each frame of the partitioned lighting effect frame sequence. The set of neighboring sampling points can be four grid points surrounding the sampling point's coordinate parameters, or it can be several grid points within a fixed radius.
[0049] The control unit performs weighted interpolation on the set of neighboring sampling points to obtain a color sequence of sampling points. The weights of the weighted interpolation are determined by the distance relationship between the coordinate parameters of the sampling points and the points in the neighboring sampling point set. For a four-point neighborhood, the weights can be determined by the decimal offsets in the horizontal and vertical directions; for a multi-point neighborhood, the weights can be obtained by inversely proportional to the distance and then normalized. The control unit calculates the color channels separately during the interpolation process to maintain the independence between the color channels. If the partition lighting effect frame sequence uses three-channel color, the interpolated output is the color of the three-channel sampling points; if the partition lighting effect frame sequence uses four-channel color, the transparency channel is processed simultaneously during interpolation, and the transparency is applied to the color channels before output to avoid ambiguity in the transparency channel on the subsequent device side. After the control unit completes the interpolation of the coordinate parameters of all sampling points, it obtains a set of sampling point color sequences that are consistent with the frame sequence number.
[0050] The control unit assembles the sampled point color sequences into a target color sequence for each light-emitting unit according to the unit numbering order. The k-th element of the target color sequence corresponds to the target color of the light-emitting unit with unit number k in that frame. To ensure that the target color sequence can be used for subsequent distribution, the control unit performs a range check on the target color sequence, truncating color values exceeding the device's supported range to the allowable range, and maintaining consistency in the truncation rule across all frames. If the light-emitting units of the external lighting device have grouping control requirements, the control unit can aggregate colors by group after generating the target color sequence and generate a grouped target color sequence. Through neighborhood interpolation and numbering order organization, the partitioned lighting effect frame sequence is stably converted into a target color sequence for light-emitting units that can be directly used by the external lighting device, and the color changes are continuous.
[0051] Generating the target color sequence of the light-emitting unit includes: obtaining the color correction parameters and brightness constraint parameters of the peripheral lighting device; performing color correction on the target color sequence of the light-emitting unit based on the color correction parameters; and limiting the brightness of the color-corrected target color sequence of the light-emitting unit based on the brightness constraint parameters.
[0052] In one embodiment, the target color sequence of the light-emitting unit undergoes further color correction and brightness limitation. Compared to directly outputting the interpolation result, color correction and brightness limitation incorporate optical differences and driving capability differences between devices into the constraints, preventing the same virtual canvas lighting effect from exhibiting obvious color shifts or overexposure on different peripheral lighting devices. The control terminal acquires the color correction parameters and brightness constraint parameters of the peripheral lighting devices.
[0053] Color correction parameters can be obtained from factory calibration or generated by the user after performing white balance calibration in the software. Brightness constraint parameters are used to limit the color amplitude corresponding to the maximum brightness or maximum current of the light-emitting unit. Brightness constraint parameters can be configured uniformly for the entire device or configured separately for each lamp area. The control unit performs color correction on the target color sequence of the light-emitting unit based on the color correction parameters. Color correction can be performed using a lookup table or a channel gain method. The lookup table method establishes an input-to-output mapping table for each color channel, and the control unit replaces each color value according to the mapping table. The channel gain method configures a gain coefficient for each color channel, and the control unit multiplies each color channel by the corresponding gain and truncates it to the effective range.
[0054] If the external lighting equipment exhibits a significant nonlinear brightness response, the control unit can add a gamma correction step after color correction. Gamma correction can be implemented using a pre-calculated lookup table to reduce the real-time computational burden. After completing color correction, the control unit limits the brightness of the target color sequence of the color-corrected emitting units based on brightness constraint parameters. Brightness limiting can be achieved using a maximum channel truncation method, limiting each channel to its maximum allowable value; or it can be achieved using an overall scaling method, where when the combined brightness of the three channels exceeds the threshold, the three channels are scaled proportionally to prevent significant hue shift.
[0055] To avoid abrupt changes between frames caused by brightness limiting, the control unit can smooth the target color sequence of the light-emitting units after brightness limiting. Smoothing can be achieved using differential limiting between adjacent frames; when the brightness change between two adjacent frames exceeds a preset limit, the change is limited to a preset range. After completing color correction and brightness limiting, the control unit outputs the final target color sequence of the light-emitting units. This final target color sequence is associated with the peripheral lighting device identifier, facilitating the encapsulation and transmission of control commands separately for each device during subsequent generation. Through color correction and brightness limiting, the target color sequence of the light-emitting units can be stably executed within the device's capabilities, maintaining visual consistency across multiple peripherals driven by the same lighting effect generation parameters.
[0056] Control commands for peripheral lighting devices are generated based on the target color sequence of the light-emitting unit and sent to each peripheral lighting device.
[0057] In one embodiment, after obtaining the target color sequence of the light-emitting unit corresponding to each peripheral lighting device, the control terminal generates peripheral lighting device control commands based on the communication interface and command format of the peripheral lighting devices, and sends the peripheral lighting device control commands to each peripheral lighting device. The peripheral lighting device control commands carry the target color information of the light-emitting unit in the current frame, enabling the peripheral lighting devices to update the output state of the light-emitting unit frame by frame. The control terminal can maintain a separate sending queue for each peripheral lighting device, ensuring that multiple peripheral lighting devices proceed in parallel at the same output rhythm. After receiving the peripheral lighting device control commands, the peripheral lighting devices write the color data in the control commands into the light-emitting unit driver buffer, and synchronously update the light-emitting unit output when the driver refresh cycle arrives, achieving continuous display of lighting effects frame by frame. During the transmission process, the control terminal keeps the frame sequence number incremented, and performs retransmission or frame skipping processing when communication congestion or transmission failure occurs, to ensure continuous system output without prolonged stagnation.
[0058] Generating and sending control commands for peripheral lighting devices based on the target color sequence of the light-emitting unit includes: assigning a frame sequence number parameter to the target color sequence of the light-emitting unit; encapsulating the frame sequence number parameter and the target color sequence of the light-emitting unit into a control command frame; sending the control command frame, and sending the next control command frame upon receiving a confirmation message.
[0059] In one embodiment, the peripheral lighting device control command includes a frame sequence number parameter to establish frame-by-frame consistency between the control terminal and the peripheral lighting device. Compared to simply sending color data, the frame sequence number parameter enables the peripheral lighting device to identify dropped, out-of-order, and duplicate frames, thus maintaining the correct order of the lighting effect sequence even when communication jitter exists. The control terminal assigns the frame sequence number parameter to the target color sequence of the light-emitting units. The frame sequence number parameter can increment from zero, or it can generate an initial value based on the start time of the lighting effect and increment it.
[0060] The control unit encapsulates the frame sequence number parameter and the target color sequence of the light-emitting units into a control command frame. The control command frame includes at least a frame header, an external lighting device identifier, a frame sequence number parameter, and a color data segment. The frame header indicates the command type and data length, the external lighting device identifier indicates the target device of the control command frame, and the color data segment carries the target color value in the order of the light-emitting unit numbers. To ensure feasibility, the control unit performs a length check on the target color sequence of the light-emitting units before encapsulation. The length check includes whether the number of elements in the target color sequence of the light-emitting units matches the number of light-emitting units in the external lighting device; if they do not match, the control unit supplements or truncates the sequence according to preset rules and records a configuration anomaly.
[0061] The control unit sends a control command frame and waits for a confirmation message from the external lighting device. The confirmation message includes at least the external lighting device identifier and the received frame sequence number, indicating that the external lighting device has received the corresponding control command frame. Upon receiving the confirmation message, the control unit sends the next control command frame to maintain sequential frame delivery. To ensure real-time performance, the control unit can set a timeout for the confirmation message. If the timeout expires and no confirmation message is received, the control unit retransmits the corresponding frame, or skips the frame after reaching the maximum number of retransmissions and continues sending subsequent frames to avoid single-frame blocking causing overall lighting effect interruptions.
[0062] After receiving a control command frame, the peripheral lighting device can check the continuity of the frame sequence number parameter. When the frame sequence number parameter is not continuous, the peripheral lighting device can choose to discard the old frame, request a retransmission, or directly apply the latest frame to maintain continuous lighting effects. Through the frame sequence number parameter, control command frame encapsulation, and transmission confirmation mechanism, a stable frame-by-frame transmission closed loop is formed between the control terminal and the peripheral lighting device, ensuring that the target color sequence of the light-emitting unit can be received and executed by the peripheral lighting device in a verifiable order.
[0063] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects.
[0064] The above are merely embodiments of the present invention and are not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.
Claims
1. A method for controlling asynchronous lighting effects of multiple peripherals based on virtual canvas partitioning, characterized in that, The method includes: Obtain the spatial position parameters and layout configuration parameters of the light-emitting units of at least two peripheral lighting devices, establish a virtual canvas rendering space based on the layout configuration parameters, determine the partition area of each peripheral lighting device in the virtual canvas rendering space, and generate a partition mapping relationship. Receive lighting effect generation parameters, generate a virtual canvas lighting effect frame sequence in the virtual canvas rendering space based on the lighting effect generation parameters, extract a partition lighting effect frame sequence from the virtual canvas lighting effect frame sequence for each peripheral lighting device based on the partition mapping relationship, and sample and map the partition lighting effect frame sequence based on the spatial position parameters of the light-emitting unit to generate a target color sequence for the light-emitting unit. Control commands for peripheral lighting devices are generated based on the target color sequence of the light-emitting unit and sent to each of the peripheral lighting devices.
2. The method according to claim 1, characterized in that, The layout configuration parameters include canvas size parameters and canvas coordinate origin parameters. Establishing the virtual canvas rendering space based on the layout configuration parameters includes: A two-dimensional coordinate system is established based on the canvas size parameters and the canvas coordinate origin parameters. The two-dimensional coordinate system is used to represent the virtual canvas rendering space.
3. The method according to claim 2, characterized in that, The layout configuration parameters include partition area position parameters and partition area size parameters. The partition area position parameters and partition area size parameters are used to determine the partition area boundary parameters of each peripheral lighting device in the virtual canvas rendering space. The partition area boundary parameters are used to indicate the position range of the partition area in the virtual canvas rendering space.
4. The method according to claim 3, characterized in that, Generating the partition mapping relationship includes: Generate a peripheral lighting device identifier for each of the aforementioned peripheral lighting devices; Establish a correspondence between the peripheral lighting device identifier and the boundary parameters of the partition area, wherein the partition mapping relationship includes the correspondence.
5. The method according to claim 1, characterized in that, Generating the virtual canvas lighting effect frame sequence in the virtual canvas rendering space based on the lighting effect generation parameters includes: Generate at least one layer of lighting effect frame sequence based on the lighting effect generation parameters; The virtual canvas lighting effect frame sequence is obtained by synthesizing at least one of the layer lighting effect frame sequences.
6. The method according to claim 4, characterized in that, Extracting the partition lighting effect frame sequence from the virtual canvas lighting effect frame sequence based on the partition mapping relationship includes: The virtual canvas lighting effect frame sequence is truncated according to the boundary parameters of the partitioned region to obtain the partitioned lighting effect frame sequence.
7. The method according to claim 1, characterized in that, Sampling and mapping the partitioned lighting effect frame sequence based on the spatial location parameters of the light-emitting units includes: The spatial position parameters of the light-emitting unit are expressed as the coordinate parameters of the light-emitting unit in the device coordinate system; The coordinate transformation relationship between the device coordinate system and the virtual canvas rendering space is determined based on the layout configuration parameters. Based on the coordinate transformation relationship, the coordinate parameters of the light-emitting unit are mapped to the virtual canvas rendering space to obtain the coordinate parameters of the sampling point.
8. The method according to claim 7, characterized in that, The sampling and mapping of the partitioned lighting effect frame sequence based on the spatial location parameters of the light-emitting units also includes: Based on the coordinate parameters of the sampling points, a set of neighboring sampling points is determined in the partition lighting effect frame sequence; Weighted interpolation is performed on the neighborhood sampling point set to obtain the sampling point color sequence; The color sequences of the sampling points are arranged in the order of the light-emitting unit numbers to form the target color sequence of the light-emitting unit.
9. The method according to claim 1, characterized in that, Generating the target color sequence of the light-emitting unit includes: Obtain the color correction parameters and brightness constraint parameters of the peripheral lighting device; The target color sequence of the light-emitting unit is color-corrected based on the color correction parameters; The brightness of the target color sequence of the light-emitting unit after color correction is limited based on the brightness constraint parameters.
10. The method according to claim 1, characterized in that, Generating control commands for the peripheral lighting devices based on the target color sequence of the light-emitting units and sending them to each peripheral lighting device includes: Assign a frame number parameter to the target color sequence of the light-emitting unit; The frame sequence number parameter and the target color sequence of the light-emitting unit are encapsulated into a control command frame; The control command frame is sent, and upon receiving a confirmation message, the next control command frame is sent.