General processing device based on flow control

By only changing the script files on the instruction execution unit side in the embedded control system, using Ethernet communication and XML script interpreter to dynamically control the control flow of the terminal device, the large amount of program code changes and development efficiency caused by changes in the terminal device control process are solved. The problem of low efficiency and reliable process control is achieved.

CN118939375APending Publication Date: 2024-11-12TIANJIN JINHANG COMP TECH RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411060299.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In embedded control systems, changes in the control process or code changes of the terminal equipment lead to large amount of program code changes on the instruction execution unit, low software development efficiency, and is not conducive to the high-quality reuse of software code.

Method used

By only changing the script file at the instruction execution unit, using Ethernet communication between the console and the instruction execution unit, dynamically control the control flow of the terminal device, avoiding large-scale modification of program code, and using XML script interpreter to execute process control statements. Achieve flexibility and reusability of process control.

Benefits of technology

It reduces the amount of program code changes on the instruction execution unit side, improves software development efficiency and reliability, and realizes flexible adaptability to terminal equipment process control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939375A_ABST
    Figure CN118939375A_ABST
Patent Text Reader

Abstract

The invention relates to a universal processing device based on process control, and belongs to the technical field of embedded system communication. When the control flow of the instruction execution unit end is changed or the control code of the terminal equipment end is changed, the method realizes the flow control of the instruction execution unit on the terminal equipment only by changing the script file of the instruction execution unit end under the condition that the program code of the instruction execution unit end is not changed as much as possible or is changed as little as possible. The universal processing device based on process control perfectly solves the problems that the change amount of program codes at an instruction execution unit end is large and the software development efficiency is low due to the change of a control process of terminal equipment or the change of codes at the terminal equipment end. The device provided by the invention has the characteristics of small program code change amount, high software development efficiency and reliability, easiness in implementation and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of embedded system communication, and in particular relates to a general processing device based on process control. Background Art

[0002] In an embedded control system, the instruction execution unit needs to implement control of the terminal device according to the corresponding control process. When the control process on the instruction execution unit side changes or the control code on the terminal device side changes, it is usually necessary to modify the code on the instruction execution unit side to implement process control of the terminal device.

[0003] Although the method of modifying the code on the instruction execution unit side can realize the process control of the instruction execution unit on the terminal device, this method has certain disadvantages. On the one hand, this method leads to a large amount of changes in the program code on the instruction execution unit side. If the control process of the terminal device is relatively complex, and the program architecture design on the instruction execution unit side is not reasonable, when the control process of the terminal device is changed a lot, or the code changes between the new terminal device side and the old terminal device side are large, it will not only lead to an increase in the workload of modifying and maintaining the program on the instruction execution unit side, but also increase the risk of errors after the program is modified. On the other hand, this method of requiring a large amount of modification of the program code on the instruction execution unit side or even modifying the software architecture on the instruction execution unit side due to changes in the terminal device control process or the terminal device side code is not conducive to the high-quality reuse of the software code on the instruction execution unit side, and reduces the software development efficiency and implementation reliability. Summary of the invention

[0004] 1. Technical issues to be resolved

[0005] The present invention provides a general processing device based on process control, which solves the problem of "large amount of program code changes on the instruction execution unit side and low software development efficiency caused by changes in the terminal device control process or the terminal device side code" in an embedded control system. The process control of the terminal device by the instruction execution unit is realized by only changing the script file on the instruction execution unit side, while the program code on the instruction execution unit side is not changed or changed as little as possible.

[0006] (II) Technical solution

[0007] In order to solve the above technical problems, the present invention provides a general processing device based on process control, including a console, an instruction execution unit and a terminal device;

[0008] The console sends control commands and control parameters to the instruction execution unit via Ethernet, and receives the working status fed back by the instruction execution unit via Ethernet; the console notifies the instruction execution unit to start or terminate the control process of the terminal device through different control commands, and sends the working parameters to the terminal device via the instruction execution unit via Ethernet;

