Data storage method based on serial port transmission

By adopting a data storage method based on serial port transmission in the star sensor, and using the cyclic and collection reception method combined with the handshake protocol, the problems of low efficiency and insufficient accuracy of star map transmission are solved, and fast and accurate star map storage is achieved, and the performance of the star sensor is improved.

CN115933983BActive Publication Date: 2025-05-13SUZHOU JITIAN XINGZHOU SPACE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211693119.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-28
Publication Date
2025-05-13
Estimated Expiration
2042-12-28

AI Technical Summary

Technical Problem

When storing star maps, the timer method uses low transmission efficiency, and simple serial port reception events will delay a lot of time and accuracy.

Method used

The data storage method based on serial port transmission is adopted, through the collaborative work of the upper and lower computers, the cyclic and collective reception methods are used, combined with the handshake protocol, to achieve accurate and efficient storage of the star map.

Benefits of technology

It greatly improves the speed and accuracy of star map transmission, reduces the time consumption during reception and processing feedback, avoids frame drop defects in array reception, and improves the star map update rate and accuracy of star sensors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115933983B_ABST
    Figure CN115933983B_ABST
Patent Text Reader

Abstract

The data storage method based on serial port transmission relates to the technical field of star map data transmission in star sensors. It solves the problems that the timer method used in the existing star sensor to store star maps has low transmission efficiency, and simple serial port receiving events will also delay a lot of time and lack of accuracy. The method of the present invention draws on the structure of the set array and adopts a combination of set reception and cyclic framing to accurately and efficiently store a star map in the specified address of the lower computer RAM. The present invention adopts cyclic transmission and cyclic judgment. Compared with the ordinary serial port receiving method, the method improves the storage speed, can fully meet the communication of the serial port speed, and also avoids the frame loss defect of array reception. It is fully stored in the specific handshake protocol between the upper computer and the lower computer, which reduces the time consumption of the upper computer processing data, and helps to improve the star map update rate and accuracy of the star sensor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of star map data transmission in a star sensor, and in particular to a data storage method based on serial port transmission. Background Art

[0002] Aerospace technology is booming. Satellite technology is an important part of it. The technology of various military and civilian satellites in my country also requires higher technical requirements. As the only device for satellite attitude confirmation, the performance of star sensors has become an important symbol of satellite technology. As aerospace equipment, star sensors need to be debugged correctly on the ground before they can follow the satellite into space. How to quickly and accurately store star sensors Figure 1 It is the key to improve the performance debugging of star sensors.

[0003] Star map storage is the key to star sensor performance debugging. The accuracy of the star points in the star map largely determines the accuracy of subsequent star map recognition, affecting the attitude performance of the star sensor. Star sensors have very strict requirements on the accuracy of star map data. How to quickly and accurately achieve star map transmission has always been a key factor in improving the performance of star sensor debugging.

[0004] In order to accurately store the star map information, the star map in the star map must first be segmented and identified. The star map identification method can use basic pixel processing methods, such as the RGB average method. At present, many star map transmissions use timer methods. The timer is inefficient for full pixel transmission of star maps, and simple serial port receiving events will also delay a lot of time and lack accuracy. However, with the development of aerospace technology, how to accurately debug star sensors is the key to meeting the performance of aerospace equipment.

[0005] The invention takes into account the hardware configuration of the star sensor and the execution order of the software, realizes the storage of the star map through the handshake protocol based on the cyclic and collective reception, accurately and quickly searches for the complete frame and continues to transmit through the cooperative work of the upper computer and the lower computer, and greatly improves the accuracy and speed of the star sensor debugging process under specific conditions (only the serial port is available for data transmission). Summary of the invention

[0006] The present invention provides a data storage method based on serial port transmission to solve the problems that when an existing star sensor stores a star map, a timer is used to store the star map, the transmission efficiency is low, a simple serial port receiving event also delays a large amount of time and the accuracy is lost.

[0007] A data storage method based on serial port transmission, the steps of the method are as follows:

[0008] Step 1: The host computer receives the star map and parses the input address of the star map;

