Data storage method, system and equipment based on circular queue and medium
By configuring the array queue in the control and control unit of the infrared guide, storage and sending telemetry data, the problem of not receiving or receiving multiple update data during the read cycle of the comprehensive control machine has been solved, and the remote test data is achieved stable. Effect.
Patent Information
- Application Number
- CN202411393942.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-01-28
AI Technical Summary
In the same periodic communication between the control and processing unit of the infrared seeker and the integrated control machine, it may occur that the integrated control machine does not receive updated information processing system telemetry data or receives two updated data in one reading cycle. , resulting in loss of telemetry data.
Configure a array queue in the control processing unit to store the remote test data from the information processing system. The receiving queue address and sending queue address are obtained by calculating the number of receivers and sending times, and the telemetry data is stored in the corresponding queue to ensure that the comprehensive controller can obtain the correct remote test data stably within the reading cycle.
Through several array of queue data storage, the shake and data loss of the comprehensive controller when reading the remote test data is avoided, and the synchronization of the communication system, the infrared guidance head control processing unit, and the comprehensive control machine are ensured.
Smart Images

Figure CN119383144A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of telemetry data technology, and in particular to a circular queue-based data storage method, system, device and medium. Background Art
[0002] The control and management processing unit in the infrared seeker needs to query in real time the telemetry data information sent by the information processing system at a certain time period. After receiving the telemetry data, the control and management processing unit updates the data information to the sending buffer of the integrated control machine. The integrated control machine reads the telemetry data of the information processing system in the buffer at the same time period to obtain relevant telemetry data information. Since the same cycle communication between the information processing system, the infrared seeker control and management processing unit and the integrated control machine does not have synchronous operation or handshake processing, under certain circumstances, the control and management unit of the integrated control machine may not receive the updated information processing system telemetry data or receive the updated information processing telemetry data twice within one reading cycle, which will cause the loss of information processing telemetry data. Summary of the invention
[0003] In view of the above-mentioned defects or deficiencies in the prior art, the present application aims to provide a method, system, device and medium for storing data based on a circular queue.
[0004] In a first aspect, the present application provides a method for storing data based on a circular queue, comprising the following steps: S100. Configuring an array queue in the control processing unit, the array queue includes a plurality of queues, each queue has a unique queue address, and the queue is used to store telemetry data sent from the information processing system; S200. Receive telemetry data and obtain the number of receptions and transmissions; S300. Calculate the receiving queue address according to the number of receptions; S400. Obtain the queue with the same queue address as the receiving queue address, record it as the receiving queue, store the telemetry data in the receiving queue, and increase the number of receptions by one; S500. Calculate the sending queue address according to the number of sending times; S600. Obtain the queue whose queue address is the same as the sending queue address, record it as the sending queue, send the telemetry data stored in the sending queue to the integrated control machine, and increase the number of sending times by one.
[0005] According to the technical solution provided in the embodiment of the present application, step S600 includes the following steps: S610. Send the telemetry data in the sending queue to a data buffer; S620. Send the telemetry data in the data buffer to the integrated control machine.
[0006] According to the technical solution provided in the embodiment of the present application, before step S300 and after step S200, the following steps are also included: S210. Determine whether the array queue is full, and obtain a first determination result or a second determination result, wherein the first determination result is that the array queue is not full, and the second determination result is that the array queue is full; S220. In response to the first judgment result, continue to execute steps S300-S600.
[0007] According to the technical solution provided in the embodiment of the present application, the following steps are also included after step S210: S230. In response to the second judgment result, stop receiving the telemetry data.
[0008] According to the technical solution provided in the embodiment of the present application, step S210 includes the following steps: S211. Obtain the maximum capacity of the array queue, the size of data that can be stored in each queue, and the difference between the number of receptions and the number of transmissions, recorded as the first difference; S212. Calculate the occupied capacity based on the first difference and the data size; S213. Determine the size of the occupied capacity and the maximum capacity. When the occupied capacity is smaller than the maximum capacity, the first determination result is obtained; when the occupied capacity is greater than or equal to the maximum capacity, the second determination result is obtained.
[0009] According to the technical solution provided in the embodiment of the present application, before step S500 and after step S400, the following steps are also included: S410. Determine whether the array queue is empty, and obtain a third determination result or a fourth determination result, wherein the third determination result is that the array queue is empty, and the fourth determination result is that the array queue is not empty; S420. In response to the fourth judgment result, continue to execute steps S500-S600.
[0010] According to the technical solution provided in the embodiment of the present application, step S410 includes the following steps: S411. Compare the number of receptions and the number of transmissions. If the number of receptions is greater than the number of transmissions, obtain the fourth judgment result. If the number of receptions is less than or equal to the number of transmissions, obtain the third judgment result.
[0011] In a second aspect, the present application provides a circular queue-based data storage system for implementing the circular queue-based data storage method as described above, the system comprising: A configuration module, the configuration module is used to configure an array queue in the management and control processing unit, the array queue includes a plurality of queues, each queue has a unique queue address, and the queue is used to store telemetry data sent from the information processing system; A first acquisition module, the first acquisition module is configured to receive telemetry data and obtain a reception number and a transmission number; A first calculation module, the first calculation module is configured to calculate a receiving queue address according to the number of reception times; A first receiving module, wherein the first receiving module is configured to obtain the queue whose queue address is the same as the receiving queue address, record it as the receiving queue, store the telemetry data in the receiving queue, and increase the number of reception times by one; A second calculation module, the second calculation module is configured to calculate a sending queue address according to the number of sending times; The first sending module is configured to obtain the queue whose queue address is the same as the sending queue address, recorded as the sending queue, and send the telemetry data stored in the sending queue to the integrated control machine, and the number of sending times is increased by one.
[0012] In a third aspect, the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the circular queue-based data storage method as described above when executing the computer program.
[0013] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the circular queue-based data storage method as described above are implemented.
[0014] In summary, the present application proposes a method for storing data based on a circular queue, by configuring an array queue including multiple queues in the control processing unit, calculating the receiving queue address and the sending queue address by the number of receiving times and the number of sending times, and storing the received telemetry data in the corresponding queue according to the receiving queue address, and sending the telemetry data in the corresponding queue to the integrated control machine according to the sending queue address. The present application can avoid jitter when the integrated control machine reads the telemetry data. Although the information processing system, the infrared seeker control processing unit and the integrated control machine have the same time period, the communication is not synchronized, which makes the reading time lag or advance, resulting in the reading of two data or data loss. By means of array queue data storage, it is ensured that the integrated control machine can stably obtain the correct telemetry data within the reading cycle. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A flowchart of a circular queue data storage method provided in an embodiment of the present application; Figure 2 A schematic diagram of the structure of the terminal device provided for this application.
[0016] The text annotations in the figure represent: 700. Computer system; 701. CPU; 702. ROM; 703. RAM; 704. Bus; 705. I / O interface; 706. Input part; 707. Output part; 708. Storage part; 709. Communication part; 710. Drive; 711. Removable media. DETAILED DESCRIPTION
[0017] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It is also necessary to explain that, for ease of description, only the parts related to the invention are shown in the accompanying drawings.
[0018] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0019] Example 1 As the technical problem mentioned in the background technology, this application proposes a data storage method based on a circular queue, such as Figure 1 As shown, the following steps are included: S100. Configuring an array queue in the control processing unit, the array queue comprises multiple queues, each queue has a unique queue address, and the queue is used to store telemetry data sent from the information processing system; Among them, this method is executed on the control and management processing unit of the infrared guidance head, the input end of the control and management processing unit is connected to the output end of the information processing system, and is used to receive the telemetry data sent by the information processing system with a certain time period; the output end of the control and management unit is connected to the input end of the integrated control machine, and the integrated control machine reads the data of the control and management processing unit with the same time period.
[0020] First, the array queue is initialized, the number of queues and the size of data that can be stored in each queue are set, wherein the size of data that can be stored in the queue depends on the telemetry data. For example, if the telemetry data received each time is 64 bytes, the capacity of the queue is set to 64 bytes, that is, it can store one telemetry data; and the number of bytes that the queue pointer jumps each time is the same as the size of data stored in each queue, that is, the queue pointer jumps 64 bytes each time and jumps to the position of the next queue.
[0021] S200. Receive telemetry data and obtain the number of receptions and transmissions; The control processing unit includes a first counting unit and a second counting unit. The first counting unit is used to record the number of times the telemetry data has been received, and the second counting unit is used to record the number of times the telemetry data has been sent.
[0022] Before step S300 and after step S200, the following steps are also included: S210. Determine whether the array queue is full, and obtain a first determination result or a second determination result, wherein the first determination result is that the array queue is not full, and the second determination result is that the array queue is full; comprising the following steps: S211. Obtain the maximum capacity of the array queue, the size of data that can be stored in each queue, and the difference between the number of receptions and the number of transmissions, recorded as the first difference; Among them, according to the number of queues and the capacity of each queue, the maximum capacity of the entire array queue can be obtained. For example, the data size that each queue can store is 64 bytes, and if there are 10 queues, the maximum capacity is 640 bytes.
[0023] S212. Calculate the occupied capacity based on the first difference and the data size; The occupied capacity is obtained by multiplying the first difference and the data size. For example, if the first difference is 2, the occupied capacity is 2*64=128.
[0024] S213. Determine the size of the occupied capacity and the maximum capacity. When the occupied capacity is smaller than the maximum capacity, the first determination result is obtained; when the occupied capacity is greater than or equal to the maximum capacity, the second determination result is obtained.
[0025] S220. In response to the first judgment result, continue to execute steps S300-S600.
[0026] Among them, taking the first difference value of 2 as an example, the occupied capacity is 128, which is less than 640, and there is still some space left in the array queue for storing the telemetry data, so continue to execute the subsequent steps.
[0027] S230. In response to the second judgment result, stop receiving the telemetry data.
[0028] When the communication between the control and management processing unit of the infrared guidance head and the integrated control machine is interrupted, but the communication with the information processing system is good, the control and management processing unit always receives the telemetry data periodically sent by the information processing system, but the integrated control machine cannot read data from the control and management processing unit, so that the array queue is full and no longer receives telemetry data; therefore, this can avoid the problem of data overflow caused by the control and management processing unit thinking that it is continuously receiving telemetry data sent by the information processing system when the communication between the integrated control machine and the control and management processing unit is interrupted, thereby causing program running errors.
[0029] S300. Calculate the receiving queue address according to the number of receptions; For example, there are ten queues, including the first queue, the second queue...the tenth queue, and the storage order is from one to ten. The queue pointer includes a storage pointer and a read pointer. The storage pointer first points to the first queue. When the tenth queue stores data, since the order of reading data is the same as the storage, both start from the first queue. When the occupied capacity is less than the maximum capacity, at least the first queue does not store data, and the received eleventh telemetry data is stored in the first queue for circular storage; therefore, the specified queue can be obtained by the number of receptions and the number of queues, and then the address of the queue is obtained, which is the receiving queue address. Each time a telemetry data is stored, the storage pointer jumps to the next queue position, and the address of the queue pointed to by the storage pointer is the receiving queue address.
[0030] S400. Obtain the queue with the same queue address as the receiving queue address, record it as the receiving queue, store the telemetry data in the receiving queue, and increase the number of receptions by one; The telemetry data is stored in the queue, the number of receptions is increased by one, and the storage pointer jumps to the next queue.
[0031] Before step S500 and after step S400, the following steps are also included: S410. Determine whether the array queue is empty, and obtain a third determination result or a fourth determination result, wherein the third determination result is that the array queue is empty, and the fourth determination result is that the array queue is not empty; comprising the following steps: S411. Compare the number of receptions and the number of transmissions. If the number of receptions is greater than the number of transmissions, obtain the fourth judgment result. If the number of receptions is less than or equal to the number of transmissions, obtain the third judgment result.
[0032] S420. In response to the fourth judgment result, continue to execute steps S500-S600.
[0033] That is, the control unit receives more data than the sent data, so the array queue is not empty and the telemetry data is still stored, so the reading operation continues, that is, the subsequent steps continue.
[0034] S500. Calculate the sending queue address according to the number of sending times; The order of reading data from the array queue is the same as the order of storing data. Taking the first to tenth queues as an example, the first queue at the head of the queue is read first, and the read pointer first points to the first queue. Each time a data is read out, the read pointer jumps to the next queue, and the queue address is the sending queue address. S600. Obtain the queue whose queue address is the same as the sending queue address, record it as the sending queue, send the telemetry data stored in the sending queue to the integrated control machine, and increase the number of sending times by one. It includes the following steps: S610. Send the telemetry data in the sending queue to a data buffer; Optionally, the present application adopts a 1553B bus for data communication, and the 1553B system has a data buffer for avoiding data loss.
[0035] S620. Sending the telemetry data in the data buffer to the integrated control machine; In summary, this application can avoid jitter when the integrated control machine reads telemetry data. Although the information processing system, infrared seeker control processing unit and integrated control machine have the same time period, the communication is not synchronized, which makes the reading time lag or advance, resulting in reading two data or data loss. By storing data in an array queue, it is ensured that the integrated control machine can stably obtain correct telemetry data within the reading cycle.
[0036] Example 2 Based on Example 1, the present application provides a circular queue data storage system for implementing the circular queue data storage method described above, the system comprising: A configuration module, the configuration module is used to configure an array queue in the management and control processing unit, the array queue includes a plurality of queues, each queue has a unique queue address, and the queue is used to store telemetry data sent from the information processing system; A first acquisition module, the first acquisition module is configured to receive telemetry data and obtain a reception number and a transmission number; A first calculation module, the first calculation module is configured to calculate a receiving queue address according to the number of reception times; A first receiving module, wherein the first receiving module is configured to obtain the queue whose queue address is the same as the receiving queue address, record it as the receiving queue, store the telemetry data in the receiving queue, and increase the number of reception times by one; A second calculation module, the second calculation module is configured to calculate a sending queue address according to the number of sending times; The first sending module is configured to obtain the queue whose queue address is the same as the sending queue address, recorded as the sending queue, and send the telemetry data stored in the sending queue to the integrated control machine, and the number of sending times is increased by one.
[0037] Example 3 like Figure 2As shown, the computer system 700 of the terminal device includes a CPU 701, which can perform various appropriate actions and processes according to the program stored in the ROM 702 or the program loaded from the storage part 708 to the RAM 703. In the RAM 703, various programs and data required for system operation are also stored. The CPU 701, the ROM 702 and the RAM 703 are connected to each other through the bus 704. The I / O interface 705 is also connected to the bus 704. The following components are connected to the I / O interface 705: an input part 706 including a keyboard, a mouse, etc.; an output part 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage part 708 including a hard disk, etc.; and a communication part 709 including a network interface card such as a LAN card, a modem, etc. The communication part 709 performs communication processing via a network such as the Internet. The drive is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like, is mounted on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed.
[0038] In particular, according to the embodiments of the present application, the above reference process Figure 1 The described process can be implemented as a computer software program. For example, embodiment 3 of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by CPU 701, the above-mentioned functions defined in the present computer system 700 are executed.
[0039] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0040] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments 3 of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0041] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the circular queue data storage method described in the above embodiment.
[0042] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with (but not limited to) technical features with similar functions disclosed in the present application.
Claims
1. A method for storing data based on a circular queue, characterized in that: The steps include: S100. Configuring an array queue in the control processing unit, the array queue includes a plurality of queues, each queue has a unique queue address, and the queue is used to store telemetry data sent from the information processing system; S200. Receive telemetry data and obtain the number of receptions and transmissions; S300. Calculate the receiving queue address according to the number of receptions; S400. Obtain the queue with the same queue address as the receiving queue address, record it as the receiving queue, store the telemetry data in the receiving queue, and increase the number of receptions by one; S500. Calculate the sending queue address according to the number of sending times; S600. Obtain the queue whose queue address is the same as the sending queue address, record it as the sending queue, send the telemetry data stored in the sending queue to the integrated control machine, and increase the number of sending times by one.
2. The method for storing data based on a circular queue according to claim 1, characterized in that: Step S600 includes the following steps: S610. Send the telemetry data in the sending queue to a data buffer; S620. Send the telemetry data in the data buffer to the integrated control machine.
3. The method for storing data based on a circular queue according to claim 1, characterized in that: Before step S300 and after step S200, the following steps are also included: S210. Determine whether the array queue is full, and obtain a first determination result or a second determination result, wherein the first determination result is that the array queue is not full, and the second determination result is that the array queue is full; S220. In response to the first judgment result, continue to execute steps S300-S600.
4. The method for storing data based on a circular queue according to claim 3, characterized in that: After step S210, the following steps are also included: S230. In response to the second judgment result, stop receiving the telemetry data.
5. The method for storing data based on a circular queue according to claim 3, characterized in that: Step S210 includes the following steps: S211. Obtain the maximum capacity of the array queue, the size of data that can be stored in each queue, and the difference between the number of receptions and the number of transmissions, recorded as the first difference; S212. Calculate the occupied capacity based on the first difference and the data size; S213. Determine the size of the occupied capacity and the maximum capacity. When the occupied capacity is less than the maximum capacity, the first determination result is obtained; When the occupied capacity is greater than or equal to the maximum capacity, the second judgment result is obtained.
6. The method for storing data based on a circular queue according to claim 1, characterized in that: Before step S500 and after step S400, the following steps are also included: S410. Determine whether the array queue is empty, and obtain a third determination result or a fourth determination result, wherein the third determination result is that the array queue is empty, and the fourth determination result is that the array queue is not empty; S420. In response to the fourth judgment result, continue to execute steps S500-S600.
7. The method for storing data based on a circular queue according to claim 5, characterized in that: Step S410 includes the following steps: S411. Compare the number of receptions and the number of transmissions. If the number of receptions is greater than the number of transmissions, obtain the fourth judgment result. If the number of receptions is less than or equal to the number of transmissions, obtain the third judgment result.
8. A circular queue data storage system, used to implement the circular queue data storage method according to any one of claims 1 to 6, characterized in that: The system comprises: A configuration module, the configuration module is used to configure an array queue in the management and control processing unit, the array queue includes a plurality of queues, each queue has a unique queue address, and the queue is used to store telemetry data sent from the information processing system; A first acquisition module, the first acquisition module is configured to receive telemetry data and obtain a reception number and a transmission number; A first calculation module, the first calculation module is configured to calculate a receiving queue address according to the number of reception times; A first receiving module, wherein the first receiving module is configured to obtain the queue whose queue address is the same as the receiving queue address, record it as the receiving queue, store the telemetry data in the receiving queue, and increase the number of reception times by one; A second calculation module, the second calculation module is configured to calculate a sending queue address according to the number of sending times; The first sending module is configured to obtain the queue whose queue address is the same as the sending queue address, recorded as the sending queue, and send the telemetry data stored in the sending queue to the integrated control machine, and the number of sending times is increased by one.
9. A terminal 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 circular queue-based data storage method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the circular queue-based data storage method according to any one of claims 1 to 7 are implemented.