Communication method, board card, energy storage valve control system and storage medium
By establishing a unified system communication interface layer in the energy storage valve control system and using inter-board and intra-board communication proxies to achieve virtual port mapping, the problem of poor portability and scalability of inter-board communication methods is solved, and flexible data routing and efficient communication are realized.
Patent Information
- Application Number
- CN202310921271.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-25
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-07-25
AI Technical Summary
The communication between boards in existing energy storage valve control systems is based on the same operating system driver, resulting in poor portability, scalability, and flexibility.
A unified system communication interface layer is established between the operating system layer and the application layer. Through inter-board communication agents and intra-board communication agents, virtual ports and shared spaces are pre-configured to achieve transparent communication between different boards and between intra-board processes, and data routing is performed based on the mapping relationship between virtual ports.
It enables flexible communication between different boards and between processes within a board, improves portability and scalability, and simplifies the R&D and maintenance process.
Smart Images

Figure CN119383150B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of communication, and particularly relates to a communication method, a board card, an energy storage valve control system and a storage medium. BACKGROUND
[0002] The energy storage valve control system usually adopts a multi-board card design (for example, a control board, an interface board, an input / output board, a display panel, etc.), and each board card can have different functions or architectures. The application software configured on these board cards can run based on an operating system or directly based on a processor, and the physical communication interface between the board cards can be a point-to-point communication bus interface or a shared bus interface, such as an Ethernet interface, an RS485 interface, a Controller Area Network (CAN) interface, a Low-Voltage Differential Signaling (LVDS) interface, etc.
[0003] At present, the communication mode between the board cards is usually a physical signal interface based on the same operating system driver, and the portability, scalability and flexibility are poor. SUMMARY
[0004] Therefore, the embodiments of the present application provide a communication method, a board card, an energy storage valve control system and a storage medium, aiming at solving the problem that the current communication mode between the board cards is usually a physical signal interface based on the same operating system driver, and the portability, scalability and flexibility are poor.
[0005] A first aspect of the embodiments of the present application provides a communication method, which is realized based on a communication system running on a board card. The communication system includes a driver layer, an operating system layer and an application layer, and further includes a unified system communication interface layer established between the operating system layer and the application layer. The communication method includes the following steps.
[0006] Through a first process, a source port corresponding to the first process is started to obtain a first communication channel identifier, and first data is written into a first shared space according to the first communication channel identifier;
[0007] Through an inter-board communication agent, a destination port corresponding to the inter-board communication agent is started to obtain the first communication channel identifier, and the first data is read from the first shared space according to the first communication channel identifier;
[0008] Through the inter-board communication agent, a port number of the destination port corresponding to the inter-board communication agent is written into the first data to generate first target data;
[0009] Through the inter-board communication agent, the first target data is sent to the driver layer;
[0010] by the driving layer, the at least one physical communication interface of the board card sends the first target data to the physical communication interface of the at least one other board card;
[0011] The unified system communication interface layer includes the inter-board communication agent, the destination port corresponding to the inter-board communication agent, and the source port corresponding to the first process.
[0012] In a first aspect, a communication method based on a communication system running on a board card is provided. A unified system communication interface layer is established between an operating system layer and an application layer of the communication system. At least one set of source ports and destination ports is preconfigured in the unified system communication interface layer based on an inter-board communication agent of the unified system communication interface layer according to actual needs. A communication channel identifier and a shared space are established according to a port number of each set of virtual ports (i.e., source ports and destination ports) to establish a mapping relationship between each set of virtual ports. In the case where inter-board communication is needed and a user does not know an address of a data receiver, the user can achieve communication between different board cards without knowing the address of the data receiver based on the mapping relationship between each set of virtual ports. The type of an operating system running on different board cards is not limited. This inter-board communication method is transparent to the user (user transparency means that the user does not need to care about a specific communication implementation method, which is transparent and invisible to the user, and the user only needs to use it). By pre-establishing a mapping relationship between different virtual ports, a data sender (i.e., a first process) and a data receiver (i.e., at least one other board card) can be flexibly bound, so that different data routing can be achieved, and the method can be applied to any board card, and has good portability, scalability, and flexibility. The first aspect can achieve one-way data sending from a board card to at least one other board card, i.e., one-to-one or one-to-many.
[0013] In a first implementation manner of the first aspect, before the first process is started, the source port corresponding to the first process is opened to obtain a first communication channel identifier, and the first data is written into a first shared space according to the first communication channel identifier, the method further includes:
[0014] The inter-board communication agent establishes a globally unique first communication channel identifier and a globally unique first shared space according to a port number of the source port corresponding to the first process and a port number of the destination port corresponding to the inter-board communication agent.
[0015] In the first implementation manner of the first aspect, the first communication channel identifier and the first shared space are established based on the source port corresponding to the first process and the destination port corresponding to the inter-board communication agent according to the user configuration before inter-board communication is performed, so that the mapping between the source port corresponding to the first process and the destination port corresponding to the inter-board communication agent is implemented based on the first communication channel identifier, and the first process writes data and the inter-board communication agent reads data based on the first communication channel identifier and the first shared space, so as to implement the communication between the first process and the inter-board communication agent, and further implement the communication between the first process and other boards, which is good in scalability and flexibility.
[0016] In the second implementation manner of the first aspect, the number of the destination ports corresponding to the inter-board communication agent is multiple, and each of the destination ports corresponding to the inter-board communication agent is mapped with a source port corresponding to the first process, based on the first or second implementation manner of the first aspect.
[0017] The communication method further includes:
[0018] In the case that the inter-board communication agent generates multiple first target data, the inter-board communication agent packs and sends all the first target data to the drive layer.
[0019] In the second implementation manner of the first aspect, in the case that the number of the destination ports corresponding to the inter-board communication agent is multiple, the inter-board communication agent generates multiple first target data according to the first data sent by multiple first processes based on the mapping relationship between each of the destination ports corresponding to the inter-board communication agent and a source port corresponding to the first process, and packs and sends the first target data to the drive layer, so as to send the first target data to other boards through the drive layer, thereby realizing one-way batch data communication between different boards. The second implementation manner of the first aspect can realize one-way batch sending of data from a board to at least one other board.
[0020] In the third implementation manner of the first aspect, the communication method further includes:
[0021] The drive layer drives the physical communication interface of the board to receive second target data sent by the physical communication interface of at least one other board.
[0022] The second target data is acquired and parsed by the inter-board communication agent to obtain a port number of a destination port corresponding to another inter-board communication agent and second data, the port number of the destination port corresponding to the another inter-board communication agent being the same as the port number of the source port corresponding to the inter-board communication agent, the another inter-board communication agent running on the another board card;
[0023] The source port corresponding to the inter-board communication agent is started according to the port number of the destination port corresponding to the another inter-board communication agent, to obtain a second communication channel identifier, and the second data is written into a second shared space according to the second communication channel identifier;
[0024] The destination port corresponding to the second process is started to obtain the second communication channel identifier, and the second data is read from the second shared space according to the second communication channel identifier;
[0025] The unified system communication interface layer further includes the source port corresponding to the inter-board communication agent and the destination port corresponding to the second process.
[0026] In the third implementation manner of the first aspect, based on the mapping relationship between each group of virtual ports of the board card that is established in advance, the port number of the source port corresponding to the inter-board communication agent of the board card is made the same as the port number of the destination port corresponding to the another inter-board communication agent of the another board card, so that the mapping relationship between the virtual ports of different board cards is established, so that the user can realize the communication between different board cards based on the mapping relationship between the virtual ports of different board cards without knowing the address of the data receiving party, without needing to know the address of the data receiving party, and without being limited to the type of operating system running on different board cards. This inter-board communication mode is transparent to the user. Based on this, the data sender (that is, the another board card) and the data receiving party (that is, the second process) can be flexibly bound by establishing the mapping between the virtual ports of different board cards in advance, so that different data routing can be performed, and the method can be applied to any board card and has good portability, scalability and flexibility. In the third implementation manner of the first aspect, based on the first aspect, the board card can one-way receive data sent by at least one another board card, that is, one-to-one or multiple-to-one, so that bidirectional data communication between different board cards is realized as a whole.
[0027] In the fourth implementation manner of the first aspect, based on the third implementation manner of the first aspect, before the physical communication interface of the board card receives the second target data sent by the physical communication interface of the another board card by driving the driving layer, the method further includes:
[0028] The inter-board communication agent establishes a globally unique second communication channel identifier and a globally unique second shared space according to a port number of the source port corresponding to the inter-board communication agent and a port number of the destination port corresponding to the second process.
[0029] In the fourth implementation manner of the first aspect, before the inter-board communication, the inter-board communication agent establishes a common and globally unique second communication channel identifier and a common and globally unique second shared space according to a port number of a source port corresponding to the inter-board communication agent and a port number of a destination port corresponding to the second process based on the actual needs of the user, so as to realize the mapping between the source port corresponding to the inter-board communication agent and the destination port corresponding to the second process based on the second communication channel identifier, and realize the inter-board communication agent writing data and the second process reading data based on the second communication channel identifier and the second shared space, thereby realizing the communication between the inter-board communication agent and the second process, and further realizing the communication between the second process and other board cards, which is good in scalability and flexibility.
[0030] In the fifth implementation manner of the first aspect, the number of the source ports corresponding to the inter-board communication agent is multiple, and each source port corresponding to the inter-board communication agent is mapped with a destination port corresponding to one second process.
[0031] The communication method further includes:
[0032] In the case that the inter-board communication agent obtains the packaged multiple second target data, the inter-board communication agent unpacks and parses all the second target data to obtain the port numbers of the multiple source ports corresponding to the inter-board communication agent and the multiple second data.
[0033] In the fifth implementation manner of the first aspect, in the case that the number of the source ports corresponding to the inter-board communication agent is multiple, the inter-board communication agent can unpack to obtain the port numbers of the multiple destination ports corresponding to other inter-board communication agents and the multiple second data in the case that it receives the packaged multiple second target data sent by at least one other board card, and then distribute the multiple second data to each second process based on the mapping relationship between each group of virtual ports of different board cards and the mapping relationship between each group of virtual ports of the same board card, so as to realize the one-way batch data communication between different board cards. The fifth implementation manner of the first aspect can realize that the board card receives the batch data sent by at least one other board card in one way.
[0034] In a sixth implementation form of the first aspect, in any of the third or fourth implementation form of the first aspect, the second process and the first process are the same process.
[0035] In the sixth implementation form of the first aspect, in the case that the second process and the first process are the same process, bidirectional communication between the same process in the board and the inter-board communication agent can be implemented.
[0036] In a seventh implementation form of the first aspect, based on the first aspect or any one of the first to sixth implementation forms of the first aspect, the communication method further includes:
[0037] opening, by the third process, a source port corresponding to the third process to obtain a third communication channel identifier, and writing third data into a third shared space according to the third communication channel identifier;
[0038] opening, by the fourth process, a destination port corresponding to the fourth process to obtain the third communication channel identifier, and reading the third data from the third shared space according to the third communication channel identifier;
[0039] The unified system communication interface layer further includes the source port corresponding to the third process and the destination port corresponding to the fourth process.
[0040] In the seventh implementation form of the first aspect, based on the pre-established mapping relationship between each group of virtual ports, in the case that intra-board communication is needed and the user does not know the address of the data receiver, the user does not need to know the address of the data receiver, and communication between different processes in the same board can be implemented, which is transparent to the user. Based on this, by pre-establishing the mapping between different virtual ports, the data sender (i.e., the third process) and the data receiver (i.e., the fourth process) can be flexibly bound, so that different data routing can be performed, which can be applied to any board and has good portability, scalability and flexibility.
[0041] In an eighth implementation form of the first aspect, based on the seventh implementation form of the first aspect, the unified system communication interface layer further includes an intra-board communication agent.
[0042] Before the opening, by the third process, of the source port corresponding to the third process to obtain the third communication channel identifier and the writing of the third data into the third shared space according to the third communication channel identifier, the method further includes:
[0043] establishing, by the intra-board communication agent, a globally unique third communication channel identifier and a globally unique third shared space according to a port number of the source port corresponding to the third process and a port number of the destination port corresponding to the fourth process.
[0044] In an eighth implementation form of the first aspect, by establishing a third communication channel identifier and a third shared space which are common and globally unique based on the source port number of the third process and the destination port number of the fourth process configured by the user before the intra-board communication is performed, the mapping between the source port of the third process and the destination port of the fourth process is realized based on the third communication channel identifier, and the writing of data by the third process and the reading of data by the fourth process are realized based on the third communication channel identifier and the third shared space, thereby realizing the communication between the third process and the fourth process, that is, the communication between different processes in the board, and good scalability and flexibility.
[0045] In a ninth implementation form of the first aspect based on the seventh or eighth implementation form of the first aspect, the third process and the first process are the same process.
[0046] In the eighth implementation form of the first aspect, in the case where the third process and the first process are the same process, the communication between the same process in the board and other processes in the board and other processes outside the board can be realized.
[0047] The second aspect of the embodiment of the present application provides a board card, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the communication method provided in the first aspect of the embodiment of the present application when executing the computer program.
[0048] The third aspect of the embodiment of the present application provides an energy storage valve control system, which comprises the board card provided in the second aspect of the embodiment of the present application and the at least one other board card.
[0049] The fourth aspect of the embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps of the communication method provided in the first aspect of the embodiment of the present application when executed by a processor.
[0050] It can be understood that the beneficial effects of the second aspect to the fourth aspect described above can be referred to the related description in the first aspect described above, and will not be described here again. BRIEF DESCRIPTION OF DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0052] Figure 1 is a schematic diagram of an architecture of a communication system running on a board card provided by an embodiment of the present application;
[0053] Figure 2 is a first flowchart of a communication method provided by an embodiment of the present application;
[0054] Figure 3 is a second flowchart of a communication method provided by an embodiment of the present application;
[0055] Figure 4 is a schematic diagram of a bidirectional communication architecture between two different board cards provided by an embodiment of the present application;
[0056] Figure 5 is a third flowchart of a communication method provided by an embodiment of the present application;
[0057] Figure 6 is a fourth flowchart of a communication method provided by an embodiment of the present application;
[0058] Figure 7 is a schematic diagram of a bidirectional communication architecture between different processes in a same board card provided by an embodiment of the present application;
[0059] Figure 8 is a schematic diagram of a structure of a board card provided by an embodiment of the present application. DETAILED DESCRIPTION
[0060] In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular sequences of steps, techniques, etc., in order to provide a thorough understanding of the present embodiments. However, it will be apparent to those skilled in the art that the present embodiments can be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known methods, devices, and circuits are omitted so as not to obscure the description of the present embodiments.
[0061] It is to be understood that the terminology "includes", "has", "holds", "contains" and / or "comprising", when used in this specification and in the following claims, indicates the presence of the described features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0062] It is also to be understood that the terminology "and / or" when used in this specification and in the following claims, refers to at least one of the items, or any combination of the items, that are possibly included in the associated list of items, and that includes all possible combinations of the items.
[0063] As used in the specification and the appended claims, the term "if' can be interpreted as meaning "when" or "upon" or "in response to determining" or "in response to detecting" depending on the context. Similarly, the phrase "if it is determined" or "if [a described condition or event] is detected" can be interpreted to mean "upon determining" or "in response to determining" or "upon detecting [the described condition or event]" or "in response to detecting [the described condition or event]" depending on the context.
[0064] In addition, the description in the specification and the appended claims of this application, the terms "first", "second", "third", etc. are merely used to distinguish descriptions, and cannot be understood as indicating or implying relative importance.
[0065] Reference in the specification to "one embodiment" or "some embodiments" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearances of the phrase "in one embodiment" or "in some embodiments" in various places in the specification are not necessarily all referring to the same embodiment, although it can. The terms "including," "containing," "having," and variations thereof are meant to encompass the terms "including but not limited to."
[0066] The embodiment of the application provides a communication method, which is realized based on a communication system running on a board card, can be executed by a processor of the board card when a computer program with corresponding functions is run, a unified system communication interface (USCI) layer is established between an operating system layer and an application layer of the communication system, at least one group of source ports and destination ports is configured in the USCI layer based on an in-board communication agent or an inter-board communication agent of the USCI layer according to actual needs, a common communication channel identity (ID) and a shared space are established according to each group of source ports and destination ports, and the mapping relationship between each group of virtual ports (namely, source ports and virtual ports) is established, so that in the case that in-board communication or inter-board communication is needed and the user does not know the address of a data receiver, the address of the data receiver does not need to be known, and the mapping relationship between each group of virtual ports can be used to realize the communication between different processes in the board or between different board cards, the type of the operating system running on different board cards is not limited, the communication mode is transparent to the user, and based on this, the mapping between different virtual ports is established in advance, so that the data sender and the data receiver can be flexibly bound, different data routing can be realized, the method can be applied to any board card, and the portability, scalability and flexibility are good, the research and development cycle can be effectively shortened, and the method is easy to maintain and test.
[0067] In the application, the types of the operating systems running on different board cards can be the same or different, and the operating system can be Microsoft Windows, macOS, Linux, Google chrome OS, iOS, Android, Huawei Hongmeng system, kaios, ipad OS, fuchsia OS and the like.
[0068] As shown in the figure, Figure 1 An exemplary architecture of a communication system 101 running on a board card is shown, the communication system 101 comprises a driving layer 11, an operating system layer 12, a USCI layer 13 and an application layer arranged in sequence;
[0069] The USCI layer 13 comprises an inter-board communication agent 131, an in-board communication agent 132 and at least one group of virtual ports, Figure 1 Four groups of virtual ports are exemplarily shown in the figure, which are source port 133-1 and destination port 134-1, source port 134-2 and destination port 133-2, source port 134-3 and destination port 135-1, and source port 135-2 and destination port 134-4
[0070] The application layer is used for running a plurality of processes or tasks, Figure 1Two processes are exemplarily shown in the figure, which are process 141 and process 142 respectively;
[0071] The board card 100 is provided with at least one physical communication interface, Figure 1 In the figure, one physical communication interface 102 is exemplarily shown;
[0072] The source port 133-1 corresponding to the process 141 and the destination port 134-1 corresponding to the process 142 are mapped to each other, for realizing one-way sending of data from the process 141 to the process 142;
[0073] The source port 134-2 corresponding to the process 142 and the destination port 133-2 corresponding to the process 141 are mapped to each other, for realizing one-way sending of data from the process 142 to the process 141;
[0074] The source port 134-3 corresponding to the process 142 and the destination port 135-1 corresponding to the inter-board communication agent 131 are mapped to each other, for realizing one-way sending of data from the process 142 to the inter-board communication agent 131;
[0075] The source port 135-2 corresponding to the inter-board communication agent 131 and the destination port 134-4 corresponding to the process 142 are mapped to each other, for realizing one-way sending of data from the inter-board communication agent 131 to the process 142;
[0076] The driver layer 11 is used for:
[0077] The physical communication interface 102 provided on the board card is driven to send the data one-way sent from the process 142 to the inter-board communication agent 131 to the physical communication interface of at least one other board card;
[0078] The physical communication interface 102 is driven to receive the data sent from the physical communication interface of at least one other board card;
[0079] The inter-board communication agent 131 is used for acquiring the data sent from the physical communication interface of at least one other board card from the driver layer 11 and sending the data to the process 142.
[0080] In the application, when the board card is provided with multiple physical communication interfaces, the types of the multiple physical communication interfaces can be the same or different, and the physical communication interface can be a bus interface for point-to-point communication or a shared bus interface, for example, an Ethernet interface, an RS485 interface, a Controller Area Network (CAN) interface, a Low-Voltage Differential Signaling (LVDS) interface, etc.
[0081] In the application, the drive layer, the operating system layer, the USIC layer, the application layer, and the inter-board communication agent and the intra-board communication agent of the USIC layer are all computer programs running on the processor of the board card, and the physical communication interface is an entity interface arranged on the board card and in communication connection with the processor.
[0082] The drive layer is configured to run a software driver of the physical communication interface to drive the physical communication interface to communicate with the physical communication interface of another board card.
[0083] The operating system layer is configured to run an operating system to create processes or tasks and manage the processes or tasks.
[0084] The application layer is configured to run the processes or tasks to realize corresponding application functions.
[0085] The USIC layer is configured to run the inter-board communication agent and the intra-board communication agent, and provide a plurality of groups of virtual ports for realizing data communication between the inter-board communication agent and different processes or tasks, between the intra-board communication agent and different processes or tasks, between different processes, between different tasks, and between a process and a task, each group of virtual ports being mutually mapped.
[0086] In the USIC layer, the inter-board communication agent is configured to realize communication between different board cards, and specifically configured to:
[0087] In the USIC layer, one or more groups of virtual ports are configured between the inter-board communication agent and the processes or tasks, each group of virtual ports including one source port and one destination port which are mutually mapped, and data is unidirectionally sent from the source port to the destination port.
[0088] In response to a port number configuration operation of a user, a port number of each group of virtual ports is configured.
[0089] According to the port number of each group of virtual ports, a globally unique communication channel ID and a globally unique shared space corresponding to each group of virtual ports are established, and the communication channel ID is stored in the shared space.
[0090] Data written in the shared space by the processes or tasks is read from the shared space according to the communication channel ID.
[0091] The port number of the destination port corresponding to itself is written in the data, target data is generated and sent to the drive layer to trigger the drive layer to drive at least one physical communication interface of the board card to send the data to at least one physical communication interface of another board card, and in the case of multiple target data, the multiple target data are packaged and then sent to the drive layer.
[0092] The at least one physical communication interface of the trigger driver layer driver board card receives target data sent by a physical communication interface of at least one other board card and performs analysis to obtain a port number of a source port corresponding to an inter-board communication agent and data, and in the case of receiving a plurality of packaged target data, the plurality of packaged target data are unpacked and then analyzed; and the analyzed data are written into a shared space according to a communication channel ID;
[0093] In the USIC layer, the inter-board communication agent is configured to implement communication between different processes in the same board card, and is specifically configured to:
[0094] A group or multiple groups of virtual ports are configured between different processes or tasks in the USIC layer, each group of virtual ports includes one source port and one destination port which are mapped to each other, and data is unidirectionally sent from the source port to the destination port;
[0095] In response to a port number configuration operation of a user, a port number of each group of virtual ports is configured;
[0096] According to the port number of each group of virtual ports, a globally unique communication channel ID and a globally unique shared space corresponding to each group of virtual ports are established, and the communication channel ID is stored in the shared space;
[0097] The inter-board communication agent and the inter-board communication agent are further configured to:
[0098] The communication channel in the same board card or between different board cards is configured, and the specific configuration content includes but is not limited to: a source port, a destination port, a port number of the source port, a port number of the destination port, a communication channel ID, a port type, a data size, a channel depth, a driver type, etc.
[0099] In an application, the communication method provided by the embodiment of the application can be applied to different board cards (including the above-mentioned board card and at least one other board card) of an energy storage valve control system, and the energy storage valve control system can be applied to flight equipment in the field of aviation / aerospace, electric vehicles or automobile batteries in the field of automobiles, etc.
[0100] As shown in Figure 2 The communication method provided by the embodiment of the application includes the following steps S101 to S105 for implementing a first unidirectional inter-board communication (specifically, unidirectional data sending from the board card to at least one other board card):
[0101] In step S101, a source port corresponding to a first process is opened by the first process to obtain a first communication channel ID, and first data are written into a first shared space according to the first communication channel ID, and step S102 is entered;
[0102] Step S102, opening the destination port corresponding to the inter-board communication agent by the inter-board communication agent, obtaining the first communication channel ID, and reading the first data from the first shared space according to the first communication channel ID, entering step S103.
[0103] In application, the first process can be any process running on the board card which needs to send data to other processes running on other board cards. According to the actual needs of the user, the source port corresponding to the first process and the destination port corresponding to the inter-board communication agent are configured in the USCI layer of the board card by the inter-board communication agent, and then the globally unique first communication channel ID and the globally unique first shared space are established by the inter-board communication agent according to the port numbers of the virtual ports, and the first communication channel ID is stored in the first shared space.
[0104] In application, the process of the first process sending the first data to the inter-board communication agent unidirectionally is as follows:
[0105] The first process opens the source port corresponding to the first process, reads the globally unique first communication channel ID from the first shared space, and writes the first data into the first shared space according to the first communication channel ID;
[0106] The inter-board communication agent opens the destination port corresponding to the inter-board communication agent, reads the globally unique first communication channel ID from the first shared space, and reads the first data from the first shared space according to the first communication channel ID, thereby realizing the unidirectional sending of the first data from the first process to the inter-board communication agent.
[0107] Step S103, generating the first target data by writing the port number of the destination port corresponding to the inter-board communication agent into the first data through the inter-board communication agent, entering step S104;
[0108] Step S104, sending the first target data to the driver layer through the inter-board communication agent, entering step S105;
[0109] Step S105, sending the first target data to the physical communication interface of at least one other board card through the driver layer.
[0110] In application, the port number of the destination port corresponding to the inter-board communication agent and the port number of the source port corresponding to the inter-board communication agent of other board are set to be the same and globally unique according to the actual needs of the user in advance, so as to establish the mutual mapping relationship between the destination port corresponding to the inter-board communication agent and the source port corresponding to the inter-board communication agent of other board, so that after the first target data carrying the port number of the destination port corresponding to the inter-board communication agent is received, the other board can start the source port corresponding to the inter-board communication agent with the mapping relationship according to the port number of the destination port corresponding to the inter-board communication agent, and send the first data to other processes according to the corresponding relationship between the source port corresponding to the inter-board communication agent and the destination port corresponding to other processes on the other board.
[0111] In application, the inter-board communication agent triggers the drive layer to drive the at least one physical communication interface of the board to send the first target data to the physical communication interface of the at least one other board, so as to realize one-to-one or one-to-many. When one-to-many is realized, each physical communication interface of the board sends the first target data to the physical communication interface on one other board.
[0112] In one embodiment, before step S101, it comprises:
[0113] Through the inter-board communication agent, the globally unique first communication channel ID and the globally unique first shared space are established according to the port number of the source port corresponding to the first process and the port number of the destination port corresponding to the inter-board communication agent.
[0114] In application, before the first inter-board communication is performed, the port number of the source port corresponding to the first process and the port number of the destination port corresponding to the inter-board communication agent are configured by the inter-board communication agent according to the actual needs of the user, and then the globally unique first communication channel ID and the globally unique first shared space are established according to the port numbers of the virtual ports. The first communication channel ID is used to realize the mapping between the source port corresponding to the first process and the destination port corresponding to the inter-board communication agent, so that the first process can send the first data to the mutually mapped destination port corresponding to the inter-board communication agent after starting the corresponding source port. The specific implementation manner is that the first process writes the first data into the first shared space according to the first communication channel ID, and the inter-board communication agent reads the first data from the first shared space according to the first communication channel ID, so as to realize the communication between the first process and the inter-board communication agent, and further realize the communication between the first process and other boards. The scalability and flexibility are good.
[0115] In one embodiment, the destination port corresponding to the inter-board communication agent is multiple, and each destination port corresponding to the inter-board communication agent is mutually mapped with the source port corresponding to one first process;
[0116] The communication method further includes the following steps for implementing the second one-way inter-board communication (specifically, one-way batch data transmission from the board card to at least one other board card):
[0117] In the case where the plurality of first target data are generated by the inter-board communication agent, the inter-board communication agent packages and transmits all the first target data to the driver layer.
[0118] In the application, in the case where the number of destination ports corresponding to the inter-board communication agent is multiple, the plurality of first processes can simultaneously transmit data to the inter-board communication agent through the corresponding source ports. The principle of one-way data transmission from each first process to the inter-board communication agent is the same as steps S101 to S103, which will not be described here. The inter-board communication agent can generate a plurality of first target data according to the first data transmitted by the plurality of first processes, respectively, and then package and transmit all the first target data to the driver layer for transmission to other board cards through the driver layer, so as to realize one-way batch data communication between different board cards.
[0119] As shown in FIG. 2, Figure 3 The communication method provided by the embodiment of the application further includes the following steps S201 to S204 for implementing the third one-way inter-board communication (specifically, one-way reception of data transmitted by at least one other board card):
[0120] Step S201, receiving, through the driver layer, second target data transmitted by the physical communication interface of at least one other board card through the physical communication interface of the board card, and entering step S202.
[0121] In the application, the inter-board communication agent triggers the driver layer to drive at least one physical communication interface of the board card to receive second target data transmitted by the physical communication interface of at least one other board card, to realize one-to-one or one-to-many. In the case of one-to-many, each physical communication interface of the board card receives second target data transmitted by the physical communication interface on one other board card.
[0122] Step S202, acquiring and analyzing the second target data through the inter-board communication agent to obtain the port number of the source port corresponding to the other inter-board communication agent and the second data, and entering step S203.
[0123] In application, the port number of the source port corresponding to the inter-board communication agent and the port number of the destination port corresponding to the other inter-board communication agent are set to be the same and globally unique according to the actual needs of the user in advance, so as to establish the mutual mapping relationship between the source port corresponding to the inter-board communication agent and the destination port corresponding to the other inter-board communication agent, so that after the inter-board communication agent obtains the second data carrying the port number of the destination port corresponding to the other inter-board communication agent, the inter-board communication agent corresponding to the source port with the mapping relationship can be started according to the port number of the destination port corresponding to the other inter-board communication agent, and the second data can be sent to the second process according to the corresponding relationship between the source port corresponding to the inter-board communication agent and the destination port corresponding to the second process running on the board card.
[0124] In step S203, the inter-board communication agent starts the source port corresponding to the inter-board communication agent according to the port number of the source port corresponding to the other inter-board communication agent, obtains the second communication channel ID, and writes the second data into the second shared space according to the second communication channel ID, and enters step S204.
[0125] In step S204, the second process starts the destination port corresponding to the second process to obtain the second communication channel ID, and reads the second data from the second shared space according to the second communication channel ID.
[0126] In application, the second process can be any process running on the board card that needs to receive data sent by other processes running on other board cards. According to the actual needs of the user, the inter-board communication agent configures a group of virtual ports including the destination port corresponding to the second process and the source port corresponding to the inter-board communication agent on the USCI layer of the board card in advance, and then the inter-board communication agent establishes a globally unique second communication channel ID and a globally unique second shared space according to the port numbers of the virtual ports. The second communication channel ID is stored in the second shared space.
[0127] In application, the process of the inter-board communication agent unidirectionally sending the second data to the second process is as follows:
[0128] The inter-board communication agent starts the source port corresponding to the inter-board communication agent according to the port number of the destination port corresponding to the other inter-board communication agent, reads the globally unique second communication channel ID from the second shared space, and writes the second data into the second shared space according to the second communication channel ID;
[0129] The second process starts the destination port corresponding to the second process, reads the globally unique second communication channel ID from the second shared space, and reads the second data from the second shared space according to the second communication channel ID, so as to realize the unidirectional sending of the second data from the inter-board communication agent to the second process.
[0130] In one embodiment, before step S201, the following steps are included:
[0131] Through the inter-board communication agent, a globally unique second communication channel ID and a globally unique second shared space are established according to the port number of the source port corresponding to the inter-board communication agent and the port number of the destination port corresponding to the second process.
[0132] In the application, before the third inter-board communication is performed, the port number of the destination port corresponding to the first process and the port number of the source port corresponding to the inter-board communication agent are configured according to the actual needs of the user in advance through the inter-board communication agent, and then a globally unique second communication channel ID and a globally unique second shared space are established according to the port numbers of the set of virtual ports. The second communication channel ID is used to realize the mapping between the destination port corresponding to the second process and the source port corresponding to the inter-board communication agent, so that the inter-board communication agent can send the second data to the destination port corresponding to the first process after the corresponding source port is opened. The specific implementation manner is that the inter-board communication agent writes the second data into the second shared space according to the second communication channel ID, and the second process reads the second data from the second shared space according to the second communication channel ID, so as to realize the communication between the inter-board communication agent and the second process, and further realize the communication between the second process and other board cards. The scalability and flexibility are good.
[0133] In one embodiment, the number of source ports corresponding to the inter-board communication agent is multiple, and each source port corresponding to the inter-board communication agent is mapped with a destination port corresponding to a second process.
[0134] The above communication method further includes the following steps for realizing the fourth one-way inter-board communication (specifically, the board card receives the data sent by at least one other board card in a one-way batch manner):
[0135] In the case that the packaged multiple second target data are obtained through the inter-board communication agent, the inter-board communication agent is used to unpack and parse all the second target data to obtain the port numbers of multiple destination ports corresponding to other inter-board communication agents and multiple second data.
[0136] In the application, in the case that the number of source ports corresponding to the inter-board communication agent is multiple, the inter-board communication agent can receive the packaged multiple second target data sent by at least one other board card, and then unpack the multiple second target data to obtain the port numbers of multiple destination ports corresponding to the other inter-board communication agents and the multiple second data. Then, based on the mapping relationship between each group of virtual ports of different board cards and the mapping relationship between each group of virtual ports of the same board card, the multiple source ports corresponding to the inter-board communication agent can simultaneously send data to multiple second processes in one direction, so as to realize one-way batch data communication between different board cards. The principle and steps of each source port of the inter-board communication agent sending data to the second process in one direction are the same as steps S203 and S204, which will not be described here.
[0137] In one embodiment, the second process and the first process can be the same process. Based on the steps of the first one-way inter-board communication and the fourth one-way inter-board communication, bidirectional communication between the same process in the board card and the inter-board communication agent can be realized, and then bidirectional communication between the same process in the board card and other board cards can be realized.
[0138] In the application, the board card and other board cards realize communication based on the above communication method. In the case that the board card uses Figure 2 the corresponding communication method to send data to at least one other board card in one direction, the other board card can use Figure 3 the corresponding communication method to receive the data sent by the board card in one direction; similarly, in the case that the board card uses Figure 3 the corresponding communication method to receive data sent by at least one other board card in one direction, the other board card can use Figure 2 the corresponding communication method to send data to the board card in one direction.
[0139] Based on Figure 1 , Figure 4 The exemplary structure diagram of bidirectional communication between two different board cards is shown in the case that the second process and the first process are the same process;
[0140] Among them, the board card 100 is Figure 1 the board card in the corresponding embodiment;
[0141] In the board card 200, the source port 235-1 corresponding to the inter-board communication agent 231 and the destination port 234-3 corresponding to the process 242 are mapped to each other, which is used to realize one-way data sending from the inter-board communication agent 231 to the process 242;
[0142] The source port 234-4 corresponding to the process 242 and the destination port 235-2 corresponding to the inter-board communication agent 231 are mapped to each other, which is used to realize one-way data sending from the process 241 to the inter-board communication agent 231;
[0143] The port number of the destination port 135-1 corresponding to the inter-board communication agent 131 is the same as the port number of the source port 235-1 corresponding to the inter-board communication agent 231, and the port number of the destination port 235-2 corresponding to the inter-board communication agent 231 is the same as the port number of the source port 135-2 corresponding to the inter-board communication agent 131.
[0144] The physical communication interface 102 is connected with the physical communication interface 202.
[0145] As shown in FIG. 1, the communication method provided by the embodiment of the present application further includes the following steps S301 and S302 for realizing the first one-way intra-board communication (specifically, one-way sending of data from the third process to the fourth process): Figure 5
[0146] In step S301, the third process is used to open the source port corresponding to the third process, to obtain the third communication channel ID, and to write the third data into the third shared space according to the third communication channel ID, and then step S302 is entered.
[0147] In step S302, the fourth process is used to open the destination port corresponding to the fourth process, to obtain the third communication channel ID, and to read the third data from the third shared space according to the third communication channel ID.
[0148] In application, the third process and the fourth process can be any two different processes running on the board card, the third process sends the third data to the fourth process, and the fourth process receives the third data sent by the third process. According to the actual needs of the user, the source port corresponding to the third process and the destination port corresponding to the fourth process are configured by the intra-board communication agent in the USCI layer of the board card, and then the globally unique third communication channel ID and the globally unique third shared space are established by the intra-board communication agent according to the port numbers of the virtual ports, and the third communication channel ID is stored in the third shared space.
[0149] In application, the process of one-way sending of the third data from the third process to the fourth process is as follows:
[0150] The third process opens the source port corresponding to the third process, reads the globally unique third communication channel ID from the third shared space, and writes the third data into the third shared space according to the third communication channel ID;
[0151] The fourth process opens the destination port of the fourth process, reads the globally unique third communication channel ID from the third shared space, and reads the third data from the third shared space according to the third communication channel ID, thereby realizing one-way sending of the third data from the third process to the inter-board communication agent.
[0152] In one embodiment, before step S301, the following steps are included:
[0153] The plate-in communication agent establishes a globally unique third communication channel ID and a globally unique third shared space according to a port number of the source port corresponding to the third process and a port number of the destination port corresponding to the fourth process.
[0154] In the application, before the first plate-in communication is performed, the plate-in communication agent is used to configure the port number of the source port corresponding to the third process and the port number of the destination port corresponding to the fourth process according to the actual needs of the user, and then a globally unique third communication channel ID and a globally unique third shared space are established according to the port numbers of the set of virtual ports. The third communication channel ID is used to realize the mapping between the source port corresponding to the third process and the destination port corresponding to the fourth process, so that the third process can direct the third data to the destination port corresponding to the fourth process after the corresponding source port is opened.
[0155] As shown in FIG. 4, the communication method provided by the embodiment of the application further includes the following steps S401 and S402 for realizing the second one-way plate-in communication (specifically, the fourth process sends data to the third process in one direction): Figure 6
[0156] Step S401: The fourth process is used to open the source port corresponding to the fourth process to obtain a fourth communication channel ID, and the fourth data is written into a fourth shared space according to the fourth communication channel ID, and then step S402 is entered.
[0157] Step S402: The third process is used to open the destination port corresponding to the third process to obtain the fourth communication channel ID, and the fourth data is read from the fourth shared space according to the fourth communication channel ID.
[0158] In the application, based on the principle of identity, the fourth process can also send the fourth data to the third process, and the third process receives the fourth data sent by the fourth process. According to the actual needs of the user, the plate-in communication agent is used to configure the set of virtual ports including the source port corresponding to the fourth process and the destination port corresponding to the third process on the USCI layer of the board card, and then the plate-in communication agent is used to establish a globally unique fourth communication channel ID and a globally unique fourth shared space according to the port numbers of the set of virtual ports. The fourth communication channel ID is stored in the fourth shared space.
[0159] In the application, the process in which the fourth process sends the fourth data to the third process in one direction is as follows:
[0160] The fourth process opens the source port corresponding to the fourth process, reads the globally unique fourth communication channel ID from the fourth shared space, and writes the fourth data into the fourth shared space according to the fourth communication channel ID.
[0161] The third process opens a destination port of the third process, reads a globally unique fourth communication channel ID from the fourth shared space, and reads fourth data from the fourth shared space according to the fourth communication channel ID, so that the fourth process unidirectionally sends the fourth data to the inter-board communication agent.
[0162] Before step S401, in one embodiment, the following steps are included:
[0163] The inter-board communication agent establishes a globally unique fourth communication channel ID and a globally unique fourth shared space according to the port number of the source port corresponding to the fourth process and the port number of the destination port corresponding to the third process.
[0164] In an application, before the second kind of intra-board communication is performed, the port number of the source port corresponding to the fourth process and the port number of the destination port corresponding to the third process are configured according to actual needs of a user through the inter-board communication agent, and then a globally unique fourth communication channel ID and a globally unique fourth shared space are established according to the port numbers of the set of virtual ports. The fourth communication channel ID is used to realize mapping between the source port corresponding to the fourth process and the destination port corresponding to the third process, so that the fourth process can directively send fourth data to the destination port corresponding to the third process after the corresponding source port is opened.
[0165] In an application, based on the steps of the first kind of unidirectional intra-board communication and the second kind of unidirectional intra-board communication, bidirectional communication between different processes in a board card can be realized.
[0166] Based on Figure 1 , Figure 7 An exemplary bidirectional communication architecture diagram between different processes in the same board card is shown in FIG. 1.
[0167] The source port 133-1 corresponding to the process 141 and the destination port 134-1 corresponding to the process 142 are mutually mapped, and are used to realize unidirectional data sending from the process 141 to the process 142.
[0168] The source port 134-2 corresponding to the process 142 and the destination port 133-2 corresponding to the process 141 are mutually mapped, and are used to realize unidirectional data sending from the process 142 to the process 141.
[0169] In one embodiment, the third process or the fourth process can be the same process as the first process, and communication between the same process in the board card and other processes in the board and other processes outside the board can be realized.
[0170] In applications, data transmitted between processes and inter-board communication agents, or between different processes within the same board, can be messages. Users can control the communication system based on actual needs, using any human-computer interaction method supported by the energy storage valve control system. Communication channels within the same board or between different boards can be configured through the intra-board and inter-board communication agents. Specific configuration details include, but are not limited to, source port, destination port number, source port number, destination port number, communication channel ID, port type, data size, channel depth, and driver type. The port type identifies whether each source and destination port is used for intra-board or inter-board communication. The channel depth defines how much data can be stored in each shared space. The driver type defines the type of physical communication interface.
[0171] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0172] like Figure 8 As shown, the embodiment of the present application further provides a board 300 including: at least one processor 301 ( Figure 8 Only one processor is shown in the figure), a memory 302, and a computer program 303 stored in the memory 302 and executable on at least one processor 301, and also including at least one physical communication interface 304. When the processor 301 executes the computer program 303, the steps in any one of the above communication method embodiments are implemented.
[0173] In applications, a board may include, but not limited to, a processor, a memory, and a physical communication interface. Those skilled in the art will appreciate that Figure 8 This is merely an example of a board and does not constitute a limitation on the board. The board may include more or fewer components than shown in the figure, or a combination of certain components, or different components.
[0174] In applications, the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0175] In applications, the memory can be an internal storage unit of the board card in some embodiments, such as a hard disk or a memory of the board card. The memory can also be an external storage device of the board card in other embodiments, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Further, the memory can include both the internal storage unit and the external storage device of the board card. The memory is used to store an operating system, an application program, a boot loader, data, and other programs, such as program codes of computer programs, etc. The memory can also be used to temporarily store data that has been output or will be output.
[0176] In applications, the energy storage valve control system can further include a human-computer interaction device, a network access device, etc. The human-computer interaction device can include a display screen, a touch screen, a touch display screen, an audio playing device, a mouse, a keyboard, a key, a communication module, etc.
[0177] In applications, the display screen can be a thin film transistor liquid crystal display (TFT-LCD), a liquid crystal display (LCD), an organic electroluminesence display (OLED), a quantum dot light emitting diode (QLED) display screen, a seven-segment or eight-segment digital tube, etc.
[0178] In applications, the communication module can be set to any device capable of direct or indirect long-distance wired or wireless communication according to actual needs. For example, the communication module can provide a communication solution applied to network equipment, including Wireless Local Area Networks (WLAN) (such as Wi-Fi network), Bluetooth, Zigbee, mobile communication network, GNSS, Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR) technology, etc. The communication module can include an antenna, which can have only one array element or an antenna array including multiple array elements. The communication module can receive electromagnetic waves through the antenna, frequency modulate and filter the electromagnetic wave signals, and send the processed signals to the processor. The communication module can also receive signals to be sent from the processor, frequency modulate and amplify them, and convert them into electromagnetic wave radiation through the antenna.
[0179] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the steps in each of the above communication method embodiments.
[0180] The embodiments of the present application provide a computer program product. When the computer program product is run on a board card, the board card is caused to implement the steps in each of the above communication method embodiments.
[0181] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the present application can implement all or part of the processes in the above embodiments by a computer program to instruct related hardware to complete, and the computer program can be stored in a computer readable storage medium. The computer program is executed by a processor to implement the steps of each of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer readable medium at least includes any entity or device capable of carrying the computer program code to the board card, recording medium, computer memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc.
[0182] In the above embodiments, the description of each embodiment has its own focus, and the parts not described or recorded in a certain embodiment can be referred to the relevant description of other embodiments.
[0183] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0184] In the embodiments provided in the present application, it should be understood that the disclosed board card and method can be implemented in other ways. For example, the above-described board card embodiments are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed coupling or direct coupling or communication connection between each other can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0185] The units described as separate components can or can not be physically separated, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0186] The above-described embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features can be replaced by equivalents; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A communication method characterized by comprising: The communication method is based on a communication system implemented on a board card, the communication system comprising a driver layer, an operating system layer and an application layer, further comprising a unified system communication interface layer established between the operating system layer and the application layer, the communication method comprising: by a first process, opening a source port corresponding to the first process to obtain a first communication channel identifier, and writing first data into a first shared space according to the first communication channel identifier; by an inter-board communication agent, opening a destination port corresponding to the inter-board communication agent to obtain the first communication channel identifier, and reading the first data from the first shared space according to the first communication channel identifier; by the inter-board communication agent, writing a port number of the destination port corresponding to the inter-board communication agent into the first data to generate first target data; by the inter-board communication agent, sending the first target data to the driver layer; by the driver layer, driving at least one physical communication interface of the board card to send the first target data to a physical communication interface of at least one other board card; wherein the unified system communication interface layer comprises the inter-board communication agent, the destination port corresponding to the inter-board communication agent, and the source port corresponding to the first process.
2. The communication method of claim 1, wherein, Before the first process, opening a source port corresponding to the first process to obtain a first communication channel identifier, and writing first data into a first shared space according to the first communication channel identifier, the method further comprises: by the inter-board communication agent, establishing a globally unique first communication channel identifier and a globally unique first shared space according to a port number of the source port corresponding to the first process and a port number of the destination port corresponding to the inter-board communication agent.
3. The communication method according to claim 1 or 2, characterized by, The number of destination ports corresponding to the inter-board communication agent is multiple, and each destination port corresponding to the inter-board communication agent is mapped with a source port corresponding to the first process; The communication method further comprises: in the case that the inter-board communication agent generates a plurality of first target data, the inter-board communication agent packs and sends all the first target data to the driver layer.
4. The communication method according to claim 1 or 2, wherein Further comprising: by the driver layer, driving a physical communication interface of the board card to receive second target data sent by a physical communication interface of at least one other board card; by the inter-board communication agent, obtaining and analyzing the second target data to obtain a port number of a destination port corresponding to another inter-board communication agent and second data, the port number of the destination port corresponding to the other inter-board communication agent being the same as the port number of the source port corresponding to the inter-board communication agent, the other inter-board communication agent running on the other board card; by the inter-board communication agent, opening a source port corresponding to the inter-board communication agent according to the port number of the destination port corresponding to the other inter-board communication agent to obtain a second communication channel identifier, and writing the second data into a second shared space according to the second communication channel identifier; by a second process, opening a destination port corresponding to the second process to obtain the second communication channel identifier, and reading the second data from the second shared space according to the second communication channel identifier; The uniform system communication interface layer further comprises a source port corresponding to the inter-board communication agent and a destination port corresponding to the second process.
5. The communication method of claim 4, wherein, Before driving the physical communication interface of the board card to receive the second target data sent by the physical communication interface of the other board card, the method comprises: Through the inter-board communication agent, a globally unique second communication channel identifier and a globally unique second shared space are established according to the port number of the source port corresponding to the inter-board communication agent and the port number of the destination port corresponding to the second process.
6. The communication method according to claim 4 or 5, characterized by, The number of source ports corresponding to the inter-board communication agent is multiple, and each source port corresponding to the inter-board communication agent is mapped with a destination port corresponding to the second process. The communication method further comprises: When the packaged multiple second target data are acquired through the inter-board communication agent, the second target data are unpacked and parsed through the inter-board communication agent to obtain the port number of the multiple source ports corresponding to the inter-board communication agent and the multiple second data.
7. The communication method according to claim 4 or 5, wherein The second process and the first process are the same process.
8. The communication method according to any one of claims 1 to 7, characterized by, Further comprising: Through the third process, the source port corresponding to the third process is started to acquire a third communication channel identifier, and third data are written into a third shared space according to the third communication channel identifier; Through the fourth process, the destination port corresponding to the fourth process is started to acquire the third communication channel identifier, and the third data are read from the third shared space according to the third communication channel identifier; The uniform system communication interface layer further comprises a source port corresponding to the third process and a destination port corresponding to the fourth process.
9. The communication method of claim 8, wherein, The uniform system communication interface layer further comprises an intra-board communication agent. Before the third process is started to acquire the third communication channel identifier and write the third data into the third shared space according to the third communication channel identifier, the method comprises: Through the intra-board communication agent, a globally unique third communication channel identifier and a globally unique third shared space are established according to the port number of the source port corresponding to the third process and the port number of the destination port corresponding to the fourth process.
10. The communication method according to claim 8 or 9, characterized by, The third process and the first process are the same process.
11. A board card comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, Further comprising at least one physical communication interface, and the processor executes the computer program to realize the steps of the communication method according to any one of claims 1 to 10.
12. An energy storage valve control system, characterized by, The board card and the at least one other board card according to claim 11.
13. A computer-readable storage medium, the computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the communication method according to any one of claims 1 to 9. The computer program is executed by the processor to realize the steps of the communication method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Method for inter-board communication
CN102821055A
Method for communication among business boards in distributed equipment
CN105227463A