Method for identifying synchronization type of safety grating and related device

By using a bus chip to output identification data and receive results at the transmitting and receiving ends of the safety light curtain, the synchronization type is automatically identified, solving the problem of difficult placement of DIP switches in miniaturized devices and realizing automatic identification and consistent configuration of synchronization types.

CN122172328APending Publication Date: 2026-06-09SHENZHEN BAYTEST TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN BAYTEST TECH CO LTD
Filing Date
2026-05-12
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing safety light curtains are difficult to install DIP switches in miniaturized designs, resulting in inconsistent synchronization type configurations and cumbersome, error-prone manual settings.

Method used

By connecting bus chips to the transmitting and receiving ends respectively, the bus chips output preset identification data and receive results, automatically identifying the synchronization type and distinguishing between line synchronization and optical synchronization.

Benefits of technology

It enables automatic identification of safety light curtain synchronization type without relying on DIP switches, improving the convenience and consistency of synchronization type configuration and adapting to the needs of miniaturized devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122172328A_ABST
    Figure CN122172328A_ABST
Patent Text Reader

Abstract

This invention discloses a method and related equipment for identifying the synchronization type of a safety light grating. The method includes: outputting preset identification data to a bus via a target bus chip, and receiving the reception result of the bus via the target bus chip, wherein the target bus chip is a first bus chip or a second bus chip; determining whether the current synchronization type is a line synchronization type based on the reception result; and determining the current synchronization type as an optical synchronization type if the current synchronization type is not a line synchronization type. By using the bus chip connected to the transmitting and receiving ends to output preset identification data and receive the corresponding reception result, the method first determines whether the current synchronization type is a line synchronization type, and then determines it as an optical synchronization type if it is not a line synchronization type. This eliminates the need for manual setting using traditional DIP switches, enabling automatic identification of the synchronization type of the safety light grating. This method effectively adapts to application scenarios where DIP switches are difficult to arrange in miniaturized devices and improves the consistency of synchronization type configuration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial safety, and in particular to a method, apparatus, computer device, and storage medium for identifying the synchronization type of a safety light curtain. Background Technology

[0002] Safety light curtains typically consist of a transmitter and a receiver. The transmitter and receiver must coordinate using a consistent synchronization method to ensure proper beam transmission, reception, and light-blocking detection. In existing technology, to distinguish between different synchronization methods, DIP switches are commonly used to pre-set the synchronization type, such as manually setting it to line synchronization or a specific optical synchronization mode. After installation, debugging, or replacement, operators must manually configure the DIP switches at both ends to ensure they operate under the same synchronization type.

[0003] However, as safety light curtain products become increasingly miniaturized and compact, internal circuit board space is becoming increasingly limited. Mechanical setting devices such as DIP switches are often difficult to place in small-sized devices, or even if they can be placed, they occupy a large installation space, which is not conducive to the miniaturization design of the overall structure. At the same time, DIP switches also have problems such as cumbersome manual setting steps, inconvenient assembly and debugging, and easy missetting or omission, which in turn affect the consistency of the synchronization type configuration between the transmitting and receiving ends.

[0004] Therefore, how to achieve automatic identification of the synchronization type of safety grating without relying on manual setting devices such as DIP switches, while taking into account the identification needs of both line synchronization type and optical synchronization type, and improving the consistency of synchronization type configuration, has become a technical problem that urgently needs to be solved in this field. Summary of the Invention

[0005] Based on this, it is necessary to provide a method, device, computer equipment, and storage medium for identifying the synchronization type of a safety light curtain, which has the advantages of automatically identifying the synchronization type of the safety light curtain without relying on manual setting devices such as DIP switches, and taking into account the identification needs of both linear and optical synchronization types, thereby improving the consistency of synchronization type configuration.

[0006] A method for identifying the synchronization type of a safety light grating, the safety light grating comprising a transmitter and a receiver, the transmitter being connected to a first bus chip, the receiver being connected to a second bus chip, and a bus connecting the first bus chip and the second bus chip, the method being applied to the receiver or the transmitter, the method comprising: The target bus chip outputs preset identification data to the bus and receives the reception result of the bus through the target bus chip, wherein the target bus chip is either the first bus chip or the second bus chip; Based on the received result, determine whether the current synchronization type is a line synchronization type; When the current synchronization type is not a line synchronization type, the current synchronization type is determined to be an optical synchronization type.

[0007] Optionally, the step of outputting preset identification data to the bus through the target bus chip and receiving the reception result of the bus through the target bus chip includes: The transmitting end outputs preset identification data to the bus through the first bus chip at the first output time, and receives the reception result of the bus through the first bus chip; Alternatively, the receiving end outputs preset identification data to the bus through the second bus chip at the second output time, and receives the reception result of the bus through the second bus chip; The first output time and the second output time are in different time windows.

[0008] Optionally, the preset identification data consists of multiple consecutive target identification characters, and determining whether the current synchronization type is a line synchronization type based on the received result includes: Detect the number of consecutive occurrences of the target identified character in the received result; Based on the number of consecutive occurrences and a preset threshold, determine whether the current synchronization type is a line synchronization type; The preset number threshold is set according to the number of target characters in the preset recognition data.

[0009] Optionally, determining whether the current synchronization type is a line synchronization type based on the number of consecutive occurrences and a preset threshold number includes: When the number of consecutive occurrences meets a preset threshold, the current synchronization type is determined to be a line synchronization type. When the number of consecutive occurrences does not meet the preset threshold, the preset identification data is repeatedly sent through the target bus chip, and the number of consecutive occurrences of the target identification character in the received result is re-detected; When the number of re-detections reaches a preset number, and the number of consecutive occurrences still does not meet the preset threshold, it is determined that the current synchronization type is not a line synchronization type.

[0010] Optionally, the method further includes: When the current synchronization type is optical synchronization, obtain the level state of the output terminal of the target bus chip; When the number of consecutive high-level states meets a preset number of high-level states, the optical synchronization type is determined to be the first optical synchronization type. When the number of consecutive low-level states meets a preset number of low-level states, the optical synchronization type is determined to be the second optical synchronization type.

[0011] Optionally, the method further includes: When the current synchronization type is detected as line synchronization, the serial port receive interrupt is disabled; When the current synchronization type is identified as optical synchronization, the serial port receive interrupt is kept enabled. The serial port receive interrupt is used to receive the reception result fed back by the target bus chip.

[0012] Optionally, the method further includes: Upon power-on, the receiving result is received at a preset time interval, and synchronization status data sent by the other end is received within the time interval. Based on the received result or the synchronization status data, determine whether the current synchronization type is the line synchronization type.

