A method, device and medium for driving a split indicator light

By introducing a lighting effect state machine into the camera device to uniformly acquire and determine the state, the problem of inconsistent display of indicator lights under multiple main control units of the camera device is solved, and a unified display effect of state switching and intermediate color synthesis is achieved.

CN123056252APending Publication Date: 2026-11-06SHENZHEN EMEET TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611488163.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-23
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

In the prior art, the indicator lights of the camera equipment are connected to multiple main control units, which leads to inconsistent display during state switching, multi-state arbitration, and intermediate color synthesis.

Method used

By introducing a lighting effect state machine into the camera equipment, the working status data is uniformly acquired and the current state is determined. The target working parameters of each light-emitting unit are centrally determined and the target working parameters are assigned according to physical affiliation, ensuring that each light-emitting unit maintains consistent display during state switching, multi-state arbitration, and intermediate color synthesis.

Benefits of technology

This avoids asynchronous state switching and inconsistent display colors caused by different arrival times of the main control unit's state data. It solves the problem of inconsistent display of light-emitting units connected to multiple main control units in the existing technology, and realizes unified display of each light-emitting unit during state switching, multi-state arbitration and intermediate color synthesis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123056252A_ABST
    Figure CN123056252A_ABST
Patent Text Reader

Abstract

This invention discloses a method, device, and medium for driving indicator lights in a split configuration, relating to the field of lighting driving technology. The method is applied to a camera device, which includes multiple main control units and multiple light-emitting units connected to them. Each main control unit is connected to at least one light-emitting unit, and the first main control unit is communicatively connected to the other main control units. Specifically, the method is applied to the first main control unit: determining the target operating parameters of each light-emitting unit by acquiring the camera device's operating status data; obtaining the physical affiliation of each light-emitting unit and assigning them to other units according to their affiliation, thus obtaining the first target operating parameters of the first main control unit and the second target operating parameters of the other main control units; driving the light-emitting unit based on the first target operating parameters; and constructing lighting effect commands based on the second target operating parameters and sending them to the other main control units to drive their respective light-emitting units. This invention allows the first main control unit to make unified decisions and assignments, ensuring consistent display across the light-emitting units under each main control unit's jurisdiction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of lamp driving technology, and in particular to a method, device and medium for driving indicator lights separately. Background Technology

[0002] Indicator lights on camera equipment typically consist of multiple light-emitting units to indicate various operating states, such as initialization, normal streaming, human tracking, privacy masking, firmware upgrade, unauthorized access, and malfunction. Different states are distinguished by different colors and flashing rhythms. A common approach is to have multiple main control units within the device, each with its own function: one handles the external host interface and image path, while another handles visual detection and status determination. The light-emitting units of each street light are connected to the pins of different main control units according to hardware layout, wiring length, and pin margin.

[0003] In existing technologies, multiple master control units independently implement their own lighting effect logic and maintain the correspondence between states and lighting effect parameters. Each master control unit independently determines the display mode of its subordinate light-emitting units based solely on the state data acquired at its own end. Since the state data of each master control unit comes from different channels and arrives at different times, at the same time, one master control unit may have switched to a new state while another remains in the old state, resulting in light-emitting units belonging to different master control units displaying colors corresponding to different states. Furthermore, when multiple states are simultaneously established, each master control unit performs state arbitration. Due to different arbitration criteria or arbitration times, different arbitration conclusions may be reached, causing inconsistencies in the states displayed by light-emitting units under different master control units. In addition, when an intermediate color needs to be displayed, light-emitting units belonging to different master control units need to be lit simultaneously according to a preset brightness ratio. However, each master control unit performs brightness conversion and rounding separately. Due to different rounding methods or benchmarks, the actual brightness ratio deviates from the preset brightness ratio, causing the synthesized color to deviate from the expected value. Therefore, existing technologies cannot guarantee that light-emitting units connected to multiple main control units will display consistently during state switching, multi-state arbitration, and intermediate color synthesis. Summary of the Invention

[0004] This invention provides a method, device, and medium for driving indicator lights separately. The technical problem it aims to solve is: how to ensure consistent display of each light-emitting unit during state switching, multi-state arbitration, and intermediate color synthesis when the light-emitting unit is connected to multiple main control units.

[0005] In a first aspect, the present invention provides a method for driving a split indicator light. A camera device includes multiple main control units and indicator lights. The indicator lights include multiple light-emitting units, which are connected to the multiple main control units. Each main control unit is connected to at least one light-emitting unit. The multiple main control units include a first main control unit and at least one other main control unit. The first main control unit is communicatively connected to the other main control units. The method is applied to the first main control unit, and the method includes: Acquire the working status data of the camera device, and determine the current status of the camera device based on the working status data; Determine the target operating parameters for each light-emitting unit based on the current state; Obtain the physical affiliation of each light-emitting unit, and assign the target operating parameters one by one according to the physical affiliation to obtain the first target operating parameters belonging to the first main control unit and the second target operating parameters belonging to the other main control units; The light-emitting units belonging to the first main control unit are driven based on the first target operating parameters; Based on the second target operating parameters, a lighting effect command is constructed and sent to the other master control units so that the other master control units drive the light-emitting units belonging to the other master control units based on the second target operating parameters.

[0006] Optionally, acquiring the operating status data of the camera device includes: Receive setting instructions from the host computer, detection results from the first main control unit, and operating status reported by the other main control units; The setting instructions, the detection results, and the operating status are determined as the working status data of the camera device.

[0007] Optionally, determining the current state of the camera device based on the operating state data includes: Based on the work status data, determine the currently established work status; If there are multiple currently established work states, obtain the priority of each work state among the currently established work states, and determine the work state with the highest priority as the current state; If the number of currently established working states is one, then the currently established working state is determined as the current state.

[0008] Optionally, determining the target operating parameters of each light-emitting unit based on the current state includes: If the current state is a constant-on state, the current state is used as an index to query a preset correspondence table, and the brightness value of each light-emitting unit corresponding to the current state is read from the correspondence table as the target working parameter. If the current state is a flashing state, obtain the current flashing beat, use the current state and the current flashing beat as indexes to query a preset correspondence table, and read the brightness value corresponding to each light-emitting unit corresponding to the current state from the correspondence table as the target working parameter.

[0009] Optionally, constructing the lighting effect command based on the second target working parameters includes: Obtain the second light-emitting unit serial number and indicator light group identifier corresponding to the second target working parameters. The indicator light group identifier is used to distinguish multiple groups of indicator lights driven by the same main control unit. The second target operating parameter is encoded as a single-byte brightness field, where a zero value in the single-byte brightness field indicates that the light is off; a non-zero value in the single-byte brightness field indicates that the light is on in the switch-driven mode, and serves as the duty cycle in the dimming-driven mode. Determine the unified effective date; The indicator group identifier, the second light-emitting unit serial number, the single-byte brightness field, and the unified effective time are encapsulated into the lighting effect command; Alternatively, the indicator group identifier, the second light-emitting unit serial number, the single-byte brightness field, and the preset relative delay can be encapsulated into the lighting effect command. The relative delay is used to instruct the other main control units to execute the lighting effect command after the relative delay has elapsed from the moment the lighting effect command is received and interrupted.

[0010] Optionally, determining the unified effective time includes: Obtain the command length of the lighting effect command and the communication rate of the communication connection, and estimate the transmission time of the lighting effect command based on the command length and the communication rate; Take a value that is not less than the transmission duration as the lead time; The unified effective time is obtained by adding the advance amount to the current time base of the first master control unit; The first main control unit delays the driving action of the first target working parameter until the unified effective time, and the lighting effect command instructs the other main control units to delay the driving action of the second target working parameter until the unified effective time.

