Data writing method, device and storage medium

By using two data buffers in the satellite-based device for data splicing, the problem of memory needing to fill in blank data during write operations is solved, and efficient utilization of storage space and spectrum resources is achieved.

CN115098018BActive Publication Date: 2025-02-07BEIJING WEINA STAR TECH CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210609216.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-31
Publication Date
2025-02-07
Estimated Expiration
2042-05-31

AI Technical Summary

Technical Problem

In miniaturized satellite-based devices, memory needs to force fill in blank data when performing write operations to meet data length requirements, resulting in waste of storage space and waste of spectrum resources.

Method used

By using two data buffers, the remaining sequence array and the new target array are spliced ​​in the head and tail, avoiding forward copying and storage space occupation, and improving memory operation efficiency.

Benefits of technology

It achieves the avoidance of waste of storage space and spectrum resources, improves the operation efficiency of memory, and meets the needs of high-integration satellite platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115098018B_ABST
    Figure CN115098018B_ABST
Patent Text Reader

Abstract

The present application provides a data writing method, device and storage medium, which are applied to the field of data storage technology. The method includes: writing a serialized array of first data in a navigation data packet into a first data buffer; intercepting the serialized array of the first data according to a preset length value to obtain multiple segments of a first target array and a remaining serialized array less than the preset length value; writing the multiple segments of the first target array sequentially into a memory in each clock cycle; writing a serialized array of second data in a newly received navigation data packet into a second data buffer; according to the difference between the preset length value and the length value of the remaining serialized array in the first data, intercepting a first row array equal to the difference from the head of the second data; writing the remaining serialized array and the first row array in the first data into the memory in sequence; the present application avoids filling blank data by splicing the head and tail data, thereby improving the operating efficiency of the memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data storage, and in particular to a data writing method, device and storage medium. Background Art

[0002] Aerospace has made important contributions to the development of scientific research. In recent years, with the improvement of my country's comprehensive national strength and scientific and technological level, my country's aerospace industry has developed rapidly, and there is a strong demand for various types of satellites, which has put forward higher requirements for the use of highly integrated and miniaturized satellite platforms.

[0003] The memory used in the current miniaturized satellite-borne equipment has a requirement for data length when performing a write operation. When the control unit writes the residual frame operation, in order to meet the write requirement, it is necessary to forcibly fill in blank data so that the data length reaches the write requirement. Since blank data is invalid data for the user and has no use value, it causes a waste of storage space, and it is inevitable to downlink during satellite-to-ground communication, resulting in a waste of spectrum resources. In addition, when the total length of the acquired navigation data is small, the probability of residual frames will be greater, which further increases the situation of filling the storage space with blank data, thereby reducing the utilization rate of the memory. The writing method of the existing technology is contrary to the development concept of the highly integrated satellite platform. Summary of the invention

[0004] In view of this, an embodiment of the present application provides a data writing method, which uses two data buffers to splice the remaining sequence array and the new target array end to end, avoiding the problem of copying the remaining sequence array forward and occupying storage space, and improving the operating efficiency of the memory.

[0005] In a first aspect, an embodiment of the present application provides a data writing method, comprising:

[0006] In response to a first operation instruction of the control unit, a serialized array of first data in the navigation data packet is written into a first data buffer, wherein the navigation data packet carries telemetry data acquired by a ground-based onboard computer through a satellite downlink;

[0007] The serialized array of the first data is intercepted according to a preset length value to obtain a plurality of first target arrays and a remaining serialized array less than the preset length value;

[0008] In each clock cycle, the obtained multiple segments of the first target array are sequentially written into the memory respectively;

[0009] In response to a second operation instruction of the control unit, writing a serialized array of second data in the new navigation data packet received again into a second data buffer, wherein the new navigation data packet carries telemetry data acquired by a ground-based onboard computer through a satellite downlink;

[0010] According to the difference between the preset length value and the length value of the remaining serialized array in the first data, intercepting the first row array equal to the difference from the header of the second data;

[0011] Writing the remaining serialized array in the first data and the first row array intercepted from the second data header into the memory in sequence, so as to complete the concatenation of the remaining serialized array and the first row array intercepted from the second data header;

[0012] Sequentially intercepting arrays other than the first row of arrays in the serialized array in the second data according to the preset length value to obtain multiple segments of second target arrays;

[0013] In each clock cycle, the obtained multiple segments of the second target array are written into the memory in sequence.

[0014] In combination with the first aspect, an embodiment of the present application provides a first possible implementation of the first aspect, wherein writing a serialized array of first data in a navigation data packet into a first data buffer includes:

[0015] When the first data buffer is in a writing state, reading first data from the navigation data packet in a timed query manner;

[0016] Encode the read first data to generate a serialized array of the first data;

[0017] According to the first write pointer and the first write offset in the first data buffer, the serialized array of the first data is written into the first data buffer; the first write pointer indicates the first byte address of the first data in the navigation data packet, and the first write offset indicates the moving distance of the serialized array from the first byte address of the first data to each frame.

[0018] In combination with the first possible implementation of the first aspect, an embodiment of the present application provides a second possible implementation of the first aspect, wherein the serialized array of the first data is intercepted according to a preset length value to obtain multiple segments of the first target array and the remaining serialized array less than the preset length value, respectively, including:

[0019] Accumulating the total length of the serialized array of the first data to obtain the first target length value;

[0020] The first target length value of the serialized array is truncated according to the preset length value to obtain a plurality of first target array segments equal to the preset length value and a remaining serialized array less than the preset length value.