[0013] A synchronization type identification device for a safety light curtain, the safety light curtain including a transmitting end and a receiving end, the transmitting end being connected to a first bus chip, the receiving end being connected to a second bus chip, and a bus connecting the first bus chip and the second bus chip, the device being applied to the receiving end or the transmitting end, the device comprising: The output module is used to output preset identification data to the bus through the target bus chip, and to receive the reception result of the bus through the target bus chip, wherein the target bus chip is the first bus chip or the second bus chip; The first determining module is used to determine whether the current synchronization type is a line synchronization type based on the received result; The second determining module is used to determine that the current synchronization type is an optical synchronization type when the current synchronization type is not a line synchronization type.

[0014] A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor, when executing the computer-readable instructions, implements the aforementioned method for identifying the synchronization type of a security grating.

[0015] A readable storage medium storing computer-readable instructions that, when executed by a processor, implement the aforementioned method for identifying the synchronization type of a security grating.

[0016] The aforementioned method, apparatus, computer equipment, and storage medium for identifying the synchronization type of a safety light curtain include a transmitting end and a receiving end. The transmitting end is connected to a first bus chip, and the receiving end is connected to a second bus chip. A bus connects the first bus chip and the second bus chip. The method is applied to the receiving end or the transmitting end and includes: outputting preset identification data to the bus through a target bus chip, and receiving the reception result of the bus through the target bus chip, wherein the target bus chip is either the first bus chip or the second bus chip; determining whether the current synchronization type is a line synchronization type based on the reception result; and determining the current synchronization type as an optical synchronization type if the current synchronization type is not a line synchronization type. By using the bus chip connected to the transmitting and receiving ends to output preset identification data and receive the corresponding reception result, the system first determines whether the current synchronization type is a line synchronization type, and then determines it as an optical synchronization type if it is not a line synchronization type. This eliminates the need for manual setting using traditional DIP switches, thus achieving automatic identification of the synchronization type of the safety light curtain. Therefore, it can effectively adapt to application scenarios where DIP switches are difficult to arrange in miniaturized devices and improve the convenience and consistency of synchronization type configuration. Attached Figure Description

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

[0018] Figure 1 This is a flowchart illustrating a method for identifying the synchronization type of a safety light grating according to an embodiment of the present invention; Figure 2 This is a schematic diagram of a synchronization type identification device for a safety light curtain in one embodiment of the present invention; Figure 3 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation

[0019] 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.

[0020] In one embodiment, such as Figure 1As shown, a method for identifying the synchronization type of a safety light curtain is provided. The safety light curtain includes a transmitter and a receiver. The transmitter is connected to a first bus chip, and the receiver is connected to a second bus chip. A bus connects the first bus chip and the second bus chip. The method is applied to either the receiver or the transmitter and includes the following steps: 101. Output preset identification data to the bus through the target bus chip, and receive the bus reception result through the target bus chip.

[0021] In this embodiment of the invention, the safety light curtain can be an optoelectronic safety device used for intrusion detection in hazardous areas, equipment protection interlocking, or personnel protection in automated production lines. It typically consists of a transmitter and a receiver positioned opposite each other. The transmitter emits a detection beam, and the receiver receives the corresponding beam and determines whether it is in a light-blocking, light-transmitting, or abnormal state. The transmitter can be a transmitting device equipped with a light-emitting device, control circuitry, and a communication interface, while the receiver can be a receiving device equipped with a light-receiving device, control circuitry, and a communication interface. A first bus chip can be located in the transmitter to establish a signal interaction relationship between the internal control unit of the transmitter and an external bus; a second bus chip can be located in the receiver to establish a signal interaction relationship between the internal control unit of the receiver and an external bus. The bus can be a two-wire communication path connecting the transmitter and receiver, such as a differential bus path composed of high-level and low-level lines, used to carry identification data, status data, or level information reflecting the synchronization type. The target bus chip can be either the first bus chip or the second bus chip; that is, the synchronization type identification action can be performed at either the transmitter or the receiver. The preset identification data can be a pre-agreed sequence of identification characters, such as a data string consisting of multiple consecutive identical characters, or other agreed-upon code values ​​that can be recognized by the other end or this end and used to determine the synchronization type. The received result can be the return data, received data, or data result formed based on the bus state obtained by the target bus chip after outputting the preset identification data, and is used to subsequently determine whether the identification conditions for the line synchronization type are met.

[0022] From an overall architecture perspective, bus chips are deployed at both the transmitting and receiving ends, and an electrical connection is established through the bus. The control units in both the transmitting and receiving ends can output identification data to the bus via their respective bus chips, while simultaneously receiving the reception results from the bus side. In other words, the bus chip not only serves as the interface converter between its local control unit and the bus, but also handles the transmission of identification data, acquisition of reception results, and representation of the bus status. Based on this architecture, when one end is currently performing identification, it can output preset identification data to the bus through the bus chip connected to it. The same bus chip then receives the feedback from the bus, thereby obtaining the reception result and determining the current synchronization type based on the result. This architecture eliminates the need for mechanical setting devices such as DIP switches, allowing synchronization type identification to be completed at either the transmitting or receiving end. Therefore, it is more suitable for applications in small-sized safety light curtain products with limited internal space.

[0023] In practical implementation, the target bus chip outputs preset identification data to the bus. This can be understood as the end currently performing identification loading the agreed-upon identification information onto the bus through its own bus chip, enabling the bus to enter a detection state suitable for identification. The target bus chip receives the bus's reception result, which can be understood as the local bus chip, after outputting identification data, continuing to obtain feedback information from the bus side to determine whether the current bus environment meets the conditions for line-synchronous identification. For example, the end currently performing identification can first output multiple consecutive identical characters to the bus via its bus chip, and then its own bus chip receives the returned data. If the returned data contains the target identification character corresponding to the preset identification data, it indicates that the current bus has the necessary identification response foundation. Subsequently, the current synchronization type can be further determined by combining the consecutive occurrences of the target identification character. As another example, when one end is powered on again or initially powered on, the bus chip corresponding to that end can first send preset identification data, and then read the feedback result from the bus side to determine whether the current connection relationship or the current bus state is closer to line-synchronous or optical-synchronous.