[0009] Step 2: Determine whether the receiving flag is 1. If yes, go to step 3; if no, go to step 4;

[0010] Step 3: The upper computer sends a complete data frame to the lower computer based on a cyclic framing method, wherein the complete data frame is composed of a frame header + address + data + frame tail; the receiving flag is changed to 0, and step 7 is executed;

[0011] Step 4: Return to the previous complete frame sending cycle, that is, reframe the error frame; transmit the complete data frame, i.e., frame header + address + data + frame tail, to the lower computer, and change the receiving flag bit to 0, and execute step 5;

[0012] Step 5: The lower computer receives the complete data frame transmitted by the upper computer and stores the data in RAM after parsing the data. After the lower computer determines that the address and data are correct, it feeds back a flag bit to the upper computer;

[0013] Step 6: After receiving the data transmitted by the lower computer, the upper computer finds the complete data frame, and changes the flag bit after judging the feedback result, and returns to execute step 2;

[0014] Step 7: Determine whether the last set of pixel values ​​is stored successfully. If yes, end; if not, return to step 5.

[0015] Beneficial effects of the present invention: The method of the present invention adopts a combination of collective reception and cyclic framing to accurately and efficiently store a star map in the specified address of the lower computer RAM. The method adopts cyclic transmission and cyclic judgment to solve the drawbacks of low efficiency and byte loss in serial port reception event processing data. The method only takes a time infinitely close to the serial port transmission rate. Compared with the existing method, the speed of star map transmission is accelerated and the time consumption when receiving and processing feedback is reduced.

[0016] The method of the present invention improves the storage speed, can fully meet the communication speed of the serial port, and also avoids the frame loss defect of array reception. It is fully stored in the specific handshake protocol between the host computer and the slave computer, which reduces the time consumption of the host computer in processing data, and helps to improve the star map update rate and accuracy of the star sensor. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 This is a general flow chart of the data storage method based on serial port transmission according to the present invention;

[0019] Figure 2 The present invention is a flowchart of the upper computer based on the cycle of framing and sending;

[0020] Figure 3 The data processing and feedback flow chart of the lower computer of the present invention;

[0021] Figure 4 It is a flow chart of receiving and combing feedback frames received by the host computer based on the set array according to the present invention;

[0022] Specific implementation method

[0023] Specific implementation method 1. Combination Figures 1 to 4 This embodiment describes a data storage method based on serial port transmission. First, the star map is sent cyclically, and the algorithm for receiving and traversing the judgment feedback frame of the collection array is as follows: Figure 1 shown.

[0024] Step 1: The host computer receives the star map and parses the input address of the star map; performs grayscale analysis on the transmitted star map. When the receiving flag is 1, it means that the storage of the lower computer is completed. The loop is performed to perform RGB analysis on the first four pixels of the selected star map and convert them into grayscale, and the maximum pixel value is recorded as the end point of the loop transmission. In the starting state, the receiving flag is set to 1.

[0025] Step 2: Determine whether the receiving flag is 1. If yes, go to step 3; if no, go to step 4;

[0026] Step 3: The upper computer sends a complete data frame to the lower computer based on a cyclic framing method, wherein the complete data frame is composed of a frame header + address + data + frame tail; the receiving flag is changed to 0, and step 7 is executed;

[0027] In this implementation, after the grayscale value analysis is completed, the data is framed within the loop, and the complete frame is in the form of "frame header + address + data + frame tail". The lower computer RAM address is a custom 32-bit address, and the first frame of data is sent. The global variable is used to temporarily store the address for subsequent data judgment, and the receiving flag is changed to 0 at the same time, and the loop is temporarily waited.

[0028] like Figure 2 As shown, in this implementation, after the star map selection and address parsing are completed, the loop is entered according to the initial receiving flag being 1, and the grayscale values ​​of the first four pixels are first parsed as a group, and then the parsed address is split into 4 bytes, and the frame header is added to calculate the SUM verification bit of the frame tail, and the complete frame "frame header + address + 4 pixel data + frame tail" is sent to the lower computer through the serial port for storage and judgment, and the global variable is used to store the sending address, and the sending flag is changed to 0.