[0011] Optionally, if the display color corresponding to the current state is an intermediate color synthesized by at least two light-emitting units belonging to different main control units simultaneously lighting up, then determining the target operating parameters of each light-emitting unit based on the current state includes: the first main control unit determining the target operating parameters of each light-emitting unit participating in the synthesis according to the brightness ratio corresponding to the intermediate color; the first main control unit and the other main control units each drive their own light-emitting units only according to the assigned target operating parameters, and the other main control units do not perform brightness ratio conversion.

[0012] Optionally, the lighting effect command is a state-based idempotent command; sending the lighting effect command to the other master control units includes: While the current state is maintained, the lighting effect command is repeatedly sent to the other main control units based on a preset retransmission cycle.

[0013] Optionally, the method further includes: Periodically send communication messages to the other master control units, the communication messages carrying the time base count value of the first master control unit; The other master control unit is used to record its local count value during the interruption of the transmission of the time synchronization message; determine the time base offset of the other master control unit relative to the first master control unit based on the time base count value, half the transmission duration of the transmission of the time synchronization message and the local count value of the other master control unit; and correct the local time base of the other master control unit according to the time base offset so that the alignment residual is less than the advance amount.

[0014] Secondly, the present invention also provides a camera device, including multiple main control units and indicator lights. The indicator lights include multiple light-emitting units, which are connected to the multiple main control units, and each main control unit is connected to at least one light-emitting unit. The multiple main control units include a first main control unit and at least one other main control unit, wherein the first main control unit is communicatively connected to the other main control units. The first main control unit is configured to execute the above-described method, and the other main control units are configured to receive the lighting effect command and drive the light-emitting units belonging to the other main control units based on the second target operating parameters therein.

[0015] Thirdly, the present invention also provides a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method.

[0016] Fourthly, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, can implement the above-described method.

[0017] This invention provides a method, device, and medium for driving separate indicator lights, applicable to camera equipment. The camera equipment's multi-channel light-emitting units are connected to multiple main control units. A first main control unit acquires the camera equipment's operating status data and determines the current state based on this data; other main control units do not participate in determining the current state. In this way, the current state is centrally determined by the first main control unit, avoiding discrepancies in the current state determined by multiple main control units due to different judgment criteria or timing.

[0018] After determining the current state, the first master control unit determines the target operating parameters for each light-emitting unit based on the current state; other master control units do not participate in the determination of target operating parameters. Subsequently, the first master control unit obtains the physical affiliation of each light-emitting unit and assigns the target operating parameters to each unit according to the physical affiliation, resulting in the first target operating parameters belonging to the first master control unit and the second target operating parameters belonging to other master control units. This assignment only applies to the same set of target operating parameters that have already been determined, and the assignment result is independent of the pin affiliation of the light-emitting unit.

[0019] During operation, the first master control unit drives the light-emitting units belonging to it based on the first target operating parameters, and constructs lighting effect commands based on the second target operating parameters, sending them to other master control units. Other master control units drive the light-emitting units belonging to them based on the second target operating parameters. Thus, each light-emitting unit connected to different master control units executes the drive based on the same current state and the same set of target operating parameters. Therefore, this invention avoids asynchronous state switching and inconsistent display colors caused by different arrival times of state data from different master control units, avoids inconsistent arbitration conclusions caused by different master control units arbitrating multiple simultaneously established states, and avoids deviations in the synthesized color from the expected result caused by different master control units performing intermediate color brightness conversion and rounding. Therefore, when light-emitting units are connected to multiple master control units, each light-emitting unit maintains consistent display during state switching, multi-state arbitration, and intermediate color synthesis, solving the problem of inconsistent display of light-emitting units connected to multiple master control units in the prior art. Attached Figure Description

[0020] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a structural block diagram of a camera device provided in an embodiment of the present invention; Figure 2A flowchart illustrating a split-type indicator light driving method provided in an embodiment of the present invention; Figure 3 This is a schematic block diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0023] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0024] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0025] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0026] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [the described condition or event] is detected," or "in response to detection of [the described condition or event]."

[0027] Please see Figure 1 The present invention proposes a camera device, which includes multiple main control units and indicator lights. The indicator lights include multiple light-emitting units, which are connected to multiple main control units. Each main control unit is connected to at least one light-emitting unit. The multiple main control units include a first main control unit and at least one other main control unit, and the first main control unit is communicatively connected to the other main control units.

[0028] In specific implementation, the camera equipment includes multiple main control units and indicator lights. Multiple main control units refer to controllers located inside the camera equipment, each undertaking different data processing and control tasks. The number of main control units can be two, three, or more; this invention is not specifically limited. Multiple main control units include a first main control unit and at least one other main control unit. The first main control unit can undertake tasks such as visual detection and state determination, while other main control units can undertake tasks such as external host interface and image path. The lighting effect state machine is located within the first main control unit responsible for state determination, enabling it to directly grasp the most state quantities; alternatively, the lighting effect state machine can be located within the main control unit responsible for the host interface, the selection based on which side grasps more state quantities, which is unrelated to the allocation mechanism of this invention. Furthermore, the first main control unit is communicatively connected to other main control units; the communication connection can be a serial port, bus, or other link capable of enabling data interaction between main control units.

[0029] Furthermore, the indicator lights are used to indicate the working status of the camera device, such as initialization, normal streaming, portrait tracking, privacy masking, firmware upgrade, unauthorized access, and malfunction, etc., which are not specifically limited in this invention. The indicator lights include multiple light-emitting units. Each light-emitting unit can emit a different color, and the colors of each light-emitting unit are different from each other. The multiple light-emitting units are connected to the pins of multiple main control units according to the hardware layout; that is, not all light-emitting units are connected to the same main control unit. Instead, based on factors such as printed circuit board layout, trace length, power partitioning, and pin margin, different light-emitting units are connected to different main control units. Each main control unit is connected to at least one light-emitting unit, so that each main control unit can directly drive the light-emitting unit it is connected to. The light emitted from the multiple light-emitting units can be mixed through the same light guide. When two light-emitting units belonging to different main control units are lit simultaneously, the human eye sees an intermediate color synthesized from the two colors according to their brightness ratio. The specific number of multiple main control units, the functions undertaken by each main control unit, the number of light-emitting units and the color combination can all be set according to actual needs, as long as multiple light-emitting units are connected to multiple main control units, each main control unit is connected to at least one light-emitting unit, and the first main control unit communicates with other main control units. This invention does not specifically limit this.

[0030] Please see Figure 2 This invention provides a method for driving indicator lights in separate units, applied to the first main control unit of the aforementioned camera device. This embodiment involves the first main control unit uniformly acquiring working status data and determining the current state, then uniformly determining the target working parameters for each light-emitting unit. Finally, the target working parameters are assigned to the local direct drive path and the inter-machine command distribution path according to physical affiliation, ensuring that the outputs of light-emitting units belonging to multiple main control units originate from the same source. This guarantees consistent display across all light-emitting units during state switching, multi-state arbitration, and intermediate color synthesis. Specifically, the method includes the following steps: S1, acquire the working status data of the camera equipment, and determine the current status of the camera equipment based on the working status data.

[0031] In specific implementation, a lighting effect state machine is set up within the first main control unit. The lighting effect state machine is a functional unit located within the first main control unit, and can be implemented by software programs, hardware logic, or a combination of both; this invention does not specifically limit its implementation. The lighting effect state machine is used to collect the working status of the camera equipment, arbitrate the current status, determine the target working parameters for each light-emitting unit, and assign the target working parameters according to physical affiliation.

[0032] The lighting effect state machine acquires the operating status data of the camera equipment. This operating status data describes the current working condition of the camera equipment and can include various status information generated during operation. The sources of this data can be diverse, such as setting commands issued by the host computer, detection results from the first main control unit itself, and operating status reports from other main control units; this invention does not specifically limit these sources. The data can be acquired through active querying, passive reception, or periodic collection. The lighting effect state machine aggregates this status information and uses it as the basis for determining the current state.

