Method, system and terminal device for determining status of cascade device

By setting specific connection terminals and pins in the cascade device and using a microcontroller to control the status output, automatic status sorting and reverse horizontal line reading are achieved, which solves the problems of resource consumption and lack of flexibility in the existing technology and improves the flexibility and convenience of multi-machine cascade devices.

CN120215390BActive Publication Date: 2025-09-05SHENZHEN SHENPU ELECTRIC CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510596181.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-09-05
Estimated Expiration
2045-05-09

AI Technical Summary

Technical Problem

In the prior art, methods for determining the status of cascaded devices require multiple IO ports or rely entirely on communication, resulting in serious resource consumption and poor flexibility.

Method used

By setting specific connection terminals and connection pins, and using a microcontroller to control the output of each device status through a specific pin, the status is automatically sorted to the connection pin of the last device. Combined with pin degradation and reverse horizontal line reading, it reduces hardware resource usage and adapts to different connection scenarios.

Benefits of technology

It reduces resource consumption in multi-machine cascade devices, improves flexibility and convenience, and can accurately obtain device status without the need for communication and occupying too many bus resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120215390B_ABST
    Figure CN120215390B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of industrial automation control technology, and provides a method, system, and terminal device for determining the status of cascaded devices, including: obtaining a first pin corresponding to each device in the cascaded devices; wherein the first pin corresponding to the device is a pin among the multiple output pins included in the device for outputting the status information of the device; and determining the second pin corresponding to each device in the first device based on the pin connection relationship between each device and its adjacent devices; wherein the first device is the last device in the cascaded devices, and the second pin is a pin among the multiple output pins of the first device for outputting the status information of each device. The device status of the device corresponding to the second pin is determined based on the status information output by the second pin. The above method can reduce resource consumption and improve and can adapt to different connection scenarios of multiple cascaded devices, and has good flexibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of industrial automation control technology, and in particular relates to a method, system, and terminal device for determining the status of a cascaded device. Background Art

[0002] In current industrial application scenarios, multiple industrial machines and equipment usually need to work in cascade. To facilitate viewing and management, the status of multiple industrial machines and equipment usually needs to be processed centrally. However, during the data collection process, not only the status needs to be obtained, but also the device's identity (ID) needs to be matched with its status; otherwise, the data will be meaningless.

[0003] In related technologies, device status is determined by directly outputting the status through hardware input / output (IO) ports via connectors and then reading it from a master device, or by actively reporting it to a master device through a communication protocol, or by the master device requesting it from a slave device. However, these methods require multiple IO ports or rely entirely on communication, resulting in significant resource consumption and limited flexibility. Summary of the Invention

[0004] The embodiments of the present application provide a method, system, and terminal device for determining the status of a cascade device, which can reduce resource consumption and improve and adapt to different connection scenarios of multiple cascade devices with good flexibility.

[0005] In a first aspect, an embodiment of the present application provides a method for determining the status of a multi-machine cascade device, wherein the cascade device includes multiple devices connected sequentially in a first order, each device includes multiple groups of connection pins, and each group of connection pins includes an input pin and an output pin; the method includes:

[0006] Obtaining a first pin corresponding to each device in the cascaded devices; wherein the first pin corresponding to the device is a pin among a plurality of output pins included in the device for outputting status information of the device;

[0007] Determining, based on the pin connection relationship between each device and its adjacent devices, the second pin corresponding to each device in the first device; wherein the first device is the last device in the cascaded devices, and the second pin is a pin among the multiple output pins of the first device used to output status information of each device;

[0008] The device state of the device corresponding to the second pin is determined according to the state information output by the second pin.

[0009] In an embodiment of the present application, each device includes multiple output pins, wherein the pin for outputting device status information is defined as the first pin. The first device (i.e., the last device) in the cascade device has a second pin among its multiple output pins for outputting the status information of each device. Starting from the starting device, according to the pin connection rules, the status information is traced from the first pin of each device through the adjacent device to the first device, and then the second pin corresponding to each device status information on the first device is determined. After obtaining the status information output by the second pin, the status of the corresponding device can be determined. This method avoids setting up complex status monitoring circuits and interfaces for each device separately. It only needs to focus on the specific connection pins of the last device, reducing the occupation of hardware resources. Regardless of how the number of cascaded devices and the number of status output channels of each device change, this method can accurately obtain the device status, which has strong flexibility and adaptability.

[0010] In a possible implementation of the first aspect, determining a device state of a device corresponding to the second pin according to the state information output by the second pin includes:

[0011] Obtaining the status information of the second pin output corresponding to each device in sequence according to the first order;

[0012] The device state of the device corresponding to the second pin is determined according to the state information output by the second pin.

[0013] In the embodiment of the present application, the status information output by the second pin corresponding to each device is obtained in sequence according to the first order, ensuring that the status data of any device is not missed. Through this orderly acquisition method, the operating status of each device can be accurately monitored from the device at the beginning to the end of the cascade device.

[0014] In a possible implementation of the first aspect, determining a device state of a device corresponding to the second pin according to the state information output by the second pin includes:

[0015] Detecting whether a second device exists in the cascaded device; wherein the second device corresponds to a plurality of first pins;

[0016] If the second device exists, the device status of the second device is determined according to status information output by second pins corresponding to each of the plurality of first pins of the second device.

[0017] In the embodiments of the present application, detecting the presence of a second device in the cascaded devices ensures that the system comprehensively monitors the status of all devices. Because the second device corresponds to multiple first pins, its status information is more complex and diverse. Detecting the second device helps to fully understand the device status information and accurately determine the device status of each device.

[0018] In a possible implementation of the first aspect, determining the second pin corresponding to each device in the first device according to a pin connection relationship between each device and its adjacent device includes:

[0019] Obtaining a connection relationship between an input pin and an output pin of each device to obtain a first relationship;

[0020] Obtaining a connection relationship between input pins and output pins of each device and its adjacent device to obtain a second relationship;

[0021] According to the first relationship and the second relationship, a second pin corresponding to each device in the first device is determined.

[0022] In the embodiments of the present application, by obtaining the connection relationship between input and output pins within a device (a first relationship) and the connection relationship between adjacent pins between devices (a second relationship), and determining the second pin accordingly, accurate monitoring and centralized management of the status of each device in a cascaded device system can be achieved. The first relationship allows understanding the signal processing logic within each device and clarifying the flow of device status information from input to output. The second relationship allows understanding the transmission path of status information between devices. Based on the second pin determined by these two relationships, the status information of each device can be centralized at the output of the first device, facilitating unified monitoring.

[0023] In a possible implementation of the first aspect, the multiple groups of connection pins of each device are arranged in a high-low hierarchy;

[0024] The first relationship includes the third pin being connected to the fourth pin; wherein the third pin is any input pin, and the fourth pin is an output pin with a lower level than the third pin.

[0025] In an embodiment of the present application, multiple groups of connection pins of each device are arranged in high and low levels, establishing a clear order for the transmission of status information within the device and between devices, and the status output pin corresponding to each device can be accurately determined from the last device in the cascade device.

[0026] In a second aspect, an embodiment of the present application provides a device for determining a state of a cascade device, including:

[0027] A first pin acquisition module is configured to acquire a first pin corresponding to each device in the cascaded device; wherein the first pin corresponding to the device is a pin for outputting status information of the device among a plurality of output pins included in the device;

[0028] a second pin determination module, configured to determine a second pin corresponding to each device in the first device based on a pin connection relationship between each device and its adjacent devices; wherein the first device is the last device in the cascaded devices, and the second pin is a pin among a plurality of output pins of the first device used to output status information of each device;

[0029] The device status determination module is used to determine the device status of the device corresponding to the second pin according to the status information output by the second pin.

[0030] In a third aspect, an embodiment of the present application provides a system for determining the state of a cascade device, including a cascade device and multiple groups of connection pins;

[0031] The state determination system of the cascade device is used to implement the state determination method of the cascade device as described in any one of the first aspects above.

[0032] In a fourth aspect, an embodiment of the present application provides a terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, a method for determining the status of a cascaded device as described in any one of the first aspects above is implemented.

[0033] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements a method for determining the status of a cascade device as described in any one of the first aspects above.

[0034] In a sixth aspect, an embodiment of the present application provides a computer program product, which, when running on a terminal device, enables the terminal device to execute the method for determining the status of a cascade device according to any one of the above-mentioned first aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0036] Figure 1 is a schematic diagram of a system for determining the state of a cascade device provided in an embodiment of the present application;

[0037] Figure 2 1 is a flow chart of a method for determining the status of a cascade device provided in an embodiment of the present application;

[0038] Figure 3 is a schematic diagram of a flow chart for determining a second pin provided in an embodiment of the present application;

[0039] Figure 4 This is a schematic diagram of the pin relationship provided in the embodiment of the present application;