[0024] Specifically, the first and second bus chips can be CAN chips, and the bus can be a CAN bus connecting the transmitting and receiving ends. The CAN bus can include CANH lines and CANL lines. The control unit in the transmitting end can interact with the CAN bus through the first bus chip, and the control unit in the receiving end can interact with the CAN bus through the second bus chip. Using CAN chips and CAN bus is beneficial for completing the synchronization type identification function while ensuring a simplified hardware structure. This is because the control unit and the CAN chip can exchange data through serial communication, and the CAN chip is responsible for interface adaptation between the control unit and the bus, identification data output, and bus status feedback. Thus, it is possible to complete the identification of line synchronization type and optical synchronization type with fewer hardware components.

[0025] Furthermore, using a CAN chip allows for better adaptation to higher voltage applications in safety light curtains. During optical synchronization identification, the CANH and CANL lines require high and low voltage levels respectively to form a bus state used to distinguish different optical synchronization types. When the product's operating voltage is high, the bus input voltage also increases accordingly, and the bus voltage withstand capability of conventional 485 interface chips is usually insufficient for such applications. In contrast, the CAN chip has a higher bus input voltage withstand capability, making it more suitable for carrying the corresponding bus level states during safety light curtain synchronization type identification, thus improving the compatibility between the hardware interface and the actual operating voltage.

[0026] Furthermore, the CAN chip also possesses excellent self-transmitting and receiving capabilities. After the end currently performing identification outputs preset identification data to the CAN bus through the CAN chip connected to it, it can obtain the corresponding received result based on its own CAN chip, thereby determining whether the current bus meets the conditions for line synchronization identification. Utilizing this feature, the initial determination of the line synchronization type can be completed during single-end identification, and the current synchronization type can be restored through the identification process after surge interference, electrostatic interference, or a single-end control unit reset. Therefore, even if one end experiences an abnormal reset while the other end maintains its original operating state, the reset end can still quickly re-identify the current synchronization type and restore consistency with the other end, which helps to shorten the restart time after abnormal recovery.

[0027] In some implementations, the CAN bus on the transmitting and receiving sides can be connected to matching resistors respectively to balance bus communication stability and device heat control. Conventional CAN buses often use low-value matching resistors. However, in safety light curtain synchronous identification scenarios, since the CANH and CANL lines may be connected to higher voltages, using low-value matching resistors can easily lead to significant power consumption and heat generation, which is detrimental to the space layout and long-term stable operation of miniaturized products. Therefore, higher-value matching resistors, such as 5.1KΩ, can be set for the CAN bus corresponding to the transmitting and receiving sides to reduce heat generation risk while maintaining identification stability. As one possible embodiment, the CAN bus connected to the transmitting side can be connected to a 5.1KΩ matching resistor, and the CAN bus connected to the receiving side can also be connected to a 5.1KΩ matching resistor. This maintains the compactness of the hardware structure while reducing the temperature rise of the matching resistor under high-voltage conditions.

[0028] As one possible implementation, the bus chip can be a communication chip with high bus-end voltage withstand capability to meet the application requirements when the safety light curtain operates at a high voltage; the preset identification data is not limited to a single character sequence, but can also be configured as other fixed code groups, repeating code groups or check code groups according to product design needs, as long as it can form identifiable feedback features on the bus side and distinguish different synchronization types accordingly.

[0029] 102. Based on the received results, determine whether the current synchronization type is a line synchronization type.

[0030] In this embodiment of the invention, the principle of determining whether the current synchronization type is a line synchronization type based on the received result is as follows: the end currently performing identification (either the sending end or the receiving end) first outputs preset identification data to the bus, and then, based on the received result obtained by the local bus chip from the bus side, it determines whether the current bus has the communication characteristics corresponding to line synchronization. In the line synchronization state, the bus between the sending end and the receiving end is in a connection relationship that can form communication feedback. After the preset identification data is output to the bus, the identification characteristics corresponding to the preset identification data can be reflected in the received result. Conversely, if the current state is not line synchronization, the received result usually cannot stably reflect the target identification characteristics corresponding to the preset identification data, or even if relevant characters appear, their continuity is difficult to meet the preset requirements. Therefore, by analyzing whether the target identification characters appear in the received result and the degree of continuity of their appearance, it can be determined whether the current synchronization type is a line synchronization type.

[0031] Furthermore, the received result is not simply a matter of "data present" or "data absent," but rather reflects the feedback generated after the preset identification data is output to the bus. If the current bus has the necessary connection infrastructure for line synchronization, the received result is more likely to show continuous feedback corresponding to the target identification character after the local end outputs the preset identification data via the bus chip. If the current bus lacks such a connection infrastructure, the received result will typically fail to show continuous target identification characters that meet the threshold requirements. Therefore, the determination of the line synchronization type does not solely depend on whether the local end has output the preset identification data, but rather on whether the received result obtained from the bus side after outputting the data meets the line synchronization identification conditions. In other words, the preset identification data is used to trigger the identification process, and the received result carries the basis for judgment.

[0032] For example, the preset identification data can be multiple consecutive target identification characters. After the local end outputs this preset identification data, the number of consecutive occurrences of the target identification characters can be detected in the received results. When the number of consecutive occurrences reaches a preset threshold, it can be considered that the current bus has formed an identification feedback corresponding to line synchronization, thus determining that the current synchronization type is line synchronization. If the number of consecutive occurrences does not reach the threshold, it means that the current received results do not fully represent the feedback characteristics corresponding to line synchronization. At this time, the preset identification data can be repeatedly sent and detected again to avoid misjudgment caused by occasional interference or transient anomalies. Only when the number of occurrences still cannot meet the threshold after repeated detection is it further considered that the current synchronization type does not belong to the line synchronization type.

[0033] From the perspective of the identification mechanism, this method is equivalent to first constructing a set of identification data for testing the bus feedback capability, and then judging whether the current connection state is closer to the line synchronization type based on the actual results returned by the bus. Since the line synchronization type itself corresponds to the state in which a specific feedback relationship can be formed between the transmitting and receiving ends, using the received results as the basis for judgment can avoid relying solely on manual settings or fixed configuration methods, and make the synchronization type identification more adaptive. As a possible implementation, after initial power-on, power-back, abnormal recovery, or replacement of the transmitting and receiving ends, the line synchronization type identification can be re-executed based on the received results to re-establish the current synchronization type judgment result.

[0034] It is important to note that regardless of whether the transmitting or receiving end is currently performing the identification, it only needs to connect to the bus section it is connected to to complete the synchronization type identification. In other words, after the end currently performing identification outputs preset identification data to the bus through the bus chip connected to it, the bus chip receives the corresponding reception result from the bus side and determines the current synchronization type based on this result. Therefore, the reception result is not a result specifically fed back from the other end, but rather information obtained by the target bus chip based on the current bus connection state, voltage level, or changes in bus-side data. In this way, regardless of whether the current identification is performed by the transmitting or receiving end, synchronization type identification can be completed using the interaction between the local bus chip and the bus, without requiring a separate, dedicated identification data return from the other end.

