Data block configuration method, device, computer equipment, storage medium and computer program product
By obtaining and updating the data block allocation algorithm of the remote terminal sub-address, the cumbersome problem of data block allocation for the remote terminal of the 1553B bus is solved, and efficient data block management and transmission data storage are achieved.
Patent Information
- Application Number
- CN202410687736.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-05-30
AI Technical Summary
In the prior art, the data block allocation process of the 1553B bus remote terminal is cumbersome and inefficient, resulting in inconvenience in the management of transmitted data.
By obtaining the number of allocated data blocks corresponding to multiple sub-addresses of the target remote terminal and allocating data blocks one by one in the priority order of the sub-addresses, the data block allocation algorithm is used to update the number of the data block to be allocated to determine the allocated data block when the number of allocated data blocks corresponding to the sub-address is 1 or greater than 1.
It improves the simplicity and efficiency of data block allocation, ensures the accurate storage of transmitted data, and simplifies the data block management process.
Smart Images

Figure CN118784620B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data block configuration method, apparatus, computer equipment, storage medium, and computer program product. Background Art
[0002] For the remote terminal of the 1553B bus, it is usually necessary to perform memory management on the transmission data sent / received by the remote terminal. That is, based on the transmission data, data blocks are allocated to multiple sub-addresses of the remote terminal so that the transmission data of the sub-address is stored in the specified data block to ensure that the transmission content is not lost or erroneous.
[0003] In current technology, data blocks are generally allocated manually, which is cumbersome and inefficient. Summary of the Invention
[0004] Based on this, it is necessary to provide a data block configuration method, device, computer equipment, storage medium and computer program product that can improve data block configuration efficiency and simplicity in response to the above technical problems.
[0005] In a first aspect, the present application provides a data block configuration method. The method comprises:
[0006] Obtaining the number of allocated data blocks corresponding to each of the plurality of sub-addresses of the target remote terminal;
[0007] Allocating data blocks that satisfy the corresponding number of allocated data blocks to each of the sub-addresses one by one according to the priority order of the plurality of sub-addresses;
[0008] In a case where the number of allocated data blocks corresponding to a sub-address is 1, allocating a data block corresponding to a current data block number to be allocated to the sub-address, and updating the current data block number to be allocated;
[0009] When the number of allocated data blocks allocated to a sub-address is greater than 1, the allocated data block of the sub-address is determined according to the current data block number to be allocated and the number of allocated data blocks, and the current data block number to be allocated is updated.
[0010] In one embodiment, obtaining the number of allocated data blocks corresponding to each of the multiple sub-addresses of the target remote terminal includes: obtaining the data length value of the transmission data of each of the multiple sub-addresses; converting the data length value into binary form to obtain a binary length value corresponding to the data length value; and obtaining the number of allocated data blocks corresponding to each of the multiple sub-addresses of the target remote terminal based on the binary length value.
[0011] In one embodiment, obtaining the number of allocated data blocks corresponding to each of the multiple sub-addresses of the target remote terminal based on the binary length value includes: determining the number of preset digits in the binary length value; and determining the number of allocated data blocks based on the number of preset digits.
[0012] In one embodiment, determining the allocated data block of the sub-address based on the current data block number to be allocated and the number of allocated data blocks includes: determining a first allocation parameter corresponding to the sub-address based on the number of allocated data blocks; determining a parameter value of a second allocation parameter corresponding to the sub-address based on the first allocation parameter and the current data block number to be allocated; and determining the allocated data block of the sub-address based on the parameter value of the second allocation parameter.
[0013] In one embodiment, the step of determining the allocated data block of the sub-address according to the parameter value of the second allocation parameter includes: when the parameter value of the second allocation parameter does not meet the preset data block allocation condition, taking the next data block number of the current data block number to be allocated as the new current data block number to be allocated; arranging the data block numbers of the data blocks to be allocated from small to large; executing the step of determining the parameter value of the second allocation parameter corresponding to the sub-address according to the first allocation parameter and the current data block number to be allocated until the parameter value of the second allocation parameter meets the preset data block allocation condition; determining the last data block number in the allocated data block according to the parameter value of the second allocation parameter; arranging the data block numbers in the allocated data block from small to large; and determining the allocated data block of the sub-address according to the last data block number and the number of allocated data blocks.
[0014] In one embodiment, determining the parameter value of the second allocation parameter corresponding to the sub-address based on the first allocation parameter and the current data block number to be allocated includes: determining the parameter value of the second allocation parameter corresponding to the sub-address based on the sum of the parameter value of the first allocation parameter and the current data block number to be allocated.
[0015] In a second aspect, the present application provides a data block configuration device. The device includes:
[0016] a calculation module, configured to obtain the number of allocated data blocks corresponding to each of the plurality of sub-addresses of the target remote terminal;
[0017] a first allocating module, configured to allocate data blocks satisfying the corresponding number of allocated data blocks to each of the sub-addresses one by one according to the priority order of the plurality of sub-addresses;
[0018] A second allocation module is configured to allocate a data block corresponding to a current data block number to be allocated to the sub-address when the number of allocated data blocks corresponding to the sub-address is 1, and update the current data block number to be allocated;
[0019] The third allocation module is used to determine the allocated data block of the sub-address according to the current data block number to be allocated and the number of allocated data blocks when the number of allocated data blocks allocated to the sub-address is greater than 1, and to update the current data block number to be allocated.
[0020] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are performed:
[0021] Obtaining the number of allocated data blocks corresponding to each of the plurality of sub-addresses of the target remote terminal;
[0022] Allocating data blocks that satisfy the corresponding number of allocated data blocks to each of the sub-addresses one by one according to the priority order of the plurality of sub-addresses;
[0023] In a case where the number of allocated data blocks corresponding to a sub-address is 1, allocating a data block corresponding to a current data block number to be allocated to the sub-address, and updating the current data block number to be allocated;
[0024] When the number of allocated data blocks allocated to a sub-address is greater than 1, the allocated data block of the sub-address is determined according to the current data block number to be allocated and the number of allocated data blocks, and the current data block number to be allocated is updated.
[0025] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps:
[0026] Obtaining the number of allocated data blocks corresponding to each of the plurality of sub-addresses of the target remote terminal;
[0027] Allocating data blocks that satisfy the corresponding number of allocated data blocks to each of the sub-addresses one by one according to the priority order of the plurality of sub-addresses;
[0028] In a case where the number of allocated data blocks corresponding to a sub-address is 1, allocating a data block corresponding to a current data block number to be allocated to the sub-address, and updating the current data block number to be allocated;
[0029] When the number of allocated data blocks allocated to a sub-address is greater than 1, the allocated data block of the sub-address is determined according to the current data block number to be allocated and the number of allocated data blocks, and the current data block number to be allocated is updated.
[0030] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:
[0031] Obtaining the number of allocated data blocks corresponding to each of the plurality of sub-addresses of the target remote terminal;
[0032] Allocating data blocks that satisfy the corresponding number of allocated data blocks to each of the sub-addresses one by one according to the priority order of the plurality of sub-addresses;
[0033] In a case where the number of allocated data blocks corresponding to a sub-address is 1, allocating a data block corresponding to a current data block number to be allocated to the sub-address, and updating the current data block number to be allocated;
[0034] When the number of allocated data blocks allocated to a sub-address is greater than 1, the allocated data block of the sub-address is determined according to the current data block number to be allocated and the number of allocated data blocks, and the current data block number to be allocated is updated.
[0035] In the above-mentioned data block configuration method, apparatus, computer equipment, storage medium and computer program product, first, the number of allocated data blocks corresponding to each sub-address of the target remote terminal can be obtained; next, data blocks that meet the corresponding number of allocated data blocks can be allocated to each sub-address one by one according to the priority order of the multiple sub-addresses; when the number of allocated data blocks allocated to a sub-address is 1, the data block corresponding to the current data block number to be allocated is allocated to the sub-address, and the current data block number to be allocated is updated; when the number of allocated data blocks allocated to a sub-address is greater than 1, the allocated data block of the sub-address is determined according to the current data block number to be allocated and the number of allocated data blocks, and the current data block number to be allocated is updated. In the method provided in the embodiment of the present application, a data block allocation algorithm can be introduced to allocate data blocks that meet the corresponding number of allocated data blocks to each sub-address one by one according to the priority order of the multiple sub-addresses, thereby improving the simplicity, efficiency and accuracy of data block allocation. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.
[0037] Figure 1 A flowchart of a data block configuration method provided in an embodiment of the present application;
[0038] Figure 2 A schematic diagram of a process for determining the number of allocated data blocks provided in an embodiment of the present application;
[0039] Figure 3 A schematic diagram of a process for determining a sub-address allocation data block according to an embodiment of the present application;
[0040] Figure 4 A schematic diagram of a process for determining an allocation data block of a sub-address according to a parameter value of a second allocation parameter provided in an embodiment of the present application;
[0041] Figure 5 A schematic diagram of another process for determining sub-address allocation data blocks provided in an embodiment of the present application;
[0042] Figure 6 A structural block diagram of a data block configuration device provided in an embodiment of the present application;
[0043] Figure 7 This is a diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0045] In an exemplary embodiment, Figure 1 As shown, a data block configuration method is provided. This embodiment uses the method applied to a server as an example for illustration. It is understandable that the method can also be applied to a terminal, or to a system including a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0046] Step 102: Obtain the number of allocated data blocks corresponding to each of the multiple sub-addresses of the target remote terminal.
[0047] The target remote terminal can be a remote terminal (RT) on a 1553B bus. 1553B stands for MIL-STD-1553 bus, a time-division command / response multiplexed data bus used within aircraft. The 1553B bus operates at 1 Mb / s, uses Manchester II code, and operates in half-duplex mode. The 1553B bus system primarily consists of three components: a bus controller (BC); a remote terminal (RT); and a bus monitor (BM). These components are typically implemented through a multiplexed bus interface (MBI). The bus controller (BC) is the terminal responsible for establishing and initiating data transmissions. The RT can be the interface between the user subsystem and the data bus, extracting or receiving data under the control of the BC. The bus monitor (BM) monitors information transmission on the bus to record and analyze the data source. The target remote terminal can be any remote terminal on the 1553B bus. It can use multiple subaddresses to transmit different data. The target remote terminal can include 32 transmit subaddresses and 32 receive subaddresses, numbered 0 to 31. The 32 transmit subaddresses can be named "transmit subaddress 0, transmit subaddress 1, transmit subaddress 2, ..., transmit subaddress 31," respectively; the 32 receive subaddresses can be named "receive subaddress 0, receive subaddress 1, receive subaddress 2, ..., receive subaddress 31," respectively. Each transmit subaddress and each receive subaddress can be used to transmit different data. For example, a remote terminal can request the destination address's longitude and latitude from the bus controller using receive subaddress 3 and its arrival time using receive subaddress 5. The remote terminal can send its own temperature data to the bus controller using transmit subaddress 6 and voltage data to the bus controller using transmit subaddress 8. In addition, the 1553B bus also defines multiple data blocks, for example, 101 data blocks, numbered 0 to 100. These data blocks are arranged in ascending order by data block number and can be used to store transmitted and received transmission data. Multiple subaddresses of the target remote terminal have corresponding transmission data, which can be stored in these multiple data blocks. Typically, the assigned data block for each subaddress can be determined based on the transmission data at each subaddress. Data blocks can be matched with subaddresses to store the transmission data for a subaddress in the data block corresponding to that subaddress. For example, if receiving subaddress 5 is assigned to data block 12, the aforementioned "arrival time" data is stored in data block 12. The target remote terminal obtains the transmission data by reading the contents of data block 12.In one possible implementation, the number of data blocks allocated to a subaddress can be determined based on the length of the data transmitted by each subaddress. If the data length is less than 32 words, any data block can be allocated to the subaddress. If the data length is greater than 32 words, multiple consecutive data blocks must be allocated, and the last data block number must satisfy the following requirement: the remainder is 0 when divided by 4. In allocating data blocks to multiple subaddresses, the subaddresses are traversed in ascending order of their numbers. Similarly, the multiple data blocks are allocated in ascending order of their data block numbers.
[0048] Step 104 : Allocate data blocks that meet the corresponding number of allocated data blocks to each sub-address one by one according to the priority order of the multiple sub-addresses.
[0049] The target remote terminal can implement transmission of different transmission data through multiple sub-addresses. The target remote terminal can include 32 sending sub-addresses and 32 receiving sub-addresses, and the corresponding address numbers can be 0-31. The 32 sending sub-addresses can be named "sending sub-address 0, sending sub-address 1, sending sub-address 2...sending sub-address 31" respectively; the 32 receiving sub-addresses can be named "receiving sub-address 0, receiving sub-address 1, receiving sub-address 2...receiving sub-address 31" respectively. The priority order of the multiple sub-addresses can be the order of address numbers from small to large. In the process of allocating data blocks to the multiple sub-addresses, the data blocks are traversed in the order of the numbers of each sub-address in the multiple sub-addresses from small to large. Similarly, the multiple data blocks are also allocated in the order of data block numbers from small to large. Taking the sending sub-address 0 as an example, the number of allocated data blocks corresponding to the sending sub-address 0 is 1, and the current data block number to be allocated is 0, so the data block numbered 0 can be allocated to the sending sub-address 0; sub-address 8 requires 4 consecutive data blocks, and the four data blocks numbered 8, 9, 10, and 11 can be allocated to sub-address 8. At this time, 11 satisfies the remainder of 3.
[0050] Step 106 : When the number of allocated data blocks corresponding to a sub-address is 1, allocate the data block corresponding to the current data block number to be allocated to the sub-address, and update the current data block number to be allocated.
[0051] Among them, when the number of allocated data blocks corresponding to the sub-address is 1, the data length of the transmission data of the sub-address is less than 32 words, and each data block in the multiple data blocks can store up to 32 words. Therefore, at this time, a data block can be allocated to the sub-address in the order of data block numbers from small to large, that is, the data block corresponding to the current data block number to be allocated can be allocated to the sub-address, and the current data block number to be allocated is the smallest data block number among the unallocated data block numbers. Next, the next data block number of the current data block number to be allocated can be used as the new current data block number to be allocated.
[0052] Step 108 : When the number of allocated data blocks corresponding to a sub-address is greater than 1, determine the allocated data block of the sub-address according to the current data block number to be allocated and the number of allocated data blocks, and update the current data block number to be allocated.
[0053] Among them, when the number of allocated data blocks corresponding to the sub-address is greater than 1, the data length of the transmission data of the sub-address is greater than 32 words, and each of the multiple data blocks can store a maximum of 32 words, then multiple data blocks need to be allocated to the sub-address, and the data block numbers of the multiple allocated data blocks are arranged in ascending order, and the data block numbers of the multiple allocated data blocks are continuous, and the last data block number should satisfy: the number value is divided by 4, and the remainder is 0.
[0054] In the 1553B bus, each of the multiple data blocks can occupy 32 addresses, each address stores 2 bytes, 2 bytes correspond to 1 word, and each data block corresponds to 32 words, 64 bytes, as shown in Table 1:
[0055]
[0056] Table 1 Correspondence between data blocks and data block addresses
[0057] As shown in Table 1, the data block address includes the corresponding data block's start and end addresses. The 1553B chip requires that when the number of data blocks in use exceeds one, the allocated data block's end address plus 1 is an integer multiple of 128. (For example, data block 8 has an end address of 047F, which converts to decimal 1152 after adding 1. This data is divisible by 128 (the quotient is 9 and the remainder is 0). Therefore, when the number of data blocks exceeds one, data block 8 must be allocated as the last data block.)
[0058] Correspondingly, when the number of allocated data blocks is greater than 1, a data block allocation algorithm is introduced to allocate data blocks to corresponding sub-addresses.
[0059] In the method of this embodiment, first, the number of allocated data blocks corresponding to each of the multiple sub-addresses of the target remote terminal can be obtained; next, data blocks that meet the corresponding number of allocated data blocks can be allocated to each sub-address one by one according to the priority order of the multiple sub-addresses; when the number of allocated data blocks allocated to a sub-address is 1, the data block corresponding to the current data block number to be allocated is allocated to the sub-address, and the current data block number to be allocated is updated; when the number of allocated data blocks allocated to a sub-address is greater than 1, the allocated data block of the sub-address is determined based on the current data block number to be allocated and the number of allocated data blocks, and the current data block number to be allocated is updated. In the method provided by the embodiment of the present application, a data block allocation algorithm can be introduced to allocate data blocks that meet the corresponding number of allocated data blocks to each sub-address one by one according to the priority order of the multiple sub-addresses, thereby improving the simplicity, efficiency and accuracy of data block allocation.
[0060] In an exemplary embodiment, Figure 2 As shown, step 102 may include steps 202 to 206. Among them:
[0061] Step 202: Obtain the data length value of the transmission data of each sub-address in the plurality of sub-addresses.
[0062] The target remote terminal may correspond to multiple sub-addresses, including 32 sending sub-addresses and 32 receiving sub-addresses. Each sending sub-address and each receiving sub-address may be used to transmit different transmission data. Different transmission data may have different data lengths. The number of databases to be allocated to the corresponding sub-address may be determined based on the data length value of the transmission data at each sub-address.
[0063] Step 204: Convert the data length value into binary format to obtain a binary length value corresponding to the data length value.
[0064] In a possible implementation, a data block quantity determination algorithm may be used to determine the number of allocated data blocks for each of the multiple sub-addresses based on the data length value of the transmission data of each of the multiple sub-addresses. In this data block number determination algorithm, if the "data length" ranges from 1 to 32 (inclusive), 1 data block is used; if the "data length" ranges from 33 to 128 (inclusive), 4 data blocks are used; if the "data length" ranges from 129 to 256 (inclusive), 8 data blocks are used; if the "data length" ranges from 256 to 512 (inclusive), 16 data blocks are used; if the "data length" ranges from 513 to 1024 (inclusive), 32 data blocks are used; if the "data length" ranges from 1025 to 2048 (inclusive), 64 data blocks are used; if the "data length" ranges from 2049 to 4096 (inclusive), 128 data blocks are used; if the "data length" ranges from 4097 to 8192 (inclusive), 256 data blocks are used; the data block number determination algorithm can be used to calculate in which of the above ranges the data length value of each sub-address falls, thereby determining the number of allocated data blocks corresponding to each sub-address.
[0065] Step 206: Based on the binary length value, obtain the number of allocated data blocks corresponding to each of the multiple sub-addresses of the target remote terminal.
[0066] The calculation process of the data block number determination algorithm may include: the first step, converting the data length value of the data length of each sub-address into binary form to obtain the binary length value corresponding to each sub-address; the second step, counting the number of digits "1" in the binary length of each sub-address; the third step, determining the number of allocated data blocks for each sub-address according to the number of digits "1" in the binary length of each sub-address, if the number of "1" is less than 7, the algorithm output value is 1, indicating that 1 data block is used, and the corresponding number of allocated data blocks is 1; if the number of "1" is equal to 7, the algorithm output value is 4, indicating that 4 data blocks are used, and the corresponding number of allocated data blocks is 4; if the number of "1" is greater than 7, the algorithm output value can be calculated by the following formula (1):
[0067]
[0068] Among them, N is the number of allocated data blocks of the sub-address; M is the number of "1"s corresponding to the sub-address.
[0069] In an exemplary embodiment, step 206 may include:
[0070] Determine the number of preset digits in the binary length value; and determine the number of allocated data blocks according to the number of preset digits.
[0071] Among them, the preset number can be the number "1". In the data block number determination algorithm, the number of allocated data blocks of the sub-address can be determined according to the number of numbers "1" in the binary form of the data length value of the sub-address.
[0072] In the method of this embodiment, a data block number determination algorithm can be used to determine the number of allocated data blocks for each sub-address, thereby improving the simplicity and efficiency of determining the number of allocated data blocks.
[0073] In an exemplary embodiment, Figure 3 As shown, the step 108 of determining the allocated data block of the sub-address according to the current data block number to be allocated and the number of allocated data blocks may include steps 302 to 306.
[0074] Step 302: Determine a first allocation parameter corresponding to the sub-address according to the number of allocated data blocks.
[0075] Among them, when the number of allocated data blocks corresponding to the sub-address is greater than 1, the data length of the transmission data of the sub-address is greater than 32 words, and each data block in the multiple data blocks can store up to 32 words, then multiple data blocks need to be allocated for the sub-address, and the data block numbers of the multiple allocated data blocks are arranged in ascending order, and the data block numbers of the multiple allocated data blocks are continuous, and the last data block number should satisfy: the number value divided by 4 has a remainder of 0. In a possible implementation, a data block allocation algorithm can be introduced to allocate data blocks to the corresponding sub-address. In the calculation of the data block allocation algorithm, first, according to the number of allocated data blocks of each sub-address, the first allocation parameter corresponding to each sub-address can be determined. The first allocation parameter can represent the difference between the data block number of the last data block and the data block number of the first data block in the multiple allocated data blocks of the corresponding sub-address. The data block number of the first data block can be the data block number of the current data block to be allocated.
[0076] Step 304: Determine the parameter value of the second allocation parameter corresponding to the sub-address according to the first allocation parameter and the number of the data block to be currently allocated.
[0077] In the calculation of the data block allocation algorithm, in the second step, the parameter value of the second allocation parameter corresponding to the sub-address can be determined based on the first allocation parameter and the current number of the data block to be allocated. Usually, the sum of the parameter value of the first allocation parameter and the current number of the data block to be allocated can be determined as the parameter value of the second allocation parameter corresponding to the sub-address. The parameter value of the second allocation parameter can be understood as the data block number of the last data block in the multiple allocated data blocks of the corresponding sub-address.
[0078] Step 306: Determine the allocated data block of the sub-address according to the parameter value of the second allocation parameter.
[0079] In the calculation of the data block allocation algorithm, the third step can determine whether the parameter value of the second allocation parameter of the sub-address is divisible by 4. If the parameter value of the second allocation parameter of the sub-address is divisible by 4, the parameter value of the second allocation parameter of the sub-address can be determined as the data block number of the last data block in the multiple allocated data blocks of the sub-address, and multiple data blocks from the current data block number to be allocated to the data block number of the last data block are used as the allocated data blocks of the sub-address; if the parameter value of the second allocation parameter of the sub-address is not divisible by 4, the parameter value of the second allocation parameter of the sub-address cannot be determined as the data block number of the last data block in the multiple allocated data blocks of the sub-address. In this case, it is necessary to re-determine a new current data block number to be allocated, and thus, determine a new parameter value of the second allocation parameter based on the new current data block number to be allocated; the step of determining whether the parameter value of the second allocation parameter of the sub-address is divisible by 4 is executed cyclically until the parameter value of the second allocation parameter of the sub-address is divisible by 4.
[0080] In an exemplary embodiment, Figure 4 As shown, step 306 may include steps 402 to 408. Among them:
[0081] Step 402: If the parameter value of the second allocation parameter does not meet the preset data block allocation condition, the next data block number of the current data block to be allocated is used as the new current data block number to be allocated.
[0082] The data block numbers of the data blocks to be allocated are arranged from small to large. The preset data block allocation condition may be that the parameter value of the second allocation parameter is divisible by 4.
[0083] Step 404 : determining the parameter value of the second allocation parameter corresponding to the sub-address according to the first allocation parameter and the number of the current data block to be allocated, until the parameter value of the second allocation parameter meets the preset data block allocation condition.
[0084] If the parameter value of the second allocation parameter does not meet the preset data block allocation condition, the data block number next to the current data block number to be allocated is used as the new current data block number to be allocated, that is, "current data block number to be allocated + 1". Next, the sum of the parameter value of the first allocation parameter and the new current data block number to be allocated can be determined as the parameter value of the new second allocation parameter; further, it can be determined whether the parameter value of the new second allocation parameter is divisible by 4. In the case where the parameter value of the second allocation parameter of the sub-address is divisible by 4, the parameter value of the second allocation parameter of the sub-address can be determined as the data block number of the last data block in the multiple allocated data blocks of the sub-address, and multiple data blocks from the current data block number to be allocated to the data block number of the last data block are used as the allocated data blocks of the sub-address; in the case where the parameter value of the second allocation parameter of the sub-address is not divisible by 4, the parameter value of the second allocation parameter of the sub-address cannot be determined as the data block number of the last data block in the multiple allocated data blocks of the sub-address. In this case, the new current data block number to be allocated is re-determined, and the step of determining the parameter value of the second allocation parameter corresponding to the sub-address according to the first allocation parameter and the current data block number to be allocated is cyclically executed until the parameter value of the second allocation parameter is divisible by 4.
[0085] Step 406: Determine the last data block number in the allocated data blocks according to the parameter value of the second allocation parameter.
[0086] The data block numbers in the allocated data blocks are arranged from smallest to largest. If the parameter value of the second allocation parameter of the sub-address is divisible by 4, the parameter value of the second allocation parameter of the sub-address can be determined as the data block number of the last data block in the multiple allocated data blocks of the sub-address, and the multiple data blocks from the current data block number to the data block number of the last data block are used as the allocated data blocks of the sub-address.
[0087] Step 408: Determine the allocated data block of the sub-address according to the last data block number and the number of allocated data blocks.
[0088] In the method of this embodiment, a data block allocation algorithm can be used to determine the number of allocated data blocks for each sub-address, thereby improving the simplicity and efficiency of determining the allocated data blocks.
[0089] In another exemplary embodiment, Figure 5 As shown, the step 108 of determining the allocated data block of the sub-address according to the current data block number to be allocated and the number of allocated data blocks may include steps 502 to 506.
[0090] Step 502: Determine a first allocation parameter corresponding to the sub-address according to the number of allocated data blocks.
[0091] Step 504: Determine the parameter value of the second allocation parameter corresponding to the sub-address according to the first allocation parameter and the number of the data block to be currently allocated.
[0092] Step 506: Determine whether the parameter value of the second allocation parameter satisfies a preset data block allocation condition.
[0093] If the parameter value of the second allocation parameter satisfies the preset data block allocation condition, step 508 and step 510 are executed; if the parameter value of the second allocation parameter does not satisfy the preset data block allocation condition, step 512 is executed.
[0094] Step 508: Determine the parameter value of the second allocation parameter of the sub-address as the data block number of the last data block in the multiple allocated data blocks of the sub-address.
[0095] Step 510: Use the next data block number of the current data block number to be allocated as the new current data block number to be allocated.
[0096] Step 512: The next data block number of the current data block number to be allocated is used as the new current data block number to be allocated.
[0097] Next, step 504 to step 510 are executed until the parameter value of the second allocation parameter meets the preset data block allocation condition.
[0098] In the method of this embodiment, a data block allocation algorithm can be used to traverse the data block allocation to determine the number of allocated data blocks for each sub-address, thereby improving the simplicity and efficiency of determining the allocated data blocks.
[0099] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0100] Based on the same inventive concept, embodiments of the present application also provide a data block configuration device for implementing the aforementioned data block configuration method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations in one or more data block configuration device embodiments provided below can be found in the above-mentioned limitations on the data block configuration method and will not be further elaborated here.
[0101] In an exemplary embodiment, Figure 6 As shown, a data block configuration device is provided, including: a calculation module 602, a first allocation module 604, a second allocation module 606 and a third allocation module 608, wherein:
[0102] A calculation module 602 is configured to obtain the number of allocated data blocks corresponding to each of the plurality of sub-addresses of the target remote terminal;
[0103] A first allocating module 604 is configured to allocate data blocks satisfying the corresponding number of allocated data blocks to each of the sub-addresses one by one according to the priority order of the sub-addresses;
[0104] The second allocation module 606 is configured to allocate a data block corresponding to a current data block number to be allocated to the sub-address when the number of allocated data blocks corresponding to the sub-address is 1, and update the current data block number to be allocated;
[0105] The third allocation module 608 is used to determine the allocated data block of the sub-address according to the current data block number to be allocated and the number of allocated data blocks when the number of allocated data blocks allocated to the sub-address is greater than 1, and update the current data block number to be allocated.
[0106] In one embodiment, the calculation module 602 is also used to: obtain the data length value of the transmission data of each of the multiple sub-addresses; convert the data length value into binary form to obtain a binary length value corresponding to the data length value; and based on the binary length value, obtain the number of allocated data blocks corresponding to each of the multiple sub-addresses of the target remote terminal.
[0107] In one embodiment, the calculation module 602 is further configured to: determine the number of preset digits in the binary length value; and determine the number of allocated data blocks according to the number of preset digits.
[0108] In one embodiment, the third allocation module 608 is further used to: determine the first allocation parameter corresponding to the sub-address based on the number of allocated data blocks; determine the parameter value of the second allocation parameter corresponding to the sub-address based on the first allocation parameter and the number of the current data block to be allocated; and determine the allocated data block of the sub-address based on the parameter value of the second allocation parameter.
[0109] In one embodiment, the third allocation module 608 is further used to: when the parameter value of the second allocation parameter does not meet the preset data block allocation condition, use the next data block number of the current data block number to be allocated as the new current data block number to be allocated; arrange the data block numbers of the data blocks to be allocated from small to large; execute the step of determining the parameter value of the second allocation parameter corresponding to the sub-address according to the first allocation parameter and the current data block number to be allocated, until the parameter value of the second allocation parameter meets the preset data block allocation condition; determine the last data block number in the allocated data block according to the parameter value of the second allocation parameter; arrange the data block numbers in the allocated data block from small to large; determine the allocated data block of the sub-address according to the last data block number and the number of allocated data blocks.
[0110] In one embodiment, the third allocation module 608 is further configured to determine a parameter value of the second allocation parameter corresponding to the sub-address according to a sum of a parameter value of the first allocation parameter and a number of the data block to be currently allocated.
[0111] Each module in the above-mentioned data block configuration device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0112] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 7 As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data related to data block configuration. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a data block configuration method.
[0113] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0114] In an exemplary embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0115] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0116] In an exemplary embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0117] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0118] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), data processing logic devices based on quantum computing, and the like.
[0119] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0120] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A data block configuration method, characterized in that: The method comprises: determining, based on data length values of transmission data of a plurality of sub-addresses of a target remote terminal, the number of allocated data blocks corresponding to each of the plurality of sub-addresses of the target remote terminal; the target remote terminal being a remote terminal on a 1553B bus; the plurality of data blocks corresponding to the 1553B bus being arranged in ascending order according to data block numbers and used for storing transmission data to be sent and received; Allocating consecutively numbered data blocks satisfying the corresponding number of allocated data blocks to each of the sub-addresses one by one according to the priority order of the plurality of sub-addresses; In a case where the number of allocated data blocks corresponding to a sub-address is 1, allocating a data block corresponding to a current data block number to be allocated to the sub-address, and updating the current data block number to be allocated; When the number of allocated data blocks allocated to a sub-address is greater than 1, the allocated data block of the sub-address is determined according to the current data block number to be allocated and the number of allocated data blocks, and the current data block number to be allocated is updated.
2. The method according to claim 1, characterized in that The step of determining the number of allocated data blocks corresponding to each of the plurality of sub-addresses of the target remote terminal according to the data length values of the transmission data of the plurality of sub-addresses of the target remote terminal comprises: Obtaining a data length value of the transmission data of each of the plurality of sub-addresses; Converting the data length value into binary form to obtain a binary length value corresponding to the data length value; Based on the binary length value, the number of allocated data blocks corresponding to each of the multiple sub-addresses of the target remote terminal is obtained.
3. The method according to claim 2, characterized in that The acquiring, based on the binary length value, the number of allocated data blocks corresponding to each of the plurality of sub-addresses of the target remote terminal comprises: Determining the number of predetermined digits in the binary length value; The number of allocated data blocks is determined according to the number of the preset numbers.
4. The method according to claim 1, wherein The step of determining the allocated data block of the sub-address according to the number of the current data block to be allocated and the number of allocated data blocks includes: determining a first allocation parameter corresponding to the sub-address according to the number of allocated data blocks; Determining a parameter value of a second allocation parameter corresponding to the sub-address according to the first allocation parameter and the number of the current data block to be allocated; The allocated data block of the sub-address is determined according to the parameter value of the second allocation parameter.
5. The method according to claim 4, characterized in that The step of determining the allocated data block of the sub-address according to the parameter value of the second allocation parameter includes: If the parameter value of the second allocation parameter does not meet the preset data block allocation condition, the data block number next to the current data block number to be allocated is used as the new current data block number to be allocated; the data block numbers of the data blocks to be allocated are arranged from small to large; performing the step of determining a parameter value of a second allocation parameter corresponding to the sub-address according to the first allocation parameter and the number of the current data block to be allocated, until the parameter value of the second allocation parameter meets the preset data block allocation condition; determining the last data block number in the allocated data blocks according to the parameter value of the second allocation parameter; and arranging the data block numbers in the allocated data blocks from small to large; The allocated data block of the sub-address is determined according to the last data block number and the number of allocated data blocks.
6. The method according to claim 4, characterized in that The determining, based on the first allocation parameter and the number of the current data block to be allocated, a parameter value of the second allocation parameter corresponding to the sub-address includes: The parameter value of the second allocation parameter corresponding to the sub-address is determined according to the sum of the parameter value of the first allocation parameter and the number of the data block to be currently allocated.
7. A data block configuration device, characterized in that: The device comprises: a calculation module, configured to determine, based on data length values of transmission data at multiple sub-addresses of a target remote terminal, the number of allocated data blocks corresponding to each of the multiple sub-addresses of the target remote terminal; the target remote terminal is a remote terminal on a 1553B bus; the multiple data blocks corresponding to the 1553B bus are arranged in ascending order according to data block numbers and are used to store transmitted and received transmission data; a first allocating module, configured to allocate consecutively numbered data blocks satisfying the corresponding number of allocated data blocks to each of the sub-addresses one by one according to the priority order of the plurality of sub-addresses; A second allocation module is configured to allocate a data block corresponding to a current data block number to be allocated to the sub-address when the number of allocated data blocks corresponding to the sub-address is 1, and update the current data block number to be allocated; The third allocation module is used to determine the allocated data block of the sub-address according to the current data block number to be allocated and the number of allocated data blocks when the number of allocated data blocks allocated to the sub-address is greater than 1, and to update the current data block number to be allocated.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. 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 method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Apparatus for maintaining multichannel order rule and corresponding method
CN101383773A
Carrier rocket-oriented terminal address allocation method and device
CN112637372A