[0040] Figure 5 This is a schematic diagram of the process of determining the status of the cascade device provided in the embodiment of the present application Figure 1 ;

[0041] Figure 6 This is a schematic diagram of the process of determining the status of the cascade device provided in the embodiment of the present application Figure 2 ;

[0042] Figure 7 This is a schematic diagram of a structure for determining the status of a cascaded device provided in an embodiment of the present application;

[0043] Figure 8 This is a schematic diagram of the structure of a device for determining the state of a cascade device provided in an embodiment of the present application;

[0044] Figure 9 This is a structural diagram of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.

[0046] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0047] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0048] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0049] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0050] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized.

[0051] In current industrial application scenarios, multiple industrial machines and equipment usually need to work in cascade. To facilitate viewing and management, the status of multiple industrial machines and equipment usually needs to be processed centrally. However, during the data collection process, not only the status needs to be obtained, but also the device's identity (ID) needs to be matched with its status; otherwise, the data will be meaningless.

[0052] In related technologies, device status is determined by directly outputting the status through hardware input / output (IO) ports via connectors and then reading it from a master device, or by actively reporting it to a master device through a communication protocol, or by the master device requesting it from a slave device. However, these methods require multiple IO ports or rely entirely on communication, resulting in significant resource consumption and limited flexibility.

[0053] In order to solve the problems in the above-mentioned related technologies, the embodiments of the present application provide a method, system and terminal device for determining the status of a cascaded device. The present application sets specific connection terminals and connection pins, and the devices are cascaded through the terminals. The status of each device is controlled by a microcontroller (Micro Controller Unit, MCU) and output from a specific pin. The "connection pin degradation" is used to automatically sort the status to the right connection pin of the last device. The effective connection pin is related to the number of cascaded devices or the total number of device status paths, and is read at the second pin of the first device according to the inverse horizontal line. This method can be arbitrarily arranged and combined, has a fast response speed, does not require communication and occupies too many bus and IO resources, and improves the flexibility and convenience of multi-machine cascade devices.

[0054] See also Figure 1 , is a schematic diagram of a system for determining the state of a cascaded device provided in an embodiment of the present application, comprising: multiple devices and multiple groups of connection pins. Each group of connection pins includes an input pin and an output pin.

[0055] In the embodiment of the present application, the state determination system of the cascade device includes multiple devices, such as device A, device B, device C and device D (four devices are given as an example), and each device corresponds to multiple groups of connection pins, such as Figure 1 As shown, the connection pins are the pins provided in the connection terminals provided in this application. Each connection terminal can be equipped with 8 connection pins (the number can be different according to actual needs during actual application), including four input pins and four output pins. Each device is equipped with a connection terminal, and multiple devices can be connected through the connection terminals. The status of each device is output by the first output pin 1.

[0056] It should be noted that there are also specific connection methods for the pins within the connection terminal, where the range of such connection methods includes physical connection within the terminal itself, no connection within the terminal, and physical connection via external connection lines. For example, the first input pin 5 and the second output pin 2 can be connected through internal connection or external connection. The connection method within the connection terminal is set according to the number of status output pins of the device. For example, if device A has one output state, the internal connection method is set to 5-2 connection, 6-3 connection, or 7-4 connection. If it is a two-way output state, the device state is output by the first output pins 1 and 2, and the internal pin connection method is set to 5-3 connection or 6-4 connection.

[0057] According to the above system, the status output of the cascaded device is obtained, including:

[0058] The cascade device includes a plurality of devices connected in sequence according to a first order, each device includes a plurality of groups of connection pins, and each group of connection pins includes an input pin and an output pin; Figure 2 , is a flow chart of a method for determining the status of a cascade device provided in an embodiment of the present application. As an example and not a limitation, the method may include the following steps:

[0059] S101, obtaining a first pin corresponding to each device in the cascaded devices; wherein the first pin corresponding to the device is a pin for outputting status information of the device among a plurality of output pins included in the device.

[0060] In the embodiment of the present application, the cascade device is composed of multiple devices, and these devices are connected in sequence according to the "first order", such as Figure 1 As shown, the first order can be A, B, C, and D, but other sequential connections are also possible. This sequential connection method enables data and signals to be transmitted between devices, thereby collaboratively completing specific tasks. In a multi-machine cascade status acquisition system, the connection between devices is the foundation for the orderly transmission and centralized processing of status information.

