A dual-controller RFID system control method, device and medium supporting IO-Link protocol
Patent Information
- Application Number
- CN202611398333.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-10-20
AI Technical Summary
[0003]现有支持IO-Link协议的RFID系统通常采用单控制器架构,由该控制器分别响应IO-Link从站芯片触发的IO-Link通信中断以及射频芯片触发的射频读写中断,其中,IO-Link通信中断用于完成标签操作指令的接收以及操作结果数据的发送,射频读写中断用于完成射频芯片侧的标签读取操作或标签写入操作,由于两类中断均由同一控制器进行响应处理,当其中一类中断被执行时,可能影响另一类中断的响应时序
[0065]1、通过将由IO-Link从站芯片触发的IO-Link通信中断配置为由第一控制器响应处理,将由射频芯片触发的射频读写中断配置为由第二控制器响应处理,并使射频读写中断的抢占优先级高于第二UART接收中断的抢占优先级,能够将现有单控制器中共同处理的IO-Link通信中断和射频读写中断分离至不同控制器执行,并使第二控制器在接收标签操作指令时保持射频读写中断对应的响应顺序,从而降低IO-Link通信中断与射频读写中断的响应过程相互影响的概率;
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This application relates to the field of industrial communication technology, and in particular to a control method, device and medium for a dual-controller RFID system supporting the IO-Link protocol. Background Technology
[0002] Currently, IO-Link is a communication technology used for point-to-point digital communication between industrial field devices and control terminals. RFID is a technology that identifies electronic tags and reads or writes data through radio frequency. RFID devices that support the IO-Link protocol can interact with the control terminal through IO-Link communication.
[0003] Existing RFID systems supporting the IO-Link protocol typically employ a single controller architecture. This controller responds to IO-Link communication interrupts triggered by the IO-Link slave chip and RF read / write interrupts triggered by the RF chip. The IO-Link communication interrupt is used to receive tag operation instructions and send operation result data, while the RF read / write interrupt is used to perform tag reading or tag writing operations on the RF chip side. Since both types of interrupts are handled by the same controller, the timing of the response to the other type of interrupt may be affected when one type of interrupt is executed.
[0004] The existing technical solutions mentioned above have the following drawbacks: Existing RFID devices that support the IO-Link protocol use a single controller to handle IO-Link communication interruptions and radio frequency read / write interruptions, which can easily cause the response processes of the two types of interruptions to affect each other, thus leaving room for improvement. Summary of the Invention
[0005] To reduce the mutual interference of responses caused by IO-Link communication interruptions and RF read / write interruptions when handled by the same controller, this application provides a control method, device, and medium for a dual-controller RFID system that supports the IO-Link protocol.
[0006] The above-mentioned objective of this application is achieved through the following technical solution:
[0007] A control method for a dual-controller RFID system supporting the IO-Link protocol is applied to an RFID device configured with a dual-controller structure. The RFID device includes at least a first controller, a second controller, an IO-Link slave chip, and an RFID chip. The first controller is connected to the IO-Link slave chip, and the second controller is connected to the RFID chip. The first controller and the second controller communicate via a UART communication link. The dual-controller RFID system control method includes:
[0008] The IO-Link communication interrupt triggered by the IO-Link slave chip is configured as the highest preemption priority in the first controller, and the RF read / write interrupt triggered by the RF chip is configured as the highest preemption priority in the second controller. The preemption priority of the RF read / write interrupt is higher than the preemption priority of the second UART receive interrupt in the second controller, which is used to receive tag operation instructions sent through the UART communication link.
[0009] The IO-Link slave chip receives the tag operation command sent by the IO-Link master station, and in response to the IO-Link communication interruption triggered by the IO-Link slave chip, obtains the tag operation command in the first controller;
[0010] After completing the response processing for the IO-Link communication interruption, the tag operation instruction obtained in the first controller is sent to the second controller through the UART communication link to trigger the second UART receive interruption, and in response to the second UART receive interruption, the tag operation instruction is obtained in the second controller;
[0011] According to the tag operation instruction, the tag operation type and the tag operation parameters corresponding to the tag operation type are obtained. Based on the tag operation type and the tag operation parameters, the radio frequency chip is controlled to perform tag operation on the target tag to obtain operation result data. The tag operation includes tag reading operation or tag writing operation.
[0012] The second controller obtains the operation result data returned by the radio frequency chip, sends the operation result data to the first controller through the UART communication link, and after obtaining the operation result data in the first controller, sends the operation result data to the IO-Link slave chip, so that the operation result data can be sent to the IO-Link master station through the IO-Link slave chip.
[0013] By adopting the above technical solution, by configuring the IO-Link communication interrupt triggered by the IO-Link slave chip to be handled by the first controller, and configuring the RF read / write interrupt triggered by the RF chip to be handled by the second controller, and making the preemption priority of the RF read / write interrupt higher than the preemption priority of the second UART receive interrupt, it is possible to separate the IO-Link communication interrupt and the RF read / write interrupt, which are jointly processed in the existing single controller, to be executed by different controllers, and to make the second controller maintain the response order corresponding to the RF read / write interrupt when receiving tag operation instructions, thereby reducing the probability of mutual interference between the response processes of the IO-Link communication interrupt and the RF read / write interrupt.
[0014] In a preferred embodiment, this application can be further configured as follows: the IO-Link communication interrupt triggered by the IO-Link slave chip is configured as the highest preemption priority within the first controller, and the RF read / write interrupt triggered by the RF chip is configured as the highest preemption priority within the second controller, wherein the preemption priority of the RF read / write interrupt is higher than the preemption priority of the second UART receive interrupt, specifically including:
[0015] The priority parameter of the IO-Link communication interrupt is configured to a first preset priority value, which corresponds to the highest preemption priority supported by the first controller.
[0016] The priority parameter of the radio frequency read / write interrupt is configured to a second preset priority value, which corresponds to the highest preemption priority supported by the second controller.
[0017] The priority parameter of the second UART receive interrupt is configured to a third preset priority value, and the preemption priority corresponding to the third preset priority value is lower than the preemption priority corresponding to the second preset priority value, so that when both the radio frequency read / write interrupt and the second UART receive interrupt are triggered, the radio frequency read / write interrupt is responded to first.
[0018] By adopting the above technical solution and configuring the priority parameters corresponding to IO-Link communication interrupt, RF read / write interrupt and second UART receive interrupt respectively, the priority processing relationship of IO-Link communication on the first controller side and the priority processing relationship of RF read / write on the second controller side can be implemented as executable interrupt parameter configuration, thereby providing a configuration basis for the dual-controller RFID device to process tag operation instructions and RF feedback events according to the preset interrupt response order.
[0019] In a preferred embodiment, this application can be further configured such that, in response to a second UART receive interrupt, the tag operation instruction is retrieved from the second controller, specifically including:
[0020] An instruction receive buffer is constructed in the second controller for storing tag operation instructions received via the UART communication link;
[0021] In response to the second UART receive interruption, the tag operation instruction received through the UART communication link is written into the instruction receive buffer;
[0022] After the tag operation instruction is written to the instruction receiving buffer, if the radio frequency read / write interrupt is not triggered before the tag operation instruction is read from the instruction receiving buffer, then the tag operation instruction is read from the instruction receiving buffer.
[0023] After the tag operation instruction is written to the instruction receiving buffer, if the radio frequency read / write interrupt is triggered before the tag operation instruction is read from the instruction receiving buffer, the tag operation instruction in the instruction receiving buffer is retained, and the tag operation instruction is read from the instruction receiving buffer after the response processing to the radio frequency read / write interrupt is completed.
[0024] By adopting the above technical solution, by constructing an instruction receiving buffer in the second controller, the tag operation instructions that have been received through the UART communication link are written into the instruction receiving buffer, and the tag operation instructions are retained when an RF read / write interrupt is triggered before reading the tag operation instructions. This allows the second controller to maintain the complete tag operation instructions to be executed during the RF read / write interrupt response, and to continue reading the tag operation instructions after the RF read / write interrupt response is completed, thereby realizing the connection between RF interrupt processing and subsequent processing of instructions to be executed.
[0025] In a preferred embodiment, this application can be further configured such that: after obtaining the operation result data in the first controller, the operation result data is sent to the IO-Link slave chip, specifically including:
[0026] Configure the preemption priority of the first UART receive interrupt in the first controller, which is used to receive the operation result data sent through the UART communication link, to be lower than the preemption priority of the IO-Link communication interrupt;
[0027] A result receiving buffer is constructed in the first controller to store operation result data received through the UART communication link;
[0028] In response to the first UART receive interruption, the operation result data received through the UART communication link is written into the result receive buffer;
[0029] After the operation result data is written to the result receiving buffer, if the IO-Link communication interrupt is not triggered before the operation result data is read from the result receiving buffer, the operation result data is read from the result receiving buffer and sent to the IO-Link slave chip.
[0030] After the operation result data is written to the result receiving buffer, if the IO-Link communication interrupt is triggered before the operation result data is read from the result receiving buffer, the operation result data in the result receiving buffer is retained, and after the response processing to the IO-Link communication interrupt is completed, the operation result data is read from the result receiving buffer and sent to the IO-Link slave chip.
[0031] By adopting the above technical solution, by configuring the preemption priority of the first UART receive interrupt to be lower than that of the IO-Link communication interrupt, and by constructing a result receiving buffer in the first controller to store the operation result data that has been received, it is possible to retain the operation result data to be sent to the IO-Link slave chip during the first controller's response to the IO-Link communication interrupt, and continue to send the operation result data after the IO-Link communication interrupt response is completed, thereby realizing the connection between IO-Link communication processing and subsequent reporting of operation result data.
[0032] In a preferred embodiment, this application can be further configured such that the dual-controller RFID system control method also includes:
[0033] Before sending the tag operation instruction to the second controller via the UART communication link, an instruction identifier is configured for the tag operation instruction, and the tag operation processing status corresponding to the instruction identifier is set to the processing state in the first controller;
[0034] The tag operation instruction is associated with the instruction identifier and sent to the second controller via the UART communication link;
[0035] Before obtaining the operation result data, the IO-Link slave chip receives a status query command sent by the IO-Link master station. Based on the command identifier corresponding to the status query command, the corresponding tag operation processing status is determined, and processing status response data is generated. The processing status response data is sent to the IO-Link slave chip, so that the processing status response data can be sent to the IO-Link master station through the IO-Link slave chip.
[0036] After obtaining the operation result data, the operation result data is associated with the instruction identifier and sent to the first controller through the UART communication link;
[0037] After obtaining the operation result data in the first controller, the corresponding tag operation processing status is updated to operation completion status according to the instruction identifier associated with the operation result data, and the operation result data is sent to the IO-Link slave chip so that the operation result data can be sent to the IO-Link master station through the IO-Link slave chip.
[0038] By adopting the above technical solution, configuring instruction identifiers for tag operation instructions, setting tag operation processing status corresponding to the instruction identifiers in the first controller, and returning processing status response data according to the status query instruction before the operation result data is formed, it is possible to establish a correspondence between tag operation instructions, processing status, and operation result data. This allows the IO-Link master station to obtain the corresponding processing status feedback before the tag operation is completed and to obtain the corresponding operation result data after the tag operation is completed, thereby helping to maintain the IO-Link side status interaction during tag operation processing.
[0039] In a preferred embodiment, this application can be further configured such that: obtaining the tag operation type and the tag operation parameters corresponding to the tag operation type according to the tag operation instruction specifically includes:
[0040] The operation type field is obtained from the tag operation instruction, and the tag operation type is determined according to the operation type field. The tag operation type includes tag read type and tag write type.
[0041] When the tag operation type is the tag reading type, the target address and reading length are obtained from the tag operation instruction as the tag operation parameters;
[0042] When the tag operation type is the tag write type, the target address, write length, and data to be written are obtained from the tag operation instruction as the tag operation parameters.
[0043] By adopting the above technical solution, the tag reading type or tag writing type can be determined according to the operation type field in the tag operation instruction, and the corresponding target address, reading length, writing length and data to be written can be obtained respectively. This can form tag operation parameters corresponding to different tag operation categories, thereby providing parameter basis for controlling the radio frequency chip to perform target tag reading operation or tag writing operation.
[0044] In a preferred embodiment, this application can be further configured such that: controlling the radio frequency chip to perform a tag operation on the target tag based on the tag operation type and the tag operation parameters, and obtaining operation result data, specifically includes:
[0045] When the tag operation type is the tag reading type, a tag reading control command is generated according to the target address and the reading length, and the tag reading control command is sent to the radio frequency chip;
[0046] The radio frequency chip is controlled to read tag data from the target tag, starting from the target address and corresponding to the reading length, according to the tag reading control command.
[0047] The tag data and read execution status returned by the radio frequency chip are obtained, and the tag data and read execution status are used as the operation result data.
[0048] By adopting the above technical solution, when the tag operation type is tag reading, a tag reading control instruction is generated based on the target address and reading length, and the radio frequency chip is controlled to read the tag data of the corresponding range in the target tag. This allows the tag data and reading execution status corresponding to the tag reading operation to be obtained, thereby forming tag reading operation result data that can be returned to the IO-Link master station.
[0049] In a preferred embodiment, this application can be further configured such that: controlling the radio frequency chip to perform a tag operation on the target tag based on the tag operation type and the tag operation parameters, and obtaining operation result data, specifically includes:
[0050] When the tag operation type is the tag write type, a tag write control command is generated based on the target address, the write length, and the data to be written, and the tag write control command is sent to the radio frequency chip;
[0051] The radio frequency chip is controlled to write the data to be written into the storage area of the target tag, starting from the target address and corresponding to the writing length, according to the tag writing control command.
[0052] Obtain the write execution status returned by the RF chip, and use the write execution status as the operation result data.
[0053] By adopting the above technical solution, when the tag operation type is tag write type, a tag write control instruction is generated based on the target address, write length and data to be written, and the radio frequency chip is controlled to write the data to be written into the corresponding storage area in the target tag. The write execution status corresponding to the tag write operation can be obtained, thereby forming tag write operation result data that can be returned to the IO-Link master station.
[0054] The second objective of this invention is achieved through the following technical solution:
[0055] A dual-controller RFID device supporting the IO-Link protocol includes a first controller, a second controller, an IO-Link slave chip, an RF chip, and a UART communication link. The first controller is connected to the IO-Link slave chip, the second controller is connected to the RF chip, and the first controller and the second controller communicate with each other through the UART communication link.
[0056] The first controller is configured with an IO-Link communication interrupt triggered by the IO-Link slave chip, and the preemption priority of the IO-Link communication interrupt is configured to be the highest preemption priority within the first controller;
[0057] The second controller is configured with an RF read / write interrupt triggered by the RF chip and a second UART receive interrupt for receiving tag operation instructions sent through the UART communication link. The preemption priority of the RF read / write interrupt is configured as the highest preemption priority within the second controller, and is higher than the preemption priority of the second UART receive interrupt.
[0058] The first controller is used to respond to the IO-Link communication interruption to obtain the tag operation instruction sent by the IO-Link master station, and after completing the response processing to the IO-Link communication interruption, to send the tag operation instruction to the second controller through the UART communication link;
[0059] The second controller is used to respond to the second UART receive interrupt to obtain the tag operation instruction, control the radio frequency chip to perform a tag reading operation or a tag writing operation on the target tag according to the tag operation instruction, obtain the operation result data returned by the radio frequency chip, and send the operation result data to the first controller through the UART communication link;
[0060] The first controller is further configured to send the operation result data to the IO-Link slave chip after acquiring the operation result data, so that the operation result data can be sent to the IO-Link master station through the IO-Link slave chip.
[0061] By adopting the above technical solution, by setting up a first controller and a second controller that are respectively connected to the IO-Link slave chip and the RF chip, and realizing data interaction between the first controller and the second controller through the UART communication link, and configuring the preemption priority relationship between the IO-Link communication interrupt, the RF read / write interrupt and the second UART receive interrupt, a device structure that separates the IO-Link communication side and the RF tag operation side can be formed, and the probability of mutual interference between the IO-Link communication interrupt and the RF read / write interrupt response process under the single controller architecture can be reduced.
[0062] The above-mentioned objective three of this application is achieved through the following technical solution:
[0063] A computer-readable storage medium storing first program instructions and second program instructions, the first program instructions being configured to be executed by a first controller and the second program instructions being configured to be executed by a second controller, so as to enable a dual-controller RFID device equipped with the first controller and the second controller to implement the steps of the above-described dual-controller RFID system control method supporting the IO-Link protocol.
[0064] In summary, this application includes at least one of the following beneficial technical effects:
[0065] 1. By configuring the IO-Link communication interrupt triggered by the IO-Link slave chip to be handled by the first controller, and configuring the RF read / write interrupt triggered by the RF chip to be handled by the second controller, and making the preemption priority of the RF read / write interrupt higher than the preemption priority of the second UART receive interrupt, the IO-Link communication interrupt and the RF read / write interrupt, which are jointly handled in the existing single controller, can be separated and executed by different controllers. The second controller can also maintain the response order of the RF read / write interrupt when receiving tag operation instructions, thereby reducing the probability of the response processes of the IO-Link communication interrupt and the RF read / write interrupt affecting each other.
[0066] 2. By setting up a first controller and a second controller that are respectively connected to the IO-Link slave chip and the RF chip, and realizing data interaction between the first controller and the second controller through the UART communication link, and configuring the preemption priority relationship between IO-Link communication interrupt, RF read / write interrupt and second UART receive interrupt, a device structure that separates the IO-Link communication side and the RF tag operation side can be formed, and the probability of mutual interference between the IO-Link communication interrupt and RF read / write interrupt response process under the single controller architecture can be reduced. Attached Figure Description
[0067] Figure 1This is a flowchart illustrating the implementation of a control method for a dual-controller RFID system supporting the IO-Link protocol in one embodiment of this application.
[0068] Figure 2 This is another implementation flowchart of a dual-controller RFID system control method supporting the IO-Link protocol in one embodiment of this application;
[0069] Figure 3 This is a schematic diagram of the internal structure of a dual-controller RFID device supporting the IO-Link protocol in one embodiment of this application. Detailed Implementation
[0070] The following embodiments will help those skilled in the art to further understand the function of this application, but do not limit this application in any way. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of this application. These all fall within the protection scope of this application.
[0071] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0072] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0073] The present application will be further described in detail below with reference to the accompanying drawings.
[0074] In one embodiment, such as Figure 1As shown, this application discloses a control method for a dual-controller RFID system supporting the IO-Link protocol, applied to an RFID device configured with a dual-controller structure. The RFID device includes at least a first controller, a second controller, an IO-Link slave chip, and an RF chip. The first controller is connected to the IO-Link slave chip, and the second controller is connected to the RF chip. The first and second controllers communicate via a UART communication link. The first controller handles data processing on the IO-Link communication side, the second controller handles data processing on the RF tag operation side, the IO-Link slave chip communicates with the IO-Link master station, and the RF chip performs tag reading or tag writing operations on the target tag. The specific steps of this dual-controller RFID system control method supporting the IO-Link protocol are as follows:
[0075] S10. Configure the IO-Link communication interrupt triggered by the IO-Link slave chip as the highest preemption priority in the first controller, and configure the RF read / write interrupt triggered by the RF chip as the highest preemption priority in the second controller. The preemption priority of the RF read / write interrupt is higher than the preemption priority of the second UART receive interrupt in the second controller, which is used to receive tag operation instructions sent through the UART communication link.
[0076] In this embodiment, IO-Link communication interruption refers to an interruption triggered by the IO-Link slave chip to enable the first controller to process IO-Link communication data; RF read / write interruption refers to an interruption triggered by the RF chip to enable the second controller to process RF feedback data related to tag operation; and second UART receive interruption refers to an interruption to enable the second controller to receive tag operation instructions sent by the first controller through the UART communication link.
[0077] Specifically, during device initialization, the IO-Link communication interrupt is configured in the first controller, and its preemption priority is set to the highest preemption priority within the first controller. The RF read / write interrupt is configured in the second controller, and its preemption priority is set to the highest preemption priority within the second controller. At the same time, the preemption priority of the RF read / write interrupt is set higher than that of the second UART receive interrupt. For example, when both the first and second controllers adopt a priority rule where smaller values indicate higher preemption priority, the IO-Link communication interrupt can be configured as a level 0 preemption priority in the first controller, the RF read / write interrupt as a level 0 preemption priority in the second controller, and the second UART receive interrupt as a level 1 preemption priority in the second controller. This ensures that IO-Link communication processing and RF read / write processing have priority response conditions in their respective controllers, and that the second controller processes RF-side interrupt events according to the configured priorities when there is a competition for processing order between the RF read / write interrupt and the tag operation instruction reception process.
[0078] S20. Receive the tag operation instruction sent by the IO-Link master station through the IO-Link slave chip, and in response to the IO-Link communication interrupt triggered by the IO-Link slave chip, obtain the tag operation instruction in the first controller.
[0079] In this embodiment, the tag operation instruction refers to the control data sent by the IO-Link master station to instruct the target tag to perform a read operation or a write operation. The tag operation instruction can be set with data to determine the operation category and operation content, which will serve as the data basis for subsequent RFID tag operations.
[0080] Specifically, when it is necessary to read or write data to the target tag, the IO-Link master station sends the corresponding tag operation command to the IO-Link slave chip. After receiving the tag operation command, the IO-Link slave chip triggers an IO-Link communication interrupt. In response to the IO-Link communication interrupt, the first controller reads the tag operation command received by the IO-Link slave chip. For example, when it is necessary to read data in a preset storage area of the target tag, the IO-Link master station sends a tag read command and transmits the tag read command to the first controller through the IO-Link slave chip, so that the tag read command enters the command forwarding path between the first controller and the second controller.
[0081] S30. After completing the response processing for the IO-Link communication interrupt, the tag operation instruction obtained in the first controller is sent to the second controller through the UART communication link to trigger the second UART receive interrupt, and in response to the second UART receive interrupt, the tag operation instruction is obtained in the second controller.
[0082] In this embodiment, the UART communication link is used to transmit tag operation instructions and operation result data between the first controller and the second controller, and the second UART receive interrupt is used to respond to the tag operation instruction receiving process that enters the second controller side through the UART communication link.
[0083] Specifically, after the first controller completes the response processing of the IO-Link communication interrupt triggered by the IO-Link slave chip and obtains the tag operation instruction, it sends the tag operation instruction to the second controller through the UART communication link. When the tag operation instruction enters the second controller, it triggers the second UART receive interrupt. In response to the second UART receive interrupt, the tag operation instruction is obtained in the second controller. For example, after the first controller obtains the tag read instruction for reading data with a starting address of 0x20 and a read length of 8 bytes from the target tag, it sends the tag read instruction to the second controller through the UART communication link so that the second controller can form tag operation control content that the RF chip can execute based on the tag read instruction.
[0084] S40. According to the tag operation instruction, obtain the tag operation type and the tag operation parameters corresponding to the tag operation type. Based on the tag operation type and tag operation parameters, control the radio frequency chip to perform tag operation on the target tag and obtain operation result data. The tag operation includes tag reading operation or tag writing operation.
[0085] In this embodiment, the tag operation type refers to the operation category corresponding to the current tag operation instruction, the tag operation parameters refer to the data content required to perform the corresponding tag operation, and the operation result data refers to the feedback data formed by the radio frequency chip after performing the corresponding tag operation on the target tag.
[0086] Specifically, after obtaining the tag operation instruction in the second controller, the corresponding tag operation type is determined according to the tag operation instruction, and the tag operation parameters corresponding to the tag operation type are obtained. When the tag operation type is tag read type, the RF chip is controlled to read the corresponding tag data in the target tag based on the target address and read length. When the tag operation type is tag write type, the RF chip is controlled to write data to the corresponding storage area in the target tag based on the target address, write length and data to be written. For example, for a tag read instruction with a target address of 0x20 and a read length of 8 bytes, the RF chip is controlled to read 8 consecutive bytes of data starting from address 0x20 in the target tag, and the read tag data and the corresponding read execution status are used as operation result data.
[0087] S50. Obtain the operation result data returned by the RF chip in the second controller, send the operation result data to the first controller through the UART communication link, and after obtaining the operation result data in the first controller, send the operation result data to the IO-Link slave chip so that the operation result data can be sent to the IO-Link master station through the IO-Link slave chip.
[0088] In this embodiment, the operation result data is the feedback data generated by the radio frequency chip after performing a tag reading operation or a tag writing operation. The operation result data is used to feed back the execution result of the corresponding tag operation to the IO-Link master station.
[0089] Specifically, after the RF chip performs the tag operation and returns the operation result data, the second controller obtains the operation result data and sends it to the first controller via the UART communication link. After obtaining the operation result data in the first controller, the first controller sends the operation result data to the IO-Link slave chip, and then sends the operation result data to the IO-Link master station via the IO-Link slave chip. For example, after reading 8 consecutive bytes of data starting from address 0x20 in the target tag, the 8 bytes of tag data and the reading execution status are sent from the second controller to the first controller via the UART communication link, and then sent to the IO-Link master station via the IO-Link slave chip, so as to realize the return of the tag reading result.
[0090] In one embodiment, in step S10, the IO-Link communication interrupt triggered by the IO-Link slave chip is configured as the highest preemption priority in the first controller, and the RF read / write interrupt triggered by the RF chip is configured as the highest preemption priority in the second controller, wherein the preemption priority of the RF read / write interrupt is higher than the preemption priority of the second UART receive interrupt, specifically including:
[0091] S11. Configure the priority parameter of the IO-Link communication interrupt to the first preset priority value, which corresponds to the highest preemption priority supported by the first controller.
[0092] In this embodiment, the first preset priority value is used to limit the response order of IO-Link communication interrupts in the first controller. The first preset priority value can be set according to the interrupt control rules adopted by the first controller.
[0093] Specifically, during the startup or communication function initialization process of the first controller, the preemption priority configuration range supported by the first controller is read, and the parameter value corresponding to the highest preemption priority in the preemption priority configuration range is selected as the first preset priority value. The first preset priority value is written into the priority configuration item corresponding to the IO-Link communication interrupt. For example, when the first controller supports preemption priorities from level 0 to level 3 and level 0 corresponds to the highest preemption priority, the priority parameter of the IO-Link communication interrupt is configured to level 0 so that when the IO-Link slave chip generates a communication event, it can enter the corresponding interrupt handling process according to the configuration.
[0094] S12. Configure the priority parameter of the RF read / write interrupt to the second preset priority value, which corresponds to the highest preemption priority supported by the second controller.
[0095] In this embodiment, the second preset priority value is used to limit the response order of radio frequency read / write interrupts in the second controller. The second preset priority value can be set according to the interrupt control rules adopted by the second controller.
[0096] Specifically, during the startup or RF function initialization process of the second controller, the preemption priority configuration range supported by the second controller is read, and the parameter value corresponding to the highest preemption priority in the preemption priority configuration range is selected as the second preset priority value. The second preset priority value is written into the priority configuration item corresponding to the RF read / write interrupt. For example, when the second controller supports preemption priorities from level 0 to level 3 and level 0 corresponds to the highest preemption priority, the priority parameter of the RF read / write interrupt is configured to level 0 so that when the RF chip generates an RF feedback event related to tag operation, it can enter the corresponding interrupt processing flow according to the configuration.
[0097] S13. Configure the priority parameter of the second UART receive interrupt to the third preset priority value. The preemption priority corresponding to the third preset priority value is lower than the preemption priority corresponding to the second preset priority value, so that when both the radio frequency read / write interrupt and the second UART receive interrupt are triggered, the radio frequency read / write interrupt will be responded to first.
[0098] In this embodiment, the third preset priority value is used to limit the response order of the second UART receive interrupt in the second controller, and together with the second preset priority value, they constitute the preemption priority relationship between the radio frequency read / write interrupt and the second UART receive interrupt.
[0099] Specifically, in the second controller, the priority parameter corresponding to the second UART receive interrupt is configured to a third preset priority value that is lower than the preemption priority corresponding to the second preset priority value. For example, when the second preset priority value of the RF read / write interrupt is level 0, the third preset priority value of the second UART receive interrupt is configured to level 1. When the second controller has received a new tag operation instruction and the RF chip generates an RF feedback event for the previously initiated tag operation, the RF feedback event corresponding to the RF read / write interrupt is processed according to the priority configuration, and then the instruction reception process corresponding to the second UART receive interrupt is processed again, so as to realize the interrupt response order configuration between tag instruction reception and RF feedback processing on the second controller side.
[0100] In one embodiment, step S30, i.e., in response to a second UART receive interrupt, retrieves a tag operation instruction from the second controller, specifically including:
[0101] S31. In the second controller, an instruction receiving buffer is constructed for storing tag operation instructions received via the UART communication link.
[0102] In this embodiment, the instruction receiving buffer is used to store the tag operation instructions that have been received through the UART communication link in the second controller, so that the tag operation instructions have a corresponding data holding position before being read and parsed.
[0103] Specifically, a data space for storing tag operation instructions is allocated in the storage area accessible by the second controller, and the data space is set as an instruction receiving buffer. The capacity of the instruction receiving buffer can store at least one complete tag operation instruction. For example, for a tag read instruction used to read 8 bytes of tag data starting from address 0x20 in the target tag, the data content corresponding to the tag read instruction is written into the instruction receiving buffer for subsequent reading and execution.
[0104] S32. In response to a second UART receive interruption, write the tag operation instruction received via the UART communication link into the instruction receive buffer.
[0105] In this embodiment, writing the tag operation instruction into the instruction receiving buffer means that the complete tag operation instruction received through the UART communication link is stored in the instruction receiving buffer on the second controller side so that the tag operation instruction can be read when the subsequent processing conditions are met.
[0106] Specifically, after the first controller sends the tag operation instruction to the second controller via the UART communication link, in response to the second UART receive interrupt, the received tag operation instruction is written into the instruction receive buffer, and after the corresponding tag operation instruction is written, it is determined as the instruction to be read. For example, the tag read instruction with a target address of 0x20 and a read length of 8 bytes is written into the instruction receive buffer, so that the tag read instruction can be read after the RF side processing conditions are met and used to control the RF chip to perform the tag read operation.
[0107] S33. After completing the writing of the tag operation instruction to the instruction receiving buffer, if no radio frequency read / write interrupt is triggered before reading the tag operation instruction from the instruction receiving buffer, then the tag operation instruction is read from the instruction receiving buffer.
[0108] In this embodiment, the absence of a radio frequency read / write interrupt means that the radio frequency chip did not generate a radio frequency read / write interrupt event that needs to be processed by the second controller after the tag operation instruction was fully written into the instruction receive buffer and before it was read.
[0109] Specifically, after a tag read instruction with a target address of 0x20 and a read length of 8 bytes is completely written into the instruction receive buffer, if no radio frequency read / write interrupt is triggered before reading the tag read instruction, the tag read instruction is read from the instruction receive buffer, and its tag operation type and tag operation parameters are determined so that the tag operation instruction that is not affected by the radio frequency feedback event can enter the subsequent radio frequency execution process.
[0110] S34. After writing the tag operation instruction to the instruction receiving buffer, if an RF read / write interrupt is triggered before reading the tag operation instruction from the instruction receiving buffer, the tag operation instruction in the instruction receiving buffer is retained, and the tag operation instruction is read from the instruction receiving buffer after the response to the RF read / write interrupt is completed.
[0111] In this embodiment, the RF read / write interrupt triggered before the tag operation instruction is read can be an RF feedback event generated by the RF chip in response to a previously initiated tag operation. The previously initiated tag operation is distinguished from the tag operation instruction that has been written into the instruction receive buffer.
[0112] Specifically, for example, when the instruction receive buffer of the second controller already contains a new tag read instruction for reading 8 bytes of data starting at address 0x20 in the target tag, and the RF chip returns write feedback and triggers an RF read / write interrupt in response to the previously executed tag write operation, the new tag read instruction is kept stored in the instruction receive buffer. After the response to the RF read / write interrupt is completed, the new tag read instruction is read from the instruction receive buffer and the subsequent processing is initiated. This allows the subsequent tag operation instructions to be executed to be kept during the processing of the previous RF feedback event.
[0113] In one embodiment, step S50, i.e., after obtaining the operation result data in the first controller, sends the operation result data to the IO-Link slave chip, specifically includes:
[0114] S51. Configure the preemption priority of the first UART receive interrupt in the first controller, which is used to receive operation result data sent through the UART communication link, to be lower than the preemption priority of the IO-Link communication interrupt.
[0115] In this embodiment, the first UART receive interrupt is used to respond to the operation result data returned by the second controller through the UART communication link. The preemption priority relationship between the first UART receive interrupt and the IO-Link communication interrupt is used to limit the response order between the operation result receiving processing and the IO-Link communication processing on the first controller side.
[0116] Specifically, in the interrupt configuration area of the first controller, the preemption priority of the first UART receive interrupt is configured to be lower than the preemption priority of the IO-Link communication interrupt. For example, when the IO-Link communication interrupt is configured to a preemption priority of level 0, the first UART receive interrupt is configured to a preemption priority of level 1, so that when the first controller receives the operation result data returned by the second controller and an IO-Link communication event occurs, the corresponding IO-Link communication event can be processed according to the configured interrupt priority.
[0117] S52. A result receiving buffer is constructed in the first controller to store the operation result data received through the UART communication link.
[0118] In this embodiment, the result receiving buffer is used to store the operation result data returned by the second controller through the UART communication link in the first controller, so that the operation result data has a corresponding data holding position before being sent to the IO-Link slave chip.
[0119] Specifically, a data space is allocated in the storage area accessible by the first controller to store operation result data, and the data space is set as a result receiving buffer. The capacity of the result receiving buffer can store at least one complete operation result data. For example, for the 8-byte tag data and read execution status formed by the target tag reading operation, the 8-byte tag data and read execution status are saved to the result receiving buffer for subsequent transmission to the IO-Link master station via the IO-Link slave chip.
[0120] S53. In response to the first UART receive interruption, write the operation result data received through the UART communication link into the result receive buffer.
[0121] In this embodiment, writing the operation result data into the result receiving buffer means that the first controller side saves the complete operation result data received through the UART communication link into the result receiving buffer so that the operation result data can be read when the subsequent transmission conditions are met.
[0122] Specifically, after the second controller obtains the operation result data returned by the RF chip and sends it to the first controller through the UART communication link, in response to the first UART receive interrupt, the received operation result data is written into the result receiving buffer, and after the corresponding operation result data is written, it is determined as the result data to be sent. For example, the 8 bytes of tag data read from the target tag address 0x20 and the corresponding read execution status are written into the result receiving buffer together for subsequent return of tag read results to the IO-Link master station.
[0123] S54. After writing the operation result data to the result receiving buffer, if no IO-Link communication interrupt is triggered before reading the operation result data from the result receiving buffer, then read the operation result data from the result receiving buffer and send the operation result data to the IO-Link slave chip.
[0124] In this embodiment, the absence of an IO-Link communication interruption indicates that the IO-Link slave chip did not generate a communication event that required a response from the first controller before the operation result data was fully written into the result receiving buffer and read.
[0125] Specifically, after the operation result data containing 8 bytes of tag data and read execution status is completely written into the result receiving buffer, if no IO-Link communication interrupt is triggered before reading the operation result data, the operation result data is read from the result receiving buffer and sent to the IO-Link slave chip, so that the 8 bytes of tag data and read execution status can be sent to the IO-Link master station through the IO-Link slave chip.
[0126] S55. After writing the operation result data to the result receiving buffer, if an IO-Link communication interrupt is triggered before reading the operation result data from the result receiving buffer, the operation result data in the result receiving buffer is retained. After the response processing to the IO-Link communication interrupt is completed, the operation result data is read from the result receiving buffer and sent to the IO-Link slave chip.
[0127] In this embodiment, triggering an IO-Link communication interrupt before reading the operation result data means that after the operation result data to be sent has been saved in the result receiving buffer, the IO-Link slave chip generates a communication event that needs to be responded to and processed by the first controller.
[0128] Specifically, for example, if the 8-byte tag data and read execution status generated by the target tag read operation are already stored in the result receiving buffer, and the IO-Link slave chip triggers an IO-Link communication interrupt, then the 8-byte tag data and read execution status are stored in the result receiving buffer. After the response processing to the IO-Link communication interrupt is completed, the operation result data is read from the result receiving buffer and sent to the IO-Link slave chip, thereby enabling the operation result data to be returned to be maintained during the processing of IO-Link communication events.
[0129] In one embodiment, such as Figure 2 As shown, the control method for this dual-controller RFID system also includes:
[0130] S501. Before sending the tag operation instruction to the second controller via the UART communication link, configure an instruction identifier for the tag operation instruction, and set the tag operation processing status corresponding to the instruction identifier to the processing status in the first controller.
[0131] In this embodiment, the instruction identifier is used to distinguish different tag operation instructions issued by the IO-Link master station, and the tag operation processing status is associated with the corresponding instruction identifier and is used to indicate the processing stage of the tag operation.
[0132] Specifically, after obtaining the tag operation instruction in the first controller and before sending the tag operation instruction to the second controller through the UART communication link, an instruction identifier is configured for the tag operation instruction, and the tag operation processing status corresponding to the instruction identifier is recorded. For example, for a tag read instruction used to read 8 consecutive bytes of data starting from address 0x20 in the target tag, an instruction identifier T0007 is configured, and the tag operation processing status corresponding to the instruction identifier T0007 is set to the processing status, so as to form the correspondence required for status query.
[0133] S502. Associate the tag operation command with the command identifier and send it to the second controller via the UART communication link.
[0134] In this embodiment, the tag operation instruction is associated with the instruction identifier so that the subsequently generated operation result data can correspond to the tag operation instruction that triggered the tag operation.
[0135] Specifically, the tag reading instruction used to read 8 consecutive bytes of data starting from address 0x20 in the target tag is associated with the instruction identifier T0007 and sent to the second controller via the UART communication link. On the second controller side, the radio frequency chip is controlled to perform the tag reading operation based on the tag reading instruction. The association relationship can be achieved by setting corresponding identification information in the data interaction content of the tag operation instruction, or by a data recording method that enables the tag operation instruction and the instruction identifier to correspond to each other.
[0136] S503. Before obtaining the operation result data, the IO-Link slave chip receives the status query command sent by the IO-Link master station. Based on the command identifier corresponding to the status query command, the corresponding tag operation processing status is determined, and processing status response data is generated. The processing status response data is sent to the IO-Link slave chip so that the processing status response data can be sent to the IO-Link master station through the IO-Link slave chip.
[0137] In this embodiment, the status query instruction refers to the instruction used to query the processing status of the tag operation corresponding to the instruction identifier; the processing status response data refers to the response data used to indicate that the corresponding tag operation has not yet generated operation result data to be returned.
[0138] Specifically, before the tag reading operation corresponding to instruction identifier T0007 returns the operation result data, the IO-Link slave chip receives the status query instruction sent by the IO-Link master station. Based on the instruction identifier T0007 corresponding to the status query instruction, the corresponding tag operation processing status is determined to be in the processing state. Processing status response data corresponding to the processing state is generated and sent to the IO-Link slave chip, so that it can be sent to the IO-Link master station. This allows the IO-Link master station to obtain the corresponding processing status information before the target tag reading operation is completed.
[0139] S504. After obtaining the operation result data, associate the operation result data with the instruction identifier and send it to the first controller through the UART communication link.
[0140] In this embodiment, the operation result data is associated with the instruction identifier, so that the first controller can determine the tag operation instruction that needs to update the processing status based on the returned operation result data.
[0141] Specifically, after the second controller controls the radio frequency chip to complete the tag reading operation corresponding to the instruction identifier T0007 and obtains the operation result data, it establishes an association between the operation result data and the instruction identifier T0007, and sends it to the first controller through the UART communication link. For example, it sends the 8 consecutive bytes of tag data read from the target tag address 0x20 and the reading execution status to the instruction identifier T0007, so that the first controller can determine that the operation result data corresponds to the tag reading operation previously recorded as being in the processing state.
[0142] S505. After obtaining the operation result data in the first controller, the corresponding tag operation processing status is updated to the operation completed status according to the instruction identifier associated with the operation result data, and the operation result data is sent to the IO-Link slave chip so that the operation result data can be sent to the IO-Link master station through the IO-Link slave chip.
[0143] In this embodiment, the operation completion status means that the tag operation associated with the corresponding instruction identifier has been completed and the operation result data has been generated.
[0144] Specifically, after obtaining the operation result data associated with the instruction identifier T0007 in the first controller, the corresponding tag operation processing status is determined according to the instruction identifier T0007. The tag operation processing status is updated from the processing status to the operation completed status. The 8-byte tag data corresponding to the instruction identifier T0007 and the read execution status are sent to the IO-Link slave chip, so as to send it to the IO-Link master station through the IO-Link slave chip, thereby completing the data connection between the processing status feedback and the tag operation result return.
[0145] In one embodiment, step S40, namely obtaining the tag operation type and the tag operation parameters corresponding to the tag operation type according to the tag operation instruction, specifically includes:
[0146] S41. Obtain the operation type field from the tag operation instruction, and determine the tag operation type based on the operation type field. The tag operation type includes tag read type and tag write type.
[0147] In this embodiment, the operation type field refers to the operation category corresponding to the tag operation instruction. The tag read type corresponds to the operation category of obtaining data from the target tag, and the tag write type corresponds to the operation category of writing data to the target tag.
[0148] Specifically, the operation type field is extracted from the tag operation instructions obtained from the second controller, and the current tag operation type is determined according to the correspondence between the operation type field and the preset tag operation type. For example, when the operation type field corresponds to the read flag, the tag operation type is determined to be the tag read type, and when the operation type field corresponds to the write flag, the tag operation type is determined to be the tag write type, so that the corresponding tag operation parameters can be obtained according to the tag operation type in the future.
[0149] S42. When the tag operation type is tag read type, obtain the target address and read length from the tag operation instruction as tag operation parameters.
[0150] In this embodiment, the target address and read length are used to determine the range of data that needs to be read from the target tag.
[0151] Specifically, when the tag operation type is determined to be tag reading type, the target address and reading length are obtained from the tag operation instruction, and the target address and reading length are used as tag operation parameters. For example, the target address 0x20 and the reading length 8 bytes are obtained from the tag reading instruction to control the RF chip to read 8 consecutive bytes of data starting from address 0x20 in the target tag.
[0152] S43. When the tag operation type is tag write type, obtain the target address, write length and data to be written from the tag operation instruction as tag operation parameters.
[0153] In this embodiment, the target address, write length, and data to be written are used to determine the location, quantity, and content of the data to be written in the target tag.
[0154] Specifically, when the tag operation type is determined to be tag write type, the target address, write length and data to be written are obtained from the tag operation instruction, and the target address, write length and data to be written are used as tag operation parameters. For example, the target address 0x30, write length 4 bytes and data to be written A1 B2 C3 D4 are obtained from the tag write instruction, so as to control the RF chip to write the data to be written into the target tag in a continuous 4-byte storage area starting from address 0x30.
[0155] In one embodiment, step S40, which involves controlling the RF chip to perform a tag operation on the target tag based on the tag operation type and tag operation parameters to obtain operation result data, specifically includes:
[0156] S430. When the tag operation type is tag reading type, generate a tag reading control command based on the target address and reading length, and send the tag reading control command to the radio frequency chip.
[0157] In this embodiment, the tag reading control command is used to instruct the radio frequency chip to obtain data from a specified storage range of the target tag.
[0158] Specifically, after the tag operation type is tag reading and the target address and reading length have been obtained, a tag reading control instruction that the RF chip can recognize is generated based on the target address and reading length, and the tag reading control instruction is sent to the RF chip. For example, a corresponding tag reading control instruction is generated based on the target address 0x20 and the reading length of 8 bytes to instruct the RF chip to read 8 consecutive bytes of data starting from address 0x20 in the target tag.
[0159] S4301: The control radio frequency chip reads tag data from the target tag, starting from the target address and corresponding to the reading length, according to the tag reading control command.
[0160] In this embodiment, tag data refers to the data content stored in the target tag that corresponds to the target address and read length.
[0161] Specifically, the control RF chip interacts with the target tag according to the tag reading control command, and reads the tag data from the target tag starting from the target address and corresponding to the reading length. For example, the control RF chip reads 8 consecutive bytes of data from the target tag starting from address 0x20 to form the reading feedback content corresponding to the current tag reading operation.
[0162] S4302. Obtain the tag data and read execution status returned by the RF chip, and use the tag data and read execution status as the operation result data.
[0163] In this embodiment, the read execution state is used to represent the feedback state formed after the radio frequency chip performs the tag read operation.
[0164] Specifically, after the RF chip completes the tag reading operation, the tag data and reading execution status returned by the RF chip are obtained, and the tag data and reading execution status are used as operation result data. For example, after the RF chip reads 8 consecutive bytes of data starting from address 0x20 in the target tag, the 8 bytes of tag data and the reading completion status are used as operation result data and sent to the IO-Link master station through the data return path corresponding to step S50.
[0165] In one embodiment, step S40, which involves controlling the RF chip to perform a tag operation on the target tag based on the tag operation type and tag operation parameters to obtain operation result data, specifically includes:
[0166] S431. When the tag operation type is tag write type, generate a tag write control command based on the target address, write length and data to be written, and send the tag write control command to the radio frequency chip.
[0167] In this embodiment, the tag write control command is used to instruct the radio frequency chip to write the data to be written to the specified storage range of the target tag.
[0168] Specifically, after the tag operation type is tag write type and the target address, write length and data to be written have been obtained, a tag write control instruction that the RF chip can recognize is generated based on the target address, write length and data to be written, and the tag write control instruction is sent to the RF chip. For example, the corresponding tag write control instruction is generated based on the target address 0x30, the write length of 4 bytes and the data to be written A1, B2, C3 and D4, so as to instruct the RF chip to write the corresponding data to the continuous 4-byte storage area in the target tag starting from address 0x30.
[0169] S4311: The control RF chip writes the data to be written into the target tag's storage area starting from the target address and corresponding to the writing length, according to the tag write control command.
[0170] In this embodiment, the storage area refers to the area to be written in the target tag, which is determined by the target address and the write length.
[0171] Specifically, the control RF chip interacts with the target tag with RF data according to the tag write control command, and writes the data to be written into the storage area of the target tag starting from the target address and corresponding to the write length. For example, the control RF chip writes data A1, B2, C3, and D4 into the target tag into a continuous 4-byte storage area starting from address 0x30 to complete the data writing process corresponding to the current tag write command.
[0172] S4312. Obtain the write execution status returned by the RF chip and use the write execution status as the operation result data.
[0173] In this embodiment, the write execution state is used to represent the feedback state formed after the radio frequency chip performs the tag write operation.
[0174] Specifically, after the RF chip completes the tag writing operation, the write execution status returned by the RF chip is obtained, and the write execution status is used as the operation result data. For example, after the RF chip writes data A1 B2 C3 D4 into the target tag in a continuous 4-byte storage area starting from address 0x30, the write completion status is used as the operation result data and sent to the IO-Link master station through the data return path corresponding to step S50.
[0175] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0176] In one embodiment, this application also discloses a dual-controller RFID device supporting the IO-Link protocol, the internal structure of which can be shown in the figure below. Figure 3 As shown, this dual-controller RFID device includes a first controller, a second controller, an IO-Link slave chip, an RF chip, and a UART communication link. The first controller is connected to the IO-Link slave chip, the second controller is connected to the RF chip, and the first controller and the second controller communicate with each other via the UART communication link.
[0177] In this embodiment, the first controller is used to carry out the data processing function on the IO-Link communication side, the second controller is used to carry out the data processing function on the RFID tag operation side, the IO-Link slave chip is used to interact with the IO-Link master station, the RFID chip is used to interact with the target tag with RFID data, and the UART communication link is used to transmit tag operation instructions and operation result data between the first controller and the second controller.
[0178] Specifically, the first controller is configured with an IO-Link communication interrupt triggered by the IO-Link slave chip, and the preemption priority of the IO-Link communication interrupt is configured to be the highest preemption priority within the first controller. The second controller is configured with an RF read / write interrupt triggered by the RF chip and a second UART receive interrupt for receiving tag operation instructions sent via the UART communication link, and the preemption priority of the RF read / write interrupt is configured to be the highest preemption priority within the second controller and higher than the preemption priority of the second UART receive interrupt. When the IO-Link master station sends a tag operation instruction, the tag operation instruction is obtained through the IO-Link slave chip and the first controller, and sent to the second controller through the UART communication link. Based on the tag operation instruction, the RF chip is controlled to perform a tag read operation or a tag write operation on the target tag. After obtaining the operation result data returned by the RF chip, the operation result data is sent to the IO-Link master station through the UART communication link, the first controller, and the IO-Link slave chip.
[0179] In another embodiment, an instruction receiving buffer can be set in the second controller to store tag operation instructions received through the UART communication link; a result receiving buffer can be set in the first controller to store operation result data returned through the UART communication link; and the tag operation processing status corresponding to the instruction identifier can be recorded in the first controller so as to return processing status response data to the IO-Link master station according to the status query instruction before the operation result data is formed.
[0180] In one embodiment, a computer-readable storage medium is provided, on which first program instructions and second program instructions are stored. The first program instructions are configured to be executed by a first controller, and the second program instructions are configured to be executed by a second controller, so that a dual-controller RFID device configured with the first controller and the second controller implements the steps of the above-described dual-controller RFID system control method.
[0181] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0182] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0183] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A control method for a dual-controller RFID system supporting the IO-Link protocol, characterized in that, A dual-controller RFID system control method is applied to an RFID device configured with a dual-controller structure. The RFID device includes at least a first controller, a second controller, an IO-Link slave chip, and an RFID chip. The first controller is connected to the IO-Link slave chip, and the second controller is connected to the RFID chip. The first controller and the second controller communicate via a UART communication link. The IO-Link communication interrupt triggered by the IO-Link slave chip is configured as the highest preemption priority in the first controller, and the RF read / write interrupt triggered by the RF chip is configured as the highest preemption priority in the second controller. The preemption priority of the RF read / write interrupt is higher than the preemption priority of the second UART receive interrupt in the second controller, which is used to receive tag operation instructions sent through the UART communication link. The IO-Link slave chip receives the tag operation command sent by the IO-Link master station, and in response to the IO-Link communication interruption triggered by the IO-Link slave chip, obtains the tag operation command in the first controller; After completing the response processing for the IO-Link communication interruption, the tag operation instruction obtained in the first controller is sent to the second controller through the UART communication link to trigger the second UART receive interruption, and in response to the second UART receive interruption, the tag operation instruction is obtained in the second controller; According to the tag operation instruction, the tag operation type and the tag operation parameters corresponding to the tag operation type are obtained. Based on the tag operation type and the tag operation parameters, the radio frequency chip is controlled to perform tag operation on the target tag to obtain operation result data. The tag operation includes tag reading operation or tag writing operation. The second controller obtains the operation result data returned by the radio frequency chip, sends the operation result data to the first controller through the UART communication link, and after obtaining the operation result data in the first controller, sends the operation result data to the IO-Link slave chip, so that the operation result data can be sent to the IO-Link master station through the IO-Link slave chip.
2. The control method for a dual-controller RFID system according to claim 1, characterized in that, The step of configuring the IO-Link communication interrupt triggered by the IO-Link slave chip as the highest preemption priority in the first controller, and configuring the RF read / write interrupt triggered by the RF chip as the highest preemption priority in the second controller, wherein the preemption priority of the RF read / write interrupt is higher than the preemption priority of the second UART receive interrupt, specifically includes: The priority parameter of the IO-Link communication interrupt is configured to a first preset priority value, which corresponds to the highest preemption priority supported by the first controller. The priority parameter of the radio frequency read / write interrupt is configured to a second preset priority value, which corresponds to the highest preemption priority supported by the second controller. The priority parameter of the second UART receive interrupt is configured to a third preset priority value, and the preemption priority corresponding to the third preset priority value is lower than the preemption priority corresponding to the second preset priority value, so that when both the radio frequency read / write interrupt and the second UART receive interrupt are triggered, the radio frequency read / write interrupt is responded to first.
3. The control method for a dual-controller RFID system according to claim 2, characterized in that, The step of retrieving the tag operation instruction from the second controller in response to the second UART receive interrupt specifically includes: An instruction receive buffer is constructed in the second controller for storing tag operation instructions received via the UART communication link; In response to the second UART receive interruption, the tag operation instruction received through the UART communication link is written into the instruction receive buffer; After the tag operation instruction is written to the instruction receiving buffer, if the radio frequency read / write interrupt is not triggered before the tag operation instruction is read from the instruction receiving buffer, then the tag operation instruction is read from the instruction receiving buffer. After the tag operation instruction is written to the instruction receiving buffer, if the radio frequency read / write interrupt is triggered before the tag operation instruction is read from the instruction receiving buffer, the tag operation instruction in the instruction receiving buffer is retained, and the tag operation instruction is read from the instruction receiving buffer after the response processing to the radio frequency read / write interrupt is completed.
4. The control method for a dual-controller RFID system according to any one of claims 1 to 3, characterized in that, After obtaining the operation result data in the first controller, sending the operation result data to the IO-Link slave chip specifically includes: Configure the preemption priority of the first UART receive interrupt in the first controller, which is used to receive the operation result data sent through the UART communication link, to be lower than the preemption priority of the IO-Link communication interrupt; A result receiving buffer is constructed in the first controller to store operation result data received through the UART communication link; In response to the first UART receive interruption, the operation result data received through the UART communication link is written into the result receive buffer; After the operation result data is written to the result receiving buffer, if the IO-Link communication interrupt is not triggered before the operation result data is read from the result receiving buffer, the operation result data is read from the result receiving buffer and sent to the IO-Link slave chip. After the operation result data is written to the result receiving buffer, if the IO-Link communication interrupt is triggered before the operation result data is read from the result receiving buffer, the operation result data in the result receiving buffer is retained, and after the response processing to the IO-Link communication interrupt is completed, the operation result data is read from the result receiving buffer and sent to the IO-Link slave chip.
5. The control method for a dual-controller RFID system according to claim 1, characterized in that, The dual-controller RFID system control method further includes: Before sending the tag operation instruction to the second controller via the UART communication link, an instruction identifier is configured for the tag operation instruction, and the tag operation processing status corresponding to the instruction identifier is set to the processing state in the first controller; The tag operation instruction is associated with the instruction identifier and sent to the second controller via the UART communication link; Before obtaining the operation result data, the IO-Link slave chip receives a status query command sent by the IO-Link master station. Based on the command identifier corresponding to the status query command, the corresponding tag operation processing status is determined, and processing status response data is generated. The processing status response data is sent to the IO-Link slave chip, so that the processing status response data can be sent to the IO-Link master station through the IO-Link slave chip. After obtaining the operation result data, the operation result data is associated with the instruction identifier and sent to the first controller through the UART communication link; After obtaining the operation result data in the first controller, the corresponding tag operation processing status is updated to operation completion status according to the instruction identifier associated with the operation result data, and the operation result data is sent to the IO-Link slave chip so that the operation result data can be sent to the IO-Link master station through the IO-Link slave chip.
6. The control method for a dual-controller RFID system according to claim 1, characterized in that, The step of obtaining the tag operation type and the tag operation parameters corresponding to the tag operation type according to the tag operation instruction specifically includes: The operation type field is obtained from the tag operation instruction, and the tag operation type is determined according to the operation type field. The tag operation type includes tag read type and tag write type. When the tag operation type is the tag reading type, the target address and reading length are obtained from the tag operation instruction as the tag operation parameters; When the tag operation type is the tag write type, the target address, write length, and data to be written are obtained from the tag operation instruction as the tag operation parameters.
7. The control method for a dual-controller RFID system according to claim 6, characterized in that, The process of controlling the radio frequency chip to perform tag operations on the target tag based on the tag operation type and the tag operation parameters, and obtaining operation result data, specifically includes: When the tag operation type is the tag reading type, a tag reading control command is generated according to the target address and the reading length, and the tag reading control command is sent to the radio frequency chip; The radio frequency chip is controlled to read tag data from the target tag, starting from the target address and corresponding to the reading length, according to the tag reading control command. The tag data and read execution status returned by the radio frequency chip are obtained, and the tag data and read execution status are used as the operation result data.
8. The control method for a dual-controller RFID system according to claim 6, characterized in that, The process of controlling the radio frequency chip to perform tag operations on the target tag based on the tag operation type and the tag operation parameters, and obtaining operation result data, specifically includes: When the tag operation type is the tag write type, a tag write control command is generated based on the target address, the write length, and the data to be written, and the tag write control command is sent to the radio frequency chip; The radio frequency chip is controlled to write the data to be written into the storage area of the target tag, starting from the target address and corresponding to the writing length, according to the tag writing control command. Obtain the write execution status returned by the RF chip, and use the write execution status as the operation result data.
9. A dual-controller RFID device supporting the IO-Link protocol, characterized in that, It includes a first controller, a second controller, an IO-Link slave chip, an RF chip, and a UART communication link. The first controller is connected to the IO-Link slave chip, the second controller is connected to the RF chip, and the first controller and the second controller communicate with each other through the UART communication link. The first controller is configured with an IO-Link communication interrupt triggered by the IO-Link slave chip, and the preemption priority of the IO-Link communication interrupt is configured to be the highest preemption priority within the first controller; The second controller is configured with an RF read / write interrupt triggered by the RF chip and a second UART receive interrupt for receiving tag operation instructions sent through the UART communication link. The preemption priority of the RF read / write interrupt is configured as the highest preemption priority within the second controller, and is higher than the preemption priority of the second UART receive interrupt. The first controller is used to respond to the IO-Link communication interruption to obtain the tag operation instruction sent by the IO-Link master station, and after completing the response processing to the IO-Link communication interruption, to send the tag operation instruction to the second controller through the UART communication link; The second controller is used to respond to the second UART receive interrupt to obtain the tag operation instruction, control the radio frequency chip to perform a tag reading operation or a tag writing operation on the target tag according to the tag operation instruction, obtain the operation result data returned by the radio frequency chip, and send the operation result data to the first controller through the UART communication link; The first controller is further configured to send the operation result data to the IO-Link slave chip after acquiring the operation result data, so that the operation result data can be sent to the IO-Link master station through the IO-Link slave chip.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a first program instruction and a second program instruction, the first program instruction being configured to be executed by a first controller and the second program instruction being configured to be executed by a second controller, so that a dual-controller RFID device configured with the first controller and the second controller implements the steps of a dual-controller RFID system control method supporting the IO-Link protocol as described in any one of claims 1 to 8.