[0021] In combination with the first possible implementation manner or the second possible implementation manner of the first aspect, an embodiment of the present application provides a third possible implementation manner of the first aspect, wherein, in each clock cycle, the obtained multiple segments of the first target array are respectively written into the memory in sequence, including:

[0022] In response to the transmission instruction of the control unit, at the beginning of each clock cycle, starting from the first byte address of the plurality of segments of the first target array, each segment of the first target array is sequentially read;

[0023] Each segment of the first target array read is sequentially written into the memory in the form of a data stream.

[0024] In combination with the first possible implementation manner or the second possible implementation manner of the first aspect, an embodiment of the present application provides a fourth possible implementation manner of the first aspect, wherein writing the serialized array of the second data in the new navigation data packet received again into the second data buffer includes:

[0025] When the second data buffer is in a writing state, reading second data from the new navigation data packet in a timed query manner;

[0026] Encode the read second data to generate a serialized array of the second data;

[0027] According to the second write pointer and the second write offset in the second data buffer, the serialized array of the second data is written into the second data buffer, the second write pointer indicates the first byte address of the second data in the new navigation data packet, and the second write offset indicates the moving distance from the first byte address of the second data to the serialized array of each frame.

[0028] In combination with the first possible implementation manner or the second possible implementation manner of the first aspect, an embodiment of the present application provides a fifth possible implementation manner of the first aspect, wherein, according to the difference between the preset length value and the length value of the remaining serialized array in the first data, a first row array equal to the difference is intercepted from the header of the second data, including:

[0029] Obtain the length value of the remaining serialized array in the first data;

[0030] Calculate the difference between the length value of the remaining serialized array in the first data and the preset length value;

[0031] The serialized array length value of the second array is intercepted from the first byte of the second data according to the difference, to obtain a first row array having a length equal to the difference.

[0032] In combination with the first possible implementation manner or the second possible implementation manner of the first aspect, an embodiment of the present application provides a sixth possible implementation manner of the first aspect, wherein the remaining serialized array in the first data and the first row array intercepted from the header of the second data are sequentially written into the memory, including:

[0033] Determine the remaining frame data of each frame of the remaining serialized array according to the length of the bytes in the remaining serialized array;

[0034] Determine the first frame data of each frame of the first row array according to the length of the bytes in the first row array;

[0035] The remaining frame data of the remaining serialized array and the first frame data of the first row array intercepted by the second data header are written into the memory in sequence.

[0036] In combination with the first possible implementation manner or the second possible implementation manner of the first aspect, an embodiment of the present application provides a seventh possible implementation manner of the first aspect, wherein arrays other than the first row array in the serialized array in the second data are intercepted in sequence according to the preset length value to obtain multiple segments of the second target array, including:

[0037] Read the serialized array of the second data from the byte position of the serialized array of the second data except the first row of the array;

[0038] Accumulating the total length of the serialized array of the second data to obtain a second target length value;

[0039] The second target length value of the serialized array is intercepted according to the preset length value to obtain multiple segments of the second target array equal to the preset length value.

[0040] In combination with the first possible implementation manner or the second possible implementation manner of the first aspect, an embodiment of the present application provides an eighth possible implementation manner of the first aspect, wherein, in each clock cycle, each segment of the second target array is sequentially written into the memory, including:

[0041] In response to the transmission instruction of the control unit, at the beginning of each clock cycle, each segment of the second target array is sequentially read starting from the first byte address of the plurality of segments of the second target array;

[0042] Each segment of the second target array read is written into the memory in sequence in the form of a data stream.

[0043] In a third aspect, an embodiment of the present application further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-mentioned data writing method steps when executing the computer program.

[0044] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, steps such as a data writing method are executed.

[0045] A data writing method provided by an embodiment of the present application is compared with the related art that a CPU control unit needs to forcibly fill invalid blank data to meet the writing requirement when writing residual frame data. In this method, a serialized array of first data in a navigation data packet is written into a first data buffer; the serialized array of the first data is intercepted according to a preset length value to obtain multiple segments of a first target array and a remaining serialized array less than the preset length value; in each clock cycle, the obtained multiple segments of the first target array are sequentially written into a memory; the serialized array of second data in a newly received navigation data packet is written into a second data buffer; according to the difference between the preset length value and the length value of the remaining serialized array in the first data, a first row array equal to the difference is intercepted from the header of the second data; the remaining serialized array in the first data and the first row array intercepted from the header of the second data are sequentially written into the memory; the arrays except the first row array in the serialized array in the second data are intercepted according to the preset length value to obtain multiple segments of a second target array; in each clock cycle, the obtained multiple segments of the second target array are sequentially written into the memory. Specifically, the ground-based onboard computer writes the navigation data packet into the first data buffer and the second data buffer respectively according to the writing status of the first data buffer and the second data buffer, calculates the length of the written data through the two data buffers respectively, and then intercepts the data according to the calculated length value to obtain the target array and the remaining sequence array that meet the writing requirements, and then writes the remaining serialized array and the new target array into the memory in sequence according to the write pointers and write shifts set in the two data buffers to complete the splicing of the head and tail arrays, thereby realizing the separate storage of the remaining sequence array and the new target array and the splicing of the head and tail data through the two data buffers, avoiding the problem of the remaining sequence array being moved forward and copied to occupy storage space, improving the operating efficiency of the memory, and saving spectrum resources for satellite-to-ground communications.