[0033] Furthermore, the lighting effect state machine determines the current state of the camera device based on the working state data. The current state represents the working state that the camera device should currently display, such as initialization, ready, portrait tracking, privacy masking, firmware upgrade, unauthorized, or faulty, etc., which are not specifically limited in this invention. The lighting effect state machine can determine a current state from one or more working states represented by the working state data according to preset judgment rules. The judgment rules can be priority rules, time sequence rules, or other rules that can uniquely determine the current state, which are not specifically limited in this invention. After the current state is determined, it serves as an index or basis for subsequently determining the target working parameters of each light-emitting unit.

[0034] In some preferred embodiments, acquiring the working status data of the camera device includes: receiving setting instructions from the host computer, detection results from the first main control unit, and operating status reported by other main control units; and determining the setting instructions, detection results, and operating status as the working status data of the camera device.

[0035] In practice, the operating status of the camera equipment comes from various sources, including operation commands from an external host computer, visual detection and status judgment results from the first main control unit itself, and operational status such as image paths reported by other main control units. Relying on only a single source to determine the operating status may not fully reflect the actual operating status of the equipment, leading to discrepancies between indicator light displays and the actual status. Therefore, this embodiment uses a lighting effect state machine to jointly determine the operating status data from host computer setting commands, the detection results of the first main control unit, and the operational status reported by other main control units. This ensures comprehensive data sources for accurate subsequent determination of the current status. The specific implementation method is as follows: The lighting effect state machine receives setting commands from the host computer. The host computer is an external control device for the camera equipment, such as a personal computer, mobile terminal, remote management platform, or video conferencing control terminal connected to the camera equipment. Setting commands are operation commands triggered by the user through the human-machine interface of the host computer, such as turning privacy masking on or off, starting or canceling firmware upgrades, switching working modes, and adjusting portrait tracking parameters. Setting commands reach other main control units via the host interface between the host computer and other main control units that handle external host interfaces. They are then forwarded to the first main control unit via the communication connection between the first main control unit and other main control units, and finally received by the lighting effect state machine.

[0036] Furthermore, the lighting effect state machine receives the detection results from the first main control unit. The first main control unit performs tasks such as visual detection and state determination. The detection results include the human tracking detection results and authorization verification results obtained by the first main control unit itself. The first main control unit can also monitor frame synchronization of the image link sent to its local end. If the frame interval exceeds a set time (e.g., 200 ms without frames indicates a pause), or if the line and field synchronization counts continuously exceed a set number of times, an image path anomaly conclusion is generated and included as part of the detection results. All of the above determinations are independent of image content and data format. The lighting effect state machine receives the detection results.

[0037] The lighting effect state machine receives operational status reports from other master control units. These other master control units handle tasks such as external host interfaces and image paths, and can perform self-checks on their respective image paths. Image path anomalies are determined by hard indicators at the link and timing levels, rather than by image content or data format. For example, other master control units monitor the status registers of the acquisition and encoding pipeline. If a status register malfunctions, frame counting stalls within a set time, or communication with the image sensor's control interface fails, an image path anomaly conclusion is generated. Other master control units can also report operational status such as firmware upgrade progress. These operational statuses are identified by command codes, carrying judgment conclusions rather than image data. They are reported to the first master control unit via the communication connection between the first master control unit and other master control units, and received by the lighting effect state machine; other master control units do not directly convert operational status into lighting effects on their own end.

[0038] Furthermore, the lighting effect state machine determines the setting instructions, detection results, and operating status as the working status data of the camera device. The working status data can be a set containing one or more of the three sources mentioned above. The lighting effect state machine can use the setting instructions, detection results, and operating status as individual data items in the working status data, or it can combine them into a single data set. Once the working status data is determined, it serves as the input data for the lighting effect state machine to determine the current state based on the working status data. In subsequent steps, the lighting effect state machine determines the currently established working state based on the working status data and performs priority arbitration or determines the current state according to other rules. The update frequencies of the three sources can differ; the lighting effect state machine re-determines the current state each time it receives an update, thereby ensuring the real-time nature of the state determination.

[0039] This embodiment uses a lighting effect state machine to receive setting instructions from the host computer, detection results from the first main control unit, and operational status reports from other main control units. These three sources are uniformly identified as operational status data, ensuring comprehensive and complete data coverage. Since the operational status of other main control units is reported to the lighting effect state machine of the first main control unit via communication, the lighting effect state machine can grasp the operational status of the entire device, avoiding inconsistencies caused by other main control units independently determining the lighting effect. Image path anomalies are determined using hard indicators at the link and timing levels, independent of image content and data format, ensuring reliable results. The three data sources have different update frequencies; the lighting effect state machine re-determines the current status upon receiving each update, guaranteeing real-time and accurate status determination. By jointly identifying the three sources as operational status data, the lighting effect state machine allows subsequent current status determinations to comprehensively consider external operations, local detection, and inter-machine detection information, avoiding misjudgments caused by incomplete information from a single source.

[0040] In some preferred embodiments, determining the current state of the camera device based on the working state data includes: determining the currently established working state according to the working state data; if there are multiple currently established working states, obtaining the priority of each working state among the currently established working states, and determining the working state with the highest priority as the current state; if there is only one currently established working state, determining the currently established working state as the current state.

[0041] In practice, multiple operating states may occur simultaneously during the operation of the camera equipment. For example, the device may be undergoing a firmware upgrade while an image path fault is detected; or the user may have enabled privacy masking while a human tracking target is detected. If multiple simultaneously occurring operating states are not uniformly arbitrated, and instead different main control units decide which state to display, inconsistencies may arise, with one end displaying "upgrading" and the other "fault." Therefore, this embodiment uniformly determines the currently occurring operating state and selects the current state from multiple operating states based on priority, ensuring that when multiple states are simultaneously occurring, the displayed conclusion is unique and definite. The specific implementation method is as follows: The lighting effect state machine determines the currently established working state based on the working state data. The working state data contains one or more state identifiers, each corresponding to a working state. The lighting effect state machine parses the working state data and extracts all currently established working states. A currently established working state refers to a working state that is indeed in a valid state based on the state information represented by the working state data. For example, if the working state data contains both "Firmware Upgrade in Progress" and "Fault Detected" status identifiers, then the lighting effect state machine determines that the currently established working states include both "Firmware Upgrade in Progress" and "Fault Detected".

[0042] Furthermore, the lighting effect state machine determines the number of currently established working states. The lighting effect state machine can count the currently established working states to obtain a quantity value. If there are multiple currently established working states, the lighting effect state machine obtains the priority of each working state. Further, the priority is a pre-configured value for each working state; a higher value indicates a higher priority. Priorities can be determined based on the importance, urgency, or impact on user experience of the working state. For example, fault and upgrade states can be configured as high priority, while human tracking and initialization states can be configured as low priority. The lighting effect state machine compares the priorities of multiple working states and determines the working state with the highest priority as the current state. If there is only one currently established working state, the lighting effect state machine directly determines the currently established working state as the current state.

[0043] Furthermore, in one optional implementation, each working state can also be configured with an overridable flag. The overridable flag indicates whether the working state can be overridden by a higher-priority working state. For working states that can be overridden, the working state can automatically revert to its current state after the higher-priority working state ends. For working states that cannot be overridden, the new state can only be updated after its own termination condition is met. For example, the portrait following state can be overridden by the firmware upgrade state; when the firmware upgrade ends, the portrait following state automatically reverts to its current state. However, the fault state cannot be overridden and must wait for the fault to be resolved before updating the current state. The overridable flag, together with priority, provides clear rules for switching and resuming between working states.