[0061] The "first pin" corresponding to each device is a special pin among the multiple output pins of the device. Its main function is to output the status information of the device. The status information of the device may include whether the device is working properly, the current operating mode, various parameter indicators, etc. The purpose of obtaining the first pin of each device is to accurately collect and process the status information of the device in the future. By determining the first pin, the system can read the status data from these pins in a targeted manner, thereby realizing the monitoring and management of the status of the entire cascade device. Figure 1 The first output pin 1 corresponding to each device is the first pin. When the device is in a two-way state, the first output pin 1 and the second output pin 2 are both first pins. When there is a three-way state, the first output pin 1, the second output pin 2 and the third output pin 3 are all first pins, and so on.

[0062] S102, determining the second pin corresponding to each device in the first device based on the pin connection relationship between each device and its adjacent device; wherein the first device is the last device in the cascade device, and the second pin is a pin among multiple output pins of the first device for outputting status information of each device.

[0063] In the embodiments of the present application, each device has a specific pin connection relationship with its adjacent devices. This relationship establishes a path for the transfer of status information between devices. In actual connection, the output pin of the preceding device is connected to the input pin of the following device, ensuring that the status information is transferred in sequence.

[0064] The first device, the last device in the cascade, holds special significance within the system, serving as a key node for centrally acquiring status information from each device. The second pin is one of the multiple output pins on the first device, used to output the status information of each device. Due to the pin connections between the devices, each device's status information is ultimately transmitted to the first device, and the second pin is the specific pin used to output this aggregated status information. In a multi-device data acquisition system, the last data aggregation device is the first device, and its specific output pin serves as the second pin, outputting the status data of each acquisition device.

[0065] The second pin is determined based on the pin connections between each device and its adjacent devices. Starting from the first device, its status information is transmitted via its output pin to the next adjacent device, which then processes or directly passes it on, and so on until it reaches the first device. During this process, the first device receives status information from all cascaded devices and, by analyzing the connections between them, finds the second pin for outputting each device's status information.

[0066] In one embodiment, see Figure 3 , is a schematic diagram of a flow chart for determining a second pin according to an embodiment of the present application, wherein step S102 includes:

[0067] S201: Acquire a connection relationship between an input pin and an output pin of each device to obtain a first relationship.

[0068] In the embodiments of the present application, a specific connection relationship exists between the input pins and output pins of each device. This relationship determines the flow and processing of signals within the device. In practice, there are multiple methods for obtaining this connection relationship. For some devices with clear circuit design documentation, the relevant information can be directly obtained by consulting the documentation. In the design of large-scale integrated circuits, designers will record the connection relationship of each pin within the chip in detail. Engineers can obtain the first relationship by consulting the design manual.

[0069] In one embodiment, the multiple connection pins of each device are arranged in order of high and low levels; the first relationship includes the third pin being connected to the fourth pin; wherein the third pin is any input pin, and the fourth pin is an output pin with a lower level than the third pin.

[0070] In the embodiment of the present application, the multiple groups of connection pins contained in each device are not distributed in disorder, but are arranged according to high and low levels. This arrangement gives a specific logical order to the connection and signal transmission between the pins. The first relationship clarifies the connection rules of the third pin and the fourth pin. The third pin, as any input pin, is responsible for receiving external signals. These signals may come from the output pins of other devices or the control signal source of the system. The fourth pin, as an output pin with a level lower than the third pin, receives the signal from the third pin, processes it inside the device, and outputs the processed result.

[0071] See also Figure 4 , is a schematic diagram of the pin relationship provided in the embodiment of the present application, such as Figure 4 As shown, in the case where each device includes one status output, the third pin is any one of the first input pin 5, the second input pin 6, the third input pin 7 and the fourth input pin 8 of the connection terminal corresponding to each device, and the fourth pin is an output pin with a lower level than the third pin among the first output pin 1, the second output pin 2, the third output pin 3 and the fourth output pin 4 of the connection terminal corresponding to each device.

[0072] Among them, the levels of the connection pins are divided into level 1, level 2, level 3 and level 4 according to the horizontal lines, with level 1 being the highest and level 4 being the lowest. Figure 4 As shown, when the third pin is the first input pin 5 (primary level), the corresponding fourth pin is the second output pin 2 (secondary level), wherein the connection relationship between the first input pin 5 and the second output pin 2 can be determined as the first relationship. Alternatively, when the third pin is the second input pin 6 (secondary level), the corresponding fourth pin is the third output pin 3 (tertiary level), wherein the connection relationship between the second input pin 6 and the third output pin 3 can be determined as the first relationship.

