CN113407214A - Reconfigurable multithreading parallel upper computer system based on can communication - Google Patents

Reconfigurable multithreading parallel upper computer system based on can communication Download PDF

Info

Publication number
CN113407214A
CN113407214A CN202110705246.9A CN202110705246A CN113407214A CN 113407214 A CN113407214 A CN 113407214A CN 202110705246 A CN202110705246 A CN 202110705246A CN 113407214 A CN113407214 A CN 113407214A
Authority
CN
China
Prior art keywords
main thread
thread
event
data
enumeration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110705246.9A
Other languages
Chinese (zh)
Other versions
CN113407214B (en
Inventor
陈健斌
杨程喻
邹建俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Titan Intelligent Power Co ltd
Original Assignee
Guangdong Titan Intelligent Power Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Titan Intelligent Power Co ltd filed Critical Guangdong Titan Intelligent Power Co ltd
Priority to CN202110705246.9A priority Critical patent/CN113407214B/en
Publication of CN113407214A publication Critical patent/CN113407214A/en
Priority to PCT/CN2022/082174 priority patent/WO2022267578A1/en
Application granted granted Critical
Publication of CN113407214B publication Critical patent/CN113407214B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to a reconfigurable multithreading parallel upper computer system based on CAN communication, which comprises a main thread and an auxiliary thread connected with the main thread, wherein the main thread comprises CAN equipment opening, CAN equipment initialization, CAN message transmission and reception, CAN equipment restart and CAN equipment setting change, the operation state of the main thread is determined by operation state enumeration in an enumeration variable, the data type of the operation state enumeration is a set of integer constants which CAN be named to express different operation states of the main thread, and the operation state enumeration has four values: and the Init, the Run, the Wait and the Exit are enumerated in different running states and Run in different states, and the running state enumeration is updated according to conditions so as to enter a specified running state in the next main thread cycle. The invention has the advantages that: the running efficiency of the upper computer program is effectively improved, and the fault probability is reduced.

Description

Reconfigurable multithreading parallel upper computer system based on can communication
Technical Field
The invention relates to the technical field of circuit systems, in particular to a reconfigurable multi-thread parallel upper computer system based on can communication.
Background
The upper computer is mainly used for monitoring various characterization parameters, running states, working modes and the like of the digital power supply in real time on line and can also control a digital power supply system. In the past, when no upper computer software based on virtual instrument technology is available, a traditional instrument is used for monitoring and controlling a circuit system.
The software of the upper computer can transmit data, and parameter setting, online calibration and logic test of the digital power supply are realized. In the past, when people debug the power supply system, people often need to be assisted with a plurality of test instruments to perform hardware debugging work so as to know information such as the running state of a circuit in real time. Such meters are numerous and inconvenient to read and store, and direct external coupling into the power system introduces unknown interference, which can greatly hinder research and development efforts.
In addition, some parameters related to the control model need to be modified and verified when software debugging is performed. For example, in the conventional PID control, control parameters such as a proportional coefficient, an integral coefficient, a differential coefficient and the like need to be adjusted and the working state of the control parameters is observed, and software debugging is performed based on the adjustment. Because the control strategy and parameters cannot be modified online and in real time, the program needs to be re-burned for the digital power module when the control parameters are modified each time. For conventional power modules, changing the control loop parameters means that the component parameters of the hardware circuit may be modified.
In the use process, the real-time operation state of the circuit also needs to be monitored, and output parameters need to be adjusted and modified. In the past, people monitoring the real-time operating conditions of circuits required multiple instruments embedded in the circuitry. When the parameters to be monitored are more, the instruments often appear to have unsmooth human-computer interaction experience, beautiful appearance and simple/portable/free system operation.
Disclosure of Invention
The invention aims to solve the problems and provides a reconfigurable multi-thread parallel upper computer system based on can communication, which effectively improves the operating efficiency of an upper computer program and reduces the failure probability.
In order to solve the technical problems, the technical scheme provided by the invention is as follows: a reconfigurable multithreading parallel upper computer system based on can communication is characterized in that: the CAN communication method comprises a main thread and an auxiliary thread connected with the main thread, wherein the main thread comprises CAN equipment opening, CAN equipment initialization, CAN message transmission and reception, CAN equipment restarting and CAN equipment setting change, the main thread is a state machine mode of a parallel program for orderly and elegantly carrying out CAN communication, the running state is determined by running state enumeration in an enumeration variable, the data type of the running state enumeration is a set of integer constants which CAN be named to express different running states of the main thread, and the running state enumeration has four values: init, Run, Wait and Exit, enumerating in different running states, entering different states to Run, updating running state enumeration according to conditions, and entering a specified running state in the next main thread cycle, wherein the main thread comprises the following steps:
s1, judging the value of running state enumeration, judging whether the running state enumeration is Exit, ending the program if the running state enumeration is judged to be Exit, and entering the value for judging the running state enumeration if the running state enumeration is judged to be filled with the Exit;
s2, the running state enumerated values in the step S1 include Init, Run, Wait and Exit,
s3, the Init comprises the following steps:
a1, binding the CAN configuration information into a CAN communication standard cluster according to the name,
a2, create user event CANOpen,
a3, reinserting the new CAN communication standard cluster into the main thread data stream,
a4, inserting an event into an event data stream of a main thread, and enumerating and assigning a Wait value by a running state;
the Wait comprises an update of an event structure generated from a user event, the update of the event structure generated from the user event comprises a parallel Open value change event and change events of other values, the step of opening the CAN by the parallel Open value change event is to sequentially execute three sub-VI programs, namely an Open sub-VI program, an Init sub-VI program and a Start sub-VI program, the change events of the other values comprise specific information values of the changed other values bound into a CAN communication standard cluster according to names, and the parallel Open value change event comprises judging an event data stream, enumerating running states and endowing Run and Wait values;
the Run comprises the following steps:
b1, an event structure including a button control generated from the front panel and a user event data stream UpdateUIEvent,
b2, when calling CAN transmitting subprogram for corresponding control event to convert the packaged CAN communication standard cluster into CAN message,
b3, sending the CAN message,
b4, assigning a value of Disablie corresponding to the Event attribute node when the UpdateUIEvent is the user data user Event data stream, then judging the Event data stream, finally assigning Run numerical value to Run state enumeration,
b5, b3 and b4, when running state enumeration is given to Run and Wait values at the end, the main thread enters the next round of circulation;
the Exit comprises the following steps:
c1, canceling registration event, canceling user event and unbinding corresponding data from CAN communication standard cluster according to name,
c2, turning off the CAN equipment, and ending the program if running state enumeration is endowed with an Exit numerical value;
the secondary threads comprise a receiving thread, a thread for circularly sending inquiry messages, a thread for modifying output parameters and a thread for modifying calibration high-low order parameters,
the receiving thread running process comprises the following steps:
f1, firstly, judging whether the state of the main thread is open, if so, calling the sub VI,
f2, converting the format of the received CAN message into a CAN communication standard cluster by calling a CAN secondary library, otherwise, judging that the CAN is opened, delaying for 50ms,
f3, after the CAN communication standard cluster is obtained, judging whether the CAN communication standard cluster is empty information or not, if not, continuing to operate, and analyzing and translating the message;
the function of the thread of the circular sending inquiry message is to timely acquire and update various operation parameters and mode state data of the digital power supply module, and the operation process comprises the following steps:
t1, after entering the loop to send inquiry message, judging the main thread state, then obtaining data frames and combining them into the character string of the data frame for inquiry through a parallel program diagram automatically generating polling parameters according to the protocol specification,
t2, then, the main thread status is judged, and a sending program diagram independent of the main thread is entered,
t3, finally, the main thread state is judged, the operation of updating the multi-column list box data is carried out,
t4, updating the multi-column list box data requires judging the queuing number of the data frame is not more than 500, then judging whether the multi-column list box needs to be emptied, finally updating the received data to the multi-column list box control,
the output parameter modification thread modifies various operation parameters and mode state data of the digital power supply module, and the operation process comprises the following steps:
w1, after entering the output parameter modification thread, firstly, judging parameter setting enumeration, then adding corresponding program branches to synthesize character strings for outputting messages, transmitting the data to the main thread, triggering key events of the main thread,
w2, and, at the same time, a parallel program with a dialog box is executed in this sub-thread,
w3, except for message synthesis, judging the enumeration variable generated by the pull-down selection control, and generating corresponding prompt information to prompt the user of the input range of the corresponding parameter;
the function of the calibration high-low parameter modification thread is to calibrate the digital power supply module, and the operation process comprises the following steps:
x1, respectively judging the enumeration of the calibration high-low setting numerical value input control and the calibration setting numerical value input control, respectively recording the corresponding program branches,
x2, then reading the data of the data control in the corresponding program branch and synthesizing the data frame, outputting the character string of the calibration parameter,
x3, pressing the sending button on the current panel, the main thread entering the corresponding event branch to receive the character string and sending the CAN message.
After adopting the structure, the invention has the following advantages: the system of the invention is CAN upper computer software for a digital power supply module, which is compiled by a graphical high-level programming language labview, and the invention is characterized in that:
1. the multiple threads are formed in a serial-parallel series-parallel connection mode, meanwhile, the phenomenon of data competition hazard is avoided,
2. the reconfigurable design can be carried out according to the required functions, the number and the construction mode of the threads can be increased or decreased according to the actual requirements,
3. can be adapted and reconfigurable according to the protocol content and the actual hardware, can be adapted to different digital power supply systems by replacing a protocol interpretation mode and a secondary library,
4. a main software framework and a plurality of auxiliary software frameworks to improve the stability of the upper computer system,
5. the main thread is a state machine mode of a parallel program which CAN perform CAN communication orderly and elegantly.
The main thread of the invention is the only one program thread which can always operate in the whole using process of the whole program, other program threads can determine whether to operate according to information such as running state enumeration, intermediate quantity state and the like, and the multithreading mode of 'one main thread always operates and a plurality of auxiliary threads operate intermittently' can effectively improve the operating efficiency of the upper computer program and reduce the failure probability.
As an improvement, the main thread is in the Init state, the main function of the main thread is to open the CAN device and initialize the CAN device, the specific operation includes decomposing and rebinding the CAN communication standard cluster, generating a UI update event UpdateUIEvent by calling an attribute node and a dynamic registration event, so as to update the CAN communication standard cluster and adjust the state of UI data in time, and meanwhile, assigning Wait for running state enumeration, and letting the main thread enter a Wait mode.
As an improvement, when the main thread is in the Wait state, the main thread has a main function of waiting for the preparation of the CAN device, and determining the operating state of the CAN device to determine what main thread state to enter next and update the information in the CAN communication standard cluster, the main thread in the Wait state is a program with an event structure, and the event type of the event structure mainly includes a specific information value change in the CAN communication standard cluster and a front panel closing event.
As an improvement, when the main thread is in a Run state, the main function of the main thread is to judge and receive data from each secondary thread, package the data into a CAN communication standard cluster, and call a CAN sending subprogram to convert the packaged CAN communication standard cluster into a CAN message to be sent out.
As an improvement, the main thread is in the Init state, the main function of the main thread is to open the CAN device and initialize the CAN device, the specific operation includes decomposing and rebinding the CAN communication standard cluster, generating a UI update event UpdateUIEvent by calling an attribute node and a dynamic registration event, so as to update the CAN communication standard cluster and adjust the state of UI data in time, and meanwhile, assigning Wait for running state enumeration, and letting the main thread enter a Wait mode.
As an improvement, when the main thread is in the Wait state, the main function of the main thread is to Wait for the preparation of the CAN device to be completed, and judge the operation state of the CAN device to determine which main thread state to enter next step and update the information in the CAN communication standard cluster.
As an improvement, the secondary thread further comprises calibration reset, identifier synthesis, module serial number setting parameter modification, module state information separation and display, logic variable output and power module startup and shutdown threads.
Drawings
Fig. 1 is a program function diagram of a main thread of a reconfigurable multi-thread parallel upper computer system based on can communication.
Fig. 2 is a program block diagram of a main thread of the reconfigurable multi-thread parallel upper computer system based on can communication.
Fig. 3 is a receiving thread program block diagram of the reconfigurable multi-thread parallel upper computer system based on can communication.
Fig. 4 is a program block diagram of a cycle query message sending thread of the reconfigurable multi-thread parallel upper computer system based on can communication.
FIG. 5 is a program diagram of an output parameter modification thread of the reconfigurable multi-thread parallel upper computer system based on can communication.
FIG. 6 is a program block diagram of a calibration high-low parameter modification thread of the reconfigurable multithreading parallel upper computer system based on can communication.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings.
With reference to all the accompanying drawings, a reconfigurable multithreading parallel upper computer system based on CAN communication comprises a main thread and a plurality of secondary threads connected with the main thread, wherein the main thread comprises CAN equipment opening, CAN equipment initialization, CAN message transmission and reception, CAN equipment restart and CAN equipment setting change, the running state of the main thread is determined by running state enumeration in an enumeration variable, the data type of the running state enumeration is a set of integer constants which CAN be named to express different running states of the main thread, and the running state enumeration has four values: init, Run, Wait and Exit, enumerating in different running states, entering different states to Run, updating running state enumeration according to conditions, and entering a specified running state in the next main thread cycle, wherein the main thread comprises the following steps:
s1, judging the value of running state enumeration, judging whether the running state enumeration is Exit, ending the program if the running state enumeration is judged to be Exit, and entering the value for judging the running state enumeration if the running state enumeration is judged to be filled with the Exit;
s2, the running state enumerated values in the step S1 include Init, Run, Wait and Exit,
s3, the Init comprises the following steps:
a1, binding the CAN configuration information into a CAN communication standard cluster according to the name,
a2, create user event CANOpen,
a3, reinserting the new CAN communication standard cluster into the main thread data stream,
a4, inserting an event into an event data stream of a main thread, and enumerating and assigning a Wait value by a running state;
the Wait comprises an update of an event structure generated from a user event, the update of the event structure generated from the user event comprises a parallel Open value change event and change events of other values, the step of opening the CAN by the parallel Open value change event is to sequentially execute three sub-VI programs, namely an Open sub-VI program, an Init sub-VI program and a Start sub-VI program, the change events of the other values comprise specific information values of the changed other values bound into a CAN communication standard cluster according to names, and the parallel Open value change event comprises judging an event data stream, enumerating running states and endowing Run and Wait values;
the Run comprises the following steps:
b1, an event structure including a button control generated from the front panel and a user event data stream UpdateUIEvent,
b2, when calling CAN transmitting subprogram for corresponding control event to convert the packaged CAN communication standard cluster into CAN message,
b3, sending the CAN message,
b4, assigning a value of Disablie corresponding to the Event attribute node when the UpdateUIEvent is the user data user Event data stream, then judging the Event data stream, finally assigning Run numerical value to Run state enumeration,
b5, b3 and b4, when running state enumeration is given to Run and Wait values at the end, the main thread enters the next round of circulation;
the Exit comprises the following steps:
c1, canceling registration event, canceling user event and unbinding corresponding data from CAN communication standard cluster according to name,
c2, turning off the CAN equipment, and ending the program if running state enumeration is endowed with an Exit numerical value;
the secondary threads comprise a receiving thread, a thread for circularly sending inquiry messages, a thread for modifying output parameters and a thread for modifying calibration high-low order parameters,
the receiving thread running process comprises the following steps:
f1, firstly, judging whether the state of the main thread is open, if so, calling the sub VI,
f2, converting the format of the received CAN message into a CAN communication standard cluster by calling a CAN secondary library, otherwise, judging that the CAN is opened, delaying for 50ms,
f3, after the CAN communication standard cluster is obtained, judging whether the CAN communication standard cluster is empty information or not, if not, continuing to operate, and analyzing and translating the message;
the function of the thread of the circular sending inquiry message is to timely acquire and update various operation parameters and mode state data of the digital power supply module, and the operation process comprises the following steps:
t1, after entering the loop to send inquiry message, judging the main thread state, then obtaining data frames and combining them into the character string of the data frame for inquiry through a parallel program diagram automatically generating polling parameters according to the protocol specification,
t2, then, the main thread status is judged, and a sending program diagram independent of the main thread is entered,
t3, finally, the main thread state is judged, the operation of updating the multi-column list box data is carried out,
t4, updating the multi-column list box data requires judging the queuing number of the data frame is not more than 500, then judging whether the multi-column list box needs to be emptied, finally updating the received data to the multi-column list box control,
the output parameter modification thread modifies various operation parameters and mode state data of the digital power supply module, and the operation process comprises the following steps:
w1, after entering the output parameter modification thread, firstly, judging parameter setting enumeration, then adding corresponding program branches to synthesize character strings for outputting messages, transmitting the data to the main thread, triggering key events of the main thread,
w2, and, at the same time, a parallel program with a dialog box is executed in this sub-thread,
w3, except for message synthesis, judging the enumeration variable generated by the pull-down selection control, and generating corresponding prompt information to prompt the user of the input range of the corresponding parameter;
the function of the calibration high-low parameter modification thread is to calibrate the digital power supply module, and the operation process comprises the following steps:
x1, respectively judging the enumeration of the calibration high-low setting numerical value input control and the calibration setting numerical value input control, respectively recording the corresponding program branches,
x2, then reading the data of the data control in the corresponding program branch and synthesizing the data frame, outputting the character string of the calibration parameter,
x3, pressing the sending button on the current panel, the main thread entering the corresponding event branch to receive the character string and sending the CAN message.
The main thread is in an Init state, the main function of the main thread is to open CAN equipment and initialize the CAN equipment, the specific operation comprises the steps of decomposing and rebinding a CAN communication standard cluster, generating a UI updating event UpdateUIEvent by calling an attribute node and a dynamic registration event, updating the CAN communication standard cluster in time and adjusting the state of UI data, meanwhile, assigning Wait for running state enumeration, and enabling the main thread to enter a Wait mode.
The main thread in the Wait state is a program of an event structure, and the event type of the event structure mainly comprises the change of a specific information value in a CAN communication standard cluster and the closing event of a front panel.
And under the Run state of the main thread, the main function of the main thread is to judge and receive data from each auxiliary thread, package the data into a CAN communication standard cluster, and call a CAN sending subprogram to convert the packaged CAN communication standard cluster into a CAN message to be sent out.
The main thread is in an Init state, the main function of the main thread is to open CAN equipment and initialize the CAN equipment, the specific operation comprises the steps of decomposing and rebinding a CAN communication standard cluster, generating a UI updating event UpdateUIEvent by calling an attribute node and a dynamic registration event, updating the CAN communication standard cluster in time and adjusting the state of UI data, meanwhile, assigning Wait for running state enumeration, and enabling the main thread to enter a Wait mode.
And when the main thread is in the Wait state, the main function of the main thread is to Wait for the CAN equipment to finish preparation, judge the operation state of the CAN equipment to determine which main thread state to enter next step and update the information in the CAN communication standard cluster.
The secondary thread also comprises calibration reset, identifier synthesis, module serial number setting parameter modification, module state information separation and display, logic variable output and power module startup and shutdown threads.
When the method is implemented specifically, in the Init state, the main function of the main thread is to open the CAN equipment and initialize the CAN equipment. The specific operation comprises the steps of decomposing and rebinding the CAN communication standard cluster, for example, overwriting CAN configuration information decomposed from the CAN communication standard cluster, binding the CAN configuration information back into the CAN communication standard cluster according to names, and generating a UI (user interface) update event (English name UpdateUIEvent) by calling attribute nodes and dynamic registration events so as to update the CAN communication standard cluster and adjust the state of UI data in time. Meanwhile, assigning 'Wait' for 'running state enumeration', and enabling the main thread to enter a Wait mode.
In the Wait state, the main function of the main thread is to Wait for the preparation of the CAN device to be completed, and judge the operation state of the CAN device to determine which main thread state to enter next step and update the information in the CAN communication standard cluster. The main thread in the Wait state is a program of an event structure, which is similar to an interrupt event and is a programming structure which is characterized by real-time performance, the corresponding program CAN be executed only when the corresponding event occurs, and the event types of the event structure mainly comprise ten event types including specific information value change in a CAN communication standard cluster and a front panel closing event. Except for an open value change event in the CAN communication standard cluster, a specific information value in other CAN communication standard clusters is changed by only replacing a corresponding parameter in the CAN communication standard cluster, and then a corresponding UI update event (english name UpdateUIEvent) is generated.
Among them, the open event of Wait state of the main thread needs to be described with emphasis. The program part is used for carrying out operation of specific steps on the CAN equipment to successfully open the CAN equipment after the CAN equipment is initialized. The general procedure is to execute three sub VI programs, 1.Open, 2.Init, and 3.Start, in sequence, and determine whether the execution is successful. In addition, the part also needs to generate corresponding user events to regulate and control the whole multithreading system so as to improve the reliability of the system. And judging the assignment of the running state enumeration according to the execution effect. If the CAN equipment is not successfully opened, the CAN equipment stays in the Wait state, and if the CAN equipment is successfully opened, Run is assigned to the running state enumeration.
In the Run state, the main function of the main thread is to judge and receive data from each secondary thread, package the data into the CAN communication standard cluster defined by the invention, and call a CAN sending subprogram to convert the packaged CAN communication standard cluster into a CAN message to be sent out. The program is a programmed structure of an event structure, and the operation of the program can be triggered by an event of pressing a certain key. For example, when an event of "key press of output parameter" occurs, a corresponding program flow is entered, and a data frame (a data frame that has been converted into a character string) from the output parameter sub-thread is packaged into a CAN communication standard cluster, and then converted into a CAN message to be sent out. In addition, the occurrence of a "timeout event" allows the main thread to continue running in Run state. Finally, if a CAN close command is received (the command may be from a close button on the front panel or from the closing of the CAN device), a "CAN close event" is entered, specifically, the operations are to call a CAN close sub-function, update a corresponding user event and generate a UI update event (english name UpdateUIEvent).
In addition to the above operations, the main thread updates some corresponding user events and generates a UI update event (english name UpdateUIEvent). These events (events, which are a description of the data flow of a parallel program and are generally used to coordinate the parallel operation of multiple threads) control the operating states of other sub-threads and transfer data with other sub-threads. Therefore, the purpose of coordinated operation of a plurality of threads is achieved, and the parallel operation of the program is realized.
Next, the sub-threads are introduced, and the threads enter the corresponding operating states according to the "running state enumeration" operated by the main thread, and execute the corresponding programs.
Receiving a thread: with reference to fig. 3, in order to receive and analyze the message from the digital power module in time, a thread for receiving and translating the CAN message is required. The sub-thread used by the present invention to implement this function is the "receiving thread".
The operation process of the secondary thread receiving thread comprises the following steps: firstly, judging whether the state of the main thread is open, if so, calling a sub VI (VCI _ Recieve), and converting the format of the received CAN message into a CAN communication standard cluster by calling a CAN secondary library. Otherwise, the CAN is judged to be opened, and the time is delayed by 50 ms. And after the CAN communication standard cluster is obtained, judging whether the CAN communication standard cluster is empty information or not. If the message is not empty information, continuing to perform the operation shown in the program diagram, and analyzing and translating the message.
And circularly sending an inquiry message thread: referring to fig. 4, in order to obtain and update various operation parameters and mode status data of the digital power supply module in time, a thread for polling and sending an inquiry CAN message is required. The sub thread for realizing the function is a 'round robin query message sending thread', and the program structure of the 'round robin query message sending thread' is a tiled sequence structure (English name) which is a program structure for executing corresponding program frames (English name frames) according to a specified sequence. The thread of the loop sending inquiry message uses three program frames, which are respectively: synthesizing the character string of the data frame of the inquiry (sequence 0), sending the inquiry message (sequence 1) and updating the multi-column list box data (sequence 2).
After entering the 'thread for circularly sending inquiry messages', the state of a main thread is judged, and then data frames are obtained and combined into a character string of the data frame for inquiry through a parallel program diagram for automatically generating polling parameters according to protocol regulations. Then, the state of the main thread is judged, and a sending program diagram independent of the main thread is entered. And finally, judging the state of the main thread, and updating the data of the multi-column list box. Updating data of the multi-column list frame needs to judge that the queuing number (frame number) of data frames does not exceed 500, then judge whether the multi-column list frame needs to be emptied, and finally update the received data to a multi-column list frame control.
The program for updating the data of the multi-column list box is added into the thread of the circular sending inquiry message, so that the competition-risk effect (similar to the competition-risk effect of a digital circuit, and the phenomenon can also occur in parallel programs) of the data stream can be avoided, and after the same data is transmitted by the data streams of different threads, the time of reaching a certain meeting point is prior, and then some data error phenomena can occur, so that the reliability of the system is improved.
The program structure of the output parameter modification thread is a conditional structure (english name case structure). With reference to fig. 5, the enumeration variable generated by the pull-down selection control of the front panel control is determined, then the corresponding program branch (english name case) is added, the corresponding output character string is synthesized according to the communication protocol, and the character string is transferred to the sending program of the main flow. And finally, the CAN sending process is completed by the main process, so that the problems of hardware conflict and the like of CAN equipment CAN be avoided.
After entering the "output parameter modification thread", it is first judged to enumerate "parameter setting", then add the corresponding program branch (case) to synthesize the character string used for outputting the message, and transmit this data to the main thread, and trigger the key Event of the main thread (Event, this key control that needs the front panel is pressed to start). At the same time, a parallel program with a dialog box is executed in this sub-thread. Besides, message synthesis is carried out, enumeration changes generated by the pull-down selection control are judged, and corresponding prompt information is generated to prompt a user of the input range of the corresponding parameters.
The program structure for calibrating the high and low parameter modification threads "is a conditional structure (called case structure). Referring to fig. 6, the enumeration of the "calibration high/low setting" and the "calibration setting" is determined, and then the corresponding program branches (english name case) are respectively added. And then reading the data control in the corresponding program branch, synthesizing the data frame, and outputting the character string of the calibration parameter. When the sending key is pressed down on the current panel, the main thread enters the corresponding event branch to receive the character string and send the CAN message.
So far, the main threads of the present invention have been introduced, and the threads can satisfy some conventional monitoring and control of the digital power module. In addition, in order to increase the usability of the upper computer system, other secondary threads, such as 'calibration reset', 'identifier synthesis', 'module serial number setting parameter modification', 'module state information separation and display', 'logic variable output' and 'power module on-off' can be added according to the functional requirements of the digital power module, and the functions of the upper computer can be increased by the method.
In summary, the present invention has the following advantages:
reconfigurability: the parallel software structure of the invention can increase and decrease all the secondary threads at will according to specific needs, and construct proper upper computer software according to needs. And the effect of coordinated operation of all threads is achieved by configuring and transmitting information such as running state enumeration, intermediate quantity state and the like.
Downward compatibility: the invention CAN realize the connection with different CAN devices by accessing different secondary libraries, and has wide inclusiveness to hardware downwards.
Serial-parallel coordination: some threads are combined, collectively referred to as a tiled sequential structure (the english name flat sequence), to eliminate adventure competition. In the actual design process, a plurality of single-function threads can be combined in a proper serial-parallel mode, some threads are in a serial relation, and some threads are in a parallel relation. This serial-parallel coordination helps to improve the robustness and reliability of the system.
A reconfigurable manner of multithreading in serial-parallel series-parallel connection: according to the actual power module requirements, different types of secondary threads can be arranged to be reconstructed in a serial or parallel mode. The program construction method is to reconstruct the sub threads with data conflict in a tiled sequence structure (English name of flat sequence) and make them proceed in sequence to eliminate the competition risk phenomenon of data flow, while the sub threads without data conflict can be constructed in parallel. All threads are then mixed with each other in a connection that is provided in both serial and parallel. In the actual design process, a plurality of single-function threads can be combined in a proper serial-parallel mode, some threads are in a serial relation, and some threads are in a parallel relation. This serial-parallel coordination helps to improve the robustness and reliability of the system.
Since different CAN hardware devices may require different modes of operation (the on device level timing, the off device level timing, and the reflected matching impedance may all be different), different handling modes are required for different CAN devices. The invention CAN realize the connection with different CAN devices by accessing different secondary libraries, and has wide inclusiveness to hardware downwards.
Reconfigurability of the type and number of secondary threads: the parallel software structure of the invention can increase and decrease all the secondary threads at will according to specific needs, and construct proper upper computer software according to needs. And the effect of coordinated operation of all threads is achieved by configuring and transmitting information such as running state enumeration, intermediate quantity state and the like. The reconfigurability has the characteristic of one main thread and multiple auxiliary threads, namely, one main thread works continuously, the multiple auxiliary threads work intermittently, and all the threads work in the series-parallel hybrid mode.
The working principle of the invention is as follows: the CAN communication standard cluster defined by the invention is defined according to the existing CAN communication protocol of the vehicle-mounted conductive charger standard of the electric vehicle, and comprises the system type of an identifier, a source address, a target address, a command type, data, a standard frame/remote frame mark, a data length frame, a channel type and other data, and the data of the plurality of types are bundled again to form a cluster, wherein the cluster is a data structure and is similar to a structure body variable in C language.
The present invention and its embodiments have been described above, but the description is not limitative, and the actual structure is not limited thereto. It should be understood that those skilled in the art should understand that they can easily make various changes, substitutions and alterations herein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (7)

1. A reconfigurable multithreading parallel upper computer system based on can communication is characterized in that: the CAN communication method comprises a main thread and an auxiliary thread connected with the main thread, wherein the main thread comprises CAN equipment opening, CAN equipment initialization, CAN message transmission and reception, CAN equipment restarting and CAN equipment setting change, the main thread is a state machine mode of a parallel program for orderly and elegantly carrying out CAN communication, the running state is determined by running state enumeration in an enumeration variable, the data type of the running state enumeration is a set of integer constants which CAN be named to express different running states of the main thread, and the running state enumeration has four values: init, Run, Wait and Exit, enumerating in different running states, entering different states to Run, updating running state enumeration according to conditions, and entering a specified running state in the next main thread cycle, wherein the main thread comprises the following steps:
s1, judging the value of running state enumeration, judging whether the running state enumeration is Exit, ending the program if the running state enumeration is judged to be Exit, and entering the value for judging the running state enumeration if the running state enumeration is judged to be filled with the Exit;
s2, the running state enumerated values in the step S1 include Init, Run, Wait and Exit,
s3, the Init comprises the following steps:
a1, binding the CAN configuration information into a CAN communication standard cluster according to the name,
a2, create user event CANOpen,
a3, reinserting the new CAN communication standard cluster into the main thread data stream,
a4, inserting an event into an event data stream of a main thread, and enumerating and assigning a Wait value by a running state;
the Wait comprises an update of an event structure generated from a user event, the update of the event structure generated from the user event comprises a parallel Open value change event and change events of other values, the step of opening the CAN by the parallel Open value change event is to sequentially execute three sub-VI programs, namely an Open sub-VI program, an Init sub-VI program and a Start sub-VI program, the change events of the other values comprise specific information values of the changed other values bound into a CAN communication standard cluster according to names, and the parallel Open value change event comprises judging an event data stream, enumerating running states and endowing Run and Wait values;
the Run comprises the following steps:
b1, an event structure including a button control generated from the front panel and a user event data stream UpdateUIEvent,
b2, when calling CAN transmitting subprogram for corresponding control event to convert the packaged CAN communication standard cluster into CAN message,
b3, sending the CAN message,
b4, assigning a value of Disablie corresponding to the Event attribute node when the UpdateUIEvent is the user data user Event data stream, then judging the Event data stream, finally assigning Run numerical value to Run state enumeration,
b5, b3 and b4, when running state enumeration is given to Run and Wait values at the end, the main thread enters the next round of circulation;
the Exit comprises the following steps:
c1, canceling registration event, canceling user event and unbinding corresponding data from CAN communication standard cluster according to name,
c2, turning off the CAN equipment, and ending the program if running state enumeration is endowed with an Exit numerical value;
the secondary threads comprise a receiving thread, a thread for circularly sending inquiry messages, a thread for modifying output parameters and a thread for modifying calibration high-low order parameters,
the receiving thread running process comprises the following steps:
f1, firstly, judging whether the state of the main thread is open, if so, calling the sub VI,
f2, converting the format of the received CAN message into a CAN communication standard cluster by calling a CAN secondary library, otherwise, judging that the CAN is opened, delaying for 50ms,
f3, after the CAN communication standard cluster is obtained, judging whether the CAN communication standard cluster is empty information or not, if not, continuing to operate, and analyzing and translating the message;
the function of the thread of the circular sending inquiry message is to timely acquire and update various operation parameters and mode state data of the digital power supply module, and the operation process comprises the following steps:
t1, after entering the loop to send inquiry message, judging the main thread state, then obtaining data frames and combining them into the character string of the data frame for inquiry through a parallel program diagram automatically generating polling parameters according to the protocol specification,
t2, then, the main thread status is judged, and a sending program diagram independent of the main thread is entered,
t3, finally, the main thread state is judged, the operation of updating the multi-column list box data is carried out,
t4, updating the multi-column list box data requires judging the queuing number of the data frame is not more than 500, then judging whether the multi-column list box needs to be emptied, finally updating the received data to the multi-column list box control,
the output parameter modification thread modifies various operation parameters and mode state data of the digital power supply module, and the operation process comprises the following steps:
w1, after entering the output parameter modification thread, firstly, judging parameter setting enumeration, then adding corresponding program branches to synthesize character strings for outputting messages, transmitting the data to the main thread, triggering key events of the main thread,
w2, and, at the same time, a parallel program with a dialog box is executed in this sub-thread,
w3, except for message synthesis, judging the enumeration variable generated by the pull-down selection control, and generating corresponding prompt information to prompt the user of the input range of the corresponding parameter;
the function of the calibration high-low parameter modification thread is to calibrate the digital power supply module, and the operation process comprises the following steps:
x1, respectively judging the enumeration of the calibration high-low setting numerical value input control and the calibration setting numerical value input control, respectively recording the corresponding program branches,
x2, then reading the data of the data control in the corresponding program branch and synthesizing the data frame, outputting the character string of the calibration parameter,
x3, pressing the sending button on the current panel, the main thread entering the corresponding event branch to receive the character string and sending the CAN message.
2. The reconfigurable multithreaded parallel host computer system based on can communication as claimed in claim 1, wherein: the main thread is in an Init state, the main function of the main thread is to open CAN equipment and initialize the CAN equipment, the specific operation comprises the steps of decomposing and rebinding a CAN communication standard cluster, generating a UI updating event UpdateUIEvent by calling an attribute node and a dynamic registration event, updating the CAN communication standard cluster in time and adjusting the state of UI data, meanwhile, assigning Wait for running state enumeration, and enabling the main thread to enter a Wait mode.
3. The reconfigurable multithreaded parallel host computer system based on can communication as claimed in claim 1, wherein: the main thread in the Wait state is a program of an event structure, and the event type of the event structure mainly comprises the change of a specific information value in a CAN communication standard cluster and the closing event of a front panel.
4. The reconfigurable multithreaded parallel host computer system based on can communication as claimed in claim 1, wherein: and under the Run state of the main thread, the main function of the main thread is to judge and receive data from each auxiliary thread, package the data into a CAN communication standard cluster, and call a CAN sending subprogram to convert the packaged CAN communication standard cluster into a CAN message to be sent out.
5. The reconfigurable multithreaded parallel host computer system based on can communication as claimed in claim 1, wherein: the main thread is in an Init state, the main function of the main thread is to open CAN equipment and initialize the CAN equipment, the specific operation comprises the steps of decomposing and rebinding a CAN communication standard cluster, generating a UI updating event UpdateUIEvent by calling an attribute node and a dynamic registration event, updating the CAN communication standard cluster in time and adjusting the state of UI data, meanwhile, assigning Wait for running state enumeration, and enabling the main thread to enter a Wait mode.
6. The reconfigurable multithreaded parallel host computer system based on can communication as claimed in claim 1, wherein: and when the main thread is in the Wait state, the main function of the main thread is to Wait for the CAN equipment to finish preparation, judge the operation state of the CAN equipment to determine which main thread state to enter next step and update the information in the CAN communication standard cluster.
7. The reconfigurable multithreaded parallel host computer system based on can communication as claimed in claim 1, wherein: the secondary thread also comprises calibration reset, identifier synthesis, module serial number setting parameter modification, module state information separation and display, logic variable output and power module startup and shutdown threads.
CN202110705246.9A 2021-06-24 2021-06-24 Reconfigurable multithreading parallel upper computer system based on can communication Active CN113407214B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110705246.9A CN113407214B (en) 2021-06-24 2021-06-24 Reconfigurable multithreading parallel upper computer system based on can communication
PCT/CN2022/082174 WO2022267578A1 (en) 2021-06-24 2022-03-22 Reconfigurable multi-thread-parallelism upper computer system based on can communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110705246.9A CN113407214B (en) 2021-06-24 2021-06-24 Reconfigurable multithreading parallel upper computer system based on can communication

Publications (2)

Publication Number Publication Date
CN113407214A true CN113407214A (en) 2021-09-17
CN113407214B CN113407214B (en) 2023-04-07

Family

ID=77683001

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110705246.9A Active CN113407214B (en) 2021-06-24 2021-06-24 Reconfigurable multithreading parallel upper computer system based on can communication

Country Status (2)

Country Link
CN (1) CN113407214B (en)
WO (1) WO2022267578A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022267578A1 (en) * 2021-06-24 2022-12-29 广东泰坦智能动力有限公司 Reconfigurable multi-thread-parallelism upper computer system based on can communication

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040015940A1 (en) * 2001-05-29 2004-01-22 3Com Corporation Intelligent device upgrade engine
DE102006047218B3 (en) * 2006-10-05 2008-04-03 Hippokratec Gesellschaft für Medizintechnik mbH Slave-device controlling method for use in e.g. intensive care, involves transferring representation object representing perceptible characteristics of slave device, to master-device, where slave device is implemented as medical instrument
CN101854300A (en) * 2010-06-02 2010-10-06 北京工业大学 Method for realizing CANopen slave station
US20120117361A1 (en) * 2010-11-10 2012-05-10 International Business Machines Corporation Processing Data Communications Events In A Parallel Active Messaging Interface Of A Parallel Computer
US8683444B1 (en) * 2006-12-11 2014-03-25 Synopsys, Inc. System and method of debugging multi-threaded processes
CN103984665A (en) * 2014-06-05 2014-08-13 哈尔滨工业大学 Serial port communication device and method based on LabVIEW
US20150277919A1 (en) * 2014-03-27 2015-10-01 International Business Machines Corporation Thread context preservation in a multithreading computer system
WO2016028425A1 (en) * 2014-08-21 2016-02-25 Qualcomm Incorporated Programmatic decoupling of task execution from task finish in parallel programs
WO2018072445A1 (en) * 2016-10-20 2018-04-26 南京南瑞继保电气有限公司 Running method for embedded type virtual device and system
CN109254834A (en) * 2017-07-13 2019-01-22 普天信息技术有限公司 A kind of multithreading starting synchronous method
CN111309353A (en) * 2020-01-20 2020-06-19 山东超越数控电子股份有限公司 Method and device for updating FPGA (field programmable Gate array) firmware of operation board based on server control board
CN111628197A (en) * 2020-05-29 2020-09-04 湖北工业大学 CAN bus-based fuel cell power system platform upper computer monitoring method
CN111640970A (en) * 2020-05-29 2020-09-08 湖北工业大学 CAN bus-based fuel cell engine upper computer monitoring method
CN112014733A (en) * 2020-08-28 2020-12-01 东风电子科技股份有限公司 Method, system and storage medium for realizing fault monitoring of motor driver of pure electric vehicle based on Labview

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2643878A1 (en) * 2008-11-14 2010-05-14 Pierre Caouette An electronic method of controlling propulsion & regeneration for electric, hybrid-electric and diesel-electric marine crafts
CN102722150A (en) * 2012-06-07 2012-10-10 中国东方电气集团有限公司 Multi-way waveform acquiring and displaying and data analyzing and processing system based on universal serial
CN113407214B (en) * 2021-06-24 2023-04-07 广东泰坦智能动力有限公司 Reconfigurable multithreading parallel upper computer system based on can communication

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040015940A1 (en) * 2001-05-29 2004-01-22 3Com Corporation Intelligent device upgrade engine
DE102006047218B3 (en) * 2006-10-05 2008-04-03 Hippokratec Gesellschaft für Medizintechnik mbH Slave-device controlling method for use in e.g. intensive care, involves transferring representation object representing perceptible characteristics of slave device, to master-device, where slave device is implemented as medical instrument
US8683444B1 (en) * 2006-12-11 2014-03-25 Synopsys, Inc. System and method of debugging multi-threaded processes
CN101854300A (en) * 2010-06-02 2010-10-06 北京工业大学 Method for realizing CANopen slave station
US20120117361A1 (en) * 2010-11-10 2012-05-10 International Business Machines Corporation Processing Data Communications Events In A Parallel Active Messaging Interface Of A Parallel Computer
US20150277919A1 (en) * 2014-03-27 2015-10-01 International Business Machines Corporation Thread context preservation in a multithreading computer system
CN103984665A (en) * 2014-06-05 2014-08-13 哈尔滨工业大学 Serial port communication device and method based on LabVIEW
WO2016028425A1 (en) * 2014-08-21 2016-02-25 Qualcomm Incorporated Programmatic decoupling of task execution from task finish in parallel programs
WO2018072445A1 (en) * 2016-10-20 2018-04-26 南京南瑞继保电气有限公司 Running method for embedded type virtual device and system
CN109254834A (en) * 2017-07-13 2019-01-22 普天信息技术有限公司 A kind of multithreading starting synchronous method
CN111309353A (en) * 2020-01-20 2020-06-19 山东超越数控电子股份有限公司 Method and device for updating FPGA (field programmable Gate array) firmware of operation board based on server control board
CN111628197A (en) * 2020-05-29 2020-09-04 湖北工业大学 CAN bus-based fuel cell power system platform upper computer monitoring method
CN111640970A (en) * 2020-05-29 2020-09-08 湖北工业大学 CAN bus-based fuel cell engine upper computer monitoring method
CN112014733A (en) * 2020-08-28 2020-12-01 东风电子科技股份有限公司 Method, system and storage medium for realizing fault monitoring of motor driver of pure electric vehicle based on Labview

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
何清华等: "工程装备远程监控管理系统的设计与实现", 《郑州大学学报(工学版)》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022267578A1 (en) * 2021-06-24 2022-12-29 广东泰坦智能动力有限公司 Reconfigurable multi-thread-parallelism upper computer system based on can communication

Also Published As

Publication number Publication date
WO2022267578A1 (en) 2022-12-29
CN113407214B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
US7844908B2 (en) Diagram that visually indicates targeted execution
US6173438B1 (en) Embedded graphical programming system
CA2208289C (en) Method and computer program product for interconnecting software drivers in kernel mode
US8612870B2 (en) Graphically specifying and indicating targeted execution in a graphical program
CN109324787A (en) A kind of business software development approach, device and terminal device
US8458667B2 (en) Debugging a statechart for a real time target
CN113407214B (en) Reconfigurable multithreading parallel upper computer system based on can communication
CN109040752A (en) Automatic debugging system for smart television
CN109783340A (en) Test code programming method, IP test method and the device of SoC
US20040015816A1 (en) Coordination synthesis for software systems
CN108959094A (en) A kind of definition and methods for using them of the test program based on data structure
CN111158662A (en) Method for designing MSCAN communication by using LabVIEW
CN101751115B (en) Method for solving data transmission matching of DSP and low-speed output device
CN112559264B (en) Simulation test method for realizing FPGA (field programmable Gate array) universal serial port by verification platform based on UVM (Universal verification Module)
CN114629830B (en) Method and system for automatically controlling test center instrument test
Clément et al. Integrated software components: A paradigm for control integration
CN111443963A (en) Numerical control system of reconfigurable formula
US20060198501A1 (en) Method and device for constructing a voice dialog
CN115050365A (en) Vehicle-mounted multimode interaction method
Karras et al. Designing protocol processing systems with Vivado high-level synthesis
Kastner et al. An open approach to eib/knx software development
CN100456710C (en) Method and system for realizing Tclsh instruction long-distance call
CN111037057A (en) Welder human-computer interaction system and welder
CN113572652B (en) Wired Mesh network testing method
Weidl et al. Facilitating program comprehension via generic components for state machines

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant