Communication method, device, computer equipment, storage medium and computer program product based on portable operating system
By adopting a communication method based on a portable operating system, the poor portability of the 1553B bus communication driver was solved, enabling the efficient application of the 1553B bus communication software in different scenarios, reducing development costs and improving driver efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES
- Filing Date
- 2024-06-03
- Publication Date
- 2026-04-17
AI Technical Summary
In the existing technology, the 1553B bus communication driver has poor portability, resulting in different 1553B bus protocols in different scenarios, and different underlying hardware implementation details and configurations, which makes the communication driver cumbersome and inefficient.
A communication method based on a portable operating system is adopted. By determining the target remote terminal of the target transmission task, data blocks are allocated according to the priority order of sub-addresses, and data transmission is performed according to the transmit and receive mode. 1553B bus communication software is developed, and the 1553B bus chip and software working mode are configured using the POSIX standard interface.
It improves the efficiency and ease of use of the 1553B bus communication driver, reduces the development workload for different scenarios, and lowers costs.
Smart Images

Figure CN118796746B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a communication method, apparatus, computer equipment, storage medium, and computer program product based on a portable operating system. Background Technology
[0002] MIL-STD-1553B is a digital time-division serial data bus characterized by high reliability, strong anti-interference capability, flexibility, high speed, and ease of expansion and maintenance. Typically, 1553B bus communication software can be developed based on an operating system. This software can consist of a low-level driver and an upper-level application program, with the driver program hiding and encapsulating the details of the underlying hardware implementation.
[0003] Current technologies suffer from poor portability of the operating systems used, and the 1553B bus protocol varies across different scenarios, with different underlying hardware implementation details and configurations, resulting in cumbersome and inefficient 1553B bus communication drivers. Summary of the Invention
[0004] Therefore, it is necessary to provide a communication method, device, computer equipment, storage medium, and computer program product based on a portable operating system that can improve the efficiency and ease of 1553B bus communication driving and address the aforementioned technical problems.
[0005] Firstly, this application provides a communication method based on a portable operating system. The method includes:
[0006] Identify the target remote terminal for the target transmission task;
[0007] The allocated data block corresponding to each of the multiple sub-addresses of the target remote terminal is determined one by one according to the priority order of the sub-addresses;
[0008] Determine at least one target sub-address corresponding to the target transmission task, and determine a target allocation data block for each target sub-address; the target allocation data block is used to store the transmission data of the target transmission task;
[0009] Obtain the send / receive mode of the target transmission task, and transmit the transmission data corresponding to the target allocated data block according to the send / receive mode.
[0010] In one embodiment, determining at least one target sub-address corresponding to the target transmission task and determining the target allocated data block for each target sub-address includes: clearing the sub-address parameters of multiple sub-addresses of the target remote terminal to zero, and clearing the data block parameters of the allocated data block to zero; obtaining the target sub-address number and the transmit / receive mode in the target transmission task, and determining at least one target sub-address of the target transmission task based on the target sub-address number and the transmit / receive mode; and setting the target sub-address parameters of each target sub-address and the target data block parameters of the target allocated data block for each target sub-address according to the target transmission task.
[0011] In one embodiment, obtaining the transmit / receive mode of the target transmission task and transmitting the transmission data corresponding to the target allocated data block according to the transmit / receive mode includes: transmitting the transmission data according to the transmit strategy corresponding to the transmit mode when the transmit / receive mode of the target transmission task is a transmit mode; and transmitting the transmission data according to the receive strategy corresponding to the receive mode when the transmit / receive mode of the target transmission task is a receive mode.
[0012] In one embodiment, when the transmit / receive mode of the target transmission task is a transmit mode, transmitting the transmission data according to the transmit strategy corresponding to the transmit mode includes: when the transmit / receive mode of the target transmission task is a transmit mode, sending the target sub-address number of the target transmission task to the target remote terminal; the target remote terminal is used to store the transmission data of the target transmission task in the target allocated data block corresponding to the target sub-address number; and upon receiving a transmit request for the transmission data sent by the target remote terminal, obtaining the transmission data of the target transmission task from the target allocated data block corresponding to the target sub-address number.
[0013] In one embodiment, when the transmit / receive mode of the target transmission task is a receive mode, transmitting the transmission data according to the receive strategy corresponding to the receive mode includes: when the transmit / receive mode of the target transmission task is a receive mode, sending the target sub-address number of the target transmission task and the transmission data to the target remote terminal; the target remote terminal is used to store the received transmission data in the target allocated data block.
[0014] In one embodiment, determining the allocated data block corresponding to each of the multiple sub-addresses of the target remote terminal according to their priority order includes: obtaining the number of allocated data blocks corresponding to each of the multiple sub-addresses of the target remote terminal; and allocating data blocks that satisfy the corresponding number of allocated data blocks to each of the multiple sub-addresses according to their priority order.
[0015] Secondly, this application provides a communication device based on a portable operating system. The device includes:
[0016] The first determining module is used to determine the target remote terminal of the target transmission task.
[0017] The allocation module is used to determine the allocation data block corresponding to each of the multiple sub-addresses of the target remote terminal in order of priority.
[0018] The second determining module is used to determine at least one target sub-address corresponding to the target transmission task, and to determine the target allocation data block for each target sub-address; the target allocation data block is used to store the transmission data of the target transmission task;
[0019] The transmission module is used to obtain the send / receive mode of the target transmission task and transmit the transmission data corresponding to the target allocated data block according to the send / receive mode.
[0020] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0021] Identify the target remote terminal for the target transmission task;
[0022] The allocated data block corresponding to each of the multiple sub-addresses of the target remote terminal is determined one by one according to the priority order of the sub-addresses;
[0023] Determine at least one target sub-address corresponding to the target transmission task, and determine a target allocation data block for each target sub-address; the target allocation data block is used to store the transmission data of the target transmission task;
[0024] Obtain the send / receive mode of the target transmission task, and transmit the transmission data corresponding to the target allocated data block according to the send / receive mode.
[0025] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0026] Identify the target remote terminal for the target transmission task;
[0027] The allocated data block corresponding to each of the multiple sub-addresses of the target remote terminal is determined one by one according to the priority order of the sub-addresses;
[0028] Determine at least one target sub-address corresponding to the target transmission task, and determine a target allocation data block for each target sub-address; the target allocation data block is used to store the transmission data of the target transmission task;
[0029] Obtain the send / receive mode of the target transmission task, and transmit the transmission data corresponding to the target allocated data block according to the send / receive mode.
[0030] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0031] Identify the target remote terminal for the target transmission task;
[0032] The allocated data block corresponding to each of the multiple sub-addresses of the target remote terminal is determined one by one according to the priority order of the sub-addresses;
[0033] Determine at least one target sub-address corresponding to the target transmission task, and determine a target allocation data block for each target sub-address; the target allocation data block is used to store the transmission data of the target transmission task;
[0034] Obtain the send / receive mode of the target transmission task, and transmit the transmission data corresponding to the target allocated data block according to the send / receive mode.
[0035] In the aforementioned communication method, apparatus, computer device, storage medium, and computer program product based on a portable operating system, firstly, the target remote terminal of the target transmission task can be determined; next, the allocated data block corresponding to each sub-address can be determined sequentially according to the priority order of multiple sub-addresses of the target remote terminal; further, at least one target sub-address corresponding to the target transmission task can be determined, as well as the target allocated data block for each target sub-address; the target allocated data block is used to store the transmission data of the target transmission task; subsequently, the transmit / receive mode of the target transmission task can be obtained, and the transmission data corresponding to the target allocated data block can be transmitted according to the transmit / receive mode. In the method provided in this application embodiment, a portable operating system can be combined with the 1553B bus, 1553B bus communication software can be developed based on the portable operating system, and data communication can be completed based on the 1553B bus communication software. Due to the portability of the portable operating system, the 1553B bus communication software can be used for communication in different scenarios, reducing the development workload for different scenarios, lowering costs, and improving the efficiency and simplicity of the 1553B bus communication driver. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 A flowchart illustrating a communication method based on a portable operating system provided in an embodiment of this application;
[0038] Figure 2 A schematic flowchart illustrating the transmission parameter configuration of a transmission mode provided in an embodiment of this application;
[0039] Figure 3 A schematic flowchart illustrating the transmission parameter configuration of a receiving mode provided in an embodiment of this application;
[0040] Figure 4 A schematic diagram illustrating a bus transmission data format provided in an embodiment of this application;
[0041] Figure 5 A flowchart illustrating the process of determining the target sub-address and the target allocated data block provided in an embodiment of this application;
[0042] Figure 6 A schematic diagram illustrating the data transmission process according to the transmission and reception mode, provided for an embodiment of this application;
[0043] Figure 7 A structural block diagram of a communication device based on a portable operating system provided in an embodiment of this application;
[0044] Figure 8 This is an internal structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0046] In one exemplary embodiment, such as Figure 1 As shown, a communication method based on a portable operating system is provided, which includes the following steps:
[0047] Step 102: Determine the target remote terminal for the target transmission task.
[0048] The target remote terminal can be a remote terminal on the 1553B bus, which is short for MIL-STD-1553 bus. MIL-STD-1553 bus is an aircraft internal time-division command / response multiplexed data bus. The 1553B bus operates at a frequency of 1Mb / s, uses Manchester II code, and operates in half-duplex mode. The 1553B bus system mainly consists of three parts: a bus controller (BC); a remote terminal (RT); and a bus monitor (BM). Typically, these three parts are connected through a single multiplexer interface (MBI). The bus controller (BC) is the terminal that performs the tasks of establishing and initiating data transmission. The remote terminal (RT) can be the interface between the user subsystem and the data bus, retrieving or receiving data under the control of the BC. The bus monitor (BM) can "monitor" the information transmission on the bus to record and analyze the data sources on the bus. The target transmission task can be a data transmission task utilizing the 1553B bus.
[0049] In this embodiment, the 1553B bus can be driven for communication using the Portable Operating System Interface of UNIX (POSIX). In one possible implementation, 1553B bus communication software can be developed using the POSIX standard. This software can then be used to drive the 1553B bus communication. The driver program for this software can configure the 1553B bus chip and software operating mode through the POSIX standard interface, and corresponding hardware and software status settings can be implemented through the corresponding device. On the remote terminal side of the 1553B bus, the communication software can include multiple structures, including but not limited to: message structures, lookup table structures, communication configuration structures, single sub-address configuration structures, and communication status structures. Furthermore, the driver can utilize these multiple structures to implement communication driving for the 1553B bus. The message structure stores 1553B transmission messages, which may include 10 parameters: remote terminal address, receive / send identifier, sub-address or mode instruction distinction flag, data word length, data word content, mode code address, mode code data, block status word, timestamp, and service request flag. The lookup table structure configures the location (or storage address) of the "data word content" in the message structure, consisting of 12 parameters. Receive configuration, send configuration, and broadcast configuration each occupy 4 parameters. Taking the receive configuration as an example, the 4 parameters may include: storage management mode, effective length, starting address of data word storage, and storage area data block number. The send and broadcast configurations are similar. The communication configuration structure configures parameters for the entire 1553B communication process, including the remote terminal address and 32 lookup table structures. The remote terminal address must be consistent with the local machine number. The 32 lookup table structures configure the receive, send, and broadcast parameters for 32 sub-addresses. A single sub-address configuration structure can be used to store parameters for a single sub-address. When modifying the communication configuration, it is not necessary to set all 32 lookup table structures; instead, it can include four parameters: sub-address number, transmit / receive mode (send, receive, or broadcast), storage management mode, and valid data length. The communication status structure includes seven parameters used to record the communication status, including: message count, service request count, reset count, self-test count, data word length error count, instruction word content error count, and undefined mode instruction error count.
[0050] In the communication method provided in this application embodiment, the driver program for the 1553B bus communication software can utilize the above-mentioned multiple structures to drive the communication of the 1553B bus, and implement multiple driving functions through driver functions. For the communication process of the target transmission task, firstly, the driver program can implement initialization and opening functions, which may include setting the remote terminal address. The target transmission task may include the target remote terminal number of the corresponding target remote terminal. The remote terminal address of the target remote terminal corresponding to the target remote terminal number can be obtained from the communication configuration structure, and the remote terminal address is written to the 1553B interface chip configuration address, completing the setting of the remote terminal address. In this process, the target remote terminal and the remote terminal address of the target remote terminal can be determined.
[0051] Step 104: Determine the allocated data block corresponding to each sub-address in order of priority of the multiple sub-addresses of the target remote terminal.
[0052] The target remote terminal can transmit different types of data through multiple sub-addresses. It can include 32 sending sub-addresses and 32 receiving sub-addresses, numbered 0 to 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"; the 32 receiving sub-addresses can be named "Receiving Sub-address 0, Receiving Sub-address 1, Receiving Sub-address 2...Receiving Sub-address 31". Each sending and receiving sub-address can be used to transmit different types of data. For example, the remote terminal might use receiving sub-address 3 to request the destination address (latitude and longitude) from the bus controller, and receiving sub-address 5 to request the arrival time. The remote terminal might send its own temperature data to the bus controller via sending sub-address 6, and voltage data via sending sub-address 8. Additionally, the 1553B bus defines multiple data blocks, such as 101 data blocks, numbered 0 to 100. These data blocks are arranged in ascending order of their numbers and can be used to store the transmitted and received data. The target remote terminal has multiple sub-addresses with corresponding transmission data, which can be stored in multiple data blocks. Typically, the allocated data block for each sub-address can be determined based on the transmission data at each sub-address. Data blocks can be matched with sub-addresses to store the transmission data for each sub-address in its corresponding data block. The priority order of these multiple sub-addresses can be an ascending order of address numbers. During the allocation of data blocks to these multiple sub-addresses, the process iterates through each sub-address in ascending order of its number, and similarly, the multiple data blocks are allocated in ascending order of their block numbers. In this process, the driver can perform lookup table configuration. This communication configuration structure includes 32 lookup table structures, each corresponding to a sub-address. The lookup table structures are configured one by one according to the priority order of the multiple sub-addresses. Taking the lookup table structure configuration of sub-address 0 as an example, obtain the storage management mode and the starting address of the data word in the lookup table structure, write the data to the configuration address corresponding to the 1553B interface chip, obtain the valid length in the lookup table structure as input, automatically or manually obtain the data block number corresponding to sub-address 0, and store the data block number in the "Storage Area Data Block Number" structure. The configuration process for other sub-addresses is the same.
[0053] Next, after obtaining the allocated data blocks for each sub-address, the sub-address parameters of multiple sub-addresses of the target remote terminal can be cleared, as can the data block parameters of the allocated data blocks.
[0054] Step 106: Determine at least one target sub-address corresponding to the target transmission task, and determine the target allocated data block for each target sub-address.
[0055] The target transmission task may include a target sub-address number. Based on this target sub-address number, at least one target sub-address required for executing the target transmission task can be determined, along with target allocation data blocks for each target sub-address. These target allocation data blocks are used to store the transmission data of the target transmission task. At this time, both the sub-address parameter of the target sub-address and the data block parameter of the target allocation data block are zero. The driver can utilize the control functions of the control function to configure the sub-address parameter and the data block parameter of the target sub-address and the target allocation data block. Based on the sub-address number and transmit / receive mode in the single sub-address configuration structure, the corresponding position in the lookup table structure of the communication configuration structure is found. The storage management mode and valid data in the lookup table structure are replaced with the values in the single sub-address configuration structure. For example, if the sub-address number in the "single sub-address configuration structure" is 5 and the transmit / receive mode is receive, then the lookup table structure for sub-address 5 is retrieved from the "communication configuration structure," and the corresponding parameters of the lookup table structure for sub-address 5 are replaced with the items from the single sub-address configuration structure.
[0056] Step 108: Obtain the send / receive mode of the target transmission task, and transmit the transmission data corresponding to the target allocated data block according to the send / receive mode.
[0057] In this step, such as Figure 2 As shown, when the target transmission task's transmit / receive mode is transmit mode, the driver can use the write function of the write function to determine the corresponding storage mode based on the "sub-address or mode instruction distinction flag" in the message structure. If the sub-address or mode instruction distinction flag represents a sub-address, the transmission data can be written to the allocated data block corresponding to that sub-address through the target remote terminal. This process can include, in this case, the content of the "sub-address or mode instruction distinction flag" being a sub-address number, finding the lookup table structure corresponding to that sub-address number in the communication configuration structure based on the sub-address number, and then obtaining the "starting address for storing data words" parameter from the lookup table structure and writing the transmission data from the "message structure" to that address. If the sub-address or mode instruction distinction flag represents a mode code, obtaining the mode code data storage address from the "mode code address" parameter in the message structure and writing the mode code from the message structure to that mode code data storage address.
[0058] Next, the service request flag parameter in the message structure can be obtained. If the service request flag is 1, the hardware service request register is set to 0, meaning the transmission data is written to the address corresponding to the service request in the 1553B interface chip, and then the transmission data is sent. This write function requires two parameters: "1553B device identifier" and "message structure". The "message structure" stores the transmission data to be sent. The write function writes the contents of the "message structure" to a specific address on the 1553B interface chip, thus realizing the transmission data sending process. The "sub-address or mode instruction distinction flag" refers to the sub-address or mode instruction distinction flag in the "message structure" parameter passed to the function.
[0059] like Figure 3 As shown, when the target transmission task's transmit / receive mode is receive mode, the driver can utilize the read function of the read function to configure the data reception driver. Data reception by the target remote terminal can include the reception of instruction words and data words. Specifically, it can include: First, the driver retrieves the "block status word" from the hardware register and stores it in the "message structure" as the block status word. This hardware register can be a 1553B interface chip. Second, the driver retrieves the "time stamp" from the hardware register and stores it in the "message structure" as the time stamp. Third, the driver retrieves the instruction word from the hardware register, retrieves the "remote terminal address," and writes it into the corresponding parameters of the "message structure." In this step, the instruction word contains three types of data: "remote terminal address," "sub-address / mode word," and "data word count / mode code." Retrieving the "remote terminal address" from the instruction word refers to retrieving the 5 bits of the "remote terminal address" shown in the diagram. Figure 4 As shown. The fourth step is to retrieve the instruction word from the hardware memory, extract the "receive / send identifier," and write it into the corresponding parameter of the "message structure." Here, "retrieve receive / send identifier" refers to... Figure 4 In the T / R parameter, 1 indicates sending and 0 indicates receiving. The fifth step is to fetch the instruction word from the hardware register and retrieve the "sub-address or mode instruction distinction flag". The sixth step is to determine if the "sub-address or mode instruction distinction flag" represents a sub-address. The seventh step, if it represents a sub-address, is to retrieve the starting address of the data word in the "lookup table structure" based on that sub-address. The eighth step is to read the transmission data from the starting address of the data word and write it into the "data word content" in the "message structure," which can be considered as the target allocated data block. The ninth step, if it does not represent a sub-address, is to retrieve the mode code data from the instruction word and write it into the corresponding parameter of the "message structure".
[0060] In this embodiment, the method first determines the target remote terminal for the target transmission task; then, it determines the allocated data block corresponding to each sub-address according to the priority order of multiple sub-addresses of the target remote terminal; further, it determines at least one target sub-address corresponding to the target transmission task, and the target allocated data block for each target sub-address; the target allocated data block is used to store the transmission data of the target transmission task; subsequently, it obtains the transmit / receive mode of the target transmission task, and transmits the transmission data corresponding to the target allocated data block according to the transmit / receive mode. In the method provided by this application embodiment, a portable operating system can be combined with the 1553B bus, 1553B bus communication software can be developed based on the portable operating system, and data communication can be completed based on this 1553B bus communication software. Due to the portability of the portable operating system, the 1553B bus communication software can be used for communication in different scenarios, reducing the development workload for different scenarios, lowering costs, and improving the efficiency and simplicity of the 1553B bus communication driver.
[0061] In one exemplary embodiment, such as Figure 5 As shown, step 106 may include steps 202 to 206. Wherein:
[0062] Step 502: Clear the sub-address parameters of multiple sub-addresses of the target remote terminal and clear the data block parameters of the allocated data blocks.
[0063] Step 504: Obtain the target sub-address number and transmit / receive mode in the target transmission task, and determine at least one target sub-address of the target transmission task based on the target sub-address number and transmit / receive mode.
[0064] Step 506: Based on the target transmission task, set the target sub-address parameters for each target sub-address and the target data block parameters for each target sub-address's target allocated data block.
[0065] When acquiring the allocated data blocks for each sub-address, the sub-address parameters of multiple sub-addresses on the target remote terminal can be cleared to zero, as can the data block parameters of the allocated data blocks. This step refers to clearing the contents of all data blocks and writing zeros to the address of each data block.
[0066] Furthermore, the target transmission task may include a target sub-address number. Based on this target sub-address number, at least one target sub-address required for executing the target transmission task can be determined, along with target allocation data blocks for each target sub-address. These target allocation data blocks are used to store the transmission data of the target transmission task. At this time, the sub-address parameters of the target sub-address and the data block parameters of the target allocation data block are both zero. The driver can utilize the control functions of the control function to configure the sub-address parameters of the target sub-address and the data block parameters of the target allocation data block. Based on the sub-address number and transmit / receive mode in the single sub-address configuration structure, the corresponding position of the lookup table structure in the communication configuration structure is found. The storage management mode and valid data in the lookup table structure are replaced with the values in the single sub-address configuration structure. For example, if the "sub-address number" in the "single sub-address configuration structure" is 5 and the "transmit / receive mode" is receive, then the "lookup table structure" for sub-address 5 is found in the "communication configuration structure," retrieved, and replaced with the corresponding parameters of the "lookup table structure" for sub-address 5 using the items from the "single sub-address configuration structure."
[0067] In the method of this embodiment, the driver can configure the parameters of the target sub-address and the target allocated data block through the target remote terminal to ensure the normal transmission of subsequent data, thereby improving the accuracy and efficiency of configuration and data transmission.
[0068] In one exemplary embodiment, such as Figure 6 As shown, step 108 may include steps 602 to 604. Wherein,
[0069] Step 602: If the target transmission task's transmit / receive mode is transmit mode, transmit the data according to the transmit strategy corresponding to the transmit mode.
[0070] Step 604: If the target transmission task's transmit / receive mode is receive mode, transmit the data according to the receive strategy corresponding to the receive mode.
[0071] In one exemplary embodiment, step 602 may include: when the transmit / receive mode of the target transmission task is transmit mode, sending the target sub-address number of the target transmission task to the target remote terminal; the target remote terminal is used to store the transmission data of the target transmission task in the target allocation data block corresponding to the target sub-address number; and when receiving a transmission request for transmission data sent by the target remote terminal, obtaining the transmission data of the target transmission task from the target allocation data block corresponding to the target sub-address number.
[0072] When the target transmission task's transmit / receive mode is transmit mode, the driver can use the write function of the write function to determine the corresponding storage mode based on the "sub-address or mode instruction distinction flag" in the message structure. If the sub-address or mode instruction distinction flag represents a sub-address, the transmission data can be written to the allocated data block corresponding to that sub-address via the target remote terminal. This process can include, in this case, the content of the "sub-address or mode instruction distinction flag" being a sub-address number, finding the lookup table structure corresponding to that sub-address number in the communication configuration structure based on the sub-address number, and then obtaining the "starting address for storing data words" parameter from the lookup table structure and writing the transmission data from the "message structure" to that address. If the sub-address or mode instruction distinction flag represents a mode code, obtaining the mode code data storage address from the "mode code address" parameter in the message structure and writing the mode code from the message structure to that mode code data storage address.
[0073] Next, the service request flag parameter in the message structure can be obtained. If the service request flag is 1, the hardware service request register is set to 0, meaning the transmission data is written to the address corresponding to the service request in the 1553B interface chip, and then the transmission data is sent. This write function requires two parameters: "1553B device identifier" and "message structure". The "message structure" stores the transmission data to be sent. The write function writes the contents of the "message structure" to a specific address on the 1553B interface chip, thus realizing the transmission data sending process. The "sub-address or mode instruction distinction flag" refers to the sub-address or mode instruction distinction flag in the "message structure" parameter passed to the function.
[0074] In one exemplary embodiment, step 604 may include: when the transmit / receive mode of the target transmission task is receive mode, sending the target sub-address number and transmission data of the target transmission task to the target remote terminal; the target remote terminal is used to store the received transmission data in the target allocated data block.
[0075] When the target transmission task's transmit / receive mode is receive mode, the driver can utilize the read function of the read function to configure the data reception driver. Data reception by the target remote terminal can include the reception of instruction words and data words, specifically including: First, the driver retrieves the "block status word" from a hardware register and stores it in the "message structure" as the block status word. This hardware register can be a 1553B interface chip. Second, the driver retrieves the "time stamp" from the hardware register and stores it in the "time stamp trace" of the "message structure". Third, the driver retrieves the instruction word from the hardware register, retrieves the "remote terminal address", and writes it into the corresponding parameters of the "message structure". In this step, the instruction word contains three types of data: "remote terminal address", "sub-address / mode word", and "data word count / mode code". Retrieving the "remote terminal address" from the instruction word refers to retrieving the 5 bits of the "remote terminal address" shown in the diagram. Figure 4 As shown. The fourth step is to retrieve the instruction word from the hardware memory, extract the "receive / send identifier," and write it into the corresponding parameter of the "message structure." Here, "retrieve receive / send identifier" refers to... Figure 4 In the T / R parameter, 1 indicates sending and 0 indicates receiving. The fifth step is to fetch the instruction word from the hardware register and retrieve the "sub-address or mode instruction distinction flag". The sixth step is to determine if the "sub-address or mode instruction distinction flag" represents a sub-address. The seventh step, if it represents a sub-address, is to retrieve the starting address of the data word in the "lookup table structure" based on that sub-address. The eighth step is to read the transmission data from the starting address of the data word and write it into the "data word content" in the "message structure," which can be considered as the target allocated data block. The ninth step, if it does not represent a sub-address, is to retrieve the mode code data from the instruction word and write it into the corresponding parameter of the "message structure".
[0076] In this embodiment, a portable operating system can be combined with the 1553B bus. 1553B bus communication software can be developed based on the portable operating system, and data communication can be completed based on the 1553B bus communication software. Due to the portability of the portable operating system, the 1553B bus communication software can be used for communication in different scenarios, reducing the development workload for different scenarios, lowering costs, and improving the efficiency and simplicity of the 1553B bus communication driver.
[0077] In an exemplary embodiment, step 104 may include: obtaining the number of allocated data blocks corresponding to each of the multiple sub-addresses of the target remote terminal; and allocating data blocks that meet the corresponding number of allocated data blocks to each sub-address in order of priority of the multiple sub-addresses.
[0078] Based on the transmitted data at each sub-address, the allocated data block for each sub-address can be determined. Data blocks can be matched with sub-addresses to store the transmitted data for that sub-address in its corresponding data block. The priority order of these multiple sub-addresses can be an ascending order of address numbers. During the allocation of data blocks to multiple sub-addresses, the process iterates through each sub-address in ascending order of its number, and similarly, the multiple data blocks are allocated in ascending order of their block numbers. In this process, the driver can configure lookup tables. This communication configuration structure includes 32 lookup table structures, each corresponding to a sub-address. The lookup table structures are configured one by one according to the priority order of the multiple sub-addresses. Taking the lookup table structure configuration of sub-address 0 as an example, obtain the storage management mode and the starting address of the data word in the lookup table structure, write the data to the configuration address corresponding to the 1553B interface chip, obtain the valid length in the lookup table structure as input, automatically or manually obtain the data block number corresponding to sub-address 0, and store the data block number in the "Storage Area Data Block Number" structure. The configuration process for other sub-addresses is the same.
[0079] In the method of this embodiment, data blocks that meet the corresponding number of allocated data blocks are allocated to each sub-address one by one according to the priority order of multiple sub-addresses, which improves the simplicity, efficiency and accuracy of data block allocation.
[0080] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0081] Based on the same inventive concept, this application also provides a communication device based on a portable operating system for implementing the aforementioned communication method based on a portable operating system. The solution provided by this device is similar to the implementation described in the above method. Therefore, the specific limitations in one or more embodiments of the communication device based on a portable operating system provided below can be found in the limitations of the communication method based on a portable operating system described above, and will not be repeated here.
[0082] In one exemplary embodiment, such as Figure 7 As shown, a communication device based on a portable operating system is provided, comprising: a first determining module 702, an allocation module 704, a second determining module 706, and a transmission module 708, wherein:
[0083] The first determining module 702 is used to determine the target remote terminal of the target transmission task;
[0084] The allocation module 704 is used to determine the allocation data block corresponding to each of the multiple sub-addresses of the target remote terminal in order of priority.
[0085] The second determining module 706 is used to determine at least one target sub-address corresponding to the target transmission task, and to determine the target allocation data block for each target sub-address; the target allocation data block is used to store the transmission data of the target transmission task.
[0086] The transmission module 708 is used to obtain the transmit / receive mode of the target transmission task and transmit the transmission data corresponding to the target allocated data block according to the transmit / receive mode.
[0087] In one embodiment, the second determining module 706 is further configured to: clear the sub-address parameters of multiple sub-addresses of the target remote terminal and clear the data block parameters of the allocated data block; obtain the target sub-address number and the transmit / receive mode in the target transmission task, and determine at least one target sub-address of the target transmission task based on the target sub-address number and the transmit / receive mode; and set the target sub-address parameters of each target sub-address and the target data block parameters of the target allocated data block of each target sub-address according to the target transmission task.
[0088] In one embodiment, the transmission module 708 is further configured to: transmit the transmission data according to the transmission strategy corresponding to the transmission mode when the transmission mode of the target transmission task is the transmission mode; and transmit the transmission data according to the reception strategy corresponding to the reception mode when the transmission mode of the target transmission task is the reception mode.
[0089] In one embodiment, the transmission module 708 is further configured to: send the target sub-address number of the target transmission task to the target remote terminal when the transmission mode of the target transmission task is a transmission mode; the target remote terminal is configured to store the transmission data of the target transmission task in the target allocation data block corresponding to the target sub-address number; and upon receiving a transmission request for the transmission data sent by the target remote terminal, obtain the transmission data of the target transmission task from the target allocation data block corresponding to the target sub-address number.
[0090] In one embodiment, the transmission module 708 is further configured to: when the transmit / receive mode of the target transmission task is a receive mode, send the target sub-address number of the target transmission task and the transmission data to the target remote terminal; the target remote terminal is configured to store the received transmission data in the target allocated data block.
[0091] In one embodiment, the allocation module 704 is further configured to: obtain the number of allocated data blocks corresponding to each of the plurality of sub-addresses of the target remote terminal; and allocate data blocks satisfying the corresponding number of allocated data blocks to each of the plurality of sub-addresses in order of priority.
[0092] The modules in the aforementioned communication device based on a portable operating system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0093] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores communication-related data based on the portable operating system. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a communication method based on the portable operating system.
[0094] Those skilled in the art will understand that Figure 8The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0095] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0096] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above-described method embodiments.
[0097] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0098] 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, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0099] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, 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 many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0100] The technical features of the above embodiments can be combined in any way. For the sake of brevity, 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.
[0101] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A communication method based on a portable operating system, characterized in that, The method includes: Identify the target remote terminal for the target transmission task; Obtain multiple query table structures corresponding to multiple sub-addresses of the target remote terminal; according to the order of the numbers of the multiple sub-addresses from smallest to largest as the priority order, obtain the storage management mode and the starting address of the data word storage for each query table structure; after writing the storage management mode and the starting address of the data word storage into the configuration address of the hardware register, determine the storage data block number corresponding to each sub-address based on the effective length of the query table structure. The allocated data block is determined based on the stored data block number; Determine at least one target sub-address corresponding to the target transmission task, and determine a target allocation data block for each target sub-address; the target allocation data block is used to store the transmission data of the target transmission task; Obtain the send / receive mode of the target transmission task, and transmit the transmission data corresponding to the target allocated data block according to the send / receive mode.
2. The method according to claim 1, characterized in that, The step of determining at least one target sub-address corresponding to the target transmission task, and determining the target allocation data block for each target sub-address, includes: Clear the sub-address parameters of the multiple sub-addresses of the target remote terminal to zero, and clear the data block parameters of the allocated data block to zero; Obtain the target sub-address number and the transmit / receive mode in the target transmission task, and determine at least one target sub-address of the target transmission task based on the target sub-address number and the transmit / receive mode; According to the target transmission task, set the target sub-address parameters for each target sub-address and set the target data block parameters for the target allocated data block for each target sub-address.
3. The method according to claim 1, characterized in that, The step of obtaining the send / receive mode of the target transmission task and transmitting the transmission data corresponding to the target allocated data block according to the send / receive mode includes: When the transmit / receive mode of the target transmission task is the transmit mode, the transmission data is transmitted according to the transmit strategy corresponding to the transmit mode; When the transmit / receive mode of the target transmission task is the receive mode, the transmission data is transmitted according to the receive strategy corresponding to the receive mode.
4. The method according to claim 3, characterized in that, When the transmit / receive mode of the target transmission task is transmit mode, transmitting the transmission data according to the transmission strategy corresponding to the transmit mode includes: When the transmit / receive mode of the target transmission task is the transmit mode, the target sub-address number of the target transmission task is sent to the target remote terminal; the target remote terminal is used to store the transmission data of the target transmission task into the target allocated data block corresponding to the target sub-address number; Upon receiving a transmission request for the transmission data sent by the target remote terminal, the transmission data of the target transmission task is obtained from the target allocated data block corresponding to the target sub-address number.
5. The method according to claim 3, characterized in that, When the transmit / receive mode of the target transmission task is the receive mode, transmitting the transmission data according to the receive strategy corresponding to the receive mode includes: When the transmit / receive mode of the target transmission task is the receive mode, the target sub-address number of the target transmission task and the transmission data are sent to the target remote terminal; the target remote terminal is used to store the received transmission data into the target allocated data block.
6. The method according to claim 1, characterized in that, Before obtaining the multiple query table structures corresponding to the multiple sub-addresses of the target remote terminal, the method further includes: The number of allocated data blocks corresponding to each of the multiple sub-addresses of the target remote terminal is obtained, and data blocks satisfying the corresponding number of allocated data blocks are allocated to each of the multiple sub-addresses one by one according to the priority order of the multiple sub-addresses.
7. A communication device based on a portable operating system, characterized in that, The device includes: The first determining module is used to determine the target remote terminal of the target transmission task; The allocation module is used to obtain multiple query table structures corresponding to multiple sub-addresses of the target remote terminal; according to the ascending order of the numbers of the multiple sub-addresses as a priority order, obtain the storage management mode and the starting address for storing data words for each query table structure; after writing the storage management mode and the starting address for storing data words into the configuration address of the hardware register, determine the storage data block number corresponding to each sub-address according to the effective length of the query table structure; and allocate data blocks according to the storage data block number. The second determining module is used to determine at least one target sub-address corresponding to the target transmission task, and to determine the target allocation data block for each target sub-address; the target allocation data block is used to store the transmission data of the target transmission task; The transmission module is used to obtain the send / receive mode of the target transmission task and transmit the transmission data corresponding to the target allocated data block according to the send / receive mode.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-6.
Citation Information
Patent Citations
Data distribution method, data distribution system, distribution source terminal, and distribution destination terminal
JP2011048466A