[0009] The control process of the terminal device by the instruction execution unit is divided into N steps; the instruction execution unit executes different control processes according to different control commands sent by the console, and each control process is a subset of the complete control process of the terminal device; when executing the control process of the terminal device, the instruction execution unit sends control commands and control parameters to the terminal device through different data communication interfaces;

[0010] The initiation and termination of the terminal device control process is completed by the console, and the execution and termination of the terminal device control process is completed by the instruction execution unit. When the control process is executed abnormally, the instruction execution unit automatically terminates the process operation, and the control process of the terminal device runs in the instruction execution unit;

[0011] The instruction execution unit executes the entire control process of the terminal device in sequence according to the cycle T; the instruction execution unit executes the control process according to the current running step number of the terminal device control process; after the instruction execution unit receives the control command sent by the console, it sets the running step number of the control process; each time the control process is executed, the number of steps Step being executed in the current control process is obtained, and the control process of the step Step is jumped to; when the instruction execution unit executes the control process of the terminal device, it is not necessary to execute the process in sequence according to the step number of the control process; when the instruction execution unit successfully executes the process of the current step, it can jump to the corresponding process step number to execute the control process according to the specific process requirements of the current step.

[0012] Preferably, the control process of the terminal device includes:

[0013] (1) The instruction execution unit sends a control command or control parameter to the terminal device. The control command or control parameter may come from the control console or may be generated by the instruction execution unit itself;

[0014] (2) The instruction execution unit receives and saves the execution status / result fed back by the terminal device;

[0015] (3) The instruction execution unit compares the execution status / result fed back by the terminal device to see whether it is consistent with the expected result in the control process; if the execution status / result is consistent with the expected result in the control process, the next control process is executed; otherwise, the instruction execution unit terminates the current control process and gives a prompt indicating that the process execution is abnormal;

[0016] (4) The instruction execution unit determines whether the execution status / result fed back by the receiving terminal device has timed out; if the instruction execution unit has timed out receiving the execution status / result fed back by the terminal device, the instruction execution unit terminates the current control process and gives a prompt indicating that the process execution is abnormal;

[0017] (5) The instruction execution unit needs to set the status flag of the terminal device in the process.

[0018] Preferably, each control process of the terminal device includes a timeout period T for the execution of the step. timeout And the delay time T between the previous control process delay ; After executing the control flow of the current step, delay T delay Then the next control process is executed.

[0019] Preferably, when the time taken by the instruction execution unit to receive the execution status / result fed back by the terminal device exceeds the timeout time set in the XML script file, a prompt indicating a data reception timeout is given and the process is terminated.

[0020] Preferably, each step of the control flow of the console is implemented by a block statement, each block statement is composed of multiple basic statements, and the XML script interpreter will parse and execute each statement in the block statement in sequence; the interpreter of the XML script file runs in the instruction execution unit, that is, the XML script interpreter, and the kernel of the XML script interpreter implements the interpretation and processing of each syntax element in the block statement; for each syntax element, a corresponding function is defined to respectively implement the assignment statement function, numerical operation function, comparison statement function, logical operation function, branch and loop statement function, data sending function, data receiving function, data result checking function and data testing function, and the parameters of the function are the attributes of the syntax element; according to the specific function implemented by each syntax element, the assignment statement elements, numerical operation elements, comparison statement elements, logical operation elements, branch and loop statement elements, data sending elements, data receiving elements, data result checking elements and data testing elements in the block statement are parsed line by line.

[0021] Preferably, the complete XML script file is loaded into an XML script interpreter, and the instruction execution unit starts to execute the XML script interpreter after receiving the control command of the console; when the instruction execution unit receives the control command Cmd1 sent by the console and executes the control flow and a failure / abnormality occurs, the console does not have to re-execute the control flow of the terminal device from the beginning. The console only needs to re-send the control command Cmd1, and the instruction execution unit can re-execute the control flow that just failed.

[0022] Preferably, the terminal device receives control commands and control parameters sent by the instruction execution unit through different data communication interfaces, converts the instruction execution status / results generated by itself into message data in the corresponding communication interface format, and sends it to the instruction execution unit through different data communication interfaces.

[0023] Preferably, the console comprises:

[0024] A first data sending module, used for sending a control command to the instruction execution unit via Ethernet;

[0025] A first data receiving module, connected to the first data sending module, and used for receiving the working status sent by the instruction execution unit through Ethernet;

[0026] The first data processing module is connected to the first data receiving module and is used to display or record the working status sent by the instruction execution unit.

[0027] Preferably, the instruction execution unit includes:

[0028] A second data sending module is used to send control commands and control parameters to the terminal device through different data communication interfaces, and send working status to the console through Ethernet;

[0029] A second data receiving module, connected to the second data sending module, is used to receive the instruction execution status / result sent by the terminal device through different data communication interfaces, and receive the control command and control parameter sent by the console through Ethernet;

[0030] The second data processing module is connected to the second data receiving module, and is used to convert the control commands and control parameters sent by the console into message data of corresponding formats according to different message data types and communication interface types, and execute corresponding control processes according to different control commands; compare whether the execution status / results fed back by the terminal device are consistent with the expected results in the control process, and convert the execution status / results fed back by the terminal device into Ethernet message data.

[0031] Preferably, the terminal device includes:

[0032] A third data sending module, used for sending the instruction execution status / result to the instruction execution unit through different data communication interfaces;

[0033] A third data receiving module, connected to the third data sending module, and used for receiving control commands and control parameters sent by the instruction execution unit through different data communication interfaces;

[0034] The third data processing module is connected to the third data receiving module and is used to save the instruction execution status / result and convert the instruction execution status / result into message data in a corresponding communication interface format.

[0035] (III) Beneficial effects

[0036] The advantages of the present invention compared with the prior art are:

[0037] 1. The device adapts to and meets the control requirements of the modified instruction execution unit on the terminal device by only changing the script file of the instruction execution unit, without changing or changing the program code of the instruction execution unit as much as possible;

[0038] 2. The device has the characteristics of small program code changes, high software development efficiency and reliability, and easy implementation. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a connection diagram of the console, the instruction execution unit and the terminal device in the present invention.

[0040] Figure 2 It is one of the schematic diagrams of the structure of the general processing device based on process control of the present invention;

[0041] Figure 3 This is the second schematic diagram of the structure of the general processing device based on process control of the present invention;

[0042] Figure 4 This is the third schematic diagram of the structure of the general processing device based on process control of the present invention;

[0043] Figure 5 It is an overall flow chart of the device operation of the present invention. DETAILED DESCRIPTION

[0044] In order to make the purpose, content and advantages of the present invention more clear, the specific implementation methods of the present invention are further described in detail below in conjunction with the drawings and examples.

[0045] Figure 1 This is a schematic diagram of a general processing device based on process control proposed by the present invention. When the control process on the instruction execution unit side is changed or the control code on the terminal device side is changed, the device implements the process control of the terminal device by the instruction execution unit only by changing the script file on the instruction execution unit side, while changing as little or as little as possible the program code on the instruction execution unit side.

[0046] Only by adopting the solution of the present invention can the problem of "large changes in the program code on the instruction execution unit side and low software development efficiency due to changes in the terminal device control process or the terminal device side code" be perfectly solved. The present invention proposes a general processing device based on process control, which only needs to change the script file on the instruction execution unit side, thereby improving the development efficiency and reliability of the software.

[0047] like Figure 1 , Figure 2 As shown, this embodiment provides a general processing device based on process control, including a console, an instruction execution unit and a terminal device, wherein the console includes:

[0048] A first data sending module 11, used for sending a control command to the instruction execution unit via Ethernet;

[0049] A first data receiving module 12, connected to the first data sending module 11, and configured to receive a working status sent by the instruction execution unit via Ethernet;

[0050] The first data processing module 13 is connected to the first data receiving module 12 and is used to display or record the working status sent by the instruction execution unit.

[0051] The console sends control commands and control parameters to the instruction execution unit via Ethernet, and receives working status feedback from the instruction execution unit via Ethernet;