[0035] 103. When the current synchronization type is not a line synchronization type, determine the current synchronization type as an optical synchronization type.

[0036] In this embodiment of the invention, when the current synchronization type is not a line synchronization type, it is determined to be an optical synchronization type. The principle is that the synchronization type identification process prioritizes line synchronization because line synchronization corresponds to a communication feedback relationship between the transmitting and receiving ends via a bus. Therefore, it can be determined whether the current bus possesses the feedback characteristics corresponding to line synchronization by outputting preset identification data and detecting the received result. When the received result does not meet the line synchronization identification conditions, it indicates that the current bus has not formed the communication feedback relationship corresponding to line synchronization, and the current synchronization type can then be classified as optical synchronization. In other words, line synchronization and optical synchronization types have a sequential determination relationship in this embodiment; line synchronization is excluded first, and then optical synchronization is considered, thus making the synchronization type identification logic clearer.

[0037] Furthermore, the difference between optical synchronization and line synchronization lies in the fact that line synchronization emphasizes the ability of the bus side to generate received feedback corresponding to the preset identification data, while optical synchronization does not rely on such feedback but rather reflects a specific level state presented at the bus end. Therefore, once it has been determined that the current synchronization type is not line synchronization, there is no need to continue judging along the line synchronization feedback link; instead, the identification direction can be directly switched to optical synchronization. The advantage of this design is that it avoids continuing invalid line synchronization detection when the line synchronization conditions are not met, thereby improving the efficiency of synchronization type identification.

[0038] From the overall identification process, synchronization types can be divided into two main categories: line synchronization and optical synchronization. The end currently performing the identification first sends preset identification data and determines whether the received results meet the identification conditions for line synchronization. If they do, it is directly identified as line synchronization; if not, it indicates that the current bus state does not meet the feedback characteristics of line synchronization, thus the current synchronization type is determined to be optical synchronization. Using this approach, the synchronization type identification path has good hierarchy, prioritizing the identification of line synchronization types with communication feedback characteristics and quickly proceeding to the optical synchronization type identification stage after excluding line synchronization types.

[0039] For example, after initial power-on at one end, preset identification data can be output to the bus via the local bus chip, and the received results returned from the bus side can be detected. If no target identification character meeting the preset threshold requirement is detected in the received results, it can be considered that the current state does not meet the requirements of the line synchronization type, and thus the current synchronization type is determined to be the optical synchronization type.

[0040] In this embodiment of the invention, the safety light curtain includes a transmitting end and a receiving end. The transmitting end is connected to a first bus chip, and the receiving end is connected to a second bus chip. A bus connects the first bus chip and the second bus chip. The method is applied to the receiving end or the transmitting end. The method includes: outputting preset identification data to the bus through a target bus chip, and receiving the reception result of the bus through the target bus chip, wherein the target bus chip is either the first bus chip or the second bus chip; determining whether the current synchronization type is a line synchronization type based on the reception result; and determining the current synchronization type as an optical synchronization type if the current synchronization type is not a line synchronization type. By using the bus chips connected to the transmitting and receiving ends to output preset identification data and receive the corresponding reception result, the current synchronization type is first determined to be a line synchronization type. If it is not a line synchronization type, it is then determined to be an optical synchronization type. Therefore, it can achieve automatic identification of the synchronization type of the safety light curtain without relying on traditional DIP switches for manual setting. Thus, it can effectively adapt to application scenarios where DIP switches are difficult to arrange in miniaturized devices and improve the convenience and consistency of synchronization type configuration.

[0041] Optionally, in the steps of outputting preset identification data to the bus through the target bus chip and receiving the bus reception result through the target bus chip, the transmitting end may output preset identification data to the bus through the first bus chip at the first output time and receive the bus reception result through the first bus chip; or, the receiving end may output preset identification data to the bus through the second bus chip at the second output time and receive the bus reception result through the second bus chip; wherein the first output time and the second output time are in different time windows.

[0042] In this embodiment of the invention, both the transmitting end and the receiving end can serve as the end currently performing synchronization type identification. That is, the transmitting end can output preset identification data to the bus through the first bus chip and obtain the corresponding reception result on the bus side through the first bus chip. Similarly, the receiving end can also output preset identification data to the bus through the second bus chip and obtain the corresponding reception result on the bus side through the second bus chip. Considering that if the transmitting end and the receiving end simultaneously output preset identification data to the bus at the same time, different identification data may overlap on the bus, thereby affecting the stability of the reception result, the first output time and the second output time are set in different time windows, so that the transmitting end and the receiving end perform identification data output and reception result acquisition respectively in different time periods, which helps to reduce the probability of identification data conflict on the bus side.

[0043] Furthermore, setting the first and second output times within different time windows can be understood as the transmitting and receiving ends not initiating synchronous type identification simultaneously at the same identification moment. Instead, by staggering the timing, one end performs identification while the other end temporarily refrains from outputting the same identification data. In this way, the preset identification data output by the currently performing identification end through its local bus chip can form a clearer reception result in a relatively stable bus environment, facilitating subsequent determination of whether the current type is line synchronization. If both ends simultaneously output their respective preset identification data, the signals on the bus are more likely to overlap or interfere with each other, causing discontinuities, distortions, or discrepancies between the received target identification character and expectations, thereby increasing the risk of misjudgment.

[0044] For example, the receiving end can first output preset identification data to the bus through the second bus chip at the second output time and receive the corresponding reception result. After the receiving end completes the synchronization type identification for the current round, the sending end then outputs preset identification data to the bus through the first bus chip at the first output time and receives the corresponding reception result. Alternatively, the sending end can perform identification first, followed by the receiving end. Regardless of which end executes first, as long as the first output time and the second output time are within different time windows, the timing of the identification process can be staggered. This method not only improves the discriminability of the received result but also provides a more stable timing basis for the sending and receiving ends to maintain consistent synchronization type judgment after identification.

[0045] From an implementation perspective, different time windows can be represented as two non-overlapping recognition periods, or as two recognition moments with a preset interval. The specific order, interval length, and duration of the corresponding time windows of the first and second output times can all be set according to the processing capacity of the control unit, the bus data transmission rate, and the length of the recognition data. As one possible embodiment, while the end currently prioritizing recognition is outputting preset recognition data, the other end can temporarily refrain from outputting recognition data and instead perform other control tasks or remain in a receiving state, thereby further reducing bus conflicts and improving the reliability of synchronous type recognition.