[0073] In the above method, the multiple groups of connection pins of each device are arranged in a high-low hierarchy, establishing a clear order for the transmission of status information within and between devices. The status output pin corresponding to each device can be accurately determined from the last device in the cascade.

[0074] S202: Acquire a connection relationship between input pins and output pins of each device and its adjacent device to obtain a second relationship.

[0075] In the embodiment of the present application, the second relationship records in detail the connection status of the pins between each device and its adjacent devices. Figure 4As shown in , the second relationship specifies which input pin of device B the output pin of device A is connected to, and which input pin of the next adjacent device C the output pin of device B is connected to. Figure 4 In this example, if each device contains one state channel, the output state of each device is output through its first output pin 1. Since first output pin 1 is at the primary level, it is connected to first input pin 5, also at the primary level, among the input pins of the next adjacent device B. Since first input pin 5 of device B is internally connected to second output pin 2, and since second output pin 2 of device B is at the secondary level, it is connected to second input pin 6 of the next adjacent device C, also at the secondary level. The first output pin 1 of device B is connected to the first input pin 5 of device C, and so on.

[0076] Among them, the connection relationship between the first output pin 1 of device A and the first input pin 5 of device B is the second relationship, the relationship between the first output pin 1 of device B and the first input pin 5 of device C, and the relationship between the second output pin 2 of device B (corresponding to the state of the first output pin 1 of device A) and the second input pin 6 of device C is the second relationship, and so on.

[0077] S203: Determine the second pin corresponding to each device in the first device according to the first relationship and the second relationship.

[0078] In the embodiment of the present application, the first relationship and the second relationship are combined to sort out the complete transmission path of the status information of each device in the system. For example, the status information of device A first passes through its internal first relationship from input to output, then passes to device B through the second relationship, and then continues to pass from device B. Figure 4 The state of device A is that the first output pin 1 is connected to the first input pin 5 of device B, and the first input pin 5 of device B is connected to the internal second output pin 2, and the left and right sides of the corresponding connection terminals of the devices form a "connection pin degradation" phenomenon.

[0079] Device A's status is originally at the first level of the connection terminals, but it becomes the second level when it reaches device B. Similarly, it drops to the fourth level when it reaches device D. That is, device A's first output pin 1 is connected to device D's fourth output pin 4. Similarly, device B's first output pin 1 is connected to device D's third output pin 3; and device C's first output pin 1 is connected to device D's second output pin 2. Thus, the statuses from device A to device D are mapped one-to-one to the right-hand connecting pins of device D, specifically the right-hand connecting pins of the last device (the first device).

[0080] In this method, the connection relationship between input and output pins within a device (the first relationship) and the connection relationship between adjacent pins between devices (the second relationship) are obtained, and the second pin is determined based on this relationship. This enables precise monitoring and centralized management of the status of each device in the system. The first relationship allows understanding the signal processing logic within each device and clarifying the flow of device status information from input to output. The second relationship helps understand the transmission path of status information between devices. Based on the second pin determined by these two relationships, the status information of each device can be centralized at the output of the first device, facilitating unified monitoring.

[0081] S103: Determine the device status of the device corresponding to the second pin according to the status information output by the second pin.

[0082] In this embodiment of the present application, determining the device status of a corresponding device based on the status information output by the second pin requires reference to the previously established connection relationships (the first relationship and the second relationship). Because the status information of each device follows specific rules during transmission, the status information output by the second pin corresponds to each device. By parsing the second pin output information and comparing it with the known connection relationships, the corresponding status of each device can be determined.

[0083] In the above method, each device includes multiple output pins, of which the pin used to output device status information is defined as the first pin. For the first device (i.e., the last device) in the cascade, the pin used to output each device's status information is the second pin. Starting from the starting device, the pin connection rules are used to track how status information is transmitted from the first pin of each device through adjacent devices to the first device, thereby determining the second pin on the first device that corresponds to each device's status information. After obtaining the status information output by the second pin, the status of the corresponding device can be determined. This method avoids setting up complex status monitoring circuits and interfaces for each device, focusing only on the specific connection pins of the last device, reducing hardware resource usage. This method can accurately obtain device status regardless of the number of cascaded devices and the number of status output channels for each device, demonstrating its high flexibility and adaptability.

[0084] In one embodiment, see Figure 5 , is a schematic diagram of the process of determining the status of the cascade device provided in the embodiment of the present application Figure 1 , step S103 includes:

[0085] S301, sequentially obtaining status information of a second pin output corresponding to each device according to a first order.