[0046] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0048] Figure 1 A flow chart of a data writing method provided in an embodiment of the present application is shown.

[0049] Figure 2 A structural block diagram of a data writing method provided in an embodiment of the present application is shown.

[0050] Figure 3 A schematic diagram of an embodiment of a data writing method provided in an embodiment of the present application is shown.

[0051] Figure 4 A schematic diagram of the structure of a computer device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0052] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0053] Considering that the remaining frame data in the navigation data packet needs to be filled with blank data when the writing length cannot meet the writing length requirement, the blank invalid data will occupy the storage space of the memory, making the operation efficiency of the memory low; based on this, an embodiment of the present application provides a data writing method, which is described below through an embodiment.

[0054] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0055] Figure 1 A schematic diagram of a data writing method provided in an embodiment of the present application is shown; Figure 1 , Figure 2 As shown, the specific steps include:

[0056] Step S10, in response to a first operation instruction of the control unit, a serialized array of first data in a navigation data packet is written into a first data buffer, wherein the navigation data packet carries telemetry data acquired by a ground-based onboard computer through a satellite downlink.

[0057] During the specific implementation of step S10, the satellite downlink sends the navigation data packets acquired at different times to the ground-based onboard computer, which issues a first operation instruction through the control unit, reads the first data from the navigation data packet according to the operation instruction of the control unit, encodes the first data according to the internal encoder of the control unit, generates a serialized array of the first data, loads the first write pointer in the first data buffer in an addressing manner to the first byte address of the first data, accumulates the serialized array from the first byte address of the first data until the tail byte of the serialized array is reached, thus obtaining the write shift of the current first data from the first address to the serialized array of the accumulated first data, and writes the serialized array of the first data into the first data buffer according to the first write pointer and the first write offset, wherein the first navigation data packet is the telemetry data acquired by the satellite through the downlink at different times.

[0058] Step S20, intercepting the serialized array of the first data according to a preset length value, and obtaining a plurality of first target array segments and a remaining serialized array smaller than the preset length value.

[0059] During the specific implementation of step S20, the first write pointer in the first data buffer is loaded to the address of the first byte from the beginning of the serialized array of the first data, and the address is used as the write address of the first data. The total length of the serialized array is accumulated according to the first byte address of the first data to obtain a first target length value. According to the preset length value, the serialized array of the first data is intercepted from the first byte address of the serialized array as the starting position to obtain multiple segments of the first target array equal to the preset length value.

[0060] Step S30, in each clock cycle, the obtained multiple segments of the first target array are written into the memory in sequence.

[0061] When step S30 is implemented specifically, it responds to the transmission instruction of the control unit, and at the beginning of each clock cycle, reads the first byte address of each segment of the first target array, and uses the addressing function to accumulate from the first address of each segment of the first target array to the last byte of the array to obtain the number of bytes of each segment of the first target array. According to the number of bytes of each segment of the first target array, the time interval of each frame on the bytes of each segment of the first target array is calculated, that is, the number of bytes of each segment of the first target array is obtained. Each frame of data from the first byte to the last byte of each segment of the first target array is written into the memory in sequence. Here, a random access function is used to return from the last byte of each segment of the first target array to the starting position of the first target array to be written.

[0062] Step S40, in response to the second operation instruction of the control unit, the serialized array of the second data in the newly received navigation data packet is written into the second data buffer, wherein the new navigation data packet carries the telemetry data acquired by the ground-based onboard computer through the satellite downlink.

[0063] During the specific implementation of step S40, the new navigation data packet is the telemetry data acquired by the satellite. The satellite sends the acquired new navigation data packet to the ground-based onboard computer through the satellite downlink. The ground-based onboard computer issues a second operation instruction through the control unit. According to the operation instruction of the control unit, the control unit acquires the status value of the login identifier from the second data buffer. If the status value of the current login identifier in the second data buffer is 0, it indicates that the second data buffer is in a write state. At this time, the control unit reads the second data from the navigation data packet in a timed query manner, encodes the second data according to the internal encoder of the control unit, generates a serialized array of the second data, and then loads the second write pointer of the second data buffer to the first byte address of the second data in an addressing manner. The serialized array is accumulated from the second data with the first byte address until the tail byte of the serialized array is reached, that is, the second write shift of the second data from the first byte address to the serialized array of accumulated second data is obtained, and the serialized array of the second data is written into the second data buffer according to the second write pointer and the second write offset.

[0064] Step S50: According to the difference between the preset length value and the length value of the remaining serialized array in the first data, a first row of array equal to the difference is intercepted from the header of the second data.

[0065] During the specific implementation of step S50, in response to the transmission instruction issued by the control unit, the first data buffer loads the first write pointer to the first byte of the remaining serialized array in the first data, and the first write pointer moves from the current first byte address to the tail byte of the remaining serialized array to accumulate the length, calculates the length value of the remaining serialized array, subtracts the length value of the remaining serialized array from the preset length value, determines the difference between the two, and according to the calculated difference, intercepts from the head of the serialized array of the second array to obtain the first row array with the same length as the calculated difference.

[0066] Step S60, writing the remaining serialized array in the first data and the first row array intercepted from the second data header into the memory in sequence to complete the splicing of the remaining serialized array and the first row array intercepted from the second data header.