[0044] This embodiment uses a lighting effect state machine to uniformly determine the currently established working state, and selects the current state from multiple working states based on priority, ensuring that when multiple working states are simultaneously established, the displayed conclusion is unique and definite. Since arbitration is only performed once within the lighting effect state machine, other main control units do not participate in arbitration, avoiding inconsistencies caused by multiple main control units arbitrating independently. Priority configuration clearly defines the display order between different working states, with higher priority states displayed first, ensuring that critical states such as faults and upgrades can be promptly perceived by the user. An overridable flag allows lower priority states to automatically recover after a higher priority state ends, while an unoverridable flag requires critical states such as faults to wait for their termination conditions to be met.

[0045] S2, determine the target operating parameters of each light-emitting unit based on the current state.

[0046] In specific implementation, the lighting effect state machine determines the target operating parameters for each light-emitting unit based on the current state. The target operating parameters represent the operating parameters that the light-emitting unit should achieve in the current state, such as brightness value, duty cycle, or other parameters that can represent luminous intensity. The target operating parameters can be zero or non-zero; zero indicates that the light-emitting unit should be off in the current state, and non-zero indicates that the light-emitting unit should be on and have the corresponding luminous intensity. The lighting effect state machine can determine the target operating parameters corresponding to each light-emitting unit according to a preset mapping relationship based on the current state. The mapping relationship can be pre-stored in the storage unit of the first main control unit. The mapping relationship can be in the form of a table, function, array, or other data structure that can realize the conversion from state to target operating parameters; this invention does not specifically limit this. Each light-emitting unit corresponds to one target operating parameter in the current state.

[0047] In some preferred embodiments, determining the target operating parameters for each light-emitting unit based on the current state includes: if the current state is a constant-on state, using the current state as an index, querying a preset correspondence table, and reading the brightness value corresponding to each light-emitting unit corresponding to the current state from the correspondence table as the target operating parameter; if the current state is a flashing state, obtaining the current flashing beat, using the current state and the current flashing beat as indexes, querying a preset correspondence table, and reading the brightness value corresponding to each light-emitting unit corresponding to the current state from the correspondence table as the target operating parameter.

[0048] In practical implementation, the lighting effects in the indicator light driver of the camera equipment vary depending on the operating state. Some operating states require each light-emitting unit to maintain a constant brightness, such as a solid green light in the ready state and a solid red light in the privacy-masked state; other operating states require each light-emitting unit to alternately light up and off according to a rhythm, such as a flashing blue light in the initialization state and a flashing yellow light in the firmware upgrade state. If the solid light and flashing states are not handled separately, it is impossible to accurately determine the brightness value that each light-emitting unit should reach at the current moment. Therefore, this embodiment distinguishes between solid light and flashing states through a lighting effect state machine and uses different lookup table indexing methods for each, making the determination of the target operating parameters accurate and efficient. The specific implementation method is as follows: The lighting effect state machine determines whether the current state is a constant-on or flashing state. A constant-on state means that all light-emitting units maintain a constant brightness. A flashing state means that the light-emitting units alternately turn on and off in a rhythmic pattern. The lighting effect state machine can make this determination based on the current state's state identifier or state attribute; for example, the current state's corresponding working state is marked as constant-on or flashing in a preset correspondence table.

[0049] Furthermore, if the current state is a constant-on state, the lighting effect state machine uses the current state as an index to query a preset correspondence table. This table stores the correspondence between multiple working states and the target working parameters of each light-emitting unit. Each row in the table corresponds to a working state, and each column corresponds to a light-emitting unit; the values ​​in the table represent the brightness values ​​that light-emitting unit should have in that state. The lighting effect state machine reads the brightness value of each light-emitting unit corresponding to the current state from the correspondence table and uses this brightness value as the target working parameter. The correspondence table can be pre-stored in the storage unit of the first main control unit, and its form can be a two-dimensional array, a lookup table, or a database table. This correspondence table is unique across the entire device; when adding a new working state, only this table needs to be modified, without involving modifications to the firmware of other main control units.

[0050] Furthermore, if the current state is a flashing state, the lighting effect state machine obtains the current flashing beat. The current flashing beat indicates which stage is currently in, such as the appearance stage or the phase-off stage. It should be noted that for flashing states, the appearance stage and the phase-off stage alternate according to a preset flashing period. The flashing period can be pre-configured, for example, configured as 200ms, with a preferred range of 100ms to 1000ms. The flashing period can be determined based on the range of flashing that the human eye can distinguish, and this invention does not specifically limit this. If the flashing period is too short, the human eye may not be able to distinguish the change between light and dark; if the flashing period is too long, the flashing effect is not obvious.

[0051] Furthermore, after each flashing cycle, the lighting effect state machine uses the current state and the current flashing beat as indexes to query a preset correspondence table. In the correspondence table, flashing states correspond to two rows: the appearance row and the phase-off row. The current flashing beat determines which row to select. The lighting effect state machine reads the brightness value of each light-emitting unit corresponding to the current state from the correspondence table and uses this brightness value as the target operating parameter. For example, when the current flashing beat is the appearance stage, it reads the brightness values ​​of each light-emitting unit in the appearance row; when the current flashing beat is the phase-off stage, it reads the brightness values ​​of each light-emitting unit in the phase-off row. Flashing lighting effects occupy two rows in the correspondence table: appearance and phase-off, and the lighting effect state machine switches between the two rows according to the beat.

[0052] Furthermore, once the target operating parameters are determined, they serve as input for subsequent path-by-path assignment based on physical affiliation. The target operating parameters can be zero or non-zero. Zero indicates that the light-emitting unit in that path should be off in the current state, while non-zero indicates that the light-emitting unit in that path should be on and have a corresponding brightness value in the current state. The specific value of the target operating parameters can be determined based on quantization accuracy, dimming range, or driving method; this invention does not specifically limit this.

[0053] This embodiment distinguishes between constant-on and flashing states using a lighting effect state machine, employing different lookup table indexing methods for each to ensure accurate and efficient determination of target operating parameters. Constant-on states are directly indexed by the current state, while flashing states are indexed by both the current state and the current flashing cycle, guaranteeing accurate execution of the on / off alternation in flashing states. Only one copy of the mapping table exists across the entire device; adding a new operating state only requires modifying this table, without involving modifications to other main control unit firmware, thus reducing maintenance costs. The mapping table stores the correspondence between multiple operating states and the target operating parameters of each light-emitting unit, enabling centralized management of the mapping from state to target operating parameters, facilitating maintenance and expansion.

[0054] S3, obtain the physical affiliation of each light-emitting unit, and assign the target working parameters one by one according to the physical affiliation to obtain the first target working parameters belonging to the first main control unit and the second target working parameters belonging to other main control units.

[0055] In practice, the lighting effect state machine obtains the physical affiliation of each light-emitting unit. Physical affiliation indicates which of the multiple main control units the pins connected to that light-emitting unit belong to. The physical affiliation is determined during the equipment design phase and remains unchanged during operation. The physical affiliation can be stored as a constant table in the first main control unit, recording the main control unit identifier, indicator light group identifier, and light-emitting unit serial number to which each light-emitting unit belongs. The lighting effect state machine assigns target operating parameters to each light-emitting unit according to its physical affiliation. For light-emitting units physically affiliated to the first main control unit, the lighting effect state machine determines the target operating parameters of that light-emitting unit as the first target operating parameters belonging to the first main control unit. For light-emitting units physically affiliated to other main control units, the lighting effect state machine determines the target operating parameters of that light-emitting unit as the second target operating parameters belonging to those other main control units.

[0056] S4 drives the light-emitting units belonging to the first main control unit based on the first target working parameters.