[0052] The console notifies the instruction execution unit to start or terminate the control process of the terminal device through different control commands, and sends the working parameters to the terminal device through the instruction execution unit via Ethernet.

[0053] like Figure 3 As shown, the instruction execution unit includes:

[0054] The second data sending module 21 is used to send control commands and control parameters to the terminal device through different data communication interfaces, and send the working status to the console through Ethernet;

[0055] A second data receiving module 22, connected to the second data sending module 21, is used to receive the instruction execution status / result sent by the terminal device through different data communication interfaces, and receive the control command and control parameter sent by the console through Ethernet;

[0056] The second data processing module 23 is connected to the second data receiving module 22, and is used to convert the control commands and control parameters sent by the console into message data of corresponding formats according to different message data types and communication interface types, and execute corresponding control processes according to different control commands; compare whether the execution status / results fed back by the terminal device are consistent with the expected results in the control process, and convert the execution status / results fed back by the terminal device into Ethernet message data.

[0057] Among them, the control process of the terminal device by the instruction execution unit is divided into N (N>0) steps; the instruction execution unit executes different control processes according to different control commands sent by the console (each control process is a subset of the complete control process of the terminal device); when executing the control process of the terminal device, the instruction execution unit sends control commands and control parameters to the terminal device through different data communication interfaces (Ethernet, switch quantity, serial port, CAN bus, etc.).

[0058] The initiation and termination of the terminal device control process is completed by the console, and the execution and termination of the terminal device control process (when the control process is executed abnormally, the instruction execution unit automatically terminates the process operation) is completed by the instruction execution unit. The control process of the terminal device runs in the instruction execution unit. The control process of the terminal device includes:

[0059] (1) The instruction execution unit sends a control command or control parameter to the terminal device. The control command or control parameter may come from the control console or may be generated by the instruction execution unit itself;

[0060] (2) The instruction execution unit receives and saves the execution status / result fed back by the terminal device;

[0061] (3) The instruction execution unit compares the execution status / result fed back by the terminal device to see whether it is consistent with the expected result in the control process; if the execution status / result is consistent with the expected result in the control process, the next control process is executed; otherwise, the instruction execution unit terminates the current control process and gives a prompt indicating that the process execution is abnormal;

[0062] (4) The instruction execution unit determines whether the execution status / result fed back by the receiving terminal device has timed out; if the instruction execution unit has timed out receiving the execution status / result fed back by the terminal device, the instruction execution unit terminates the current control process and gives a prompt indicating that the process execution is abnormal;

[0063] (5) The instruction execution unit needs to set the status flag of the terminal device in the process.

[0064] Among them, the instruction execution unit executes the entire control process of the terminal device in sequence according to the cycle T (T>0). The instruction execution unit executes the control process according to the current running step number of the terminal device control process; after receiving the control command sent by the console, the instruction execution unit sets the running step number of the control process; each time the control process is executed, the number of steps Step being executed in the current control process is obtained, and the control process of the step Step is executed; when the instruction execution unit executes the control process of the terminal device, it is not necessary to execute the process in sequence according to the step number of the control process; when the instruction execution unit successfully executes the process of the current step, it can jump to the corresponding process step number to execute the control process according to the specific process requirements of the current step.

[0065] Each control process of the terminal device includes a timeout period T for the execution of the step. timeout (T timeout >0) and the delay time T between the previous control process delay (T delay ≥0); after completing the control process of the current step, a delay of T is required delay Only then can the next control process be executed.

[0066] When the time for the instruction execution unit to receive the execution status / result fed back by the terminal device exceeds the timeout time set in the XML script file, a prompt of data reception timeout is given and the process is terminated.

[0067] Among them, each step of the control flow of the console is implemented by a block statement, each block statement is composed of multiple basic statements, and the XML script interpreter will parse and execute each statement in the block statement in sequence; the interpreter of the XML script file runs in the instruction execution unit, that is, the XML script interpreter, and the kernel of the XML script interpreter implements the interpretation and processing of each syntax element in the block statement; for each syntax element, the corresponding function is defined to respectively implement the assignment statement function, numerical operation function, comparison statement function, logical operation function, branch and loop statement function, data sending function, data receiving function, data result checking function and data testing function, and the parameters of the function are the attributes of the above syntax elements; according to the specific function implemented by each syntax element, the assignment statement elements, numerical operation elements, comparison statement elements, logical operation elements, branch and loop statement elements, data sending elements, data receiving elements, data result checking elements and data testing elements in the block statement are parsed line by line.

[0068] Among them, the complete XML script process file is loaded into the XML script interpreter, and the instruction execution unit starts to execute the XML script interpreter after receiving the console control command; when the instruction execution unit receives the control command Cmd1 sent by the console and executes the control process and a failure / abnormality occurs, the console does not have to re-execute the control process of the terminal device from the beginning. The console only needs to re-send the control command Cmd1, and the instruction execution unit can re-execute the control process that just failed.

[0069] like Figure 4 As shown, the terminal device includes:

[0070] A third data sending module 31, used to send the instruction execution status / result to the instruction execution unit through different data communication interfaces;

[0071] A third data receiving module 32, connected to the third data sending module 31, for receiving control commands and control parameters sent by the instruction execution unit through different data communication interfaces;

[0072] The third data processing module 33 is connected to the third data receiving module 32, and is used to save the instruction execution status / result and convert the instruction execution status / result into message data in a corresponding communication interface format.

[0073] Among them, the terminal device receives control commands and control parameters sent by the instruction execution unit through different data communication interfaces, converts the instruction execution status / results generated by itself into message data in the corresponding communication interface format, and sends it to the instruction execution unit through different data communication interfaces.

[0074] It can be seen that the general processing device based on process control provided by the present invention can realize that when the control process of the terminal device changes and needs to be modified, there is no need to change the application code of the instruction execution unit, and only the corresponding XML script process file needs to be changed to realize the process control of the terminal device by the instruction execution unit.

[0075] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A general processing device based on process control, characterized in that: It includes a control console, a command execution unit and a terminal device; The console sends control commands and control parameters to the instruction execution unit via Ethernet, and receives the working status fed back by the instruction execution unit via Ethernet; the console notifies the instruction execution unit to start or terminate the control process of the terminal device through different control commands, and sends the working parameters to the terminal device via the instruction execution unit via Ethernet; The control process of the terminal device by the instruction execution unit is divided into N steps; the instruction execution unit executes different control processes according to different control commands sent by the console, and each control process is a subset of the complete control process of the terminal device; when executing the control process of the terminal device, the instruction execution unit sends control commands and control parameters to the terminal device through different data communication interfaces; The initiation and termination of the terminal device control process is completed by the console, and the execution and termination of the terminal device control process is completed by the instruction execution unit. When the control process is executed abnormally, the instruction execution unit automatically terminates the process operation, and the control process of the terminal device runs in the instruction execution unit; The instruction execution unit executes the entire control process of the terminal device in sequence according to the cycle T; the instruction execution unit executes the control process according to the current running step number of the terminal device control process; after the instruction execution unit receives the control command sent by the console, it sets the running step number of the control process; each time the control process is executed, the number of steps Step being executed in the current control process is obtained, and the control process of the step Step is jumped to; when the instruction execution unit executes the control process of the terminal device, it is not necessary to execute the process in sequence according to the step number of the control process; when the instruction execution unit successfully executes the process of the current step, it can jump to the corresponding process step number to execute the control process according to the specific process requirements of the current step.