[0067] In the specific implementation of step 60, the first write pointer in the first data buffer is loaded with the first byte address of the remaining serialized array in the first data, and the first write pointer moves from the current first byte address to the last byte of the remaining serialized array to perform byte accumulation to obtain the number of bytes of the remaining serialized array in the first data, that is, to obtain the offset of the movement from the first byte address to the last byte of the remaining serialized array. According to the time interval of each frame on the number of bytes of the remaining serialized array in the first data, the remaining frame data of the remaining serialized array in the first data is determined, and the remaining frame data of each transmission frame is written into the memory according to the offset of the remaining serialized array. After completing the writing of the remaining serialized array in the first data, the second write pointer in the second data buffer is loaded with the second data. According to the first byte address of the first data, the header array of the second data is intercepted from the first byte address of the second data to obtain the first row array of the second array, and according to the number of bytes in the first row array, the offset of the movement from the first byte address of the first row array to the tail byte is obtained, and according to the time interval of each frame on the first row array of the second data, the first frame data of each frame of the first row array is determined, and the first frame data of each frame of the first row array is written into the memory according to the offset of the first row array; or a bidirectional read pointer is initialized according to the first row array, and the remaining serialized arrays and the first row array are written into the memory through the bidirectional read pointer, and the data splicing of the remaining serialized arrays in the first data buffer and the second data buffer is completed during the writing process, and the data splicing length is equal to the preset length value.

[0068] Step S70, sequentially intercepting the arrays except the first row array in the serialized array in the second data according to the preset length value to obtain multiple segments of the second target array.

[0069] During the specific implementation of step 70, after completing the array concatenation, a bidirectional read pointer is loaded according to the first row of the array, and the bidirectional read pointer is loaded to the byte position backward of the first row of the array intercepted from the second data, and the bidirectional read pointer accumulates the length from the first byte address of the serialized array of the second data to the last byte, and calculates the length value of the serialized array in the second data, and intercepts the calculated length value of the serialized array in the second data according to the preset length value to obtain multiple segments of the second target array.

[0070] Step S80, in each clock cycle, the obtained multiple segments of the second target array are written into the memory in sequence.

[0071] During the specific implementation of step 80, the second data buffer responds to the transmission instruction issued by the control unit, and starts from the first byte address of each segment of the second target array at the beginning of each clock cycle of the clock controller, and uses an addressing function or a random function to accumulate from the first address of each segment of the second target array to the tail byte of the array to obtain the number of bytes of each segment of the second target array. According to the number of bytes of each segment of the second target array, the time interval of each frame on the bytes of each segment of the second target array is calculated, that is, the number of bytes of each segment of the second target array and the data of each frame are obtained, and then each segment of the second target array is sequentially written into the memory in the form of a data stream, and a random access function is used here to return from the tail byte of each segment of the second target array to the starting position of the second target array to be written.

[0072] In a feasible implementation scheme, in the above step S10, in response to the first operation instruction of the control unit, the serialized array of the first data in the navigation data packet is written into the first data buffer, and the navigation data packet carries the telemetry data acquired by the ground-based onboard computer through the satellite downlink, including:

[0073] Step 101, when a first data buffer is in a writing state, first data is read from a navigation data packet in a timed query manner.

[0074] Step 102: Encode the read first data to generate a serialized array of the first data.

[0075] Step 103, write the serialized array of the first data into the first data buffer according to the first write pointer and the first write offset in the first data buffer, the first write pointer indicates the first byte address of the first data in the navigation data packet, and the first write offset indicates the moving distance of the serialized array from the first byte address of the first data to each frame.

[0076] During the specific implementation of steps 101, 102, and 103, the control unit determines whether the first data buffer satisfies the data writing requirements, first obtains the status value of the login identifier from the first data buffer, if the status value of the current login identifier of the first data buffer is 0, it indicates that the first data buffer is in a writing state, and according to the read instruction of the control unit, loads the first write pointer to the first byte of the first data, reads the first data from the first byte of the first data to the last byte, encodes the read first data according to the encoder inside the control unit, generates a serialized array of the first data, loads the first write pointer in the first data buffer to the first byte address of the first data in an addressing manner, accumulates the serialized array from the first byte address of the first data until the last byte of the serialized array is reached, that is, obtains the write shift of the current first data from the first address to the serialized array of the accumulated first data, and writes the serialized array of the first data into the first data buffer according to the first write pointer and the first write offset, wherein the first navigation data packet is the telemetry data acquired by the satellite through the downlink at different times.

[0077] For example: the ground-based onboard computer includes a first data buffer and a second data buffer, where bufflag represents the usage status of the login identifiers of the two data buffers. If the status value of the login identifier of the first data buffer, i.e., bufflag=0, the first data buffer meets the write requirement. If the status value of the login identifier of the first data buffer is not bufflag≠0, then jump to the second data buffer.

[0078] In a feasible implementation scheme, in the above step S20, the serialized array of the first data is intercepted according to the preset length value to obtain multiple segments of the first target array and the remaining serialized array less than the preset length value, including:

[0079] Step 201, accumulate the total length of the serialized array of the first data to obtain a first target length value.

[0080] Step 202 , truncating the first target length value of the serialized array according to the preset length value to obtain a plurality of first target array segments equal to the preset length value and a remaining serialized array less than the preset length value.

