Method for interaction control communication between upper computer and embedded device
By writing and reading control instructions and feedback information in the memory space between the embedded device and the host computer, the control write module and feedback write module of the PCIE interface can realize two-way communication between the embedded device and the host computer. It solves the problem of high cost of development and maintenance of embedded devices, reduces development difficulty and speeds up operation.
Patent Information
- Application Number
- CN202411239422.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2024-12-13
AI Technical Summary
During the development of embedded equipment, frequent bidirectional communication with the upper computer is required to change the internal functions of the equipment, resulting in high development and maintenance costs, and the existing technology is difficult to effectively solve the limitations of embedded equipment interface development.
A method for controlling communication between the upper computer and the embedded device is proposed. By writing and reading control instructions and feedback information in the memory space between the upper computer and the embedded device, the control writing module and feedback of the PCIE interface are used. Write module to realize two-way communication and manage the communication process through status bit variables to reduce the difficulty of development and maintenance.
It reduces the difficulty of development and maintenance of embedded devices, solves the limitations of interface development, and speeds up the equipment operation speed and improves resource utilization efficiency.
Smart Images

Figure CN119127741A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data communication and device control, and in particular to a method for interactive control communication between a host computer and an embedded device. Background Art
[0002] Embedded devices have the characteristics of high reliability, fast real-time response, low energy consumption, small size, low cost, high security and strong scalability. Embedded can be used in medical, military, aerospace, smart home and Internet of Things and other application fields. The PCIE interface has the advantages of high data transmission rate, low latency and small number of pins, and has been widely used in the field of interface interconnection. With the development of technology and the increase in demand, the application and market prospects of embedded systems and PCIE interfaces will be more extensive and better.
[0003] There are too many situations that need to be considered during the development of embedded devices with PCIE interfaces, so the cost of later maintenance is high. When controlling the internal variable transformation of the embedded device, it is necessary to perform two-way communication with the host computer to change the internal function of the embedded device. Therefore, how to perform interactive communication between the host computer and the embedded device has become a technical issue of concern to those skilled in the art.
[0004] (I) Purpose of the invention
[0005] The purpose of the present invention is to propose a solution for interactive control communication between a host computer and an embedded device.
[0006] (II) Technical solution
[0007] To solve the above problems, the first aspect of the present invention provides a method for interactive control communication between a host computer and an embedded device, wherein the host computer includes a control writing module and a feedback reading module, the embedded device includes a memory space and a PCIE interface, the PCIE interface includes a feedback writing module and a control reading module, the memory space includes a control instruction storage area, a feedback instruction storage area and a state bit variable storage area, and the state bit variable storage area has built-in control state bit variables and feedback state bit variables; the method comprises: the host computer writes control information in the control writing module, and the embedded device writes feedback information in the feedback writing module, wherein the control information includes control instructions and the control state bit variables, and the feedback information includes feedback instructions and the feedback state bit variables; the host computer writes the control instructions and the control state bit variables into the memory space; the embedded device The device writes the feedback instruction and the feedback status bit variable into the memory space; the host computer writes the control information into the control instruction storage area and the status bit variable storage area according to the control instruction and the control status bit variable; the embedded device writes the feedback information into the feedback instruction storage area and the status bit variable storage area according to the feedback instruction and the feedback status bit variable; the host computer reads the feedback instruction from the memory space; the embedded device reads the control instruction from the memory space; the host computer reads the feedback instruction from the feedback instruction storage area and stores it in the feedback reading module, and writes the modified feedback status bit variable into the status bit variable storage area; the embedded device reads the control instruction from the control instruction storage area and stores it in the control reading module, and writes the modified control status bit variable into the status bit variable storage area.
[0008] Preferably, in the method, the control instruction comprises a set of data streams with a predetermined length and a fixed structure, and the feedback information comprises a set of data streams with a predetermined length and a fixed structure.
[0009] Preferably, in the method, the control instruction includes a synchronization byte, Cmd_ID, command type, command length and command parameters; and the feedback instruction includes a synchronization byte, Ack_ID, Ack length and Ack data.
[0010] Preferably, in the method, the host computer writes the control instruction and the control status bit variable into the memory space; the embedded device writes the feedback instruction and the feedback status bit variable into the memory space, including: if the current control status bit variable of the memory space is 0, the host computer writes the control instruction into the memory space; if the current feedback status bit variable of the memory space is 0, the embedded device writes the feedback instruction into the memory space.
[0011] Preferably, the method, the host computer writes the control information into the control instruction storage area and the status bit variable storage area according to the control instruction and the control status bit variable; the embedded device writes the feedback information into the feedback instruction storage area and the status bit variable storage area according to the feedback instruction and the feedback status bit variable, includes: the host computer writes the control information into the control instruction storage area and the status bit variable storage area, and changes the control status bit variable to 1; the embedded device writes the feedback information into the feedback instruction storage area and the status bit variable storage area, and changes the feedback status bit variable to 1.
[0012] Preferably, in the method, the host computer reads the feedback instruction from the memory space; the embedded device reads the control instruction from the memory space, including: if the current control state bit variable of the memory space is 1, the embedded device reads the control instruction from the memory space; if the current feedback state bit variable of the memory space is 1, the host computer reads the feedback instruction from the memory space.
[0013] Preferably, the method, the host computer reads the feedback instruction from the feedback instruction storage area and stores it in the feedback reading module, and writes the modified feedback status bit variable into the status bit variable storage area; the embedded device reads the control instruction from the control instruction storage area and stores it in the control reading module, and writes the modified control status bit variable into the status bit variable storage area, including: the host computer reads the feedback instruction from the feedback instruction storage area and stores it in the feedback reading module, changes the feedback status bit variable to 0 and writes it into the status bit variable storage area; the embedded device reads the control instruction from the control instruction storage area and stores it in the control reading module, changes the control status bit variable to 0 and writes it into the status bit variable storage area.
[0014] (III) Beneficial effects
[0015] The above technical solution of the present invention has the following beneficial technical effects:
[0016] The present invention proposes a method for interactive control communication between a host computer and an embedded device. The present invention proposes a method for interactive control communication between a host computer and an embedded device, which reduces the difficulty of developing and maintaining embedded devices. It solves the limitation problem of embedded device interface development, reduces the resource utilization of embedded devices, and speeds up the operation of the devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1It is a schematic diagram of the steps of a method for interactive control communication between a host computer and an embedded device according to an embodiment of the present invention;
[0018] Figure 2 It is a structural diagram of a system for interactive control and communication between a host computer and an embedded device according to an embodiment of the present invention;
[0019] Figure 3 It is a schematic diagram of the working process of the method for interactive control communication between a host computer and an embedded device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0020] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, the description of well-known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present invention.
[0021] The accompanying drawings show schematic diagrams of layer structures according to embodiments of the present invention. These figures are not drawn to scale, and some details are magnified and some details may be omitted for the purpose of clarity. The shapes of various regions and layers shown in the figures and the relative sizes and positional relationships therebetween are only exemplary, and may deviate in practice due to manufacturing tolerances or technical limitations, and those skilled in the art may additionally design regions / layers with different shapes, sizes, and relative positions according to actual needs.
[0022] Obviously, the described embodiments are only some embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0024] Embedded devices have the characteristics of high reliability, fast real-time response, low energy consumption, small size, low cost, high security and strong scalability. Embedded can be used in medical, military, aerospace, smart home and Internet of Things and other application fields. The PCIE interface has the advantages of high data transmission rate, low latency and small number of pins, and has been widely used in the field of interface interconnection. With the development of technology and the increase in demand, the application and market prospects of embedded systems and PCIE interfaces will be more extensive and better.
[0025] There are too many situations that need to be considered during the development of embedded devices with PCIE interfaces, so the cost of later maintenance is high. When controlling the internal variable transformation of the embedded device, it is necessary to perform two-way communication with the host computer to change the internal function of the embedded device. Therefore, how to perform interactive communication between the host computer and the embedded device has become a technical issue of concern to those skilled in the art.
[0026] In view of the problems existing in the current technology, the present invention proposes a method for interactive control communication between a host computer and an embedded device to complete the mutual communication between the host computer and the embedded device, thereby reducing the difficulty of development and maintenance of the embedded device.
[0027] Figure 1 This is a schematic diagram of the steps of the method for interactive control communication between the host computer and the embedded device according to the embodiment of the present invention. Figure 1 Describe the specific steps of interactive control communication between the host computer and embedded devices.
[0028] First, the structure of the host computer and embedded devices in the system is explained, and then the interactive control communication between the host computer and the embedded devices is specifically described. Figure 2 It is a structural diagram of a system for interactive control and communication between a host computer and an embedded device according to an embodiment of the present invention.
[0029] like Figure 2 As shown, the host computer includes a control write module and a feedback read module, the embedded device includes a memory space and a PCIE interface, the PCIE interface includes a control read module and a feedback write module, the memory space includes a control instruction storage area, a feedback instruction storage area and a status bit variable storage area, and the status bit variable storage area has built-in control status bit variables and feedback status bit variables. Figure 2 The structural diagram of the system of the host computer and embedded devices is used to illustrate the specific steps of interactive control communication between the host computer and the embedded devices.
[0030] Step S110: The host computer writes control information into the control writing module, and the embedded device writes feedback information into the feedback writing module, wherein the control information includes control instructions and control status bit variables, and the feedback information includes feedback instructions and feedback status bit variables;
[0031] Step S120: The host computer writes the control instruction and the control status bit variable into the memory space; the embedded device writes the feedback instruction and the feedback status bit variable into the memory space;
[0032] Step S130: the host computer writes the control information into the control instruction storage area and the status bit variable storage area according to the control instruction and the control status bit variable; the embedded device writes the feedback information into the feedback instruction storage area and the status bit variable storage area according to the feedback instruction and the feedback status bit variable;
[0033] Step S140: the host computer reads the feedback instruction from the memory space; the embedded device reads the control instruction from the memory space;
[0034] Step S150, the host computer reads the feedback instruction from the feedback instruction storage area and stores it in the feedback reading module, and writes the modified feedback status bit variable into the status bit variable storage area; the embedded device reads the control instruction from the control instruction storage area and stores it in the control reading module, and writes the modified control status bit variable into the status bit variable storage area.
[0035] To perform interactive control communication between the host computer and the embedded device, in step S110, the host computer writes control information in the control writing module, and the embedded device writes feedback information in the feedback writing module, wherein the control information includes control instructions and control status bit variables, and the feedback information includes feedback instructions and feedback status bit variables. According to some optional embodiments, the control instructions include a set of data streams with a predetermined length and a fixed structure, and the feedback instructions include a set of data streams with a predetermined length and a fixed structure.
[0036] Then, in step S120, the host computer writes the control instruction and the control state bit variable into the memory space; the embedded device writes the feedback instruction and the feedback state bit variable into the memory space. In one embodiment, if the current control state bit variable of the memory space is 0, the host computer writes the control instruction into the memory space; if the current feedback state bit variable of the memory space is 0, the embedded device writes the feedback instruction into the memory space.
[0037] Step S130, the host computer writes the control information into the control instruction storage area and the state bit variable storage area according to the control instruction and the control state bit variable; the embedded device writes the feedback information into the feedback instruction storage area and the state bit variable storage area according to the feedback instruction and the feedback state bit variable. In one embodiment, the host computer writes the control information into the control instruction storage area and the state bit variable storage area, and changes the control state bit variable to 1; the embedded device writes the feedback information into the feedback instruction storage area and the state bit variable storage area, and changes the feedback state bit variable to 1.
[0038] Step S140: The host computer reads the feedback instruction from the memory space; the embedded device reads the control instruction from the memory space. In one embodiment, if the current control state bit variable of the memory space is 1, the embedded device reads the control instruction from the memory space; if the current feedback state bit variable of the memory space is 1, the host computer reads the feedback instruction from the memory space.
[0039] Step S150, the host computer reads the feedback instruction from the feedback instruction storage area and stores it in the feedback reading module, and writes the modified feedback state bit variable into the state bit variable storage area; the embedded device reads the control instruction from the control instruction storage area and stores it in the control reading module, and writes the modified control state bit variable into the state bit variable storage area. In one embodiment, the host computer reads the feedback instruction from the feedback instruction storage area and stores it in the feedback reading module, changes the feedback state bit variable to 0 and writes it into the state bit variable storage area; the embedded device reads the control instruction from the control instruction storage area and stores it in the control reading module, changes the control state bit variable to 0 and writes it into the state bit variable storage area.
[0040] Figure 3 Schematic diagram of the working process of the method for interactive control communication between the host computer and the embedded device according to the embodiment of the present invention. Figure 3 The workflow of the host computer controlling the communication of embedded devices and the workflow of the embedded devices controlling the communication of the host computer are explained respectively.
[0041] The host computer writes control information to the control write module, wherein the control information includes control instructions and control status bit variables. If the current control status bit variable of the memory space is 0, the host computer writes the control instruction to the memory space. The host computer writes the control information to the control instruction storage area and the status bit variable storage area, and changes the control status bit variable to 1. If the current control status bit variable of the memory space is 1, the embedded device reads the control instruction from the memory space. The host computer reads the feedback instruction from the feedback instruction storage area and stores it in the feedback read module, changes the feedback status bit variable to 0 and writes it to the status bit variable storage area.
[0042] The embedded device writes feedback information in the feedback writing module, where the feedback information includes feedback instructions and feedback status bit variables. If the current feedback status bit variable of the memory space is 0, the embedded device writes the feedback instruction into the memory space. The embedded device writes the feedback information into the feedback instruction storage area and the status bit variable storage area, and changes the feedback status bit variable to 1. If the current feedback status bit variable of the memory space is 1, the host computer reads the feedback instruction from the memory space. The embedded device reads the control instruction from the control instruction storage area and stores it in the control reading module, changes the control status bit variable to 0 and writes it into the status bit variable storage area.
[0043] The workflow of interactive control communication between a host computer and an embedded device provided in the embodiment of the present invention is the same as the steps in the method of interactive control communication between a host computer and an embedded device provided in the above embodiment of the present invention, and its repeated description will be omitted here.
[0044] The invention relates to a method for interactive control communication between a host computer and an embedded device, and proposes a method for completing interactive communication between the host computer and the embedded device by changing a state bit variable of a memory space, thereby reducing the difficulty of developing and maintaining the embedded device.
[0045] It should be understood that the above specific embodiments of the present invention are only used to illustrate or explain the principles of the present invention, and do not constitute a limitation of the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. In addition, the appended claims of the present invention are intended to cover all changes and modifications that fall within the scope and boundaries of the appended claims, or the equivalent forms of such scope and boundaries.
[0046] The present invention has been described above with reference to the embodiments of the present invention. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of the present invention. The scope of the present invention is defined by the appended claims and their equivalents. Without departing from the scope of the present invention, a person skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present invention.
Claims
1. A method for interactive control communication between a host computer and an embedded device, characterized in that: The host computer includes a control writing module and a feedback reading module, the embedded device includes a memory space and a PCIE interface, the PCIE interface includes a feedback writing module and a control reading module, the memory space includes a control instruction storage area, a feedback instruction storage area and a state bit variable storage area, and the state bit variable storage area has a built-in control state bit variable and a feedback state bit variable; the method includes: The host computer writes control information in the control writing module, and the embedded device writes feedback information in the feedback writing module, wherein the control information includes a control instruction and the control state bit variable, and the feedback information includes a feedback instruction and the feedback state bit variable; The host computer writes the control instruction and the control status bit variable into the memory space; the embedded device writes the feedback instruction and the feedback status bit variable into the memory space; The host computer writes the control information into the control instruction storage area and the status bit variable storage area according to the control instruction and the control status bit variable; the embedded device writes the feedback information into the feedback instruction storage area and the status bit variable storage area according to the feedback instruction and the feedback status bit variable; The host computer reads the feedback instruction from the memory space; the embedded device reads the control instruction from the memory space; The host computer reads the feedback instruction from the feedback instruction storage area and stores it in the feedback reading module, and writes the modified feedback status bit variable into the status bit variable storage area; the embedded device reads the control instruction from the control instruction storage area and stores it in the control reading module, and writes the modified control status bit variable into the status bit variable storage area.
2. The method according to claim 1, characterized in that The control instruction includes a set of data streams with a predetermined length and a fixed structure, and the feedback instruction includes a set of data streams with a predetermined length and a fixed structure.
3. The method according to claim 2, characterized in that The control instruction includes a synchronization byte, Cmd_ID, command type, command length and command parameters; The feedback instruction includes a synchronization byte, an Ack_ID, an Ack length and an Ack data.
4. The method according to claim 3, characterized in that The host computer writes the control instruction and the control status bit variable into the memory space; The embedded device writing the feedback instruction and the feedback status bit variable into the memory space comprises: If the current control state bit variable of the memory space is 0, the host computer writes the control instruction into the memory space; If the current feedback status bit variable of the memory space is 0, the embedded device writes the feedback instruction into the memory space.
5. The method according to claim 4, characterized in that The host computer writes the control information into the control instruction storage area and the status bit variable storage area according to the control instruction and the control status bit variable; the embedded device writes the feedback information into the feedback instruction storage area and the status bit variable storage area according to the feedback instruction and the feedback status bit variable, including: The host computer writes the control information into the control instruction storage area and the state bit variable storage area, and changes the control state bit variable to 1; The embedded device writes the feedback information into the feedback instruction storage area and the status bit variable storage area, and changes the feedback status bit variable to 1.
6. The method according to claim 5, characterized in that The host computer reads the feedback instruction from the memory space; the embedded device reads the control instruction from the memory space and includes: If the current control state bit variable of the memory space is 1, the embedded device reads the control instruction from the memory space; If the current feedback state bit variable of the memory space is 1, the host computer reads the feedback instruction from the memory space.
7. The method according to claim 6, characterized in that The host computer reads the feedback instruction from the feedback instruction storage area and stores it in the feedback reading module, and writes the modified feedback state bit variable into the state bit variable storage area; the embedded device reads the control instruction from the control instruction storage area and stores it in the control reading module, and writes the modified control state bit variable into the state bit variable storage area, including: The host computer reads the feedback instruction from the feedback instruction storage area and stores it in the feedback reading module, and changes the feedback state bit variable to 0 and writes it into the state bit variable storage area; The embedded device reads the control instruction from the control instruction storage area and stores it in the control reading module, and changes the control state bit variable to 0 and writes it into the state bit variable storage area.