[0046] Optionally, the preset recognition data consists of multiple consecutive target recognition characters. In the step of determining whether the current synchronization type is a line synchronization type based on the received results, the number of consecutive occurrences of the target recognition characters in the received results can also be detected. Based on the number of consecutive occurrences and a preset number threshold, it can be determined whether the current synchronization type is a line synchronization type. The preset number threshold is set according to the number of target recognition characters in the preset recognition data.

[0047] In this embodiment of the invention, the preset identification data can be five consecutive target identification characters "L". Using multiple consecutive identical characters as identification data helps to form clearer identification features on the bus side, making it easier to extract and statistically analyze the consecutive occurrence of the corresponding characters from the received results. Compared to using only a single character for identification, a continuous character sequence can improve the tolerance of the identification process to transient interference and occasional bit errors, thereby making the determination of the line synchronization type more stable.

[0048] When determining whether the current synchronization type is line synchronization based on the received results, the number of consecutive occurrences of the "L" character in the received results can be detected. If the "L" character appears four times consecutively, the current synchronization type can be determined to be line synchronization. The reason for setting the preset recognition data to five consecutive "L" characters and the determination threshold to four consecutive occurrences is to reserve a certain amount of redundancy while ensuring recognition reliability. In other words, even if there is slight interference during the recognition process, causing one character to not be completely received, as long as the remaining characters can still form four consecutive "L" character feedbacks, it can still be determined that the current bus has the feedback characteristics corresponding to the line synchronization type.

[0049] For example, the end currently performing the recognition can first output "LLLLL" as preset recognition data to the bus through the target bus chip. After the output is completed, the target bus chip receives the reception result from the bus side. If the "L" character appears four times consecutively in the reception result, it indicates that the current bus feedback and the output recognition data have a high degree of consistency, and the current synchronization type can be determined to be line synchronization. If the "L" character appears less than four times consecutively in the reception result, it indicates that the current bus feedback has not met the preset line synchronization recognition condition, and the current synchronization type can be determined to be non-line synchronization in this round of recognition.

[0050] The preset number of attempts threshold is set based on the number of target characters in the preset recognition data. It can be simply understood that the preset number of attempts threshold will not exceed the number of target characters.

[0051] By sending five consecutive "L" characters and detecting four consecutive "L" characters, the recognition rules for line synchronization type can be made more intuitive and clear, while also taking into account recognition sensitivity and anti-interference ability. Therefore, it is suitable for the initial recognition scenario of safety grating synchronization type.

[0052] As one possible implementation, the number of target characters to be continuously output and the corresponding continuous judgment threshold are not limited to 5 and 4, but can also be adjusted according to the bus communication quality, recognition response speed requirements and product anti-interference design requirements.

[0053] For example, when bus communication quality is high, the communication environment is relatively stable, and the requirement for recognition response speed is high, the number of consecutive target recognition characters in the preset recognition data can be appropriately reduced, and the preset number of times threshold can be lowered accordingly. This reduces the number of characters that need to be sent and detected in one recognition process, thereby improving the recognition speed of synchronous types. Conversely, when the bus communication environment has strong interference, the requirement for false positive control is high, or the product's anti-interference design requirements are high, the number of consecutive target recognition characters in the preset recognition data can be appropriately increased, and the preset number of times threshold can be raised accordingly. This increases the strictness of the line synchronization type judgment and reduces the risk of false positives due to occasional noise, momentary jitter, or partial character misrecognition. Furthermore, when both recognition speed and a certain level of recognition stability are desired, a moderate number of consecutive target recognition characters can be set in the preset recognition data, and the preset number of times threshold can be set to a value slightly lower than the number of consecutive target recognition characters, achieving a balance between recognition efficiency and recognition reliability.

[0054] Optionally, in the step of determining whether the current synchronization type is a line synchronization type based on the number of consecutive occurrences and a preset number threshold, the current synchronization type can be determined to be a line synchronization type when the number of consecutive occurrences meets the preset number threshold; when the number of consecutive occurrences does not meet the preset number threshold, the preset identification data is repeatedly sent through the target bus chip, and the number of consecutive occurrences of the target identification character in the received result is re-detected; when the number of re-detections reaches the preset number, and the number of consecutive occurrences still does not meet the preset number threshold, the current synchronization type is determined not to be a line synchronization type.

[0055] In this embodiment of the invention, when determining whether the current synchronization type is a line synchronization type based on the number of consecutive occurrences and a preset threshold, the final judgment is not limited to being made directly based on only one detection result. Instead, a mechanism of repeated transmission and re-detection can be introduced when the judgment condition is not met in one detection, so as to improve the stability and fault tolerance of line synchronization type identification. That is, when the number of consecutive occurrences of the target identification character in the received result meets the preset threshold, the current synchronization type can be directly determined to be a line synchronization type; when the number of consecutive occurrences does not reach the preset threshold, it is not immediately determined that the current type is not a line synchronization type. Instead, the target bus chip outputs the preset identification data to the bus again and re-detects the number of consecutive occurrences of the target identification character in the received result in order to reconfirm the current bus feedback status.

[0056] For example, the preset recognition data could still be five consecutive "L" characters, and the preset threshold for the number of consecutive occurrences of the "L" character could be four. In one round of detection, if the received result shows four consecutive occurrences of the "L" character, the current synchronization type can be directly determined to be line synchronization. If only one, two, or three consecutive occurrences of the "L" character are detected, it indicates that the current received result has not yet met the criteria for line synchronization. In this case, the target bus chip can resend "LLLLL" and re-detect the received result. If, in any subsequent round of re-detection, four consecutive occurrences of the "L" character are detected, the current synchronization type can also be determined to be line synchronization. This method avoids misjudgments caused by occasional interference during a single transmission, instantaneous bus jitter, or incomplete character reception.

[0057] Furthermore, only when the number of re-detections reaches a preset number, and the number of consecutive occurrences still does not reach a preset threshold, is the current synchronization type determined to be a non-line synchronization type. The principle behind this design is that the identification feedback corresponding to a line synchronization type should, in most cases, possess a certain degree of stability. If, after multiple rounds of sending preset identification data, the received results consistently fail to meet the consecutive occurrence requirement, it can be assumed that the current bus state does not possess the feedback characteristics corresponding to a line synchronization type, thus excluding the line synchronization type. In other words, the repeated sending and re-detection mechanism is equivalent to setting a certain number of confirmations during the line synchronization type identification process, ensuring that the identification conclusion is not determined solely by a single detection result, but rather supported by the combined results of multiple rounds of detection.