[0057] In practice, the first master control unit drives the light-emitting units belonging to it based on the first target operating parameters. The first master control unit can directly control the level or pulse width modulation (PWM) signal of its local pin. The first master control unit can convert the first target operating parameters into corresponding pin control signals based on the driving method of its local pin. For example, when the local pin uses a switch-driven method, the first master control unit can output a light-on or light-off level depending on whether the first target operating parameter is zero. When the local pin uses a dimming-driven method, the first master control unit can write the first target operating parameter as a duty cycle into the PWM channel of its local pin. Pulse width modulation (PWM) is a technique that uses pulse width adjustment to equivalently control output power. After the first master control unit drives its local light-emitting units, the light-emitting units belonging to the first master control unit achieve the brightness corresponding to the first target operating parameters.

[0058] S5, construct a lighting effect command based on the second target working parameters, and send the lighting effect command to other master control units so that the other master control units drive the light-emitting units belonging to other master control units based on the second target working parameters.

[0059] In practice, the first master control unit constructs a lighting effect command based on the second target working parameters. The lighting effect command is an application-layer command carrying the second target working parameters. The first master control unit can encapsulate the second target working parameters as at least one field of the lighting effect command. Furthermore, the lighting effect command can also include identification information for locating the light-emitting units, enabling other master control units to determine the light-emitting units affected by the second target working parameters. The format of the lighting effect command can be matched with the communication protocol between the first master control unit and other master control units. After construction, the first master control unit sends the lighting effect command to other master control units. Upon receiving the lighting effect command, the other master control units parse out the second target working parameters and drive the light-emitting units belonging to them based on these parameters. The other master control units do not participate in determining the current state, nor do they store the correspondence between working state and color; they only execute the drive according to the second target working parameters in the lighting effect command. In this way, both the light-emitting units belonging to other master control units and the light-emitting units belonging to the first master control unit emit light according to the target working parameters determined by the lighting effect state machine, resulting in consistent display states across all channels.

[0060] This embodiment sets up a lighting effect state machine within the first main control unit. This state machine uniformly acquires working status data, determines the current state, and determines the target working parameters for each light-emitting unit. It then assigns the target working parameters to the local direct drive path and the inter-machine command distribution path according to physical affiliation, ensuring that the outputs of light-emitting units belonging to multiple main control units originate from the same source. Furthermore, since state determination and target working parameter determination are completed only within the lighting effect state machine, the inconsistency problem caused by multiple main control units maintaining their own lighting effect logic is avoided. Physical affiliation determination and target working parameter calculation are independent of each other; assignment only applies to the already determined target working parameters. Therefore, state determination and parameter determination are not affected by pin affiliation. Furthermore, this embodiment does not limit the number of main control units to two; it can adapt to scenarios with three or more main control units. It also does not limit the specific form of communication connection; it can adapt to serial ports, buses, or other communication connection methods between main control units, exhibiting good scalability. The first master control unit sends lighting effect commands containing the second target working parameters to other master control units, enabling the other master control units to drive their respective light-emitting units according to the unified target working parameters. This eliminates the need for other master control units to determine the status or calculate the brightness themselves, thus ensuring the consistency of the display status of the entire group of indicator lights.

[0061] In some preferred embodiments, constructing a lighting effect command based on the second target operating parameters includes: obtaining the second light-emitting unit serial number and indicator light group identifier corresponding to the second target operating parameters, wherein the indicator light group identifier is used to distinguish multiple groups of indicator lights driven by the same main control unit; encoding the second target operating parameters into a single-byte brightness field, wherein a zero value of the single-byte brightness field indicates off; a non-zero value of the single-byte brightness field indicates on in switch-driven mode and serves as the duty cycle in dimming-driven mode; determining a unified effective time; encapsulating the indicator light group identifier, the second light-emitting unit serial number, the single-byte brightness field, and the unified effective time into a lighting effect command; or, encapsulating the indicator light group identifier, the second light-emitting unit serial number, the single-byte brightness field, and a preset relative delay into a lighting effect command, wherein the relative delay is used to instruct other main control units to execute the lighting effect command after a relative delay from the time when the lighting effect command is received and interrupted.

[0062] In specific implementation, this embodiment constructs a lighting effect command through the lighting effect status mechanism, obtains the second light-emitting unit serial number and indicator light group identifier, encodes the second target working parameters into a single-byte brightness field, determines the unified effective time or encapsulates the relative delay, and constructs a lighting effect command that the receiver can directly parse and execute. The specific implementation method is as follows: The lighting effect state machine obtains the second light-emitting unit serial number and indicator light group identifier corresponding to the second target operating parameters. The second light-emitting unit serial number indicates the serial number of the light-emitting unit in its respective indicator light group. The indicator light group identifier is used to distinguish multiple groups of indicator lights driven by the same main control unit. When other main control units drive multiple groups of indicator lights, the indicator light group identifier indicates which group the lighting effect command applies to; when other main control units drive only one group of indicator lights, the indicator light group identifier takes the default value. The second light-emitting unit serial number and the indicator light group identifier together locate the specific light-emitting unit. The lighting effect state machine can obtain the second light-emitting unit serial number and indicator light group identifier from a pre-stored physical attribution table. The physical attribution table records the main control unit, group identifier, and unit serial number to which each light-emitting unit belongs.

[0063] Furthermore, the lighting effect state machine encodes the second target operating parameter as a single-byte brightness field. This single-byte brightness field occupies one byte and has a value range of 0x00 to 0xFF. 0x00 represents off. 0x01 to 0xFF represent the brightness value, with larger values ​​indicating brighter light. The receiver interprets this value according to the driving mode of its local pin: if the pin operates in switch driving mode, a non-zero value indicates on, with 0x01 and 0xFF both representing full brightness; if the pin operates in dimming driving mode, this value is directly used as the duty cycle, with 0xFF corresponding to a full duty cycle. This division ensures that off has the same meaning in both driving modes, eliminating the possibility of interpreting it as on in switch mode and off in dimming mode. The value range is divided between zero and non-zero, not at any intermediate value.

[0064] Furthermore, the lighting effect state machine determines the unified activation time. The unified activation time is the execution time specified in the lighting effect command. The lighting effect state machine takes the current local time base and adds an advance amount to obtain the unified activation time. The advance amount is not less than the transmission duration of the lighting effect command, for example, 5 ms, with a preferred range of 1 ms to 50 ms. The advance amount is taken as the transmission duration estimated based on the command length and communication rate. The lighting effect state machine encapsulates the indicator group identifier, the second light-emitting unit sequence number, the single-byte brightness field, and the unified activation time into a lighting effect command. Furthermore, the lighting effect command may also include fields such as command code, packet type, length, source address, destination address, and checksum, used to distinguish it from service messages and ensure reliable transmission.

[0065] Furthermore, in another optional implementation, the lighting effect state machine can encapsulate the indicator group identifier, the second light-emitting unit sequence number, the single-byte brightness field, and the preset relative delay into a lighting effect command. The relative delay is used to instruct other master control units to execute the lighting effect command after the full relative delay, starting from the moment the lighting effect command is received and interrupted. This method does not require the first master control unit to be time-base aligned with other master control units; the receiver uses its own hardware timer for timing. Furthermore, the timing start point is taken from the hardware interrupt moment, the jitter is on the order of tens of microseconds, the delay length itself is only a few milliseconds to tens of milliseconds, and the timing error caused by the crystal oscillator frequency difference is on the order of microseconds. The combined effect of these two factors is negligible compared to the advance amount on the order of 5 ms.

