Communication method and system of cascaded board cards
By introducing response rules for communication flag values in the cascading board, the problems of waste and delay in addressing scheme resources in the prior art are solved, and efficient communication and flexible sorting without addressing are achieved.
Patent Information
- Application Number
- CN202411851727.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-04-15
AI Technical Summary
The addressing scheme of the cascaded board card in the prior art requires a large amount of software and hardware resources, resulting in communication delays and waste of resources. At the same time, the board card position is fixed and cannot be sorted at will.
The response rules of communication flag values are used to control the cascading board response control instructions, including the reply flag value, the passing answer flag value and the passing flag value, reducing addressing operations and realizing communication without addressing.
It reduces the cost of software and hardware design, reduces communication delay, allows boards to be sorted at will, improves communication efficiency and eliminates the problem of board errors caused by addressing errors.
Smart Images

Figure CN119829504A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communication technology, and in particular, relates to a communication method and system for cascading boards. Background Art
[0002] Cascading boards usually refer to connecting multiple boards together in some way (such as cables, buses, etc.) to achieve communication and data transmission between them. This connection method can enhance the scalability of the system, so that more devices or modules can be added to the system. In the communication link, the cascaded boards are the same and there are more of them. When the boards are controlled individually or the board data is distinguished, it is necessary to know the position or number of each board in advance, and send corresponding instructions to control the board according to the address or number of the board, so it is necessary to address the board in advance, formulate an ID for the board, and determine the identity of the board. After being able to distinguish the board ID, the subsequent host computer or main control board can control the corresponding board separately according to the ID. When the cascaded board receives the instruction, it is also necessary to compare the ID in the instruction with the local board ID, and respond to the instruction after the ID is consistent. However, the addressing scheme in the prior art often requires a large amount of communication resources such as software and hardware to be wasted, and it will also cause communication time delay. Summary of the invention
[0003] The purpose of the present application is to provide a communication method and system for cascading boards, which can reduce communication resources and communication delays.
[0004] In a first aspect, the present application provides a communication method for cascaded boards, the method being applied to any cascaded board in a communication link, comprising:
[0005] receiving a control instruction, wherein the control instruction has a communication flag value; the communication flag value includes a response flag value, a transfer response flag value, and a transfer flag value;
[0006] A response rule based on the communication flag value responds to the control instruction.
[0007] In an implementation of the first aspect, the response rule based on the communication flag value corresponding to the control instruction includes:
[0008] Responding to the control instruction based on a response rule of the response flag value;
[0009] Deliver and respond to the control instruction based on the response rule of the delivery response flag value; or
[0010] The control instruction is delivered based on a response rule of the delivery flag value.
[0011] In an implementation manner of the first aspect, responding to the control instruction based on a response rule of the response flag value includes:
[0012] When the control instruction contains the response flag value, any cascade board receiving the control instruction is configured according to the control instruction; and
[0013] After the configuration is completed, any one-stage cascade board sends a response message to the previous-stage cascade board.
[0014] In an implementation of the first aspect, transmitting and responding to the control instruction based on a response rule for transmitting a response flag value includes:
[0015] When the control instruction contains the transfer response flag value, any cascade board receiving the control instruction is configured according to the control instruction;
[0016] After the configuration is completed, any one of the cascade boards sends a response message to the previous cascade board; and
[0017] Any one-stage cascade board transmits the control instruction to the next-stage cascade board.
[0018] In an implementation manner of the first aspect, transmitting the control instruction based on a response rule of the transmission flag value includes:
[0019] When the control instruction contains the transfer flag value, any cascade card at one stage receiving the control instruction decrements the transfer flag value by 1 and then transfers the control instruction to the next cascade card at one stage.
[0020] In an implementation of the first aspect, when any one of the cascading boards receives a response message from a subsequent cascading board, the response message is transmitted to a previous cascading board.
[0021] In a second aspect, the present application provides a communication system of cascade boards, the system comprising a main control machine and a plurality of cascade boards;
[0022] The main control machine issues a control instruction, wherein the control instruction has a communication flag value; the communication flag value includes a response flag value, a transfer response flag value and a transfer flag value; and
[0023] Any cascade card among the plurality of cascade cards receives the control instruction and responds to the control instruction based on a response rule of the communication flag value.
[0024] In an implementation of the second aspect, responding to the control instruction based on a response rule of the communication flag value includes:
[0025] Responding to the control instruction based on a response rule of the response flag value;
[0026] Deliver and respond to the control instruction based on the response rule of the delivery response flag value; or
[0027] The control instruction is delivered based on a response rule of the delivery flag value.
[0028] In an implementation of the second aspect, when any one of the cascading boards receives a response message from a subsequent cascading board, the response message is transmitted to a previous cascading board.
[0029] In an implementation manner of the second aspect, the main control machine determines the number of cascade boards in the communication system of the cascade boards based on the response rule of the transfer response flag value.
[0030] As described above, the communication method and system of cascaded boards described in the present application have the following beneficial effects:
[0031] (1) The present application can control the cascaded boards to respond to control instructions by setting response rules with different communication flag values, without performing addressing operations on the cascaded boards. This reduces the software and hardware design for implementing the addressing function, reduces development content and difficulty, saves costs, and reduces communication delays.
[0032] (2) The present application does not need to consider the placement of the cascaded boards during use, and can be arranged at will, making the use process simpler and more efficient.
[0033] (3) The present application enables the cascaded boards to avoid having to compare the local ID with the command ID every time when responding, thereby eliminating the problem of board malfunction caused by local addressing errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 Shown is a schematic diagram of the structure of a communication system of cascaded boards in an embodiment of the present application.
[0035] Figure 2 Shown is a flow chart of a communication method for cascading boards described in an embodiment of the present application in one embodiment.
[0036] Figure 3 Shown is a schematic diagram of the principles of a communication method for cascading boards described in an embodiment of the present application in one embodiment. DETAILED DESCRIPTION
[0037] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.
[0038] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application, and thus the drawings only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed at will, and the component layout may also be more complicated.
[0039] In addition, in this application, descriptions such as "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0040] At present, there are usually two methods for addressing cascaded boards, including hardware addressing and software addressing. Among them, hardware addressing generally uses the state of a multi-bit dip switch or a uniquely numbered electronic component number as the board address. The method of using a multi-bit dip switch as the board address requires setting the dip switch to the correct state in advance when connecting the board, and the method of using the electronic component number as the board address requires the board to be correctly sorted according to the component number. However, after the board cascade is completed, the board that uses the dip switch state as the ID needs to toggle the dip switch according to the board position so that the state of the dip switch is consistent with the cascade order, and the board that uses the component number as the ID cannot be sorted arbitrarily when in use, and the ID must be placed corresponding to the actual position.
[0041] For software addressing, the host computer or main control board usually sends the initial number to the first board after the system is initialized. After the first board is addressed, the number is updated (usually plus or minus 1) and passed to the second board. After the second board is addressed, the number is updated and passed to the third board, and so on, until all boards are addressed. However, the use of software addressing requires adding addressing operations to the control chip of the board, increasing the chip resource usage, and once the system is disturbed during the addressing process, the board will be set to an incorrect ID and the system will not be able to be used normally. In addition, no matter whether hardware addressing or software addressing is completed, it has an ID to distinguish the cascaded boards. At this time, when the cascaded boards respond to instructions, they need to compare the ID in the instruction with the local ID each time, increasing the chip resource usage and increasing the communication time delay.
[0042] In order to at least solve the above problems, the embodiment of the present application provides a communication method for cascading boards, which can control the cascading boards to respond to control instructions by setting the response rules of the communication flag value without performing addressing operations on the cascading boards. This reduces the software and hardware design to realize the addressing function, reduces the development content and difficulty, saves costs, and reduces communication delays. Secondly, the placement of the cascading boards is no longer a consideration during use, and they can be sorted at will, making them simpler and more efficient to use. In addition, the cascading boards do not need to compare the local ID with the instruction ID every time when responding, thereby eliminating the problem of board error operation caused by local addressing errors.
[0043] The technical solutions in the embodiments of the present application will be described in detail below in conjunction with the drawings in the embodiments of the present application.
[0044] In some embodiments, the communication system of the cascaded boards provided in the embodiments of the present application is as follows: Figure 1 As shown. Figure 1 As shown, the communication system 100 of the cascade boards includes a main control board 10 and a plurality of identical cascade boards 1 to N. The main control board 10 sends a control instruction, and the control instruction has a communication flag value, and the communication flag value includes a response flag value, a transfer response flag value, and a transfer flag value. Upon receiving the control instruction, any cascade board among the cascade boards 1 to N responds to the control instruction based on the response rule of the communication flag value.
[0045] Among them, any cascade board card of the cascade boards 1 to N responds to the control instruction based on the response rule of the response flag value, or transmits and responds to the control instruction based on the response rule of the transmission response flag value, or transmits the control instruction to the cascade board of the next level based on the response rule of the transmission flag value, until when a certain cascade board receives the control instruction, the control instruction has the response flag value, and the cascade board responds to the control instruction at this time, so that the main control board 10 can control any board without addressing, and the board does not need to compare the control ID and the local ID when it should, but directly responds based on the communication flag value, which greatly reduces communication resources and communication delays.
[0046] In some embodiments, the communication flag value includes a response flag value, a transfer response flag value, and a transfer flag value. In some embodiments, the response flag value is "1", the transfer response flag value is "0", and the transfer flag value is any other value other than "1" and "0".
[0047] In some embodiments, when the communication flag value in the control instruction is "1", that is, it has the response flag value, any cascade card that receives the control instruction performs configuration according to the control instruction, and sends a response message to the previous cascade card after the configuration is completed. That is, in the communication link, any cascade card may receive the control instruction. At this time, when the communication flag value in the control instruction is "1", the card uses the parameters transmitted in the control instruction to perform configuration, and sends a response message to the previous level after the configuration is completed.
[0048] In some embodiments, when the communication flag value in the control instruction is "0", that is, when it has the transmission response flag value, any cascade board receiving the control instruction is configured according to the control instruction, and sends a response message to the previous cascade board after the configuration is completed. In addition, the board will continue to pass the control instruction to the next board. That is, in the communication system of the cascade board, when the first cascade board receives the control instruction and the communication flag value is 0, the first cascade board will use the parameters transmitted in the control instruction for configuration, and send a response message to the previous level after the configuration is completed. In addition, the first cascade board will continue to pass the control instruction to the second cascade board without any change, so as to pass it in sequence, so as to complete the configuration of all cascade boards. In other words, when the main control board or the host computer issues a control instruction, and the communication flag value in the control instruction is "0", all boards can be controlled to respond to the control instruction.
[0049] It should be noted that when any of the cascade boards receives a response message from the next cascade board, it is necessary to pass the response message to the previous cascade board. As described above, when any of the cascade boards receives a control instruction, when the communication flag value in the control instruction is "0" (transmission response flag value) or "1" (response flag value), the board receiving the control instruction will send a response message to the previous level. When the previous board receives the response message from the next board, it will continue to pass it to the previous board until it is passed to the host computer or the main control board. That is, each board receiving the control instruction will return its own response message to the host computer or the main control board.
[0050] Furthermore, when the communication system of the cascade boards needs to be initialized, the host computer or the main control board may issue a control instruction containing the transmission response flag value. Then, according to the response rule of the transmission response flag value, it can be known that in fact all the cascade boards will receive the control instruction and send a response message. At this time, the host computer or the main control board can count according to the received response messages to determine the number of cascade boards in the communication system of the cascade boards.
[0051] In some embodiments, when the communication flag value in the control instruction is other values other than "0" and "1", that is, when it has the transfer flag value, any cascade board receiving the control instruction will reduce the transfer flag value by 1 and transfer the control instruction to the next cascade board. For example, when the transfer flag value is N (N is not equal to 0 and 1), when the communication flag value of the control instruction received by the first cascade board is "N", the first cascade board only needs to reduce the communication flag value by 1 and transmit the control instruction with the communication flag value of "N-1" to the next level; when the second cascade board receives the control instruction with the communication flag value of "N-1" (N-1≠1), it only needs to reduce the instruction ID by 1 and transmit the control instruction with the communication flag value of "N-2" to the next level board... By analogy, the communication flag value of the control instruction received by the Nth board should be "1", at which time the Nth board will be configured according to the control instruction based on the response rule of the response flag value, and send a response message to the previous cascade board after the configuration is completed. In this way, the host computer or the main control board can actually control a certain board individually for configuration.
[0052] The following embodiments of the present application provide a communication method for cascading boards, and the method is applied to any cascading board in a communication link. Figure 2 The flow chart of the communication method of the cascaded boards described in the embodiment of the present application is shown as follows: Figure 2 As shown, the communication method of the cascaded boards includes steps S1 to S2.
[0053] S1. Receive a control instruction, wherein the control instruction has a communication flag value; the communication flag value includes a response flag value, a transfer response flag value and a transfer flag value.
[0054] In some embodiments, the response flag value is "1", the transfer response flag value is "0", and the transfer flag value is any other value other than "1" and "0".
[0055] S2. Respond to the control instruction based on a response rule of the communication flag value.
[0056] Specifically, the control instruction is responded to based on a response rule of the response flag value.
[0057] In some embodiments, when the communication flag value in the control instruction is "1", that is, it has the response flag value, any cascade card that receives the control instruction performs configuration according to the control instruction, and sends a response message to the previous cascade card after the configuration is completed. That is, in the communication link, any cascade card may receive the control instruction. At this time, when the communication flag value in the control instruction is "1", the card uses the parameters transmitted in the control instruction to perform configuration, and sends a response message to the previous level after the configuration is completed.
[0058] Specifically, the control instruction is delivered and responded to based on the response rule of the delivery response flag value.
[0059] In some embodiments, when the communication flag value in the control instruction is "0", that is, when it has the transmission response flag value, any cascade board receiving the control instruction at this time is configured according to the control instruction, and sends a response message to the previous cascade board after the configuration is completed. In addition, the board will continue to pass the control instruction to the next board. That is, in the communication link, when the first-level cascade board receives the control instruction and the communication flag value is 0, the first cascade board will use the parameters transmitted in the control instruction for configuration, and send a response message to the previous level after the configuration is completed. In addition, the first-level cascade board will continue to pass the control instruction to the second-level cascade board without any change, so as to pass it in sequence, so as to complete the configuration of all cascade boards. In other words, when the main control board or the host computer issues a control instruction and the communication flag value in the control instruction is "0", all boards can be controlled to respond to the control instruction.
[0060] It should be noted that when any of the cascade boards receives a response message from the next cascade board, it is necessary to pass the response message to the previous cascade board. As described above, when any of the cascade boards receives a control instruction, when the communication flag value in the control instruction is "0" (transmission response flag value) or "1" (response flag value), the board receiving the control instruction will send a response message to the previous level. When the previous board receives the response message from the next board, it will continue to pass it to the previous board until it is passed to the host computer or the main control board. That is, each board receiving the control instruction will return its own response message to the host computer or the main control board.
[0061] Specifically, the control instruction is transmitted based on a response rule of the transmission flag value.
[0062] In some embodiments, when the communication flag value in the control instruction is other values other than "0" and "1", that is, when it has the transfer flag value, any cascade board receiving the control instruction will reduce the transfer flag value by 1 and transfer the control instruction to the next cascade board. For example, when the transfer flag value is N (N is not equal to 0 and 1), when the communication flag value of the control instruction received by the first cascade board is "N", the first cascade board only needs to reduce the communication flag value by 1 and transmit the control instruction with the communication flag value of "N-1" to the next level; when the second cascade board receives the control instruction with the communication flag value of "N-1" (N-1≠1), it only needs to reduce the instruction ID by 1 and transmit the control instruction with the communication flag value of "N-2" to the next level board... By analogy, the communication flag value of the control instruction received by the Nth board should be "1", at which time the Nth board will be configured according to the control instruction based on the response rule of the response flag value, and send a response message to the previous cascade board after the configuration is completed. In this way, the host computer or the main control board can actually control a certain board individually for configuration.
[0063] Figure 3 The schematic diagram of the principle of the communication method of the cascaded boards provided in the embodiment of the present application is shown. Figure 3As shown, first, the cascade board needs to be initialized to determine the number of cascade boards in the communication link. Afterwards, for any cascade board, when it receives a control instruction, if the communication flag value of the control instruction is the response flag value, then any cascade board is configured according to the control instruction, and a response message is transmitted to the previous cascade board, and after completion, the cascade board returns to the state of waiting to receive the control instruction. If the communication flag value of the control instruction is the transmission response flag value, then any cascade board transmits the control instruction to the next cascade board, and any cascade board is configured according to the control instruction, and a response message is transmitted to the previous cascade board, and after completion, the cascade board returns to the state of waiting to receive the control instruction. If the communication flag value of the control instruction is the transmission flag value, the control instruction is continued to be transmitted to the next cascade board after the transmission flag value-1, and after completion, the cascade board returns to the state of waiting to receive the control instruction. In addition, when any cascade card receives a response message from the next cascade card, it continues to pass the response message to the previous level, and after completion, it also returns to the state of waiting to receive control instructions.
[0064] The communication method and system of the cascade boards provided in the embodiments of the present application can control the cascade boards to respond to control instructions by setting response rules for different communication flag values, without the need to perform addressing operations on the cascade boards. This reduces the hardware and software design for implementing the addressing function, reduces development content and difficulty, saves costs, and reduces communication delays. Secondly, by using the communication method of the cascade boards provided in the embodiments of the present application, it is possible to arrange the cascade boards at will without considering the placement position of the cascade boards during use, and the use process becomes simpler and more efficient. Finally, by using the communication method of the cascade boards provided in the embodiments of the present application, it is possible to make the cascade boards not need to compare the local ID with the instruction ID every time when responding, thereby eliminating the problem of board error operation caused by local addressing errors.
[0065] The protection scope of the communication method of the cascaded boards described in the embodiment of the present application is not limited to the execution order of the steps listed in the present embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.
[0066] In addition, an embodiment of the present application provides a communication system of cascading boards, and the communication system of the cascading boards can implement the communication method of the cascading boards described in the present application, but the implementation device of the communication system of the cascading boards described in the present application includes but is not limited to the structure of the communication system of the cascading boards listed in the present embodiment, and all structural deformations and replacements of the prior art made according to the principles of the present application are included in the protection scope of the present application.
[0067] In the several embodiments provided in the present application, it should be understood that the disclosed system, device or method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules / units is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or units 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 an indirect coupling or communication connection through some interfaces, devices or modules or units, which can be electrical, mechanical or other forms.
[0068] The modules / units described as separate components may or may not be physically separated, and the components displayed as modules / units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules / units may be selected according to actual needs to achieve the purpose of the embodiments of the present application. For example, the functional modules / units in the various embodiments of the present application may be integrated into one processing module, or each module / unit may exist physically separately, or two or more modules / units may be integrated into one module / unit.
[0069] Those of ordinary skill in the art should further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. 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 to be beyond the scope of this application.
[0070] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0071] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.
Claims
1. A communication method for cascading boards, characterized in that: The method is applied to any cascade card in a communication link, and includes: receiving a control instruction, wherein the control instruction has a communication flag value; the communication flag value includes a response flag value, a transfer response flag value, and a transfer flag value; A response rule based on the communication flag value responds to the control instruction.
2. The communication method of cascaded boards according to claim 1, characterized in that: The response rule based on the communication flag value corresponding to the control instruction includes: Responding to the control instruction based on a response rule of the response flag value; Deliver and respond to the control instruction based on the response rule of the delivery response flag value; or The control instruction is delivered based on a response rule of the delivery flag value.
3. The communication method of cascaded boards according to claim 2, characterized in that: Responding to the control instruction based on the response rule of the response flag value includes: When the control instruction contains the response flag value, any cascade board receiving the control instruction is configured according to the control instruction; and After the configuration is completed, any one-stage cascade board sends a response message to the previous-stage cascade board.
4. The communication method of cascaded boards according to claim 2, characterized in that: The response rule based on the transmission response flag value transmits and responds to the control instruction, including: When the control instruction contains the transfer response flag value, any cascade board receiving the control instruction is configured according to the control instruction; After the configuration is completed, any one of the cascade boards sends a response message to the previous cascade board; and Any one-stage cascade board transmits the control instruction to the next-stage cascade board.
5. The communication method of cascaded boards according to claim 2, characterized in that: Transmitting the control instruction based on the response rule of the transmission flag value includes: When the control instruction contains the transfer flag value, any cascade card at one stage receiving the control instruction decrements the transfer flag value by 1 and then transfers the control instruction to the next cascade card at one stage.
6. The communication method of cascading boards according to claim 1, characterized in that: The method further comprises: when any one-stage cascading board receives a response message from a subsequent-stage cascading board, transmitting the response message to a previous-stage cascading board.
7. A communication system for cascading boards, characterized in that: The system includes a main control machine and a plurality of cascade boards; The main control machine issues a control instruction, wherein the control instruction has a communication flag value; the communication flag value includes a response flag value, a transfer response flag value and a transfer flag value; as well as Any cascade card among the plurality of cascade cards receives the control instruction and responds to the control instruction based on a response rule of the communication flag value.
8. The communication system of cascaded boards according to claim 8, characterized in that: The response rule based on the communication flag value responds to the control instruction including: Responding to the control instruction based on a response rule of the response flag value; Deliver and respond to the control instruction based on the response rule of the delivery response flag value; or The control instruction is delivered based on a response rule of the delivery flag value.
9. The communication system of cascaded boards according to claim 8, characterized in that: When any one of the cascading boards receives a response message from a subsequent cascading board, it transmits the response message to a previous cascading board.
10. The communication method of cascaded boards according to claim 8, characterized in that: The main control machine determines the number of cascade boards in the communication system of the cascade boards based on the response rule of the transfer response flag value.