[0058] For example, the preset number of re-detections can be set to 3. During the initial detection and subsequent re-detections, if the character "L" appears consecutively 4 times in any round, the current synchronization type can be determined to be line synchronization. If, after 3 re-detections, the number of consecutive appearances of the character "L" in the received results is still less than 4, the current synchronization type can be determined to be non-line synchronization. This method improves tolerance to short-term noise and occasional anomalies while avoiding unlimited repeated detections that could affect the efficiency of synchronization type identification.

[0059] As one possible implementation, the number of re-detections can be set based on bus communication stability, recognition latency requirements, and tolerance for false positives. For example, in application environments with relatively stable bus communication and minimal interference, the number of re-detections can be set relatively low to improve the speed of synchronization type recognition; in application environments with significant bus fluctuations and high anti-interference requirements, the number of re-detections can be appropriately increased to improve the reliability of line synchronization type determination. The number of target characters in the preset recognition data, the preset threshold number of re-detections, and the number of re-detections can also be adjusted together to achieve a more suitable balance between judgment speed, anti-interference capability, and recognition accuracy in synchronization type recognition.

[0060] Optionally, the method can also, when the current synchronization type is optical synchronization, obtain the level state of the output terminal of the target bus chip; when the number of consecutive high-level states meets a preset number of high-level states, determine the optical synchronization type as a first optical synchronization type; when the number of consecutive low-level states meets a preset number of low-level states, determine the optical synchronization type as a second optical synchronization type.

[0061] In this embodiment of the invention, the optical synchronization type can be further subdivided into a first optical synchronization type and a second optical synchronization type. The first and second optical synchronization types can be understood as two different optical synchronization polarity methods. Although both belong to the optical synchronization type, they exhibit different level distribution relationships on the bus side. Further distinguishing the optical synchronization type into a first and a second type helps the transmitting and receiving ends, after determining the optical synchronization method, to further clarify which specific optical synchronization form is currently being used, thereby improving the precision of synchronization configuration and application adaptability.

[0062] During the differentiation process, after determining that the current synchronization type is optical synchronization, the voltage level of the target bus chip's output can be further acquired. Based on the continuous changes in this voltage level, it can be determined whether the current optical synchronization type is the first or second type. If the number of consecutive high-level detections reaches a preset number, the current optical synchronization type can be identified as the first type; if the number of consecutive low-level detections reaches a preset number, the current optical synchronization type can be identified as the second type. Using a continuous counting method for determination avoids single-time voltage fluctuations or momentary interference directly affecting the optical synchronization type differentiation result, thereby improving identification stability.

[0063] Table 1:

[0064] Furthermore, the current synchronization types mentioned above can be further explained by Table 1. Table 1 shows that the connection relationships or level states on the bus side are significantly different between the line synchronization type and the two optical synchronization types. In the line synchronization type, the CAN H of the transmitting end is connected to the CAN H of the receiving end, the CAN L of the transmitting end is connected to the CAN L of the receiving end, the CAN H of the receiving end is connected to the CAN H of the transmitting end, and the CAN L of the receiving end is connected to the CAN L of the transmitting end. Therefore, the key to identifying the line synchronization type lies in determining whether the bus possesses the corresponding feedback characteristics based on the received bus data.

[0065] In optical synchronization, the bus side no longer relies on the communication feedback relationship between the transmitting and receiving ends as the primary criterion. Instead, it distinguishes different optical synchronization methods by the voltage polarity of the CAN H and CAN L lines. According to Table 1, when the transmitting end's CAN H is connected to 24V and the transmitting end's CAN L is connected to 0V, while the receiving end's CAN H is connected to 24V and the receiving end's CAN L is connected to 0V, this corresponds to one type of optical synchronization. Conversely, when the transmitting end's CAN H is connected to 0V and the transmitting end's CAN L is connected to 24V, while the receiving end's CAN H is connected to 0V and the receiving end's CAN L is connected to 24V, this corresponds to another type of optical synchronization. In other words, the difference between the two optical synchronization types essentially lies in the opposite voltage polarity of the CAN H and CAN L lines.

[0066] Referring to Table 1, in one specific implementation, light B in Table 1 can be associated with the first optical synchronization type, and light A in Table 1 can be associated with the second optical synchronization type. In this case, when the target bus chip output continuously displays a high level for a preset number of high-level cycles, it indicates that the current bus state better matches the level characteristics corresponding to light B, thus determining the optical synchronization type as the first optical synchronization type. Conversely, when the target bus chip output continuously displays a low level for a preset number of low-level cycles, it indicates that the current bus state better matches the level characteristics corresponding to light A, thus determining the optical synchronization type as the second optical synchronization type. Alternatively, the opposite definition method can be used, defining light A as the first optical synchronization type and light B as the second optical synchronization type. The key is to establish a fixed correspondence between the bus level state and the preset optical synchronization type, enabling the transmitting and receiving ends to identify the specific optical synchronization method currently used based on consistent judgment rules.

[0067] For example, after excluding line synchronization, the target bus chip can continuously output port status for the control unit to read. If the output is read as high multiple times consecutively, it indicates that the bus level distribution is closer to the state corresponding to light B in Table 1, and the current optical synchronization type can be determined as the first optical synchronization type; if the output is read as low multiple times consecutively, it indicates that the bus level distribution is closer to the state corresponding to light A in Table 1, and the current optical synchronization type can be determined as the second optical synchronization type. By distinguishing optical synchronization types into two different polarity methods, synchronization type identification can not only distinguish between line synchronization and optical synchronization, but also perform finer-grained identification within optical synchronization itself.

[0068] As one possible implementation, the mapping relationship between consecutive high-level states corresponding to the first optical synchronization type and consecutive low-level states corresponding to the second optical synchronization type can be adjusted according to the specific product definition, as long as the transmitting and receiving ends in the same product use consistent mapping rules. The number of high-level and low-level cycles can also be configured according to the bus state stability, anti-interference requirements, and identification response speed requirements to achieve a balance between the reliability of optical synchronization type differentiation and identification efficiency.

[0069] Optionally, the method can also disable the serial port receive interrupt when the current synchronization type is identified as line synchronization, and keep the serial port receive interrupt enabled when the current synchronization type is identified as optical synchronization; wherein the serial port receive interrupt is used to receive the reception result fed back by the target bus chip.