[0029] The specific process of the host computer sending a complete data frame to the lower computer based on the cyclic framing method is as follows:

[0030] Step 31: The host computer determines whether the receiving flag is 1. If yes, the parsed pixel position and RAM address are updated and step 33 is executed; if no, step 32 is executed;

[0031] Step 32: Do not update the resolved pixel position and RAM address, and execute step 33;

[0032] Step 33: compose a complete data frame, i.e., frame header + address + data + frame tail, and send it to the lower computer, and execute step 34;

[0033] Step 34: Determine whether it is the last frame reception mark, if yes, end; if not, return to execute step 32.

[0034] Step 4: Return to the previous frame loop, transmit the complete data frame, i.e., frame header + address + data + frame tail, to the lower computer, and change the receiving flag bit to 0, and execute step 5;

[0035] Step 5: The lower computer receives the complete data frame transmitted by the upper computer and stores the data in RAM after parsing the data. After the lower computer determines that the address and data are correct, it feeds back a flag bit to the upper computer;

[0036] 1) After the lower computer receives the command frame from the upper computer, it first finds the frame header, and then performs check bit verification. If the frame header and check bit are correct, it means that a complete command frame has been found, and then the command frame is parsed.

[0037] 2) Parse the address and data; determine whether the address and data are within the address range (the address range is the data storage space planned in advance); if not within the address range, the feedback data frame will display the corresponding data indicating that it is not within the address range.

[0038] 3) If the resolved address is within a reasonable address range, store the resolved data into the resolved address;

[0039] 4) To ensure the correctness of the data, the data needs to be compared and verified. The data of the address is read out again and compared with the parsed data; different data will be fed back depending on whether the verification is correct or not.

[0040] 5) The parsed address and data in the feedback frame are reassembled into a standard lower-computer feedback frame and sent out.

[0041] like Figure 3 As shown, Figure 3This is the data processing and feedback process of the lower computer. After receiving the serial port data, the lower computer parses the address and pixel grayscale data, stores the data at the corresponding address, and then verifies the first address of the storage RAM with the received address. If they are consistent, a frame of data "frame header + address + 1 + SUM frame tail" is formed and sent to the upper computer as feedback. If they are inconsistent, the flag bit 0 is returned as feedback to the upper computer. The specific steps are:

[0042] Step 51: After receiving the command frame from the upper computer, the lower computer first finds the frame header, and then performs check bit verification. If the frame header and the check bit are correct, it means that a complete command frame is found, and then the command frame is parsed;

[0043] Step 52: parse the address and pixel data and store them in RAM, extract the RAM address and pixel data for comparison, and determine whether the addresses are consistent. If yes, execute step 53; if not, execute step 54;

[0044] Step 53: Determine whether the data is consistent. If yes, form a complete data frame, i.e., frame header + address + 1 + frame tail, and send it to the host computer; if no, form a data frame as follows: frame header + address + 0 + frame tail; and return 0 to the host computer;

[0045] Step 54: Compose a complete data frame, namely: frame header + address + 2 + frame tail, and return 0 to the host computer.

[0046] Step 6: After receiving the data transmitted by the lower computer, the upper computer finds the complete data frame, and changes the flag bit after judging the feedback result, and returns to execute step 2;

[0047] like Figure 4 As shown, after the lower computer transmits data to the upper computer, the upper computer needs to receive and verify the data before proceeding to the next sending process.

[0048] 1) Use the collection array method to quickly and accurately receive serial port data, and use the loop traversal frame header method to find the complete frame. The search method is to find the first byte of the frame header, use the array to store the 7 bytes starting from this byte as a group of data, verify the second byte at the same time, and also perform SUM comparison on the previous six bytes. If one item is not satisfied (the two bytes of the frame header that need to be verified, the four bytes of the address (compared with the stored last send address), and the 1 byte of the accumulated verification bit), then discard the first byte of data and continue searching until 7 bytes of continuous data that meet the frame header and frame tail are found.

