Disclosure of Invention
The present application aims to solve at least one of the technical problems existing in the prior art. Therefore, the application provides an inter-board data communication transmission method, electronic equipment and a computer readable storage medium, which can solve the problem that the transmission efficiency of the existing communication technology is low.
According to an embodiment of the first aspect of the application, the method for transmitting data communication between boards comprises the following steps: a first data area is arranged in a first memory, the first data area comprises a plurality of first storage units, the first memory is a memory of the first board card, the second memory comprises a plurality of second storage units, the second memory is a memory of the second board card, and the first storage units and the second storage units are in one-to-one correspondence; the first board card receives and analyzes a first message sent by the external device to obtain first data and a first address corresponding to the first data, wherein the first address is the address of the second storage unit; the first board card writes the first data into the first storage unit corresponding to the second storage unit; the first board card sends a second message to the second board card, judges whether the second message is sent successfully, and repeatedly executes the step if the second message is sent successfully, wherein the second message comprises second data and a second address, the second data is the data of the first storage unit, and the second address is the address of the second storage unit corresponding to the first storage unit.
The inter-board data communication transmission method according to the embodiment of the first aspect of the application has at least the following beneficial effects:
and receiving and analyzing a first message sent by the external equipment through the first board card to obtain first data and a first address corresponding to the first data, wherein the first address is an address of a second storage unit, writing the first data into the first storage unit corresponding to the second storage unit, sending the second message to the second board card through the first board card, wherein the second message comprises the second data and the second address, the second data is the data of the first storage unit, the second address is the address of the second storage unit corresponding to the first storage unit, judging whether the second message is sent successfully, and repeatedly executing the step if the sending fails, thereby realizing the communication between the external equipment and the second board card. According to the inter-board data communication transmission method of the embodiment of the first aspect of the application, compared with the traditional inter-board data communication transmission method, the first message is recoded into the second message through the first board card, the second message is sent to the second board card, namely, the data of the first message is sent to the second board card in a non-transparent transmission mode, and as the non-transparent transmission speed is faster than that of transparent transmission, the transmission time is saved, if the second message is failed to be sent, the second message is retransmitted through the first board card, the first message is prevented from being retransmitted from an external device, the external communication links with long time consumption are reduced, and the communication efficiency is improved.
According to some embodiments of the application, further comprising: and setting a second data area in the first memory, wherein the second data area comprises a plurality of third storage units, and the third storage units are in one-to-one correspondence with the second storage units.
According to some embodiments of the present application, the determining whether the second message is sent successfully includes:
the second board card sends a third message to the first board card, wherein the third message comprises third data and a third address, the third data is data of the second storage unit, and the third address is an address of the third storage unit corresponding to the second storage unit;
the first board card writes the third data into the third storage unit based on the third message;
and the first board card judges whether the data of the first storage unit and the third storage unit corresponding to the same second storage unit are the same, if so, the second message is confirmed to be successfully sent, and if not, the second message is confirmed to be failed to be sent.
According to some embodiments of the present application, the first board card determining whether the data of the first storage unit and the third storage unit corresponding to the same second storage unit are the same includes: and the first board card judges whether the data of the first storage unit and the third storage unit corresponding to the same second storage unit are the same in real time.
According to some embodiments of the present application, the sending, by the second board, a third message to the first board includes: and the second board card sends the third message to the first board card in real time.
According to some embodiments of the present application, the sending, by the second board, a third message to the first board includes: and the second board card sends the third message to the first board card at fixed time.
An electronic device according to an embodiment of a second aspect of the present application includes: a first board card; the first board card is connected with the second board card, and the first board card and the second board card perform data transmission according to the inter-board data communication transmission method.
The electronic equipment according to the embodiment of the second aspect of the application has at least the following beneficial effects:
and receiving and analyzing a first message sent by the external equipment through the first board card to obtain first data and a first address corresponding to the first data, wherein the first address is an address of a second storage unit, writing the first data into the first storage unit corresponding to the second storage unit, sending the second message to the second board card through the first board card, wherein the second message comprises the second data and the second address, the second data is the data of the first storage unit, the second address is the address of the second storage unit corresponding to the first storage unit, judging whether the second message is sent successfully, and repeatedly executing the step if the sending fails, thereby realizing the communication between the external equipment and the second board card. According to the electronic device of the second aspect of the embodiment of the application, compared with the traditional inter-board data communication transmission method, the first message is recoded into the second message through the first board card, and then the second message is sent to the second board card, namely, the data of the first message is sent to the second board card in a non-transparent transmission mode, and because the non-transparent transmission speed is faster than that of transparent transmission, the transmission time is saved, if the second message fails to be sent, the second message is retransmitted through the first board card, the first message is prevented from being retransmitted from the external device, the time-consuming longer external communication links are reduced, and the communication efficiency is improved.
A computer-readable storage medium according to an embodiment of the third aspect of the present application stores therein a processor-executable program for implementing an inter-board data communication transmission method as described above when executed by a processor.
The computer readable storage medium according to the embodiment of the third aspect of the present application has at least the following advantageous effects:
and receiving and analyzing a first message sent by the external equipment through the first board card to obtain first data and a first address corresponding to the first data, wherein the first address is an address of a second storage unit, writing the first data into the first storage unit corresponding to the second storage unit, sending the second message to the second board card through the first board card, wherein the second message comprises the second data and the second address, the second data is the data of the first storage unit, the second address is the address of the second storage unit corresponding to the first storage unit, judging whether the second message is sent successfully, and repeatedly executing the step if the sending fails, thereby realizing the communication between the external equipment and the second board card. According to the computer readable storage medium of the third aspect of the present application, compared with the conventional inter-board data communication transmission method, the first message is recoded into the second message through the first board card, and then the second message is sent to the second board card, that is, the data of the first message is sent to the second board card through the non-transparent transmission mode, because the non-transparent transmission speed is faster than the transparent transmission speed, the transmission time is saved, if the second message fails to be sent, the second message is retransmitted through the first board card, the first message is prevented from being retransmitted from the external device, the external communication link with long time consumption is reduced, and the communication efficiency is improved.
Additional aspects and advantages of the application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
In the description of the present application, it should be understood that, with respect to the description of the orientation, such as the orientation or positional relationship indicated above, below, etc., the orientation or positional relationship shown based on the drawings is merely for convenience of describing the present application and simplifying the description, and does not indicate or imply that the apparatus or element in question must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present application.
In the description of the present application, plural refers to two or more. The description of the first and second is for the purpose of distinguishing between technical features only and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or implicitly indicating the precedence of the technical features indicated.
In the description of the present application, unless explicitly defined otherwise, terms such as arrangement, installation, connection, etc. should be construed broadly and the specific meaning of the terms in the present application can be reasonably determined by a person skilled in the art in combination with the specific contents of the technical solution.
As shown in fig. 1, fig. 1 is a flowchart of an inter-board data communication transmission method according to an embodiment of the present application, and the inter-board data communication transmission method according to an embodiment of the present application is applied to an electronic device 100, where the electronic device 100 includes a first board 110 and a second board 120 that are communicatively connected to each other, and the first board 110 is used for communicatively connecting to an external device, including but not limited to step S100, step S200, step S300, and step S400.
Step S100: a first data area is arranged in the first memory, the first data area comprises a plurality of first storage units, the first memory is a memory of the first board card 110, the second memory comprises a plurality of second storage units, the second memory is a memory of the second board card 120, and the first storage units and the second storage units are in one-to-one correspondence;
step S200: the first board 110 receives and analyzes a first message sent by the external device to obtain first data and a first address corresponding to the first data, wherein the first address is an address of the second storage unit;
step S300: the first board 110 writes the first data into a first storage unit corresponding to the second storage unit;
step S400: the first board 110 sends a second message to the second board 120, determines whether the second message is sent successfully, and if the second message is sent successfully, repeatedly executes the step, where the second message includes second data and a second address, the second data is data of the first storage unit, and the second address is an address of the second storage unit corresponding to the first storage unit.
In this step, the first card 110 receives and analyzes the first message sent by the external device to obtain the first data and the first address corresponding to the first data, the first address is the address of the second storage unit, the first data is written into the first storage unit corresponding to the second storage unit, the second message is sent to the second card 120 through the first card 110, the second message includes the second data and the second address, the second data is the data of the first storage unit, the second address is the address corresponding to the second storage unit, and it is judged whether the second message is sent successfully, if the sending fails, the step is repeatedly performed, so that the communication between the external device and the second card 120 is realized, compared with the traditional inter-board data communication transmission method, the first message is recoded into the second message through the first card 110, and then the second message is sent to the second card 120 through the non-transparent transmission mode, namely, the data of the first message is sent to the second card 120 through the non-transparent transmission mode, because the non-transparent transmission speed is faster than that the second message is sent through the first card, if the sending fails, the communication time is saved, and if the sending fails, the communication is avoided, and the time is saved.
It should be noted that, the format of the second packet may be a first transmission format as shown in fig. 2, where the first transmission format includes a plurality of data and addresses corresponding to the plurality of data one by one, or may be a second transmission format as shown in fig. 3, where the second transmission format includes a data sequence having a plurality of data, a start address of the data sequence, and the number of data of the data sequence.
The inter-board data communication transmission method according to an embodiment of the present application further includes step S110.
Step S110: the first memory is internally provided with a second data area, the second data area comprises a plurality of third storage units, and the third storage units are in one-to-one correspondence with the second storage units.
In this step, a second data area is set in the first memory, where the second data area includes a plurality of third storage units, and the third storage units are in one-to-one correspondence with the second storage units, so that the content of the second storage unit is written into the third storage units in the subsequent step, and further, whether the data of the first storage unit and the third storage unit corresponding to the same second storage unit are the same is determined.
It is understood that the setting position of the second data area is not limited, and for example, the second data area may be set in other memories of the first board 110.
As shown in fig. 4, fig. 4 is a flowchart of determining whether the second message is sent successfully in an embodiment of the present application, and according to an embodiment of the present application, the "determining whether the second message is sent successfully" in step S400 is further described, and step S400 includes, but is not limited to, step S410, step S420, and step S430.
Step S410: the second board 120 sends a third message to the first board 110, where the third message includes third data and a third address, the third data is data of the second storage unit, and the third address is an address of a third storage unit corresponding to the second storage unit;
step S420: the first board 110 writes third data into the third storage unit based on the third message;
step S430: the first board 110 judges whether the data of the first storage unit and the third storage unit corresponding to the same second storage unit are the same, if so, the second message is confirmed to be successfully sent, otherwise, the second message is confirmed to be failed to be sent.
In this step, a third message is sent to the first board 110 through the second board 120, where the third message includes third data and a third address, the third data is data of the second storage unit, the third address is an address of a third storage unit corresponding to the second storage unit, and the first board 110 writes the third data into the third storage unit based on the third message, that is, copies the content of the second storage unit into the corresponding third storage unit, so as to implement data mirroring, so as to determine whether the data of the first storage unit and the third storage unit corresponding to the same second storage unit are the same, if so, it is confirmed that the second message is sent successfully, or else, it is confirmed that the second message is sent unsuccessfully.
It can be understood that, when the external device requests to read the data of the second storage unit, the first board 110 transmits the data in the first storage unit corresponding to the second storage unit to the external device, so that links of data transmission are reduced, and transmission efficiency is improved.
It should be noted that, the first board 110 determines whether the data of the first storage unit and the third storage unit corresponding to the same second storage unit are the same in real time, so as to determine whether the second message is sent successfully. In the conventional inter-board data communication transmission method, the external device needs a preset response time, if the response time exceeds the response time and the successful transmission from the second board card 120 forwarded by the first board card 110 is not received, the transmission failure is confirmed, and because the baud rate of the communication between the external device and the first board card 110 is lower, the transmission speed is slow, the preset response time is relatively longer, and if retransmission is needed, the whole transmission process takes longer, and according to the inter-board data communication transmission method in an embodiment of the application, whether the second message is successfully transmitted can be judged in real time, and if the transmission failure occurs, the second message can be immediately transmitted again, so that the transmission time is reduced.
It should be noted that, the second board 120 sends the third message to the first board 110 in real time, in other words, after the second board 120 changes the data in the second storage unit, the third message is immediately sent to the first board 110, so that the data in the third storage unit in the second data area is updated in time and kept consistent with the corresponding second storage unit. The second board 120 may also send a third message to the first board 110 at regular time intervals.
As shown in fig. 5, an electronic device 100 according to an embodiment of the present application includes: the first board 110 comprises a first processor, a first memory and a first communication interface, the first processor is electrically connected with the first memory and the first processor respectively, the second board 120 comprises a second processor, a second memory and a second communication interface, the second processor is electrically connected with the second memory and the second communication interface respectively, the first communication interface is in communication connection with the second communication interface, and the first board 110 and the second board 120 perform data transmission through the inter-board data communication transmission method.
According to the electronic device 100 of an embodiment of the present application, a first packet sent by an external device is received and parsed by the first board 110, so as to obtain first data and a first address corresponding to the first data, the first address is an address of a second storage unit, the first data is written into the first storage unit corresponding to the second storage unit, the second packet is sent to the second board 120 by the first board 110, the second packet includes the second data and the second address, the second data is the data of the first storage unit, the second address is an address corresponding to the second storage unit of the first storage unit, whether the second packet is sent successfully is determined, if the sending fails, the step is repeatedly executed, so as to realize communication between the external device and the second board 120. According to the electronic device 100 of an embodiment of the present application, compared with the conventional inter-board data communication transmission method, the first message is recoded into the second message through the first board 110, and then the second message is sent to the second board 120, that is, the data of the first message is sent to the second board 120 in a non-transparent transmission manner, because the non-transparent transmission speed is faster than that of the transparent transmission, the transmission time is saved, if the second message fails to be sent, the second message is retransmitted through the first board 110, so that the first message is prevented from being retransmitted from the external device, the external communication link with long time consumption is reduced, and the communication efficiency is improved.
In addition, an embodiment of the present application also discloses a computer-readable storage medium having stored therein computer-executable instructions for performing the inter-board data communication transmission method as in any of the previous embodiments.
Those of ordinary skill in the art will appreciate that all or some of the steps, systems, and methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on computer readable media, which may include computer storage media (or non-transitory media) and communication media (or transitory media). The term computer storage media includes both volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data, as known to those skilled in the art. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Furthermore, as is well known to those of ordinary skill in the art, communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media.
The embodiments of the present application have been described in detail above with reference to the accompanying drawings, but the present application is not limited to the above embodiments, and various changes can be made within the knowledge of one of ordinary skill in the art without departing from the spirit of the present application.