[0070] In this embodiment of the invention, the serial port receive interrupt can be an interrupt response mechanism established by the control unit for serial receive events. This mechanism allows the control unit to promptly receive the corresponding data when the target bus chip provides feedback on the received data, thus providing a data basis for synchronization type identification. By employing a serial port receive interrupt, the control unit does not need to continuously poll the feedback data from the target bus chip; it can promptly enter the data processing process upon receiving a new receive result, thereby improving the timeliness of data response during the synchronization type identification stage.

[0071] Before the synchronization type is fully identified, a serial port receive interrupt can be enabled to receive the reception result from the target bus chip and determine the current synchronization type. Once the current synchronization type is identified as line synchronization, the serial port receive interrupt can be disabled. This is because, under line synchronization, the receiver continuously sends status synchronization data, such as 0xAA data representing the light-blocking state or 0x55 data representing the light-transmitting state. If the serial port receive interrupt remains enabled, this type of status synchronization data will continuously trigger interrupt responses, potentially interfering with subsequent light-blocking scanning timing and affecting the accuracy of the light-blocking scan.

[0072] When the current synchronization type is identified as optical synchronization, the serial port receive interrupt can be kept enabled. Since there is no continuous serial port synchronization data as in the wired synchronization type under optical synchronization, there will be no problem of continuously triggering receive interrupts and interfering with light-blocking scanning. Furthermore, retaining the serial port receive interrupt under optical synchronization allows the safety light curtain to continue receiving external command data, thus supporting command communication or parameter exchange between the host device and the safety light curtain.

[0073] Therefore, by adopting different serial port receive interrupt control methods for line synchronization type and optical synchronization type, the serial port receive interrupt can take on the role of receiving the above-mentioned reception results during the synchronization type identification stage, and after the identification is completed, targeted control can be performed according to the operating characteristics corresponding to different synchronization types, thereby taking into account the needs of synchronization type identification, light-shielding scanning accuracy, and subsequent communication requirements.

[0074] Optionally, the method can also receive the above-mentioned reception results at preset time intervals when power is restored, and receive synchronization status data sent by the other end within the interval; based on the reception results or synchronization status data, determine whether the current synchronization type is a line synchronization type.

[0075] In this embodiment of the invention, the power-on scenario can be a scenario where either the transmitting or receiving end is powered on while the other end remains operational. For example, only the transmitting end is powered off and then powered on again, while the receiving end remains in its original line-synchronous operating state. In this case, the end that remains operational can continue to send synchronization status data, while the end that is powered on again needs to re-execute synchronization type identification. Since the end that is powered on again will output preset identification data to the bus, while the other end is continuously sending synchronization status data, preset identification data and synchronization status data may appear simultaneously on the bus side, thus causing identification conflict.

[0076] Based on this, upon power-on, the receiving results can be received at preset time intervals, and synchronization status data sent by the other end can be received within the intervals. In other words, the power-on end not only identifies the line synchronization type based on the received results obtained after outputting preset identification data, but also uses the synchronization status data continuously sent by the other end in the current state as an auxiliary identification basis. Thus, even if the preset identification data output by this end and the synchronization status data sent by the other end overlap on the bus, it is still possible to determine whether the current operation is line-synchronous based on the received results or the synchronization status data, provided that one end has power-on while the other end continues to operate in line synchronization.

[0077] For example, in one specific implementation, the preset identification data can be five consecutive "L" characters, and the synchronization status data sent by the other end in online synchronization mode can be 0xAA data. When the power-on end performs synchronization type identification, it can detect both the received result formed after the preset identification data is output by this end and the 0xAA data received within a preset time interval. If the consecutive "L" characters in the received result reach a preset number, or if the synchronization status data received within the interval meets the corresponding identification conditions, then the current synchronization type can be determined as online synchronization type. Thus, the identification basis for online synchronization type is no longer limited to the preset identification data output by this end, but can also be extended to the synchronization status data continuously sent by the other end.

[0078] Furthermore, when the preset identification data overlaps with the synchronization status data, the data on the bus may become mixed, causing the target identification character corresponding to the preset identification data to be inconsistently represented in the received results. In this case, a preset time interval can be used for supplementary identification. Since the local end no longer outputs the preset identification data during this interval, while the other end continues to send synchronization status data, the end that has been powered on again can receive the synchronization status data more stably during this time period and determine whether the current type is line synchronization based on this synchronization status data. In this way, even if the preset identification data and the synchronization status data conflict at a certain moment, the identification of the line synchronization type can still be completed using the data reception process within the interval.

[0079] For example, the preset time interval can be set to 100ms. During this interval, the other end can continue to periodically send synchronization status data. The end that has been powered on again can continuously receive synchronization status data during this time period and determine whether the current synchronization type is line synchronization based on the received synchronization status data. This approach improves the fault tolerance of synchronization type identification in single-end power-on scenarios and avoids misjudgment of line synchronization type due to overlap between identification data and synchronization status data. As one possible implementation, the length of the preset time interval, the transmission period of the synchronization status data, and the conditions for determining the line synchronization type based on the synchronization status data can all be configured according to the product's communication rate, bus stability, and anti-interference requirements.

[0080] 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.

[0081] In one embodiment, a synchronization type identification device for a safety grating is provided, which corresponds one-to-one with the synchronization type identification method for the safety grating in the above embodiments. For example... Figure 2 As shown, the synchronization type identification device for the safety light curtain includes an output module 201, a first determination module 202, and a second determination module 203. Detailed descriptions of each functional module are as follows: The output module 201 is used to output preset identification data to the bus through the target bus chip, and to receive the reception result of the bus through the target bus chip, wherein the target bus chip is the first bus chip or the second bus chip; The first determining module 202 is used to determine whether the current synchronization type is a line synchronization type based on the received result; The second determining module 203 is used to determine that the current synchronization type is an optical synchronization type when the current synchronization type is not a line synchronization type.

[0082] Optionally, the output module 201 is further configured to: The transmitting end outputs preset identification data to the bus through the first bus chip at the first output time, and receives the reception result of the bus through the first bus chip; Alternatively, the receiving end outputs preset identification data to the bus through the second bus chip at the second output time, and receives the reception result of the bus through the second bus chip; The first output time and the second output time are in different time windows.

[0083] Optionally, the preset recognition data consists of multiple consecutive target recognition characters, and the first determining module 202 is further configured to: Detect the number of consecutive occurrences of the target identified character in the received result; Based on the number of consecutive occurrences and a preset threshold, determine whether the current synchronization type is a line synchronization type; The preset number threshold is set according to the number of target characters in the preset recognition data.

