[go: up one dir, main page]

CN109361736B - Lower computer cache data updating method of measurement and control system - Google Patents

Lower computer cache data updating method of measurement and control system Download PDF

Info

Publication number
CN109361736B
CN109361736B CN201811094646.5A CN201811094646A CN109361736B CN 109361736 B CN109361736 B CN 109361736B CN 201811094646 A CN201811094646 A CN 201811094646A CN 109361736 B CN109361736 B CN 109361736B
Authority
CN
China
Prior art keywords
variable
time
frame
udp
millisecond
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.)
Expired - Fee Related
Application number
CN201811094646.5A
Other languages
Chinese (zh)
Other versions
CN109361736A (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.)
Institute of Electronic Engineering of CAEP
Original Assignee
Institute of Electronic Engineering of CAEP
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 Institute of Electronic Engineering of CAEP filed Critical Institute of Electronic Engineering of CAEP
Priority to CN201811094646.5A priority Critical patent/CN109361736B/en
Publication of CN109361736A publication Critical patent/CN109361736A/en
Application granted granted Critical
Publication of CN109361736B publication Critical patent/CN109361736B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/9063Intermediate storage in different physical parts of a node or terminal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Debugging And Monitoring (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a lower computer cache data updating method of a measurement and control system, which comprises the following steps: the upper computer establishes a cache use state record table; recording each UDP download frame; setting a variable A for the predicted end time; updating the variable A and writing the variable A into the table M; starting a test flow; the upper computer obtains the current test time and records the current test time as a variable B; calculating the remaining maintaining time, namely a variable C is equal to a variable A-a variable B; when the variable C is smaller than a preset warning threshold value, downloading the rest UDP download frames; when the variable C is less than half of the previous value, the downloading rate is doubled; updating the table M; and finishing updating the cache data of the lower computer until the test flow is finished. The invention has stronger robustness, simulates and calculates the cache state of the lower computer, dynamically formulates a cache updating strategy, and actively downloads the UDP download frame, thereby effectively avoiding the problems of too fast cache consumption and untimely updating of the lower computer, reducing the load of the lower computer and improving the real-time property of the lower computer.

Description

Lower computer cache data updating method of measurement and control system
Technical Field
The invention relates to a local method of a measurement and control system, in particular to a lower computer cache data updating method of the measurement and control system.
Background
The measurement and control system consists of a main control unit and a measurement and control unit, and the main control unit and the measurement and control unit are communicated through an Ethernet, namely a UDP protocol. The real-time measurement and control system is divided into an upper computer, namely a main control unit, and a lower computer, namely a measurement and control unit, and is used for providing input signals such as a power supply, an excitation signal and a control signal required by the work of the system to be measured, receiving an output signal of the system to be measured, and judging the correctness of the working state of the system to be measured according to preset conditions.
The main functions of the upper computer, namely the main control unit, are as follows:
1. receiving, storing and processing test data; displaying a test waveform;
2. selecting and controlling a test process;
3. arranging time slices;
4. and executing the test flow.
The hardware platform of the main control unit is a notebook computer or a shelf PC, the operating system is Win7 or a Chinese Standard kylin V4.0 edition, and the software is self-developed desktop software.
The lower computer, namely the measurement and control unit, has the main functions of:
1. caching a time slice sequence;
2. the operations within the time slices are performed in sequence (data communication (CAN, RS422), relay operation, and digital IO operation are performed in each time slice);
3. collecting test data, packaging and transmitting to a main control unit;
the hardware platform of the measurement and control unit is a self-developed chip, and the software is self-developed embedded software.
The time slice arrangement process in the test flow is as follows:
1. time slicing is carried out on the test flow by taking 2 milliseconds as a period;
2. filling operation data in each time slice, packaging the time slice frames, and sequencing the time slice frames according to the ascending order of time;
3. and then the time slice frame is encapsulated into a UDP download frame.
The test flow is executed as follows:
1. the upper computer software sends the UDP download frame to the lower computer;
2. the lower computer software caches UDP download frames, then unpacks, carries out operations in the time slices in sequence and communicates with the system to be tested;
3. the tested system returns the tested data;
4. and the lower computer software packages the test data received in the current time slice and sends the test data to the upper computer.
Due to the limitation of lower computer hardware, the UDP download frame buffer queue only has 30-100K storage space (difference of lower computer model numbers), and simultaneously, in order to reduce UDP sub-packets as much as possible, the size of each downloaded UDP download frame is about 1K. That is, the lower computer can only store dozens of frames of UDP data.
Time slice frames contain non-uniform sizes of operational data, e.g., some frames contain several bytes of data and some frames contain hundreds of bytes of data. Therefore, the number of slice frames in each UDP download frame is variable. It appears that some UDP download frames may contain several seconds of operation and some UDP download frames may contain less than 1 millisecond of operation.
If the buffered UDP download frame is consumed, the lower computer is forced to terminate the test flow.
The conventional method for solving the above problems is that when the lower computer has about 10K of cache data left, the lower computer sends a starvation frame to the upper computer to indicate that the data is about to be used up. And after receiving the hungry frame, the upper computer issues a UDP download frame of about 20K.
The disadvantages of the above conventional methods are:
1. the lower computer has limited computing power, and the real-time performance may be reduced after the periodic tasks are added. For example, within each 2 ms period, the usage information of the remaining available memory amount is counted and individually packaged into a frame to be uploaded to the upper computer, which may crowd hardware resources and time resources, possibly make other tasks unable to be completed within the 2 ms period, and lose real-time performance.
2. The robustness is poor, and when the data throughput is high, the test flow can be terminated accidentally due to the fact that the data cache is consumed too fast; the reason is as follows: (1) if the data is consumed too fast, for example, every 1K of UDP data can only be maintained for about 2 milliseconds, 10K of data can only be maintained for about 20 milliseconds, the thread scheduling time (reaction time) of the upper computer system is usually about 50 milliseconds, the upper computer reacts after receiving a starvation frame, sporadic data cannot be downloaded timely, the lower computer cache data is consumed completely, and the test flow is terminated; (2) the upper computer sends a large amount of data (for example, 20 frames are sent in 1 millisecond) each time, the burden on the lower computer is too large, the processing capacity cannot keep pace with the lower computer, and the real-time performance of the system is influenced; if the data is sent at a fixed interval (e.g., one frame every 2 milliseconds), the data consumption at high data throughput may not be kept up to date; (3) if the starvation frame is lost on the link, the upper computer cannot send new data, and the cache data is rapidly consumed, so that the lower computer is stopped, and the test flow is terminated.
3. To ensure reliability, data sampling accuracy is sometimes sacrificed; the reason is as follows: in high throughput, in order to avoid too fast cache data consumption, the original operation data is cut, and the sending frequency of the data is reduced; for example, the periodic data is changed from being transmitted every millisecond to being transmitted every 4 milliseconds, so that the maintenance time of each UDP download frame is increased by 4 times; the method also reduces the data sampling precision while ensuring the stable operation of the system.
Disclosure of Invention
The invention aims to solve the problems and provide a method for updating the lower computer cache data of a measurement and control system independent of a hunger frame.
The invention realizes the purpose through the following technical scheme:
a lower computer cache data updating method of a measurement and control system comprises the following steps:
step (1): the upper computer establishes a table: a cache use state recording table, namely a table M, simulates the cache use state of a lower computer, and the maximum number of the table entries is consistent with the size of a cache space, namely a K cache space corresponds to a table entries; the format of table M is as follows:
watch M
Serial number Starting time End time
1 XX millisecond XX millisecond
2 XX millisecond XX millisecond
3 XXMillisecond (ms) XX millisecond
XX millisecond XX millisecond
Caching maximum values XX millisecond XX millisecond
Step (2): the upper computer records each UDP download frame in the process of packaging the time slice frames into UDP download frames, wherein the UDP download frames comprise the time range of operation, namely the starting time and the ending time;
and (3): the upper computer sets a variable A for predicting the end time;
and (4): starting to download the UDP download frame, filling the UDP download frame to 90% of the maximum number of the table entries, updating the variable A to the end time of the UDP download frame sent this time when the UDP download frame is sent to the lower computer every time, writing the time range information of the frame into the table M, and adding one table entry; one download frame is a table entry, the reserved space of one table entry is 1K, and the data size of one table entry does not exceed 1K;
and (5): the testing process is started, and the cache data is consumed;
and (6): the upper computer receives a UDP test data frame sent by the lower computer, and obtains the current test time according to the time field in the frame and records the current test time as a variable B;
and (7): calculating the remaining maintaining time, namely a variable C is equal to a variable A-a variable B;
and (8): when the variable C is smaller than a preset warning threshold value, downloading the rest UDP download frames;
and (9): when the variable C is less than 4 seconds, downloading the UDP download frame according to the rate of 1 frame every 4 milliseconds; when the variable C is less than 2 seconds, downloading the UDP download frame according to the rate of 1 frame every 2 milliseconds; when the variable C is less than 1 second, downloading the UDP download frame according to the rate of 1 frame per 1 millisecond; by analogy, when the variable C is less than half of the previous value, the rate of downloading UDP download frames is doubled until the upper limit of the transmission rate specified by the system is reached;
step (10): and updating the table M each time a UDP download frame is downloaded, wherein the updating method comprises the following steps: deleting the table entry with the variable A smaller than the current variable B, and then adding newly downloaded UDP download frame information to the table M; repeatedly downloading the UDP download frame according to the speed of the step (9) until the UDP download frame is filled to 90 percent of the maximum number of the table entries;
step (11): and (5) repeating the step (6) to the step (10) until the test flow is finished, and finishing the updating of the lower computer cache data.
The invention has the beneficial effects that:
the invention dynamically determines the sending frequency and the quantity of UDP download frames by actively calculating the lower computer cache residual condition without depending on the starvation frame, has stronger robustness, does not depend on the starvation frame and a special protocol, dynamically formulates a cache updating strategy by simulating and calculating the lower computer cache state, and actively downloads the UDP download frames, thereby effectively avoiding the problems of too fast lower computer cache consumption and untimely update; the upper computer dynamically determines the sending frequency and the number of UDP download frames, the influence of the UDP download frames on the lower computer is reduced as much as possible, the load of the lower computer is reduced, and the real-time performance of the lower computer is improved; data cutting does not need to be carried out on the high-throughput testing process, and the usability and sampling precision of the testing system under the condition are enhanced.
Detailed Description
The invention is further illustrated by the following examples:
example (b):
a lower computer cache data updating method of a measurement and control system comprises the following steps:
step (1): the upper computer establishes a table: a cache use state recording table, namely a table M, simulates the cache use state of a lower computer, and the maximum number of the table entries is consistent with the size of a cache space, namely a K cache space corresponds to a table entries; the format of table M is as follows:
watch M
Serial number Starting time End time
1 XX millisecond XX millisecond
2 XX millisecond XX millisecond
3 XX millisecond XX millisecond
XX millisecond XX millisecond
Caching maximum values XX millisecond XX millisecond
Step (2): the upper computer records each UDP download frame in the process of packaging the time slice frames into UDP download frames, wherein the UDP download frames comprise the time range of operation, namely the starting time and the ending time;
and (3): the upper computer sets a variable A for predicting the end time;
and (4): starting to download the UDP download frame, filling the UDP download frame to 90% of the maximum number of the table entries, updating the variable A to the end time of the UDP download frame sent this time when the UDP download frame is sent to the lower computer every time, writing the time range information of the frame into the table M, and adding one table entry; one download frame is a table entry, the reserved space of one table entry is 1K, and the data size of one table entry does not exceed 1K;
and (5): the testing process is started, and the cache data is consumed;
and (6): the upper computer receives a UDP test data frame sent by the lower computer, and obtains the current test time according to the time field in the frame and records the current test time as a variable B;
and (7): calculating the remaining maintaining time, namely a variable C is equal to a variable A-a variable B;
and (8): when the variable C is smaller than a preset warning threshold value, downloading the rest UDP download frames;
and (9): when the variable C is less than 4 seconds, downloading the UDP download frame according to the rate of 1 frame every 4 milliseconds; when the variable C is less than 2 seconds, downloading the UDP download frame according to the rate of 1 frame every 2 milliseconds; when the variable C is less than 1 second, downloading the UDP download frame according to the rate of 1 frame per 1 millisecond; by analogy, when the variable C is less than half of the previous value, the rate of downloading UDP download frames is doubled until the upper limit of the transmission rate specified by the system is reached;
step (10): and updating the table M each time a UDP download frame is downloaded, wherein the updating method comprises the following steps: deleting the table entry with the variable A smaller than the current variable B, and then adding newly downloaded UDP download frame information to the table M; repeatedly downloading the UDP download frame according to the speed of the step (9) until the UDP download frame is filled to 90 percent of the maximum number of the table entries;
step (11): and (5) repeating the step (6) to the step (10) until the test flow is finished, and finishing the updating of the lower computer cache data.
The above embodiments are only preferred embodiments of the present invention, and are not intended to limit the technical solutions of the present invention, so long as the technical solutions can be realized on the basis of the above embodiments without creative efforts, which should be considered to fall within the protection scope of the patent of the present invention.

Claims (1)

1. A lower computer cache data updating method of a measurement and control system is characterized in that: the method comprises the following steps:
step (1): the upper computer establishes a table: a cache use state recording table, namely a table M, simulates the cache use state of a lower computer, and the maximum number of the table entries is consistent with the size of a cache space, namely a K cache space corresponds to a table entries; the format of table M is as follows:
watch M
Serial number Starting time End time 1 XX millisecond XX millisecond 2 XX millisecond XX millisecond 3 XX millisecond XX millisecond XX millisecond XX millisecond Caching maximum values XX millisecond XX millisecond
Step (2): the upper computer records each UDP download frame in the process of packaging the time slice frames into UDP download frames, wherein the UDP download frames comprise the time range of operation, namely the starting time and the ending time;
and (3): the upper computer sets a variable A for predicting the end time;
and (4): starting to download the UDP download frame, filling the UDP download frame to 90% of the maximum number of the table entries, updating the variable A to the end time of the UDP download frame sent this time when the UDP download frame is sent to the lower computer every time, writing the time range information of the frame into the table M, and adding one table entry; one download frame is a table entry, the reserved space of one table entry is 1K, and the data size of one table entry does not exceed 1K;
and (5): the testing process is started, and the cache data is consumed;
and (6): the upper computer receives a UDP test data frame sent by the lower computer, and obtains the current test time according to the time field in the frame and records the current test time as a variable B;
and (7): calculating the remaining maintaining time, namely a variable C is equal to a variable A-a variable B;
and (8): when the variable C is smaller than a preset warning threshold value, downloading the rest UDP download frames;
and (9): when the variable C is less than 4 seconds, downloading the UDP download frame according to the rate of 1 frame every 4 milliseconds; when the variable C is less than 2 seconds, downloading the UDP download frame according to the rate of 1 frame every 2 milliseconds; when the variable C is less than 1 second, downloading the UDP download frame according to the rate of 1 frame per 1 millisecond; by analogy, when the variable C is less than half of the previous value, the rate of downloading UDP download frames is doubled until the upper limit of the transmission rate specified by the system is reached;
step (10): and updating the table M each time a UDP download frame is downloaded, wherein the updating method comprises the following steps: deleting the table entry with the variable A smaller than the current variable B, and then adding newly downloaded UDP download frame information to the table M; repeatedly downloading the UDP download frame according to the speed of the step (9) until the UDP download frame is filled to 90 percent of the maximum number of the table entries;
step (11): and (5) repeating the step (6) to the step (10) until the test flow is finished, and finishing the updating of the lower computer cache data.
CN201811094646.5A 2018-09-19 2018-09-19 Lower computer cache data updating method of measurement and control system Expired - Fee Related CN109361736B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811094646.5A CN109361736B (en) 2018-09-19 2018-09-19 Lower computer cache data updating method of measurement and control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811094646.5A CN109361736B (en) 2018-09-19 2018-09-19 Lower computer cache data updating method of measurement and control system

Publications (2)

Publication Number Publication Date
CN109361736A CN109361736A (en) 2019-02-19
CN109361736B true CN109361736B (en) 2022-03-04

Family

ID=65351349

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811094646.5A Expired - Fee Related CN109361736B (en) 2018-09-19 2018-09-19 Lower computer cache data updating method of measurement and control system

Country Status (1)

Country Link
CN (1) CN109361736B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103888815A (en) * 2014-03-13 2014-06-25 广州市花都区中山大学国光电子与通信研究院 Method and system for real-time separation treatment and synchronization of audio and video streams

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8831090B2 (en) * 2008-11-18 2014-09-09 Avigilon Corporation Method, system and apparatus for image capture, analysis and transmission
US8810173B2 (en) * 2010-11-18 2014-08-19 Rockwell Automation Technologies, Inc. Rotating machinery condition monitoring using position sensor

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103888815A (en) * 2014-03-13 2014-06-25 广州市花都区中山大学国光电子与通信研究院 Method and system for real-time separation treatment and synchronization of audio and video streams

Also Published As

Publication number Publication date
CN109361736A (en) 2019-02-19

Similar Documents

Publication Publication Date Title
US20220413705A1 (en) Resource Monitoring in a Distributed Storage System
CN103176932B (en) Method and system for DMA data transmission
CN106874224A (en) The multi-thread SPI Flash controllers of automatic transporting and adaptation device
RU2014118970A (en) PENDED DATA PUBLICATION IN PROCESS MANAGEMENT SYSTEMS
US8917733B2 (en) Using wireless wide area network protocol information for managing a performance level of a processor
US11109389B2 (en) Method for reporting network performance parameter and device
CN108495239B (en) Method, device, equipment and storage medium for accurately and synchronously playing audio among multiple equipment
CN109917672B (en) Semi-physical simulation system and method for navigation and control loop
CN109361736B (en) Lower computer cache data updating method of measurement and control system
CN113364701B (en) RTT (round trip time) -based congestion control method and equipment combining proportional-integral-derivative control
US20200012448A1 (en) Data collection system and data collection method
US8160084B2 (en) Method for time-stamping messages
CN111740806A (en) Telemetry data framing method and system with self-adaptive variable frame length
CN103840910A (en) Data transmission control method and apparatus
CN115941615B (en) Data processing method, device, vehicle and storage medium
US20240078115A1 (en) Flush-on-demand processor instruction trace
CN111381539A (en) A real-time bus synchronization control device
US20230012394A1 (en) Managing network latency using buffer fill control
US20190089786A1 (en) Data collection device, data transfer device, data collection system, and computer readable medium
CN113010366B (en) Log output method, device and equipment
CN113726677A (en) Network congestion control method and equipment
US10073762B2 (en) Debug device, debug method, and debug program
CN114257263A (en) High-mobility channel simulation device and method based on triggering
CN114325605A (en) Qt-based visual general radar signal processing interaction system
US20210382745A1 (en) Methods and Apparatus for Modifying an Allocation of Virtualized Processing Resources for a Digital Unit based on Timing Feedback from a Radio Unit

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20220304

CF01 Termination of patent right due to non-payment of annual fee