2. The device according to claim 1, characterized in that The control process of the terminal device includes: (1) The instruction execution unit sends a control command or control parameter to the terminal device. The control command or control parameter may come from the control console or may be generated by the instruction execution unit itself; (2) The instruction execution unit receives and saves the execution status / result fed back by the terminal device; (3) The instruction execution unit compares the execution status / result fed back by the terminal device to see whether it is consistent with the expected result in the control process; if the execution status / result is consistent with the expected result in the control process, the next control process is executed; otherwise, the instruction execution unit terminates the current control process and gives a prompt indicating that the process execution is abnormal; (4) The instruction execution unit determines whether the execution status / result fed back by the receiving terminal device has timed out; if the instruction execution unit has timed out receiving the execution status / result fed back by the terminal device, the instruction execution unit terminates the current control process and gives a prompt indicating that the process execution is abnormal; (5) The instruction execution unit needs to set the status flag of the terminal device in the process.

3. The device according to claim 1, characterized in that Each control process of the terminal device includes a timeout period T for the execution of the step. timeout And the delay time T between the previous control process delay ; After executing the control flow of the current step, delay T delay Then the next control process is executed.

4. The device according to claim 1, characterized in that When the time for the instruction execution unit to receive the execution status / result fed back by the terminal device exceeds the timeout time set in the XML script file, a prompt of data reception timeout is given and the process is terminated.

5. The device according to claim 1, characterized in that Each step of the control flow of the console is implemented by a block statement, and each block statement is composed of multiple basic statements. The XML script interpreter will parse and execute each statement in the block statement in sequence; the interpreter of the XML script file runs in the instruction execution unit, that is, the XML script interpreter, and the kernel of the XML script interpreter implements the interpretation and processing of each syntax element in the block statement; for each syntax element, the corresponding function is defined to respectively implement the assignment statement function, numerical calculation function, comparison statement function, logical calculation function, branch and loop statement function, data sending function, data receiving function, data result checking function and data testing function, and the function parameter is the attribute of the syntax element; according to the specific function implemented by each syntax element, the assignment statement element, numerical calculation element, comparison statement element, logical calculation element, branch and loop statement element, data sending element, data receiving element, data result checking element and data testing element in the block statement are parsed line by line.

6. The device according to claim 5, characterized in that The complete XML script file is loaded into the XML script interpreter, and the instruction execution unit starts to execute the XML script interpreter after receiving the control command of the console; when the instruction execution unit receives the control command Cmd1 sent by the console and executes the control process and a failure / abnormality occurs, the console does not have to re-execute the control process of the terminal device from the beginning. The console only needs to re-send the control command Cmd1, and the instruction execution unit can re-execute the control process that just failed.

7. The device according to claim 1, characterized in that The terminal device receives control commands and control parameters sent by the instruction execution unit through different data communication interfaces, converts the instruction execution status / results generated by itself into message data in the corresponding communication interface format, and sends them to the instruction execution unit through different data communication interfaces.

8. The device according to claim 1, characterized in that The console comprises: A first data sending module, used for sending a control command to the instruction execution unit via Ethernet; A first data receiving module, connected to the first data sending module, and used for receiving the working status sent by the instruction execution unit through Ethernet; The first data processing module is connected to the first data receiving module and is used to display or record the working status sent by the instruction execution unit.

9. The device according to claim 8, characterized in that The instruction execution unit comprises: A second data sending module is used to send control commands and control parameters to the terminal device through different data communication interfaces, and send working status to the console through Ethernet; A second data receiving module, connected to the second data sending module, is used to receive the instruction execution status / result sent by the terminal device through different data communication interfaces, and receive the control command and control parameter sent by the console through Ethernet; The second data processing module is connected to the second data receiving module, and is used to convert the control commands and control parameters sent by the console into message data of corresponding formats according to different message data types and communication interface types, and execute corresponding control processes according to different control commands; compare whether the execution status / results fed back by the terminal device are consistent with the expected results in the control process, and convert the execution status / results fed back by the terminal device into Ethernet message data.

10. The device according to claim 9, characterized in that The terminal device comprises: A third data sending module, used for sending the instruction execution status / result to the instruction execution unit through different data communication interfaces; A third data receiving module, connected to the third data sending module, and used for receiving control commands and control parameters sent by the instruction execution unit through different data communication interfaces; The third data processing module is connected to the third data receiving module and is used to save the instruction execution status / result and convert the instruction execution status / result into message data in a corresponding communication interface format.