[0084] Optionally, the first determining module 202 is further configured to: When the number of consecutive occurrences meets a preset threshold, the current synchronization type is determined to be a line synchronization type. When the number of consecutive occurrences does not meet the preset threshold, the preset identification data is repeatedly sent through the target bus chip, and the number of consecutive occurrences of the target identification character in the received result is re-detected; When the number of re-detections reaches a preset number, and the number of consecutive occurrences still does not meet the preset threshold, it is determined that the current synchronization type is not a line synchronization type.

[0085] Optionally, the device further includes: The acquisition module is used to acquire the level state of the output terminal of the target bus chip when the current synchronization type is optical synchronization type; The third determining module is used to determine the optical synchronization type as the first optical synchronization type when the number of consecutive high-level states meets the preset number of high-level states. The fourth determining module is used to determine the optical synchronization type as the second optical synchronization type when the number of consecutive low-level states meets a preset number of low-level states.

[0086] Optionally, the device further includes: The shutdown module is used to disable the serial port receive interrupt when the current synchronization type is detected to be line synchronization type. The module is enabled to keep the serial port receive interrupt enabled when the current synchronization type is identified as optical synchronization. The serial port receive interrupt is used to receive the reception result fed back by the target bus chip.

[0087] Optionally, the device further includes: The receiving module is used to receive the receiving result at a preset time interval when the power is restored, and to receive synchronization status data sent by the other end within the time interval. The fifth determining module is used to determine whether the current synchronization type is the line synchronization type based on the received result or the synchronization status data.

[0088] Each module in the aforementioned synchronization type identification device for safety light curtains can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0089] In one embodiment, a computer device is provided, which may be a terminal device, and its internal structure diagram may be as follows: Figure 3 As shown, the computer device includes a processor, memory, and network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a readable storage medium storing computer-readable instructions. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer-readable instructions implement a synchronization type identification method for a security grating. The readable storage medium provided in this embodiment includes both non-volatile and volatile readable storage media.

[0090] In one embodiment of the application, a readable storage medium is provided, which stores computer-readable instructions. When the computer-readable instructions are executed by a processor, they implement the steps of the synchronization type identification method for the security grating described above.

[0091] 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 instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When executed, these computer-readable instructions can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0092] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0093] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for identifying the synchronization type of a safety light grating, characterized in that, The safety light curtain includes a transmitting end and a receiving end. The transmitting end is connected to a first bus chip, and the receiving end is connected to a second bus chip. A bus connects the first bus chip and the second bus chip. The method is applied to the receiving end or the transmitting end, and the method includes: The target bus chip outputs preset identification data to the bus and receives the reception result of the bus through the target bus chip, wherein the target bus chip is either the first bus chip or the second bus chip; Based on the received result, determine whether the current synchronization type is a line synchronization type; When the current synchronization type is not a line synchronization type, the current synchronization type is determined to be an optical synchronization type.

2. The synchronization type identification method for security light gratings as described in claim 1, characterized in that, The step of outputting preset identification data to the bus through the target bus chip and receiving the reception result of the bus through the target bus chip includes: The transmitting end outputs preset identification data to the bus through the first bus chip at the first output time, and receives the reception result of the bus through the first bus chip; Alternatively, the receiving end outputs preset identification data to the bus through the second bus chip at the second output time, and receives the reception result of the bus through the second bus chip; The first output time and the second output time are in different time windows.

3. The synchronization type identification method for security light gratings as described in claim 1, characterized in that, The preset recognition data consists of multiple consecutive target recognition characters. The step of determining whether the current synchronization type is a line synchronization type based on the received result includes: Detect the number of consecutive occurrences of the target identified character in the received result; Based on the number of consecutive occurrences and a preset threshold, determine whether the current synchronization type is a line synchronization type; The preset number threshold is set according to the number of target characters in the preset recognition data.

4. The synchronization type identification method for security light gratings as described in claim 3, characterized in that, The step of determining whether the current synchronization type is a line synchronization type based on the number of consecutive occurrences and a preset threshold number includes: When the number of consecutive occurrences meets a preset threshold, the current synchronization type is determined to be a line synchronization type. When the number of consecutive occurrences does not meet the preset threshold, the preset identification data is repeatedly sent through the target bus chip, and the number of consecutive occurrences of the target identification character in the received result is re-detected; When the number of re-detections reaches a preset number, and the number of consecutive occurrences still does not meet the preset threshold, it is determined that the current synchronization type is not a line synchronization type.

5. The synchronization type identification method for a security grating as described in any one of claims 1 to 4, characterized in that, The method further includes: When the current synchronization type is optical synchronization, obtain the level state of the output terminal of the target bus chip; When the number of consecutive high-level states meets a preset number of high-level states, the optical synchronization type is determined to be the first optical synchronization type. When the number of consecutive low-level states meets a preset number of low-level states, the optical synchronization type is determined to be the second optical synchronization type.

6. The synchronization type identification method for a security light grating as described in any one of claims 1 to 4, characterized in that, The method further includes: When the current synchronization type is detected as line synchronization, the serial port receive interrupt is disabled; When the current synchronization type is identified as optical synchronization, the serial port receive interrupt is kept enabled. The serial port receive interrupt is used to receive the reception result fed back by the target bus chip.

7. The synchronization type identification method for a security light grating as described in any one of claims 1 to 4, characterized in that, The method further includes: Upon power-on, the receiving result is received at a preset time interval, and synchronization status data sent by the other end is received within the time interval. Based on the received result or the synchronization status data, determine whether the current synchronization type is the line synchronization type.

8. A synchronization type identification device for a safety light curtain, characterized in that, The safety light curtain includes a transmitting end and a receiving end. The transmitting end is connected to a first bus chip, and the receiving end is connected to a second bus chip. A bus connects the first bus chip and the second bus chip. The device is applied to the receiving end or the transmitting end, and the device includes: The output module is used to output preset identification data to the bus through the target bus chip, and to receive the reception result of the bus through the target bus chip, wherein the target bus chip is the first bus chip or the second bus chip; The first determining module is used to determine whether the current synchronization type is a line synchronization type based on the received result; The second determining module is used to determine that the current synchronization type is an optical synchronization type when the current synchronization type is not a line synchronization type.

9. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and running on the processor, characterized in that, When the processor executes the computer-readable instructions, it implements the synchronization type identification method for the security grating as described in any one of claims 1 to 7.

10. A readable storage medium having computer-readable instructions stored thereon, characterized in that, When the computer-readable instructions are executed by the processor, they implement the synchronization type identification method for the security grating as described in any one of claims 1 to 7.