[0081] During the specific implementation of steps 201 and 202, the first write pointer in the first data buffer is loaded to the first byte address of the serialized array of the first data, and the address is used as the write address of the first data. The data is accumulated from the first byte address of the serialized array to the tail byte of the serialized array. The total length of the serialized array of the first data is calculated using a random function or a hash function. According to the calculated total length, the first target length value corresponding to the serialized array of the first data is determined. According to the preset length value, the first byte address of the serialized array of the first data is used as the starting position, and the serialized array of the first data is truncated into multiple first target arrays of equal length to the preset length value. Meanwhile, the tail data of the serialized array that is less than the preset length value is used as the remaining serialized array.

[0082] In a feasible implementation scheme, in the above step S30, in each clock cycle, the obtained multiple segments of the first target array are sequentially written into the memory, including:

[0083] Step 301, responding to the transmission instruction of the control unit, at the beginning of each clock cycle, starting from the first byte address of the multiple first target arrays, each segment of the first target array is read sequentially.

[0084] Step 302, sequentially write each segment of the read first target array into the memory in the form of a data stream.

[0085] During the specific implementation of steps 301 and 302, the first data buffer responds to the transmission instruction issued by the control unit, and starts by sequentially reading the current first byte address from the multiple first target arrays at the beginning of each clock cycle of the clock controller, and uses the addressing function to accumulate from the first address of each first target array to the last byte of the array to obtain the number of bytes of each first target array, and calculates the time interval of each frame on the bytes of each first target array according to the number of bytes of each first target array, that is, the number of bytes of each first target array The data of each frame is obtained, and then each first target array is sequentially written into the memory in the form of a data stream. Here, a random access function is used to return from the last byte of each first target array to the starting position of the first target array to be written.

[0086] In a feasible implementation scheme, in the above step S40, in response to the second operation instruction of the control unit, the serialized array of the second data in the newly received navigation data packet is written into the second data buffer, and the new navigation data packet carries the telemetry data acquired by the ground-based onboard computer through the satellite downlink, including:

[0087] Step 401, when the second data buffer is in a writing state, second data is read from a new navigation data packet in a timed query manner.

[0088] Step 402: Encode the read second data to generate a serialized array of the second data.

[0089] Step 403, write the serialized array of the second data into the second data buffer according to the second write pointer and the second write offset in the second data buffer, the second write pointer indicates the first byte address of the second data in the new navigation data packet, and the second write offset indicates the moving distance from the first byte address of the second data to the serialized array of each frame.

[0090] In the specific implementation of steps 401, 402, and 403, the control unit first determines whether the first data buffer and the second data buffer meet the data writing requirements, and the control unit obtains the status value of the login identifier from the first data buffer. If the status value of the login identifier of the first data buffer is 0, the writing requirements are met; if the status value of the login identifier of the first data buffer is not 0, the writing requirements are met. Then jump to the second data buffer, the control unit obtains the status value of the login identifier from the second data buffer, if the status value of the login identifier of the second data buffer is 0, the writing requirement is met, the second write pointer is loaded to the first byte of the second data, the second data is read from the first byte of the second data to the last byte, the read second data is encoded according to the encoder inside the control unit, a serialized array of the second data is generated, the second write pointer in the second data buffer is loaded to the first byte address of the second data in an addressing manner, the serialized array is accumulated from the first byte address of the second data until the last byte of the serialized array is reached, that is, the write shift of the current second data from the first address to the serialized array of the accumulated second data is obtained, and the serialized array of the second data is written into the second data buffer according to the second write pointer and the second write offset, wherein the second data can be the telemetry data acquired by the ground-based satellite computer at different times.

[0091] For example: a ground-based satellite computer includes a first data buffer and a second data buffer, where bufflag represents the usage status of the login identifiers of the two data buffers. If the status value of the login identifier of the first data buffer, i.e., bufflag=0, the first data buffer meets the write requirement. If the status value of the login identifier of the first data buffer, bufflag=1, the first data buffer does not meet the write requirement, and jumps to the second data buffer. The control unit determines that the second data buffer obtains the status value bufflag of the login identifier. If the status value of the login identifier of the second data buffer, bufflag=0, the second data buffer meets the write requirement. If the status value of the login identifier of the second data buffer, bufflag=1, the second data buffer does not meet the write requirement.

[0092] In a feasible implementation scheme, in the above step S50, according to the difference between the preset length value and the length value of the remaining serialized array in the first data, the first row array equal to the difference is intercepted from the header of the second data, including:

[0093] Step 501, obtaining the length value of the remaining serialized array in the first data.

[0094] Step 502: Calculate the difference between the length value of the remaining serialized array in the first data and the preset length value.

[0095] Step 503: intercept the serialized array length value of the second array from the first byte of the second data according to the difference, and obtain a first row array with a length equal to the difference.

[0096] During the specific implementation of steps 501, 502, and 503, in response to the transmission instruction issued by the control unit, the first data buffer loads the first write pointer to the first byte of the remaining serialized array in the first data, and uses the addressing function to move the first write pointer from the current first byte address to the tail byte of the remaining serialized array for accumulation, calculates the length value of the remaining serialized array, and then subtracts the length value of the remaining serialized array from the preset length value to determine the difference between the two, and then loads the second write pointer in the second data buffer with the first byte address of the second data, and according to the difference between the preset length value and the length value of the remaining serialized array, intercepts the header array of the second data from the first byte address of the second data backward to obtain a first row array of the same length as the calculated difference.

[0097] In a feasible implementation scheme, in the above step S60, the remaining serialized array in the first data and the first row array intercepted from the header of the second data are sequentially written into the memory, including:

[0098] Step 601, determining the remaining frame data of each frame of the remaining serialized array according to the length of the bytes in the remaining serialized array.