[0086] In the embodiments of the present application, the "first order" refers to the specific order in which the devices in the cascaded device are connected in sequence. This order is determined when the device cascade is planned and built, and the status information of these second pin outputs is obtained in the first order. This sequential acquisition method ensures the completeness and accuracy of the status information acquisition.

[0087] As mentioned above Figure 4 In the example, when the cascaded device includes four devices, the first pin of device D, also called the valid pin, is determined based on the first relationship (the connection rules of the input and output pins within the device) and the second relationship (the connection rules of the input and output pins between adjacent devices). That is, it is determined that the output state of the fourth output pin 4 of device D (the first device) corresponds to device A, the output state of the third output pin 3 of device D corresponds to device B, the output state of the second output pin 2 of device D corresponds to device C, and the output state of the first output pin 1 of device D corresponds to device D. Therefore, the status information of the output pins of device D is read in the first order of A, B, C, and D, that is, reading from the right connection pins of device D from low to high along a horizontal line.

[0088] When cascading three devices, only the top three horizontal pins on the right side of the last device, device C, are valid. Status reading is performed in reverse order (first in first place). Similarly, when cascading two devices, only the top two horizontal pins are valid, and status reading is performed in reverse order. In summary, the valid pins are related to the number of cascaded devices and have a one-to-one correspondence. That is, when the number of cascaded devices is three, only the top three horizontal pins are valid. In other words, the valid pins are those connected to the first output pin 1 and the same number of cascaded devices in the same horizontal order (from highest to lowest). Status reading is performed in reverse order. That is, when cascading two devices, the valid pins are those on the first and second horizontal lines. The status of device A corresponds to pin 2 of device B, and the status of device B corresponds to pin 1 of device B.

[0089] S302: Determine a device state of a device corresponding to the second pin according to the state information output by the second pin.

[0090] In an embodiment of the present application, in accordance with the first order, starting from the starting device of the system, the second pin corresponding to each device on the first device is determined one by one, and then the status information output by these second pins is obtained to determine the device status corresponding to each device.

[0091] In the above method, the status information output by the second pin corresponding to each device is obtained in sequence according to the first order, ensuring that no device's status data is missed. Through this orderly acquisition method, the operating status of each device in the cascade can be accurately monitored, from the device at the beginning to the end.

[0092] In one embodiment, see Figure 6 , is a schematic diagram of the process of determining the status of the cascade device provided in the embodiment of the present application Figure 2 , step S103 further includes:

[0093] S401, detecting whether a second device exists in the cascaded device; wherein the second device corresponds to a plurality of first pins.

[0094] In the embodiments of the present application, a device typically has more than one channel state. A single channel state corresponds to a single, special output pin, namely the first pin, of the device. If a device has multiple channels, it may have multiple first pins. If a device has multiple channels, the pin connections within the corresponding connection terminals will differ, and the pins transmitted to the last device (i.e., the first device) will also change. Therefore, it is necessary to detect whether there are devices in the cascaded device with multiple channels.

[0095] As an example, detecting the presence of the second device requires determining the connection relationship between the devices and the electrical characteristics of the pins. Hardware testing can be performed using professional circuit testing tools, such as logic analyzers and oscilloscopes, to monitor and analyze the pin signals of the cascaded devices. If a device is found to have multiple pins outputting status information that matches the characteristics of the second device, it can be determined to be the second device.

[0096] S402: If the second device exists, determine the device status of the second device according to status information output by second pins corresponding to each of the plurality of first pins of the second device.

[0097] In the examples of this application, see Figure 7 , is a structural diagram of determining the state of a cascade device provided in an embodiment of the present application, such as Figure 7 As shown, if it is detected that there is a device B in the cascade device with a 2-way state, since it is in a 2-way state, its state will be output by its first output pin 1 and second output pin 2, and the internal connection pins will start from the third output pin 3, that is, the number of states + 1. The same is true for multi-way connection terminals. Its internal third output pin 3 is connected to the first input pin 5, and the fourth output pin 4 and the second input pin 6 are connected. Device C is the last one, and the connection pins on the right side of its terminal are the total state arrangement. The number of effective connection pins has changed, and its effective connection pins are equal to the sum of the number of state paths of all devices. That is, the connection pins connecting the first output pin 1 to the sum of the number of device state paths along the horizontal line are effective connection pins.