[0066] This embodiment encodes the second target operating parameter into a single-byte brightness field through a lighting effect state machine, and encapsulates the indicator group identifier, the second light-emitting unit sequence number, and a unified effective time or relative delay, making the lighting effect command format uniform and semantically clear. The division of the single-byte brightness field into zero and non-zero values ​​allows the switch driver and dimming driver to share the same value domain; when a route's switch driver is changed to a dimming driver, the lighting effect command format does not need to be modified. The indicator group identifier and the second light-emitting unit sequence number jointly locate the specific light-emitting unit, supporting extended scenarios where one main control unit drives multiple groups of indicator lights. The unified effective time or relative delay setting allows two light-emitting units across main control units to execute synchronously, avoiding instantaneous color shifts caused by transmission delays. The lighting effect command is an application layer command, without pin levels; the receiver only drives according to the brightness value and does not participate in state determination. The receiver firmware does not change with the increase or decrease of operating states, reducing maintenance costs.

[0067] In some preferred embodiments, determining the unified effective time includes: obtaining the command length of the lighting effect command and the communication rate of the communication connection; estimating the transmission duration of the lighting effect command based on the command length and communication rate; taking a value not less than the transmission duration as a lead time; adding the lead time to the current time base of the first master control unit to obtain the unified effective time; wherein the first master control unit delays the execution of the driving action of the first target working parameter to the unified effective time, and the lighting effect command instructs other master control units to delay the execution of the driving action of the second target working parameter to the unified effective time.

[0068] In practical implementation, in scenarios where the light-emitting unit is driven across multiple main control units, after the first main control unit determines the unified effective time, it needs to write this time into the lighting effect command and ensure that one local unit and one external unit execute the drive at the same time. If the advance value is too small, the command may arrive late, and one external unit will only light up after the unified effective time; if the advance value is too large, the response of the entire group of indicator lights will be significantly lagging behind the relative state change. Therefore, this embodiment obtains the command length of the lighting effect command and the communication rate of the communication connection through the lighting effect state machine, estimates the transmission duration, takes a value not less than the transmission duration as the advance, and adds the advance to the current time base to obtain the unified effective time, so that both ends execute the drive action synchronously. The specific implementation method is as follows: The first main control unit contains a lighting effect state machine. This state machine acquires the command length of the lighting effect command and the communication rate of the communication connection. The command length is the number of bytes occupied by the lighting effect command, and the communication rate is the data transmission rate of the communication connection. The state machine estimates the transmission duration of the lighting effect command based on the command length and communication rate. For example, if the communication rate is 921600bps and the lighting effect command length is more than ten bytes, the transmission duration is approximately 0.1 ms to 0.2 ms. The state machine uses a value not less than the transmission duration as a lead time. The lower bound of the lead time is determined by the transmission duration, and the upper bound is determined by the perceptible threshold of response lag for the human eye. If the value is too small, the command may arrive late, and the light may only illuminate after the effective time; if the value is too large, the response of the entire group of indicator lights will be significantly delayed relative to the state change. For example, the preferred range for the lead time is 1 ms to 50 ms; for example, a lead time of 5 ms.

[0069] The lighting effect state machine adds an advance to the current local time base to obtain a unified activation time. The lighting effect state machine writes this unified activation time into the lighting effect command. The first master control unit delays the execution of the driving action for the first target operating parameter until the unified activation time. The lighting effect command instructs other master control units to delay the execution of the driving action for the second target operating parameter until the unified activation time. In this way, the light-emitting units belonging to the first master control unit and other master control units reach their respective brightness levels at the same time. The local output of the first master control unit also delays execution until this time, preventing premature lighting due to the lack of local time delay. The unified activation time can be expressed as an absolute time or a relative time. When expressed as an absolute time, the time bases at both ends need to be aligned; when expressed as a relative time, the receiver starts timing itself.

[0070] Furthermore, if a relative delay method is adopted, the lighting effect state machine encapsulates the relative delay into the lighting effect command. Other main control units, starting from the moment the lighting effect command is received and interrupted, begin timing with their local hardware timers, executing the driver after the relative delay is complete. The relative delay method does not require time base alignment at both ends, but the receiver must perform its own timing. The timing start point is taken from the hardware interrupt time, with jitter on the order of tens of microseconds. The delay length itself is only a few milliseconds to tens of milliseconds, and the timing error caused by the crystal oscillator frequency difference is on the order of microseconds. The combined effect of these two factors is negligible compared to the 5 ms lead time.

[0071] This embodiment estimates the transmission duration using a lighting effect state machine and takes an advance amount not less than the transmission duration. This ensures that the unified activation time covers the transmission delay without causing the lighting action to lag significantly behind the state change. The first main control unit delays the driving action of the first target working parameter to the unified activation time, while other main control units delay the driving action of the second target working parameter to the unified activation time. Both ends are lit synchronously, eliminating the instantaneous color deviation caused by communication transmission delay. The advance amount has a wide range of values ​​and does not require precise tuning, exhibiting good engineering feasibility. The unified activation time is written into the lighting effect command, allowing the receiver to clearly understand when to execute the drive, avoiding the asynchrony problem caused by executing the command immediately upon arrival. Furthermore, for scenarios requiring intermediate color synthesis, the two light-emitting units simultaneously illuminate according to their respective brightness to synthesize the intermediate color. The ratio is calculated by the lighting effect state machine, and each end only executes its own channel, ensuring the accuracy of the synthesized color.

[0072] In some preferred embodiments, if the display color corresponding to the current state is an intermediate color synthesized by at least two light-emitting units belonging to different main control units simultaneously lighting up, then the target operating parameters of each light-emitting unit are determined based on the current state, including: the first main control unit determines the target operating parameters of each light-emitting unit participating in the synthesis according to the brightness ratio corresponding to the intermediate color; the first main control unit and other main control units each drive their own light-emitting units only according to the assigned target operating parameters, and the other main control units do not perform brightness ratio conversion.

[0073] In practical implementation, the multiple light-emitting units of the same group of indicator lights are structurally adjacent, and the emitted light is mixed through the same light guide. When two lights are lit simultaneously, the human eye sees an intermediate color synthesized from the two colors according to their brightness ratio. The accuracy of the synthesized color depends on the ratio of the brightness of the two lights rather than their absolute values. When the two lights are simultaneously increased or decreased proportionally, the synthesized hue remains unchanged, only the overall brightness changes. If the ratio is calculated separately by the two ends belonging to different main control units, the slight difference between the rounding method and the reference will cause the synthesized color to deviate from the expected value. Therefore, in this embodiment, the brightness ratio is calculated only once on the lighting effect state machine side of the first main control unit and is assigned as the target working parameter according to physical affiliation. Each end only executes its own light, and the receiving end does not participate in the ratio conversion. The lighting effect state machine can also first determine the ratio of the two lights according to the hue, and then scale the brightness of the two lights as a whole according to the ambient light requirements. The scaling is also performed only once on the state machine side.

[0074] For example, when a device enters an unauthorized state, it is designated to display orange. Orange is synthesized from the red and green paths according to a brightness ratio. The red path is connected to pins on other master control units, while the green and blue paths are connected to pins on the first master control unit. The lighting effect state machine calculates the red path brightness as 0xFF, the green path brightness as 0x50, and the blue path brightness as 0x00 according to the corresponding relationship table; the ratio is calculated only once at this point. The lighting effect state machine takes the current local time base plus 5 ms as the unified effective time and writes the lighting effect command to the red path. The green and blue paths, although local, are also written to their pins at the same time. The red path command is sent to other master control units within 5 ms. At the unified effective time, the other master control units drive the red path pin to 0xFF, and all three paths simultaneously reach their respective brightness levels, causing the indicator lights to directly turn orange. If a unified activation time is not adopted, the green and blue paths will activate immediately on the local machine, while the red path will activate only after a transmission delay. During this delay window, only the green path will be lit and appear greenish, before it will change to orange. This will manifest as color flashing when the status changes frequently. This window will be eliminated after a unified activation time is adopted.