[0099] Step 602, determining the first frame data of each frame in the first row of the array according to the length of the bytes in the first row of the array.

[0100] Step 603, write the remaining frame data of the remaining serialized array and the first frame data of the first row array intercepted by the second data header into the memory in sequence.

[0101] In the specific implementation of steps 601, 602, and 603, the first write pointer in the first data buffer is loaded with the first byte address of the remaining serialized array in the first data, and the first write pointer moves from the current first byte address to the last byte of the remaining serialized array to perform byte accumulation to obtain the number of bytes of the remaining serialized array in the first data, that is, to obtain the offset of the movement from the first byte address to the last byte of the remaining serialized array. According to the time interval of each frame on the number of bytes of the remaining serialized array in the first data, the remaining frame data of the remaining serialized array in the first data is determined, and the remaining frame data of each transmission frame is written into the memory according to the offset of the remaining serialized array. After completing the writing of the remaining serialized array in the first data, the second write pointer in the second data buffer is then Load the first byte address of the second data, intercept the header array of the second data from the first byte address of the second data to obtain the first row array of the second array, obtain the offset of the movement from the first byte address of the first row array to the tail byte according to the number of bytes in the first row array, determine the first frame data of each frame of the first row array according to the time interval of each frame on the first row array of the second data, and write the first frame data of each frame of the first row array into the memory according to the offset of the first row array; or initialize a bidirectional read pointer according to the first row array, write the remaining serialized arrays and the first row array into the memory through the bidirectional read pointer, and complete the data splicing of the remaining serialized arrays in the first data buffer and the second data buffer during the writing process, and the data splicing length is equal to the preset length value.

[0102] In a feasible implementation scheme, in the above step S70, the remaining serialized array in the first data and the first row array intercepted from the header of the second data are sequentially written into the memory, including:

[0103] Step 701, read the serialized array of the second data from the byte position of the serialized array of the second data except the first row of the array.

[0104] Step 702: Accumulate the total length of the serialized array of the second data to obtain a second target length value.

[0105] Step 703: intercept the second target length value of the serialized array according to the preset length value to obtain multiple segments of the second target array equal to the preset length value.

[0106] During the specific implementation of steps 701, 702, and 703, the byte positions in the serialized array of the second data except the byte position after the first row of the array are used as the write address, a bidirectional read pointer is loaded according to the first row of the array, and the bidirectional read pointer is loaded to the byte position after the first row of the array of the second data, and the bidirectional read pointer is moved from the first byte address of the serialized array of the second data to the last byte for accumulation to obtain the number of bytes of the serialized array of the second data, and the length value of the serialized array in the second data is calculated according to the number of bytes of the serialized array, and the calculated length value of the serialized array in the second data is intercepted according to a preset length value to intercept into multiple segments of a second target array equal to the preset length value.

[0107] In a feasible implementation, in the above step S80, in each clock cycle, each segment of the second target array is sequentially written into the memory, including:

[0108] Step 801, responding to the transmission instruction of the control unit, at the beginning of each clock cycle, starting from the first byte address of the multiple segments of the second target array, each segment of the second target array is read sequentially.

[0109] Step 802, writing each segment of the read second target array into the memory in sequence in the form of a data stream.

[0110] During the specific implementation of steps 801 and 802, the second data buffer responds to the transmission instruction issued by the control unit, and starts by sequentially reading the current first byte address from the multiple second target arrays at the beginning of each clock cycle of the clock controller, and uses an addressing function or a random function to accumulate from the first address of each second target array to the tail byte of the array to obtain the number of bytes of each second target array. According to the number of bytes of each second target array, the time interval of each frame on the bytes of each second target array is calculated, that is, the number of bytes of each second target array is obtained. Each frame of data is then written into the memory in sequence in the form of a data stream. Here, a random access function is used to return from the tail byte of each second target array to the starting position of the second target array to be written.

[0111] In one possible implementation, Figure 3 A schematic diagram showing a specific embodiment of a data writing method provided in an embodiment of the present application;

[0112] Embodiment: Two data buffers are arranged in a ground-based satellite computer, a first data buffer is provided with a first write pointer and a first write offset, and a second data buffer is provided with a second write pointer and a second write offset respectively. A control unit determines whether the login identifiers of the two data buffers meet the usage status. If the status value bufflag=0 of the login identifier of the first data buffer, the writing requirement is met. First, the first write pointer is loaded to the first byte of the first data, and the first data is read from the first byte of the first data to the last byte. The read first data is encoded according to an encoder inside the control unit to generate a serialized array of the first data. The serialized array is accumulated from the first byte address of the first data until the last byte of the serialized array is reached to obtain the write shift of the current first data from the first address to the serialized array of the accumulated first data. The control unit writes the serialized array of the first data into the first data buffer according to the first write pointer and the first write offset, and modifies the status value of the login identifier of the first data buffer to bufflag=1; loads the first write pointer in the first data buffer to the first byte address of the serialized array of the first data, moves backward from the first byte address of the serialized array to the tail byte of the serialized array for accumulation, determines the first target length value corresponding to the serialized array of the first data, and intercepts the serialized array of the first data from the first byte address of the serialized array of the first data as the starting position according to the preset length value, and intercepts it into multiple segments of the first target array with the same length as the preset length value, and writes the multiple segments of the first target array into the memory in sequence in the form of a data stream, and temporarily stores the remaining serialized arrays in the first data less than the preset length value in the first data buffer;