[0098] like Figure 7In this example, the valid connection pins are the first output pin 1, the second output pin 2, the third output pin 3, and the fourth output pin 4. Therefore, based on the internal pin connections of the device and the pin connections between adjacent devices, it can be determined that the fourth output pin 4 of device C corresponds to the device state of device A, the third output pin 3 corresponds to the device state of the second output pin 2 of device B, and the second output pin 2 corresponds to the device state of the first output pin 1 of device B. The device state corresponding to each device is read in reverse horizontal order from the right pins of device C, following the first order, i.e., the connection order of the cascaded devices.

[0099] In the above method, detecting the presence of a second device in the cascade ensures that the system fully monitors the status of all devices. Because the second device corresponds to multiple first pins and its status information is more complex and diverse, detecting the second device helps to fully understand the device status information and accurately determine the device status of each device.

[0100] The present application provides a method, system and terminal device for determining the status of cascaded devices. The present application sets specific connection terminals and connection pins, and the devices are cascaded through the terminals. The status of each device is controlled by the microcontroller MCU and output from a specific pin. "Connection pin degradation" is used to automatically sort the status to the right connection pin of the last device. The effective connection pin is related to the number of cascaded devices or the total number of device status paths, and is read according to the inverse horizontal line. This method can be arbitrarily arranged and combined, has a fast response speed, does not require communication and occupies too many bus and IO resources, and improves the flexibility and convenience of multi-machine cascade devices.

[0101] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean 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 this application.

[0102] Corresponding to the method for determining the state of the cascade device in the above embodiment, Figure 8 This is a structural block diagram of the device 8 for determining the state of a cascaded device provided in an embodiment of the present application. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0103] Reference Figure 8 , the device 8 comprises:

[0104] A first pin acquisition module 81 is configured to acquire a first pin corresponding to each device in the cascaded devices; wherein the first pin corresponding to the device is a pin for outputting device status information among a plurality of output pins included in the device;

[0105] A second pin determination module 82 is configured to determine a second pin corresponding to each device in the first device based on a pin connection relationship between each device and its adjacent devices; wherein the first device is the last device in the cascaded devices, and the second pin is a pin among a plurality of output pins of the first device used to output status information of each device;

[0106] The device status determining module 83 is configured to determine the device status of the device corresponding to the second pin according to the status information output by the second pin.

[0107] Optionally, the second pin determination module 82 is further configured to:

[0108] Obtaining a connection relationship between an input pin and an output pin of each device to obtain a first relationship;

[0109] Obtaining a connection relationship between input pins and output pins of each device and its adjacent device to obtain a second relationship;

[0110] According to the first relationship and the second relationship, a second pin corresponding to each device in the first device is determined.

[0111] Optionally, the second pin determination module 82 is further configured to:

[0112] Multiple groups of connection pins for each device are arranged in high and low levels;

[0113] The first relationship includes the third pin being connected to the fourth pin; wherein the third pin is any input pin, and the fourth pin is an output pin with a lower level than the third pin.

[0114] Optionally, the device status determination module 83 is further configured to:

[0115] Obtaining the status information of the second pin output corresponding to each device in sequence according to the first order;

[0116] The device state of the device corresponding to the second pin is determined according to the state information output by the second pin.

[0117] Optionally, the device status determination module 83 is further configured to:

[0118] Detecting whether a second device exists in the cascaded device; wherein the second device corresponds to a plurality of first pins;

[0119] If the second device exists, the device status of the second device is determined according to status information output by second pins corresponding to each of the plurality of first pins of the second device.

[0120] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of this application. Their specific functions and technical effects can be found in the method embodiment section and will not be repeated here.

[0121] in addition, Figure 8 The cascade device status determination device 8 shown can be a software unit, hardware unit, or a combination of software and hardware units built into the existing terminal device, or can be integrated into the terminal device as an independent hangup, or can exist as an independent terminal device.

[0122] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by 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. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0123] Figure 9 This is a schematic diagram of the structure of the terminal device provided in the embodiment of the present application. Figure 9 As shown, the terminal device 9 of this embodiment includes: at least one processor 90 ( Figure 9 Only one is shown in the figure) a processor, a memory 91, and a computer program 92 stored in the memory 91 and executable on at least one processor 90. When the processor 90 executes the computer program 92, the steps in the above-mentioned method for determining the state of any of the cascade devices are implemented.

[0124] The terminal device can be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that Figure 9 It is only an example of the terminal device 9 and does not constitute a limitation on the terminal device 9. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0125] The processor 90 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor or any conventional processor.