[0075] This embodiment calculates the brightness ratio of the intermediate color all at once on the lighting effect state machine side of the first main control unit, and assigns it to each main control unit according to physical affiliation to execute its own path. This avoids the deviation of the synthesized color caused by the difference between the rounding method and the reference when the ratio is calculated by each end. In conjunction with the unified effective time, it ensures that each light-emitting unit participating in the synthesis reaches its respective brightness at the same time, and the intermediate color does not show instantaneous color deviation.

[0076] In some preferred embodiments, the lighting effect command is a state-based idempotent command; sending the lighting effect command to other master control units includes: repeatedly sending the lighting effect command to other master control units based on a preset retransmission cycle while the current state is in a hold period.

[0077] In practical implementation, in scenarios where lighting units are driven by multiple master control units, lighting effect commands need to be transmitted via a communication connection. If packet loss occurs in the communication connection, other master control units may not receive the lighting effect commands, causing the lighting units belonging to other master control units to display lag. If an acknowledgment and retransmission mechanism is set for each lighting effect command, it will increase communication overhead and protocol complexity. Therefore, this embodiment sets the lighting effect commands as state-type idempotent commands through a lighting effect state machine, and repeatedly sends the lighting effect commands according to a preset retransmission cycle during the current state maintenance period, so that command loss can be corrected in a timely manner without increasing the link burden. The specific implementation method is as follows: The lighting effect commands are state-based idempotent commands. State-based commands indicate the current state of the device, rather than a one-time control action. Idempotency means that repeated execution of the same command will not produce side effects; that is, the display result remains unchanged even if the receiver receives the same lighting effect command multiple times. The receiver drives the corresponding pin based on the target operating parameters in the last received lighting effect command. Therefore, lighting effect commands do not require acknowledgments or retransmission counts. The link load is proportional to the frequency of operating state switching.

[0078] Furthermore, the lighting effect state machine determines that the current state is in a hold period. The current state remains in a hold period until it is overwritten by a new, higher-priority state. During the hold period, the lighting effect state machine periodically retransmits the lighting effect commands corresponding to the target operating parameters of each current light-emitting unit according to a preset retransmission cycle. The retransmission cycle can be preset, for example, sent along with a second-level periodic message.

[0079] Furthermore, if a lighting effect command is lost during transmission, other master control units, upon receiving a new lighting effect command in the next retransmission cycle, will drive the corresponding pins based on the target operating parameters in the new command. Therefore, an error will be corrected at most one retransmission cycle later. Command loss during state transitions is also handled by the next retransmission cycle. The lighting effect state machine does not require a response mechanism or retransmission count for lighting effect commands, simplifying the communication protocol.

[0080] Furthermore, the transmission of lighting effect commands can employ a frame structure with delimitation and double checksum. The frame structure includes a start code, header segment, data segment, and end code. The header segment includes a header checksum, and the data segment includes a data checksum. The receiver parses and verifies the start code, header checksum, length validity, data checksum, and end code level by level using a byte stream state machine. If any level of verification fails, the current frame is discarded and the receiver resets to the start code search state; corrupted frames are not executed. The receiver state machine can also be configured with intra-frame timeout protection. If the byte stream is interrupted during frame parsing for more than a set time, the frame is discarded and the receiver resets to the start code search state, preventing residual frames from blocking subsequent messages. The checksum can be XOR verification, or it can use CRC8 or CRC16, which offer stronger verification while maintaining the same mechanism.

[0081] This embodiment sets the lighting effect commands as state-level idempotent commands through a lighting effect state machine, and periodically retransmits them at a low frequency during the current state maintenance period. This ensures that command loss can be corrected promptly without increasing the link burden. Because the lighting effect commands are idempotent, repeated transmissions will not cause display flickering or state errors. The receiver uses the last received lighting effect command as the standard, ensuring that the display state remains consistent with the current state of the first main control unit. This mechanism, working in conjunction with the aforementioned construction, transmission, and driving steps, forms a complete and reliable transmission closed loop. The idempotent semantics of the lighting effect commands mean that the receiver does not need to store the correspondence between state and color, nor does it participate in priority arbitration. The receiver firmware does not change with the addition or subtraction of working states, reducing maintenance costs. The frame structure with delimitation and double verification, as well as intra-frame timeout protection, prevents bad frames from being executed and fragmented frames from blocking subsequent messages, further improving the reliability of lighting effect command transmission.

[0082] In some preferred embodiments, the method further includes: periodically sending time communication messages to other master control units, the time communication messages carrying the time base count value of the first master control unit; wherein, the other master control units are used to record their local count values ​​during the reception interruption of the time communication messages; determining the time base offset of the other master control units relative to the first master control unit based on the time base count value, half the transmission duration of the time communication messages, and the local count values ​​of the other master control units; and correcting the local time base of the other master control units according to the time base offset, so that the alignment residual is less than the advance amount.

[0083] In practical implementation, in scenarios where light-emitting units are driven across multiple master control units, when the lighting effect command carries a unified effective time, the time bases of the first master control unit and other master control units need to be aligned. If there is a deviation between the time bases at both ends, the understanding of the unified effective time by other master control units will be inconsistent with that of the first master control unit, causing the two light-emitting units to fail to light up at the same time, resulting in a momentary color shift when synthesizing intermediate colors. To address this, this embodiment triggers the first master control unit to periodically send communication messages to other master control units through the lighting effect state machine. Other master control units record their local count value during the interruption of receiving the communication message, and determine the time base offset based on the time base count value, half a transmission duration, and their local count value, correcting their local time base so that the alignment residual is less than the lead time. The specific implementation method is as follows: The first master control unit contains a lighting effect state machine. This state machine triggers the first master control unit to periodically send synchronization messages to other master control units. These synchronization messages are used for time base synchronization and carry the time base count value of the first master control unit. The time base count value is the current time base count value of the first master control unit, for example, a millisecond-level time base count value. The synchronization period can be 1 second, preferably ranging from 0.1 seconds to 10 seconds. Furthermore, the synchronization messages can reuse the communication connection between the first master control unit and other master control units, or they can use an independent communication link. The message format of the synchronization messages can be the same as or different from the message format of the lighting effect commands, as long as it can carry the time base count value.

[0084] Furthermore, other master control units record their local count values ​​during the receive interrupt of the time synchronization message. The receive interrupt is an interrupt service routine triggered when another master control unit receives a time synchronization message. In the interrupt, each other master control unit reads the count value of its local hardware timer as its local count value. Based on the time base count value, half the transmission duration of the time synchronization message, and the local count values ​​of other master control units, each other master control unit determines its time base offset relative to the first master control unit. Specifically, each other master control unit adds half the transmission duration to the time base count value and then subtracts its local count value to obtain the time base offset. Half the transmission duration is half the time required for the time synchronization message to travel from the first master control unit to the other master control units, used to compensate for transmission delay. The time base offset represents the deviation of the other master control unit's local time base from the first master control unit's time base.

[0085] Furthermore, other master control units correct their local time bases according to the time base offset, ensuring that the alignment residual is less than the lead time. The alignment residual is the remaining deviation between the two time bases after correction. For example, with a communication rate of 921600 bps, a synchronization message of more than ten bytes takes approximately 0.1 ms to 0.2 ms to transmit, the jitter of the receive interrupt response is on the order of tens of microseconds, and the synchronization accuracy is less than 1 ms, far less than the 5 ms lead time. Furthermore, each time base is taken from the millisecond tick of its local hardware timer, the crystal oscillator frequency difference is on the order of tens of ppm, and the cumulative drift between two synchronizations does not exceed 0.1 ms, which does not affect synchronization. The corrected local time base is used to parse the unified effective time in the lighting effect command and execute the driving action at that time.