[0113] Then, when the ground onboard computer receives a new navigation data packet again, the control unit determines whether the status value of the login identifier of the second data buffer satisfies the write status. If the status value bufflag of the login identifier of the second data buffer is 0, the second data buffer satisfies the write requirement, and the second write pointer is loaded to the first byte of the second data. The second data is read from the first byte of the second data to the last byte. The read second data is encoded according to the encoder inside the control unit to generate a serialized array of the second data. The serialized array is accumulated from the first byte address of the second data until the last byte of the serialized array is reached. The write shift of the current second data from the first address to the serialized array of the accumulated second data is obtained, and the serialized array of the second data is written into the second data buffer according to the second write pointer and the second write offset. Then, the first write pointer in the first data buffer is loaded with the first The first byte address of the remaining serialized array in the data, the first write pointer moves from the current first byte address to the last byte of the remaining serialized array to perform byte accumulation, and obtains the number of bytes of the remaining serialized array in the first data. The number of bytes of the remaining serialized array is used as the offset of the movement from the first byte address to the last byte of the remaining serialized array. The remaining frame data of each transmission frame is written into the memory according to the offset of the remaining serialized array. After completing the writing of the remaining serialized array in the first data, the header array of the second data is intercepted from the first byte address of the second data to obtain the first row array of the second array. According to the number of bytes of the first row array, the offset of the movement from the first byte address to the last byte of the first row array is obtained. According to the offset of the first row array, the first frame data of each frame of the first row array is written into the memory. In the writing process, the data splicing of the remaining serialized array in the first data buffer and the second data buffer is completed;

[0114] Finally, the byte position after the first row of the serialized array in the second data is used as the write address, and the bidirectional read pointer moves from the first byte address of the serialized array of the second data to the last byte for accumulation to obtain the number of bytes of the serialized array of the second data, and the length value of the serialized array in the second data is calculated according to the number of bytes of the serialized array, and the calculated length value of the serialized array in the second data is intercepted according to a preset length value to obtain multiple segments of the second target array, and then each segment of the second target array is sequentially written into the memory in the form of a data stream.

[0115] Corresponds to Figure 1 The data writing method in the present application embodiment also provides a computer device 90, such as Figure 4 As shown, the device includes a memory 901, a processor 902, and a computer program stored in the memory 901 and executable on the processor 902, wherein the processor 902 implements the method when executing the computer program.

[0116] In response to a first operation instruction of the control unit, a serialized array of first data in a navigation data packet is written into a first data buffer, wherein the navigation data packet carries telemetry data acquired by a ground-based onboard computer through a satellite downlink;

[0117] The serialized array of the first data is intercepted according to a preset length value to obtain a plurality of first target arrays and a remaining serialized array less than the preset length value;

[0118] In each clock cycle, the obtained multiple segments of the first target array are sequentially written into the memory respectively;

[0119] In response to a second operation instruction of the control unit, a serialized array of second data in a newly received navigation data packet is written into a second data buffer, wherein the new navigation data packet carries telemetry data acquired by a ground-based onboard computer through a satellite downlink;

[0120] According to the difference between the preset length value and the length value of the remaining serialized array in the first data, intercepting the first row array equal to the difference from the header of the second data;

[0121] Writing the remaining serialized array in the first data and the first row array intercepted from the second data header into the memory in sequence to complete the splicing of the remaining serialized array and the first row array intercepted from the second data header;

[0122] Sequentially intercepting the arrays except the first row array in the serialized array in the second data according to the preset length value to obtain multiple segments of the second target array;

[0123] In each clock cycle, the obtained multiple segments of the second target array are written into the memory in sequence.

[0124] Corresponds to Figure 1 The data writing method in the embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to perform the following steps:

[0125] In response to a first operation instruction of the control unit, a serialized array of first data in a navigation data packet is written into a first data buffer, wherein the navigation data packet carries telemetry data acquired by a ground-based onboard computer through a satellite downlink;

[0126] The serialized array of the first data is intercepted according to a preset length value to obtain a plurality of first target arrays and a remaining serialized array less than the preset length value;

[0127] In each clock cycle, the obtained multiple segments of the first target array are sequentially written into the memory respectively;

[0128] In response to a second operation instruction of the control unit, a serialized array of second data in a newly received navigation data packet is written into a second data buffer, wherein the new navigation data packet carries telemetry data acquired by a ground-based onboard computer through a satellite downlink;

[0129] According to the difference between the preset length value and the length value of the remaining serialized array in the first data, intercepting the first row array equal to the difference from the header of the second data;

[0130] Writing the remaining serialized array in the first data and the first row array intercepted from the second data header into the memory in sequence to complete the splicing of the remaining serialized array and the first row array intercepted from the second data header;

[0131] Sequentially intercepting the arrays except the first row array in the serialized array in the second data according to the preset length value to obtain multiple segments of the second target array;

[0132] In each clock cycle, the obtained multiple segments of the second target array are written into the memory in sequence.

[0133] Based on the above analysis, it can be seen that compared with the related art in which blank data needs to be filled when the writing length of the remaining frame data cannot meet the writing length requirement, the ground-based satellite computer provided in the embodiment of the present application writes the navigation data packet into the first data buffer and the second data buffer respectively according to the writing status of the first data buffer and the second data buffer, calculates the length of the written data through the two data buffers respectively, and then intercepts it according to the calculated length value to obtain the target array and the remaining sequence array that meet the writing requirements, and then writes the remaining serialized array and the new target array sequentially into the memory according to the write pointers and write shifts set in the two data buffers to complete the splicing of the head and tail arrays, thereby realizing the separate storage of the remaining sequence array and the new target array and the splicing of the head and tail data through the two data buffers, avoiding the problem of forward copying of the remaining sequence array and occupying storage space, improving the operating efficiency of the memory, and saving spectrum resources for satellite-to-ground communications.