[0049] 2) After finding it, the feedback address is compared with the address stored in the global variable. When the feedback byte is 1, the receiving flag is changed to 1 for subsequent receipt sending. If one of the two conditions is not met, the receiving flag is changed to 0 for the next data sending.

[0050] Step 7: Determine whether the last set of pixel values ​​is stored successfully. If yes, end; if not, return to step 5.

[0051] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0052] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A data storage method based on serial port transmission, characterized in that: The method is implemented by the following steps: Step 1: The host computer receives the star map and parses the input address of the star map; Step 2: Determine whether the receiving flag is 1. If yes, go to step 3; if no, go to step 4; Step 3: The upper computer sends a complete data frame to the lower computer based on a cyclic framing method, wherein the complete data frame is composed of a frame header + address + data + frame tail; Change the receive flag to 0 and execute step 7; Step 4: Return to the loop of sending the previous frame of pixels, transmit the complete data frame, i.e., frame header + address + data + frame tail, to the lower computer, and change the receiving flag to 0, and execute step 5; Step 5: The lower computer receives the complete data frame transmitted by the upper computer and stores the data in RAM after parsing the data. After the lower computer determines that the address and data are correct, it feeds back a flag bit to the upper computer; Step 6: After receiving the data transmitted by the lower computer, the upper computer finds the complete data frame, and changes the flag bit after judging the feedback result, and returns to execute step 2; Step 7: Determine whether the last set of pixel values ​​is stored successfully, if yes, end; If not, return to step 5.

2. The data storage method based on serial port transmission according to claim 1, characterized in that: In step 3, the specific process of the upper computer sending a complete data frame to the lower computer based on the cyclic framing method is as follows: Step 31: The host computer determines whether the receiving flag is 1. If yes, the parsed pixel position and RAM address are updated and step 33 is executed; if no, step 32 is executed; Step 32: Do not update the resolved pixel position and RAM address, and execute step 33; Step 33: compose a complete data frame, i.e., frame header + address + data + frame tail, and send it to the lower computer, and execute step 34; Step 34: Determine whether it is the last frame reception mark, if yes, end; if not, return to execute step 32.

3. The data storage method based on serial port transmission according to claim 1, characterized in that: The specific process of step five is: Step 51: After receiving the command frame from the upper computer, the lower computer first finds the frame header, and then performs check bit verification. If the frame header and the check bit are correct, it means that a complete command frame is found, and then the command frame is parsed; Step 52: parse the address and pixel data and store them in RAM, extract the RAM address and pixel data for comparison, and determine whether the addresses are consistent. If yes, execute step 53; if not, execute step 54; Step 53: Determine whether the data is consistent. If yes, form a complete data frame, i.e., frame header + address + 1 + frame tail, and send it to the host computer; if not, form a data frame as follows: frame header + address + 0 + frame tail; And return 0 to the host computer; Step 54: Compose a complete data frame, namely: frame header + address + 2 + frame tail, and return 0 to the host computer.

4. The data storage method based on serial port transmission according to claim 1, characterized in that: The specific process of step six is ​​as follows: Step 61: The upper computer receives the data fed back by the lower computer, receives the serial port data in a collection array, and finds the complete data frame by looping through the frame header; Step 62: Determine whether the resolved address is consistent with the address sent last time. If yes, execute step 63; if not, execute step 64; Step 63: Determine whether the parsing feedback content is successfully and correctly stored. If yes, change the flag bit to 1; If no, proceed to step 64; Step 64: Change the flag bit to 0.

5. The data storage method based on serial port transmission according to claim 4, characterized in that: In step 61, a complete data frame is found by looping through the frame header. Specifically, after finding the first byte of the frame header, an array is used to store the 7 bytes starting from the first byte and a judgment is made. If the feedback frame is correct, the receiving flag is 1 to transmit the next frame of data.

Citation Information

Patent Citations

  • Star map identification method of multi-view-field star sensor

    CN103363987A

  • Reliable data interaction method based on RS-422 serial bus technique

    CN105573958A