General processing method based on process control
By using the XML script language process control method in the embedded control system, only changes are made in the script file on the console side, which solves the problem of large amount of program code changes on the console side caused by changes in the terminal device control process, and improves software development Efficiency and reliability.
Patent Information
- Application Number
- CN202411060455.2
- 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
In embedded control systems, when the control process or code of the terminal device is changed, it is usually necessary to significantly modify the console program code, resulting in increased workload and increased error risks, which is not conducive to software development efficiency and reliability.
Using the process control method based on the XML script language, by defining the XML script language interface specification and generating the XML script language, it is only changed in the script file on the console side to realize the process control of the terminal device and avoid the console side program code. Major changes.
With the console-side program code not changing or changing as little as possible, the process control of the terminal device is realized, which improves the efficiency and reliability of software development and reduces the amount of program code changes.
Smart Images

Figure CN118939376A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of embedded system communication, and in particular relates to a general processing method based on process control. Background Art
[0002] In an embedded control system, the console needs to control the terminal device according to the corresponding control process. When the control process on the console side is changed or the control code on the terminal device side is changed, it is usually necessary to modify the code on the console side to realize the process control of the terminal device.
[0003] Although the method of modifying the console-side code can realize the process control of the console over 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 console side. If the control process of the terminal device is relatively complex, and the program architecture design of the console 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 and the old terminal device are large, it will not only lead to an increase in the workload of modifying and maintaining the program on the console 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 console-side program code or even the modification of the console-side software architecture due to changes in the terminal device control process or the terminal device code is not conducive to the high-quality reuse of the console-side software code, 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 method based on process control to solve the problem of "large amount of changes to console-side program code and low software development efficiency caused by changes to terminal device control process or terminal device-side code" in embedded control systems. The process control of the console over the terminal device is achieved by only changing the console-side script file, while the console-side program code 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 method based on process control, which is implemented based on a console, an instruction forwarding unit and a terminal device, and includes the following steps:
[0008] S1: Define the syntax and commands of the XML scripting process language and generate the XML scripting language interface specification;
[0009] The XML scripting language interface specification is an XML-based extensible markup language designed for the console to execute the terminal device control process, supports sequential structure, branch judgment and loop structure, and provides transmission control of Ethernet messages; the XML scripting language is designed based on the XML extensible markup language, follows the grammatical rules of the XML language, and is written in sequence according to the control process of the terminal device;
[0010] S2: Based on XML extensible markup language, describe the control process of the console to the terminal device according to the XML script language interface specification, and save the control process in the XML script process file;
[0011] The control process of the console over the terminal device is divided into N steps; the console sends the requirements and content of each step to the instruction forwarding unit through Ethernet, and the instruction forwarding unit sends the received control command and parameters to the terminal device through different data interfaces; the terminal device sends the execution result of the control command to the instruction forwarding unit through different data interfaces, and the instruction forwarding unit sends the execution result to the console through Ethernet;
[0012] S3: Load the complete XML script process file into the XML script interpreter, and the console starts the operation process of the control object.
[0013] Preferably, the statements in the XML scripting language interface specification are expressed by an XML element; all statements must have a return value, and for statements whose return values are meaningless, void is returned; the statements in the XML scripting language interface specification can be nested into combined statements, and the return value of such a statement is the execution result of the last statement within it; the return value type of each statement is dynamically determined during the execution of the XML script interpreter, and is not statically checked before execution.
[0014] Preferably, each step of the control process 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 language elements of each basic statement in the block include assignment statement elements, numerical operation elements, comparison statement elements, logical operation elements, branch and loop statement elements, Ethernet message data sending elements, Ethernet message data receiving elements, Ethernet message data result checking elements, and Ethernet message data testing elements.
[0015] Preferably, the assignment statement element setvar in the block statement is used to define and initialize a variable of any type, and the return value of the statement is of bool type, indicating whether the assignment is executed successfully; the value acquisition element getvar in the block statement is used to obtain the value of a variable of any type; the getvar element returns the value of a defined variable and is used to reference the defined variable; if the variable to be referenced has not been defined, it returns the invalid type null; the numerical calculation element calcula in the block statement is used to perform arithmetic or bitwise operations on the defined variable and store the result of the operation in the original variable; the return value of the statement is of bool type, indicating whether the operation is executed The line is successful; the comparison statement element testfield in the block statement is used to compare the size of two variable values or the variable value and the constant value, and return the comparison result; if the comparison results are consistent, true is returned, otherwise false is returned; the logical operation element in the block statement is used to perform "logical and" or "logical or" operations on sub-statements containing one or more Boolean return values, and return the operation result; the "logical and" statement element and contains one or more sub-statements with Boolean return values; when the and statement is executed, its sub-statements are evaluated in turn, and if all are true, true is returned, otherwise false is returned; the "logical or" statement element or contains There are one or more sub-statements whose return value is Boolean; when the or statement is executed, its sub-statements are evaluated in sequence. If one of them is true, true is returned, otherwise false is returned; the branch and loop statement elements in the block statement are used to implement branch statement and loop statement operations; the Ethernet message data sending element sendnetdata in the block statement is used to implement the sending of Ethernet message data. The element sendnetdata can define the content of the sent data, the type of sent message, the number of sends and the sending interval. The content of the sent data packet can be described by field; sendnetdata contains four attributes: addr represents the destination address of the send, type indicates the type of message sent, times indicates the maximum number of times to send, and gap indicates the sending interval; the Ethernet message data receiving element recvnetdata in the block statement is used to implement the Ethernet message data content, receiving type and timeout time sent by the device with the specified IP address, and save the received message data content; recvnetdata contains three attributes: addr indicates the received source address, type indicates the received message type, and timeout indicates the receiving data timeout; the Ethernet message data result check element check in the block statement is used to check whether the execution result sent by the terminal device is consistent with the expected result in the control flow;check contains two attributes: addr indicates the received source address, and type indicates the received message type; the return value of the check element is 0 or -1, 0 indicates that it is consistent with the expected result, and -1 indicates that it is inconsistent with the expected result; the Ethernet message data test element testfield in the block statement is used to check whether the content of certain fields in the execution result sent by the terminal device is correct; testfield contains two attributes: field indicates the field of the received data, and value indicates the comparison data value. ;
[0016] Preferably, the initiation, execution and termination of the terminal device control process are all completed by the console, and the terminal device control process runs in the console; the console sends the control command of each step through Ethernet, and receives the command execution result of the step feedback through Ethernet; if the execution result of the current step does not match the expected result in the control process, the console terminates the current control process and gives a prompt of process execution abnormality; if the execution result of the current step matches the expected result in the control process, the console sends the control command of the next step through Ethernet.
[0017] Preferably, the console executes the entire control process of the terminal device in sequence according to a period T; 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 the step Step to execute the step; each step of the control process contains a timeout time 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, a delay of T is required delay Only then can the next control process be executed.
[0018] Preferably, the console implements the message data retransmission operation and reception timeout processing in the control process according to the following strategy:
[0019] The "times" attribute in sendnetdata indicates the maximum number of times that data can be sent, and the "gap" attribute indicates the sending interval. When the number of times data can be sent is greater than the attribute value of "times", the console will be prompted that data sending has failed and the process will be terminated. The "timeout" attribute in recvnetdata indicates the receiving timeout. When the receiving time is greater than the attribute value of "timeout", the console will be prompted that data receiving has timed out and the process will be terminated.
[0020] Preferably, the kernel of the XML script interpreter implements the interpretation and processing of each syntax element in the block statement; for each syntax element, corresponding functions are defined to respectively implement the assignment statement function, numerical calculation function, comparison statement function, logical calculation function, branch and loop statement function, Ethernet message data sending function, Ethernet message data receiving function, Ethernet message data result checking function and Ethernet message data testing function, and the parameters of the function are the attributes of the syntax element.
[0021] Preferably, according to the specific functions implemented by each syntax element, the assignment statement elements, numerical operation elements, comparison statement elements, logical operation elements, branch and loop statement elements, Ethernet message data sending elements, Ethernet message data receiving elements, Ethernet message data result checking elements and Ethernet message data testing elements in the block statement are parsed line by line.
[0022] Preferably, after the complete XML script process file is loaded into the XML script interpreter, the console decides under what conditions to start the XML script process; the console executes the XML script content sequentially according to the terminal device control process. Once the XML script interpreter prompts failure when executing the control process, the console cannot re-execute the control process from the current failed control process step, and can only re-execute the parsing process of the control process from the beginning.
[0023] (III) Beneficial effects
[0024] The advantages of the present invention compared with the prior art are:
[0025] 1. This method adapts to and meets the control requirements of the changed console on the terminal device by only changing the console script file without changing or changing the console program code as little as possible;
[0026] 2. This method has the characteristics of small program code changes, high software development efficiency and reliability, and easy implementation. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a schematic diagram of the connection between the console and the terminal equipment in the device for implementing the method of the present invention;
[0028] Figure 2 It is an overall flow chart of the method of the present invention. DETAILED DESCRIPTION
[0029] 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.
[0030] The present invention proposes a general processing method based on process control. When the control process of the console end is changed or the control code of the terminal device end is changed, the method realizes the process control of the console over the terminal device by only changing the console end script file without changing or changing the console end program code as little as possible.
[0031] Only by adopting the solution of the present invention can the problem of "large amount of program code changes on the console side and low software development efficiency caused by changes in the terminal device control process or terminal device code changes" be perfectly solved. The present invention proposes a general processing method based on process control, which only requires changing the script file on the console side, thereby improving the development efficiency and reliability of the software.
[0032] like Figure 1 , Figure 2 As shown, the present invention proposes a general processing method based on process control, which is implemented based on a console, an instruction forwarding unit and a terminal device, and the steps are as follows:
[0033] S1: Define the syntax and commands of the XML scripting process language and generate the XML scripting language interface specification;
[0034] The XML scripting language interface specification is an XML-based extensible markup language designed for the console to execute terminal device control processes, supports sequential structures, branch judgments and loop structures, and provides transmission control for Ethernet messages.
[0035] The XML scripting language is designed based on the XML extensible markup language, follows the grammatical rules of the XML language, and is written in sequence according to the control flow of the terminal device.
[0036] Among them, the statements in the XML scripting language interface specification are expressed by an XML element; all statements must have a return value, and for statements with meaningless return values, void is returned; the statements in the XML scripting language interface specification can be nested into combined statements, and the return value of such a statement is the execution result of the last statement within it; the return value type of each statement is dynamically determined during the execution of the XML script interpreter, and is not statically checked before execution.
[0037] Among them, each step of the control process 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 language elements of each basic statement in the block include assignment statement elements, numerical operation elements, comparison statement elements, logical operation elements, branch and loop statement elements, Ethernet message data sending elements, Ethernet message data receiving elements, Ethernet message data result checking elements, and Ethernet message data testing elements.
[0038] The assignment statement element setvar in the block statement is used to define and initialize a variable of any type. The return value of the statement is of type bool, indicating whether the assignment is successful. For example, the following code assigns the value of 0x1234 to the 16-bit unsigned integer variable "int3":
[0039] <setvartype="uint16"name="int3">
[0040] 0x1234
[0041]
[0042] The getvar element in the block statement is used to get the value of any type of variable. The getvar element returns the value of a defined variable and is mainly used to reference defined variables. If the variable to be referenced has not been defined, an invalid type (null) is returned. For example, the following code assigns the value of the variable "int1" to the variable "int2":
[0043] <setvartype="uint16"name="int2">
[0044] <getvar variable="int1"type="uint16">
[0045]
[0046] The numerical operation element calcula in the block statement is used to perform arithmetic or bitwise operations on the defined variables and store the results of the operations in the original variables; the return value of the statement is a bool type, indicating whether the operation is successful. For example, the following code adds 1 to the value of the variable "int2" and saves the result in the variable "int2":
[0047] <calcula op="add"lvalue="int2"rvalue="1">
[0048]
[0049] Among them, the comparison statement element testfield in the block statement is used to compare the magnitudes of two variable values or a variable value and a constant value, and return the comparison result; if the comparison results are the same, it returns true, and if the comparison results are different, it returns false. For example, the following code compares whether the value of the status word is equal to 0:
[0050] <testfield field="status word" value="0">
[0051] Among them, the logical operation element in the block statement is used to perform "logical AND" or "logical OR" operations on one or more sub-statements with return values of the boolean type, and return the operation result; the "logical AND" statement element and contains one or more sub-statements with return values of boolean; when the and statement is executed, it evaluates its sub-statements in sequence. If all are true, it returns true, otherwise it returns false; the "logical OR" statement element or contains one or more sub-statements with return values of boolean; when the or statement is executed, it evaluates its sub-statements in sequence. If one is true, it returns true, otherwise it returns false.
[0052] Logical operation elements are often used together. The usage examples are as follows:
[0053] <or>
[0054] <and>
[0055] <testfield field="Type" value="0xAAAA">
[0056] <testfield field="Length" value="10">
[0057] < / and>
[0058] <and>
[0059] <testfield field="Type" value="0x5555">
[0060] <testfield field="Length" value="20">
[0061] < / and>
[0062] < / or>
[0063] Among them, the branch and loop statement elements in the block statement are used to implement branch statement and loop statement operations.
[0064] The if element is used to implement the branch statement, and it selects different branches to execute according to the result of the conditional judgment.
[0065] <if>
[0066] Conditional statement (statement 1)
[0067] Statement to be executed if the condition is successful (statement 2)
[0068] Statement to be executed if the condition fails (statement 3)
[0069] < / if>
[0070] if first executes statement 1. If statement 1 returns true, it executes statement 2, otherwise it executes statement 3.
[0071] The while element iteratively evaluates its sub-statements when its condition is satisfied. The while element has no attributes, but there are requirements for the structure of its content.
[0072] <while>
[0073] Conditional statement (statement 1)
[0074] Statements that are executed iteratively when the conditions are met (statement 2)
[0075] < / while>
[0076] The while statement first executes statement 1. If the result of statement 1 is true, it executes statement 2, and then executes statement 1 again. This repeats until statement 1 returns false.
[0077] Among them, the Ethernet packet data sending element sendnetdata in the block statement is used to implement the sending of Ethernet packet data. This element sendnetdata can define the content of the data to be sent, the type of the packet to be sent, the number of sending times, and the sending interval. The content of the sent data packet can be described by field; sendnetdata contains four attributes: addr represents the destination address of the sending, type represents the type of the packet to be sent, times represents the maximum number of sending times, and gap represents the sending interval, with the unit of ms.
[0078] <sendnetdata addr="192.168.24.5" type="Status packet" times="3" gap="50">
[0079] <field name="XX status 1" value="0x500a">
[0080] <field name="XX status 2" value="0x070f">
[0081]
[0082] Among them, the Ethernet packet data receiving element recvnetdata in the block statement is used to implement receiving the content, receiving type, and timeout of the Ethernet packet data sent by the device with the specified IP address, and saving the content of the received packet data; recvnetdata contains three attributes: addr represents the source address of the receiving, type represents the type of the packet to be received, and timeout represents the timeout of receiving data, with the unit of ms. For example, the following code saves the data received from "192.168.24.5" into the array "data". Among them, setarray represents setting the array name.
[0083] <setarray name="data">
[0084] <recvnetdata addr="192.168.24.5" timeout="50">
[0085]
[0086]
[0087] Among them, the Ethernet packet data result check element check in the block statement is used to check whether the execution result sent by the terminal device matches the expected result in the control flow; check contains two attributes: addr represents the received source address, and type represents the received packet type. The return value of the check element is 0 (matching the expected result) or -1 (not matching the expected result). To check whether the packet data received from the address 192.168.24.5 is consistent with the content of the expected "status data packet", the following command can be used:
[0088] <check addr="192.168.24.5"type="status data packet">
[0089] Among them, the Ethernet packet data test element testfield in the block statement is used to check whether the content of some fields in the execution result sent by the terminal device is correct; testfield contains two attributes: field represents the field of the received data, and value represents the comparison data value.
[0090] To check whether the "instruction identification code" in the packet is 0x23, the following command can be used:
[0091] <testfield field="instruction identification code"value="0x23">
[0092] S2: Based on the XML (Extensible Markup Language), describe the control flow of the console for the terminal device according to the XML script language interface specification, and save this control flow in the XML script flow file;
[0093] Among them, the control flow of the console for the terminal device is divided into N (N>0) steps; the console sends the requirements and content of each step to the instruction forwarding unit through Ethernet, and the instruction forwarding unit sends the received control commands and parameters to the terminal device through different data interfaces; the terminal device sends the execution result of the control command to the instruction forwarding unit through different data interfaces, and the instruction forwarding unit then sends this execution result to the console through Ethernet.
[0094] Among them, the initiation, execution, and termination operations of the control flow of the terminal device are all completed by the console, and the control flow of the terminal device runs in the console; the console sends the control command of each step through Ethernet and receives the command execution result feedback of this step through Ethernet; if the execution result of the current step does not match the expected result in the control flow, the console terminates the current control flow and gives a prompt of abnormal process execution; if the execution result of the current step matches the expected result in the control flow, the console sends the control command of the next step through Ethernet.
[0095] The console executes the entire control process of the terminal device in sequence according to the cycle T (T>0); 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 the step Step to execute the step; each step of the control process contains the timeout time 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.
[0096] The console implements the retransmission operation and reception timeout processing of message data in the control process according to the following strategy:
[0097] The "times" attribute in sendnetdata indicates the maximum number of times that data can be sent, and the "gap" attribute indicates the sending interval. When the number of times data is sent is greater than the value of the "times" attribute, the console will be prompted that data sending has failed and the process will be terminated.
[0098] The "timeout" attribute in recvnetdata indicates the receiving timeout. When the receiving time is greater than the "timeout" attribute value, the console should be prompted that the receiving data has timed out and the process should be terminated.
[0099] S3: Load the complete XML script process file into the XML script interpreter, and the console starts the operation process of the control object;
[0100] Among them, the kernel of the XML script interpreter implements the interpretation and processing of each syntax element in the block statement; for each syntax element, corresponding functions are defined to respectively implement the assignment statement function, numerical calculation function, comparison statement function, logical calculation function, branch and loop statement function, Ethernet message data sending function, Ethernet message data receiving function, Ethernet message data result checking function and Ethernet message data testing function, and the parameters of the function are the attributes of the above-mentioned syntax elements.
[0101] Among them, according to the specific functions implemented by each syntax element, the assignment statement elements, numerical operation elements, comparison statement elements, logical operation elements, branch and loop statement elements, Ethernet message data sending elements, Ethernet message data receiving elements, Ethernet message data result checking elements and Ethernet message data testing elements in the block statement are parsed line by line.
[0102] Among them, after the complete XML script process file is loaded into the XML script interpreter, the console decides under what conditions to start the XML script process; the console executes the XML script content in sequence according to the terminal device control process. Once the XML script interpreter prompts failure when executing the control process, the console cannot re-execute the control process from the current failed control process step, and can only re-execute the parsing process of the control process from the beginning.
[0103] It can be seen that the general processing method based on process control of 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 console. Only the corresponding XML script process file needs to be changed to realize the process control of the terminal device by the console.
[0104] 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 method based on process control, characterized in that: The method is implemented based on a console, a command forwarding unit and a terminal device, and includes the following steps: S1: Define the syntax and commands of the XML scripting process language and generate the XML scripting language interface specification; The XML scripting language interface specification is an XML-based extensible markup language designed for the console to execute the terminal device control process, supports sequential structure, branch judgment and loop structure, and provides transmission control of Ethernet messages; the XML scripting language is designed based on the XML extensible markup language, follows the grammatical rules of the XML language, and is written in sequence according to the control process of the terminal device; S2: Based on XML extensible markup language, describe the control process of the console to the terminal device according to the XML script language interface specification, and save the control process in the XML script process file; The control process of the console over the terminal device is divided into N steps; the console sends the requirements and content of each step to the instruction forwarding unit through Ethernet, and the instruction forwarding unit sends the received control command and parameters to the terminal device through different data interfaces; the terminal device sends the execution result of the control command to the instruction forwarding unit through different data interfaces, and the instruction forwarding unit sends the execution result to the console through Ethernet; S3: Load the complete XML script process file into the XML script interpreter, and the console starts the operation process of the control object.
2. The method according to claim 1, characterized in that The statements in the XML scripting language interface specification are expressed by an XML element; all statements must have a return value, and for statements whose return values are meaningless, void is returned; the statements in the XML scripting language interface specification can be nested into combined statements, and the return value of such a statement is the execution result of the last statement within it; the return value type of each statement is dynamically determined during the execution of the XML script interpreter, and is not statically checked before execution.
3. The method according to claim 2, characterized in that Each step of the control process 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 language elements of each basic statement in the block include assignment statement elements, numerical operation elements, comparison statement elements, logical operation elements, branch and loop statement elements, Ethernet message data sending elements, Ethernet message data receiving elements, Ethernet message data result checking elements, and Ethernet message data testing elements.
4. The method according to claim 3, characterized in that The assignment statement element setvar in the block statement is used to define and initialize a variable of any type. The return value of the statement is of bool type, indicating whether the assignment is executed successfully. The getvar element in the block statement is used to obtain the value of a variable of any type. The getvar element returns the value of a defined variable and is used to reference the defined variable. If the variable to be referenced has not been defined, it returns the invalid type null. The numerical operation element calcula in the block statement is used to perform arithmetic or bitwise operations on the defined variable and store the result of the operation in the original variable. The return value of the statement is of bool type, indicating whether the operation is executed successfully. ; The comparison statement element testfield in the block statement is used to compare the size of two variable values or the variable value and the constant value, and return the comparison result; if the comparison results are consistent, true is returned, otherwise false is returned; the logical operation element in the block statement is used to perform "logical and" or "logical or" operations on sub-statements containing one or more Boolean return values, and return the operation result; the "logical and" statement element and contains one or more sub-statements with Boolean return values; when the and statement is executed, its sub-statements are evaluated in turn, and if all are true, true is returned, otherwise false is returned; the "logical or" statement element or contains one One or more sub-statements with Boolean return values; when the or statement is executed, its sub-statements are evaluated in sequence. If one of them is true, true is returned, otherwise false is returned; the branch and loop statement elements in the block statement are used to implement branch statement and loop statement operations; the Ethernet message data sending element sendnetdata in the block statement is used to implement the sending of Ethernet message data. The element sendnetdata can define the content of the sent data, the type of sent message, the number of sends and the sending interval. The content of the sent data packet can be described by field; sendnetdata contains four attributes: addr represents the destination address of the send, t ype indicates the type of message sent, times indicates the maximum number of times to send, and gap indicates the sending interval; the Ethernet message data receiving element recvnetdata in the block statement is used to implement the Ethernet message data content, receiving type and timeout time sent by the device with the specified IP address, and save the received message data content; recvnetdata contains three attributes: addr indicates the received source address, type indicates the received message type, and timeout indicates the receiving data timeout; the Ethernet message data result check element check in the block statement is used to check whether the execution result sent by the terminal device is consistent with the expected result in the control flow;check contains two attributes: addr indicates the received source address, and type indicates the received message type; the return value of the check element is 0 or -1, 0 indicates that it is consistent with the expected result, and -1 indicates that it is inconsistent with the expected result; the Ethernet message data test element testfield in the block statement is used to check whether the content of certain fields in the execution result sent by the terminal device is correct; testfield contains two attributes: field indicates the field of the received data, and value indicates the comparison data value. ; 5. The method according to claim 4, characterized in that The initiation, execution and termination of the terminal device control process are all completed by the console, and the terminal device control process runs in the console; the console sends the control command of each step through Ethernet, and receives the command execution result of the step through Ethernet; if the execution result of the current step does not match the expected result in the control process, the console terminates the current control process and gives a prompt of process execution abnormality; If the execution result of the current step matches the expected result in the control process, the console sends the control command of the next step via Ethernet.
6. The method according to claim 5, characterized in that The console executes the entire control process of the terminal device in sequence according to the cycle T; 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 the step Step to execute the step; each step of the control process contains the timeout time 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, a delay of T is required delay Only then can the next control process be executed.
7. The method according to claim 6, characterized in that The console implements the retransmission operation and reception timeout processing of message data in the control process according to the following strategy: The "times" attribute in sendnetdata indicates the maximum number of times that data can be sent, and the "gap" attribute indicates the sending interval. When the number of times data can be sent is greater than the "times" attribute value, the console will be prompted that data sending has failed and the process will be terminated. The "timeout" attribute in recvnetdata indicates the receiving timeout. When the receiving time is greater than the "timeout" attribute value, the console will be prompted that data receiving has timed out and the process will be terminated.
8. The method according to claim 5, characterized in that The kernel of the XML script interpreter implements the interpretation and processing of each syntax element in the block statement; for each syntax element, corresponding functions are defined to respectively implement the assignment statement function, numerical calculation function, comparison statement function, logical calculation function, branch and loop statement function, Ethernet message data sending function, Ethernet message data receiving function, Ethernet message data result checking function and Ethernet message data testing function, and the parameters of the function are the attributes of the syntax element.
9. The method according to claim 8, characterized in that According to the specific functions implemented by each syntax element, the assignment statement elements, numerical operation elements, comparison statement elements, logical operation elements, branch and loop statement elements, Ethernet message data sending elements, Ethernet message data receiving elements, Ethernet message data result checking elements and Ethernet message data testing elements in the block statement are parsed line by line.
10. The method according to claim 9, characterized in that After the complete XML script process file is loaded into the XML script interpreter, the console decides under what conditions to start the XML script process; the console executes the XML script content sequentially according to the terminal device control process. Once the XML script interpreter prompts failure when executing the control process, the console cannot re-execute the control process from the current failed control flow step, and can only re-execute the parsing process of the control flow from the beginning.