[0134] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0135] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0136] In addition, each functional unit in the embodiments provided in the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0137] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.

[0138] It should be noted that similar numbers and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance.

[0139] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. They should all be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A data writing method, characterized in that: include: In response to a first operation instruction of the control unit, a serialized array of first data in a navigation data packet is written into a first data buffer, wherein the navigation data packet carries telemetry data acquired by a ground-based onboard computer through a satellite downlink; The serialized array of the first data is intercepted according to a preset length value to obtain a plurality of first target arrays and a remaining serialized array less than the preset length value; In each clock cycle, the obtained multiple segments of the first target array are sequentially written into the memory respectively; In response to a second operation instruction of the control unit, a serialized array of second data in a newly received navigation data packet is written into a second data buffer, wherein the new navigation data packet carries telemetry data acquired by a ground-based onboard computer through a satellite downlink; According to the difference between the preset length value and the length value of the remaining serialized array in the first data, intercepting the first row array equal to the difference from the header of the second data; Writing the remaining serialized array in the first data and the first row array intercepted from the second data header into the memory in sequence, so as to complete the concatenation of the remaining serialized array and the first row array intercepted from the second data header; Sequentially intercepting arrays other than the first row of arrays in the serialized array in the second data according to the preset length value to obtain multiple segments of second target arrays; In each clock cycle, the obtained multiple segments of the second target array are written into the memory in sequence.

2. The method according to claim 1, characterized in that Writing the serialized array of the first data in the navigation data packet into the first data buffer includes: When the first data buffer is in a writing state, reading first data from the navigation data packet in a timed query manner; Encode the read first data to generate a serialized array of the first data; According to the first write pointer and the first write offset in the first data buffer, the serialized array of the first data is written into the first data buffer; the first write pointer indicates the first byte address of the first data in the navigation data packet, and the first write offset indicates the moving distance of the serialized array from the first byte address of the first data to each frame.

3. The method according to claim 1, characterized in that The serialized array of the first data is intercepted according to a preset length value to obtain multiple segments of the first target array and a remaining serialized array less than the preset length value, including: Accumulating the total length of the serialized array of the first data to obtain the first target length value; The first target length value of the serialized array is truncated according to the preset length value to obtain a plurality of first target array segments equal to the preset length value and a remaining serialized array less than the preset length value.

4. The method according to claim 1, characterized in that In each clock cycle, the obtained multiple segments of the first target array are sequentially written into the memory, including: In response to the transmission instruction of the control unit, at the beginning of each clock cycle, starting from the first byte address of the plurality of segments of the first target array, each segment of the first target array is sequentially read; Each segment of the first target array read is sequentially written into the memory in the form of a data stream.

5. The method according to claim 1, characterized in that Writing the serialized array of the second data in the new navigation data packet received again into the second data buffer includes: When the second data buffer is in a writing state, reading second data from the new navigation data packet in a timed query manner; Encode the read second data to generate a serialized array of the second data; According to the second write pointer and the second write offset in the second data buffer, the serialized array of the second data is written into the second data buffer, the second write pointer indicates the first byte address of the second data in the new navigation data packet, and the second write offset indicates the moving distance from the first byte address of the second data to the serialized array of each frame.

6. The method according to claim 1, characterized in that According to the difference between the preset length value and the length value of the remaining serialized array in the first data, intercepting the first row array equal to the difference from the header of the second data, including: Obtain the length value of the remaining serialized array in the first data; Calculate the difference between the length value of the remaining serialized array in the first data and the preset length value; The serialized array length value of the second array is intercepted from the first byte of the second data according to the difference, to obtain a first row array having a length equal to the difference.

7. The method according to claim 1, characterized in that Writing the remaining serialized arrays in the first data and the first row array intercepted from the header of the second data into the memory in sequence, including: Determine the remaining frame data of each frame of the remaining serialized array according to the length of the bytes in the remaining serialized array; Determine the first frame data of each frame of the first row array according to the length of the bytes in the first row array; The remaining frame data of the remaining serialized array and the first frame data of the first row array intercepted by the second data header are written into the memory in sequence.

8. The method according to claim 1, characterized in that The arrays except the first row array in the serialized array in the second data are intercepted in sequence according to the preset length value to obtain multiple segments of the second target array, including: Read the serialized array of the second data from the byte position of the serialized array of the second data except the first row of the array; Accumulating the total length of the serialized array of the second data to obtain a second target length value; According to the preset length value, a second target length value of the serialized array is intercepted to obtain a plurality of second target array segments equal to the preset length value; In each clock cycle, each segment of the second target array is sequentially written into the memory, including: In response to the transmission instruction of the control unit, at the beginning of each clock cycle, each segment of the second target array is sequentially read starting from the first byte address of the plurality of segments of the second target array; Each segment of the second target array read is written into the memory in sequence in the form of a data stream.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are executed.

Citation Information

Patent Citations

  • Data reading and writing method for storage medium

    CN111708485A

  • Automatic testing method and device for servo system control software and storage medium

    CN112506759A