[0086] This embodiment uses a lighting effect state machine to trigger periodic synchronization messages to align the time bases at both ends, ensuring a consistent time base reference for the unified activation time at both ends. Other master control units record their local count values ​​during receive interrupts and determine the time base offset based on the first master control unit's time base count value, half a transmission duration, and their local count value. This corrects their local time base, ensuring the alignment residual is less than the lead time. Thus, when the first master control unit specifies the unified activation time, other master control units can accurately understand the corresponding local time and execute the driving action at the unified activation time. The time base alignment mechanism ensures the accuracy of cross-master control unit synchronous lighting and avoids instantaneous color shifts caused by time base deviations. The synchronization period of the synchronization messages is between 0.1 s and 10 s, ensuring timely time base tracking without excessively consuming communication bandwidth. The time base offset is determined using three parameters: the time base count value, half a transmission duration, and the local count value. The calculation is simple, requiring no complex synchronization algorithms, making it suitable for implementation in resource-constrained embedded master control units.

[0087] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0088] Please see Figure 3 , Figure 3 This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device 500 can be the first main control unit in the camera device, or it can be other embedded processing devices with computing and control capabilities.

[0089] The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.

[0090] The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, it causes the processor 502 to execute a separate indicator light driving method.

[0091] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.

[0092] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a split indicator light driving method.

[0093] The network interface 505 is used for network communication with other devices. Those skilled in the art will understand that the above structure is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. A specific computer device 500 may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements.

[0094] The processor 502 is used to run the computer program 5032 stored in the memory to implement the steps of the indicator light split driving method provided in any of the above method embodiments.

[0095] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0096] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.

[0097] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program. When executed by a processor, the computer program causes the processor to perform the steps of the indicator light split-drive method provided in any of the above method embodiments.

[0098] Storage media are physical, non-transitory storage media, such as USB flash drives, external hard drives, read-only memory (ROM), magnetic disks, or optical disks—various physical storage media capable of storing program code. Computer-readable storage media can be non-volatile or volatile.

[0099] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0100] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0101] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0102] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention.

[0103] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0104] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, this invention is also intended to include these modifications and variations as long as they fall within the scope of the claims of this invention and their equivalents.

[0105] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for driving indicator lights separately, characterized in that, The camera device includes multiple main control units and indicator lights. Each indicator light includes multiple light-emitting units, which are connected to the multiple main control units. Each main control unit is connected to at least one light-emitting unit. The multiple main control units include a first main control unit and at least one other main control unit. The first main control unit is communicatively connected to the other main control units. The method is applied to the first main control unit, and the method includes: Acquire the working status data of the camera device, and determine the current status of the camera device based on the working status data; Determine the target operating parameters for each light-emitting unit based on the current state; Obtain the physical affiliation of each light-emitting unit, and assign the target operating parameters one by one according to the physical affiliation to obtain the first target operating parameters belonging to the first main control unit and the second target operating parameters belonging to the other main control units; The light-emitting units belonging to the first main control unit are driven based on the first target operating parameters; Based on the second target operating parameters, a lighting effect command is constructed and sent to the other master control units so that the other master control units drive the light-emitting units belonging to the other master control units based on the second target operating parameters.

2. The indicator light split driving method according to claim 1, characterized in that, The step of acquiring the operating status data of the camera device includes: Receive setting instructions from the host computer, detection results from the first main control unit, and operating status reported by the other main control units; The setting instructions, the detection results, and the operating status are determined as the working status data of the camera device.

3. The indicator light split driving method according to claim 2, characterized in that, Determining the current state of the camera device based on the operating status data includes: Based on the work status data, determine the currently established work status; If there are multiple currently established work states, obtain the priority of each work state among the currently established work states, and determine the work state with the highest priority as the current state; If the number of currently established working states is one, then the currently established working state is determined as the current state.

4. The indicator light split driving method according to claim 1, characterized in that, The determination of the target operating parameters for each light-emitting unit based on the current state includes: If the current state is a constant-on state, the current state is used as an index to query a preset correspondence table, and the brightness value of each light-emitting unit corresponding to the current state is read from the correspondence table as the target working parameter. If the current state is a flashing state, obtain the current flashing beat, use the current state and the current flashing beat as indexes to query a preset correspondence table, and read the brightness value corresponding to each light-emitting unit corresponding to the current state from the correspondence table as the target working parameter.

5. The indicator light split driving method according to claim 4, characterized in that, The command to construct the lighting effect based on the second target working parameters includes: Obtain the second light-emitting unit serial number and indicator light group identifier corresponding to the second target working parameters. The indicator light group identifier is used to distinguish multiple groups of indicator lights driven by the same main control unit. The second target operating parameter is encoded as a single-byte brightness field, where a zero value in the single-byte brightness field indicates that the light is off; a non-zero value in the single-byte brightness field indicates that the light is on in the switch-driven mode, and serves as the duty cycle in the dimming-driven mode. Determine the unified effective date; The indicator group identifier, the second light-emitting unit serial number, the single-byte brightness field, and the unified effective time are encapsulated into the lighting effect command; Alternatively, the indicator group identifier, the second light-emitting unit serial number, the single-byte brightness field, and the preset relative delay can be encapsulated into the lighting effect command. The relative delay is used to instruct the other main control units to execute the lighting effect command after the relative delay has elapsed from the moment the lighting effect command is received and interrupted.

6. The indicator light split driving method according to claim 5, characterized in that, The determination of the unified effective time includes: Obtain the command length of the lighting effect command and the communication rate of the communication connection, and estimate the transmission time of the lighting effect command based on the command length and the communication rate; Take a value that is not less than the transmission duration as the lead time; The unified effective time is obtained by adding the advance amount to the current time base of the first master control unit; The first main control unit delays the driving action of the first target working parameter until the unified effective time, and the lighting effect command instructs the other main control units to delay the driving action of the second target working parameter until the unified effective time.

7. The indicator light split driving method according to claim 1, characterized in that, If the display color corresponding to the current state is an intermediate color synthesized by at least two light-emitting units belonging to different main control units simultaneously lighting up, then determining the target operating parameters of each light-emitting unit based on the current state includes: the first main control unit determining the target operating parameters of each light-emitting unit participating in the synthesis according to the brightness ratio corresponding to the intermediate color; the first main control unit and the other main control units each drive their own light-emitting units only according to the assigned target operating parameters, and the other main control units do not perform brightness ratio conversion.

8. The indicator light split driving method according to claim 1, characterized in that, The lighting effect command is a state-based idempotent command; sending the lighting effect command to the other master control units includes: While the current state is maintained, the lighting effect command is repeatedly sent to the other main control units based on a preset retransmission cycle.

9. The indicator light split driving method according to claim 6, characterized in that, The method further includes: Periodically send communication messages to the other master control units, the communication messages carrying the time base count value of the first master control unit; The other master control unit is used to record its local count value during the interruption of the transmission of the time synchronization message; determine the time base offset of the other master control unit relative to the first master control unit based on the time base count value, half the transmission duration of the transmission of the time synchronization message and the local count value of the other master control unit; and correct the local time base of the other master control unit according to the time base offset so that the alignment residual is less than the advance amount.

10. A camera device, characterized in that, The system includes multiple main control units and indicator lights. Each indicator light includes multiple light-emitting units, which are connected to the multiple main control units. Each main control unit is connected to at least one light-emitting unit. The multiple main control units include a first main control unit and at least one other main control unit. The first main control unit is communicatively connected to the other main control units. The first main control unit is configured to execute the indicator light split driving method as described in any one of claims 1-9. The other main control units are configured to receive the lighting effect command and drive the light-emitting units belonging to the other main control units based on the second target working parameters in the lighting effect command.

11. A computer device, characterized in that, The computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method as described in any one of claims 1-9.

12. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, can implement the method as described in any one of claims 1-9.