[0126] In some embodiments, the memory 91 may be an internal storage unit of the terminal device 9, such as the terminal device 9's hard drive or memory. In other embodiments, the memory 91 may also be an external storage device of the terminal device 9, such as a plug-in hard drive, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. Furthermore, the memory 91 may include both the terminal device 9's internal storage unit and an external storage device. The memory 91 is used to store the operating system, application programs, boot loaders, data, and other programs, such as the program code of computer programs. The memory 91 may also be used to temporarily store data that has been output or is about to be output.

[0127] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0128] An embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device can implement the steps in the above-mentioned method embodiments when executing the computer program product.

[0129] If the integrated unit is implemented as a software functional unit and sold or used as a standalone product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application can implement all or part of the process steps in the above-mentioned method embodiments by using a computer program to instruct the relevant hardware. The computer program can be stored in a computer-readable storage medium. When executed by a processor, the computer program can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. Computer-readable media can include at least: any entity or device capable of carrying computer program code to a device / terminal equipment, recording media, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signals, telecommunications signals, and software distribution media. Examples include USB flash drives, removable hard drives, magnetic disks, or optical disks. In some jurisdictions, based on legislation and patent practice, computer-readable media cannot be electric carrier signals or telecommunications signals.

[0130] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0131] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0132] In the embodiments provided in this application, it should be understood that the disclosed devices / terminal devices and methods can be implemented in other ways. For example, the device / terminal device embodiments described above are merely illustrative. For example, the division of modules or units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0133] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0134] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the scope of protection of the present application.

Claims

1. A method for determining the status of a cascade device, characterized in that: The cascade device includes a plurality of devices connected in sequence according to a first order, each device includes a plurality of groups of connection pins, and each group of connection pins includes an input pin and an output pin; the method includes: Obtaining a first pin corresponding to each device in the cascaded devices; wherein the first pin corresponding to the device is a pin among a plurality of output pins included in the device for outputting status information of the device; Determining, based on a pin connection relationship between each device and its adjacent device, a second pin corresponding to each device in a first device; wherein the first device is the last device in the cascaded device, and the second pin is a pin among a plurality of output pins of the first device for outputting status information of each device; The device status of the device corresponding to the second pin is determined according to the status information output by the second pin.

2. The method for determining the state of a cascade device according to claim 1, wherein: The determining, according to the status information output by the second pin, the device status of the device corresponding to the second pin includes: sequentially acquiring the status information of the second pin output corresponding to each device according to the first order; The device status of the device corresponding to the second pin is determined according to the status information output by the second pin.

3. The method for determining the state of a cascade device according to claim 1 or 2, wherein: The determining, according to the status information output by the second pin, the device status of the device corresponding to the second pin includes: Detecting whether there is a second device in the cascade device; wherein the second device corresponds to a plurality of first pins; If the second device exists, the device status of the second device is determined according to status information output by second pins corresponding to each of the plurality of first pins of the second device.

4. The method for determining the state of a cascade device according to claim 1, wherein: The step of determining the second pin corresponding to each device in the first device according to the pin connection relationship between each device and its adjacent device includes: Obtaining a connection relationship between an input pin and an output pin of each device to obtain a first relationship; Obtaining a connection relationship between input pins and output pins of each device and its adjacent device to obtain a second relationship; According to the first relationship and the second relationship, a second pin corresponding to each device in the first device is determined.

5. The method for determining the state of a cascade device according to claim 4, wherein: Multiple groups of connection pins for each device are arranged in high and low levels; The first relationship includes a third pin being connected to a fourth pin; wherein the third pin is any input pin, and the fourth pin is an output pin with a lower level than the third pin.

6. A device for determining the state of a cascade device, characterized in that: include: A first pin acquisition module, configured to acquire a first pin corresponding to each device in the cascaded devices; wherein the first pin corresponding to the device is a pin among a plurality of output pins included in the device, which is used to output status information of the device; a second pin determination module, configured to determine, based on a pin connection relationship between each device and its adjacent device, a second pin corresponding to each device in the first device; wherein the first device is the last device in the cascaded devices, and the second pin is a pin among a plurality of output pins of the first device used to output status information of each device; The device status determination module is configured to determine the device status of the device corresponding to the second pin according to the status information output by the second pin.

7. A system for determining the state of a cascade device, characterized in that: include: Multiple devices, multiple sets of connection pins; The state determination system of the cascade device is used to implement the state determination method of the cascade device according to any one of claims 1 to 5.

8. The state determination system of the cascade device according to claim 7, characterized in that: Each set of connection pins includes one input pin and one output pin.

9. A terminal device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Input pin status detection circuit and method

    CN102291106A

  • Multi-cascade key detection method and device

    CN116820256A