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 the inter -board communication agent to configure the virtual port mapping, the problem of poor flexibility of the communication method of the in existing technology in the existing technology, and realizing the high transplantation and flexibility. Essence
Patent Information
- Application Number
- CN202310921271.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-25
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2043-07-25
AI Technical Summary
In existing energy storage valve control systems, the communication between boards and cards usually depends on the physical communication interface driven by the same operating system, resulting in poor portability, scalability and flexibility.
By establishing a unified system communication interface layer between the operating system layer of the communication system and the application layer, use the inter -board communication agent to pre -configure the source port and the destination port to establish the mapping relationship between the virtual ports to achieve the communication between the board and the card. Know the address of the data receiver.
The flexible communication between different boards and cards supports arbitrary operating system types, which improves transplantability, scalability and flexibility. Users are transparent and can be used in any board card.
Smart Images

Figure CN119383150A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of communications, and in particular relates to a communication method, a board, an energy storage valve control system and a storage medium. Background Art
[0002] Energy storage valve control systems usually adopt a multi-board design (for example, control board, interface board, input and output board, display panel, etc.), and each board may have different functions or architectures. The application software configured on these boards can run based on the operating system or directly on the processor. The physical communication interface between boards may be a point-to-point communication bus interface or a shared bus interface, such as an Ethernet interface, RS485 interface, Controller Area Network (CAN) interface, Low-Voltage Differential Signaling (LVDS) interface, etc.
[0003] Currently, the communication method between boards is usually based on a physical signal interface driven by the same operating system, which has poor portability, scalability and flexibility. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a communication method, a board, an energy storage valve control system and a storage medium, aiming to solve the problem that the current communication method between boards is usually based on a physical signal interface driven by the same operating system, with poor portability, scalability and flexibility.
[0005] A first aspect of an embodiment of the present application provides a communication method, which is implemented based on a communication system running on a board, wherein 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, and the communication method includes:
[0006] Opening, through a first process, 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;
[0007] By means of an inter-board communication agent, a destination port corresponding to the inter-board communication agent is opened 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] By means of the inter-board communication agent, the 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] Sending the first target data to the driver layer through the inter-board communication agent;
[0010] By means of the driver layer, driving at least one physical communication interface of the board to send the first target data to a physical communication interface of at least one other board;
[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 the first aspect, a communication method implemented based on a communication system running on a board is provided, a unified system communication interface layer is established between the operating system layer and the application layer of the communication system, and an inter-board communication agent based on the unified system communication interface layer is configured in advance in the unified system communication interface layer according to actual needs, and a communication channel identifier and a shared space are established according to the port number of each group of virtual ports (that is, the source port and the virtual port) to establish a mapping relationship between each group of virtual ports, so that when inter-board communication is required and the user does not know the address of the data recipient, it is not necessary to know the address of the data recipient, and only Based on the mapping relationship between each group of virtual ports, communication between different boards can be realized, and there is no restriction on the types of operating systems running on different boards. This inter-board communication method is transparent to users (user transparency means that users do not need to care about the specific communication implementation method, it is transparent and invisible to users, and users only need to use it). Based on this, by pre-establishing the mapping between different virtual ports, the data sender (that is, the first process) and the data receiver (that is, at least one other board) can be flexibly bound, so that different data routing can be performed, which can be applied to any board, with good portability, scalability and flexibility. In the first aspect, it can specifically realize the unidirectional sending of data from a board to at least one other board, that is, one send and one receive or one send and multiple receive.
[0013] In a first implementation of the first aspect, the step of opening, by a first process, a source port corresponding to the first process to obtain a first communication channel identifier, and before writing the first data into the first shared space according to the first communication channel identifier includes:
[0014] Through the inter-board communication agent, a globally unique first communication channel identifier and a 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.
[0015] The first implementation method of the first aspect is to establish a globally unique first communication channel identifier and a globally unique first shared space based on the inter-board communication agent according to the actual needs of the user before inter-board communication, according to the port number of the source port corresponding to the first process configured by the user and the port number of the destination port corresponding to the inter-board communication agent, so that based on the first communication channel identifier, the mapping between the source port corresponding to the first process and the destination port corresponding to the inter-board communication agent is realized, and based on the first communication channel identifier and the first shared space, the first process writes data and the inter-board communication agent reads data, thereby realizing communication between the first process and the inter-board communication agent, and then realizing communication between the first process and other boards, and having good scalability and flexibility.
[0016] Based on the first or second implementation of the first aspect, in the second implementation of the first aspect, 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 to a source port corresponding to the first process;
[0017] The communication method further comprises:
[0018] In the case where a plurality of first target data are generated by the inter-board communication agent, all the first target data are packaged and sent to the driver layer by the inter-board communication agent.
[0019] A second implementation of the first aspect, when there are multiple destination ports corresponding to the inter-board communication agent, based on the pre-established mutual mapping relationship between each destination port corresponding to the inter-board communication agent and a source port corresponding to a first process, the inter-board communication agent can generate multiple first target data according to the first data sent by multiple first processes, and package them to the driver layer, so as to be sent to other boards through the driver layer, thereby realizing unidirectional batch data communication between different boards. The second implementation of the first aspect can specifically realize unidirectional batch data transmission from a board to at least one other board.
[0020] Based on the first aspect, or the first or second implementation of the first aspect, in a third implementation of the first aspect, the communication method further includes:
[0021] By means of the driver layer, driving 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 through the inter-board communication agent to obtain the port number of the destination port corresponding to the other inter-board communication agent and the second data, the port number of the destination port corresponding to the other inter-board communication agent is the same as the port number of the source port corresponding to the inter-board communication agent, and the other inter-board communication agent runs on the other board card;
[0023] By means of the inter-board communication agent, according to the port number of the destination port corresponding to the other inter-board communication agent, the source port corresponding to the inter-board communication agent is opened to obtain a second communication channel identifier, and the second data is written into the second shared space according to the second communication channel identifier;
[0024] Opening, by the second process, 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;
[0025] The unified system communication interface layer further includes a source port corresponding to the inter-board communication agent and a destination port corresponding to the second process.
[0026] The third implementation of the first aspect is based on the mapping relationship between each group of virtual ports of the pre-established board, by making the port number of the source port corresponding to the board communication agent of the board the same as the port number of the destination port corresponding to other board communication agents of other boards, a mapping relationship between virtual ports of different boards can be established, so that the user does not need to know the address of the data receiver without knowing the address of the data receiver, and can achieve communication between different boards based on the mapping relationship between virtual ports of different boards, and there is no restriction on the types of operating systems running on different boards. This inter-board communication method is transparent to the user. Based on this, by pre-establishing the mapping between virtual ports of different boards, the data sender (that is, other boards) and the data receiver (that is, the second process) can be flexibly bound, so that different data routing can be performed, and it can be applied to any board, with good portability, scalability and flexibility. The third implementation of the first aspect, based on the first aspect, can further realize that the board receives data sent by at least one other board in a unidirectional manner, that is, one send and one receive or multiple send and one receive, so as to realize bidirectional data communication between different boards as a whole.
[0027] Based on the third implementation of the first aspect, in a fourth implementation of the first aspect, before the physical communication interface of the board is driven by the driver layer to receive the second target data sent by the physical communication interface of the other board, the method includes:
[0028] 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.
[0029] The fourth implementation method of the first aspect is to establish a common and globally unique second communication channel identifier and a common and globally unique second shared space based on the inter-board communication agent according to the actual needs of the user before inter-board communication, according to the port number of the source port corresponding to the inter-board communication agent configured by the user and the port number of the destination port corresponding to the second process, so that based on the second communication channel identifier, the mapping between the source port corresponding to the inter-board communication agent and the destination port corresponding to the second process is realized, and based on the second communication channel identifier and the second shared space, the inter-board communication agent writes data and the second process reads data, thereby realizing communication between the inter-board communication agent and the second process, and then realizing communication between the second process and other boards, and having good scalability and flexibility.
[0030] Based on the third or fourth implementation of the first aspect, in a fifth implementation of the first aspect, 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 to a destination port corresponding to the second process;
[0031] The communication method further comprises:
[0032] When multiple packaged second target data are obtained through the inter-board communication agent, all the second target data are unpacked and parsed through the inter-board communication agent to obtain the port numbers of multiple source ports corresponding to the inter-board communication agent and multiple second data.
[0033] The fifth implementation of the first aspect, when there are multiple source ports corresponding to the inter-board communication agent, based on the pre-established mutual mapping relationship between each source port corresponding to the inter-board communication agent and a destination port corresponding to a second process, the inter-board communication agent can, when receiving multiple packaged second target data sent by at least one other board, unpack and obtain the port numbers of multiple destination ports corresponding to other inter-board communication agents and multiple second data, and then distribute the multiple second data to each second process based on the mapping relationship between each group of virtual ports of different boards and the mapping relationship between each group of virtual ports of the same board, so as to realize unidirectional batch data communication between different boards. The fifth implementation of the first aspect can specifically realize that the board can unidirectionally receive batch data sent by at least one other board.
[0034] Based on the third or fourth implementation manner of the first aspect, in a sixth implementation manner of the first aspect, the second process and the first process are the same process.
[0035] A sixth implementation manner of the first aspect, when the second process and the first process are the same process, can implement bidirectional communication between the same process in the board and the inter-board communication agent.
[0036] Based on the first aspect, or any one of the first to sixth implementations of the first aspect, in a seventh implementation of the first aspect, the communication method further includes:
[0037] Opening, through a third process, a source port corresponding to the third process to obtain a third communication channel identifier, and writing the third data into a third shared space according to the third communication channel identifier;
[0038] Opening, through a 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 a source port corresponding to the third process and a destination port corresponding to the fourth process.
[0040] The seventh implementation method of the first aspect is based on the pre-established mapping relationship between each group of virtual ports, so that when intra-board communication is required 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 to achieve communication between different processes in the same board. This intra-board communication method is transparent to the user. Based on this, by pre-establishing the mapping between different virtual ports, the data sender (that is, the third process) and the data receiver (that is, the fourth process) can be flexibly bound, so that different data routing can be performed. It can be applied to any board and has good portability, scalability and flexibility.
[0041] Based on the seventh implementation of the first aspect, in an eighth implementation of the first aspect, the unified system communication interface layer further includes an intra-board communication agent;
[0042] The method of opening the source port corresponding to the third process through the third process to obtain the third communication channel identifier and writing the third data into the third shared space according to the third communication channel identifier includes:
[0043] 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.
[0044] The eighth implementation method of the first aspect is to establish a common and globally unique third communication channel identifier and a common and globally unique third shared space before conducting intra-board communication based on the intra-board communication agent according to the actual needs of the user, 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 configured by the user, thereby realizing the mapping between the source port corresponding to the third process and the destination port corresponding to the fourth process based on the third communication channel identifier, and realizing the writing of data by the third process and the reading of data by the fourth process based on the third communication channel identifier and the third shared space, thereby realizing communication between the third process and the fourth process, that is, realizing communication between different processes in the board, and having good scalability and flexibility.
[0045] Based on the seventh or eighth implementation manner of the first aspect, in a ninth implementation manner of the first aspect, the third process and the first process are the same process.
[0046] An eighth implementation of the first aspect, when the third process and the first process are the same process, can implement communication between the same process within the board and other processes within the board and other processes outside the board.
[0047] The second aspect of an embodiment of the present application provides a board card, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the communication method provided in the first aspect of the embodiment of the present application when executing the computer program.
[0048] A third aspect of the embodiments of the present application provides an energy storage valve control system, comprising the board card provided in the second aspect of the embodiments of the present application and the at least one other board card.
[0049] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the communication method provided in the first aspect of the embodiment of the present application are implemented.
[0050] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0052] Figure 1 It is a schematic diagram of the architecture of a communication system running on a board provided in an embodiment of the present application;
[0053] Figure 2 This is a schematic diagram of a first flow chart of a communication method provided in an embodiment of the present application;
[0054] Figure 3 This is a second flow chart of the communication method provided in the embodiment of the present application;
[0055] Figure 4 is a bidirectional communication architecture diagram between two different boards provided in an embodiment of the present application;
[0056] Figure 5 This is a third flow chart of the communication method provided in the embodiment of the present application;
[0057] Figure 6 This is a fourth flow chart of the communication method provided in the embodiment of the present application;
[0058] Figure 7 This is a bidirectional communication architecture diagram between different processes in the same board provided by an embodiment of the present application;
[0059] Figure 8 It is a schematic diagram of the structure of the board provided in the embodiment of the present application. DETAILED DESCRIPTION
[0060] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0061] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0062] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0063] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0064] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0065] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0066] The embodiment of the present application provides a communication method, which is implemented based on a communication system running on a board, and can be executed by a processor of the board when running a computer program with corresponding functions, by establishing a unified system communication interface (Unified System Communication) between the operating system layer and the application layer of the communication system. The invention discloses a communication method for realizing a communication interface (USCI) layer, and according to actual needs, an intra-board communication agent or an inter-board communication agent based on the USCI layer is configured in advance at least one group of source ports and destination ports in the USCI layer, and a common communication channel identifier (Identity Document, ID) and a shared space are established according to each group of source ports and destination ports to establish a mapping relationship between each group of virtual ports (that is, a source port and a virtual port), so that when intra-board communication or inter-board communication is required and the user does not know the address of the data receiver, it is not necessary to know the address of the data receiver, and only based on the mapping relationship between each group of virtual ports, communication between different processes in the board or between different boards can be realized, and there is no restriction on the types of operating systems running on different boards. This communication mode is transparent to the user. Based on this, by pre-establishing the mapping between different virtual ports, the data sender and the data receiver can be flexibly bound, so that different data routing can be performed, and it can be applied to any board, with good portability, scalability and flexibility, and can also effectively shorten the research and development cycle, and is easy to maintain and test.
[0067] In the application, the types of operating systems running on different boards can be the same or different. The operating system can be Microsoft Windows, macOS, Linux, Google Chrome OS, iOS, Android, Huawei Hongmeng System, KaiOS, iPad OS, Fuchsia OS, etc.
[0068] like Figure 1 As shown, an architecture of a communication system 101 running on a board is exemplarily shown, and the communication system 101 includes a driver layer 11, an operating system layer 12, a USCI layer 13 and an application layer arranged in sequence;
[0069] The USCI layer 13 includes an inter-board communication agent 131, an intra-board communication agent 132, and at least one group of virtual ports. Figure 1 Four groups of virtual ports are shown as an example, namely 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, source port 135-2 and destination port 134-4)
[0070] The application layer is used to run multiple processes or tasks. Figure 1Two processes are shown as an example, namely process 141 and process 142;
[0071] The board 100 is provided with at least one physical communication interface. Figure 1 A physical communication interface 102 is exemplarily shown in FIG.
[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, so as to realize unidirectional data transmission 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, so as to implement unidirectional data transmission 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 121 are mapped to each other, so as to realize unidirectional data transmission 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, so as to realize the one-way data transmission 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 set on the board is driven to send the data sent unidirectionally by the process 142 to the inter-board communication agent 131 to the physical communication interface of at least one other board;
[0078] Drive the physical communication interface 102 to receive data sent by the physical communication interface of at least one other board;
[0079] The inter-board communication agent 131 is used to obtain data sent by the physical communication interface of at least one other board from the driver layer 11 and send the data to the process 142 .
[0080] In an application, when a board is provided with multiple physical communication interfaces, the types of the multiple physical communication interfaces may be the same or different. The physical communication interface may be a point-to-point communication bus interface or a shared bus interface, for example, an Ethernet interface, an RS485 interface, a controller area network (CAN) interface, a low-voltage differential signal (LVDS) interface, etc.
[0081] In the application, the driver layer, operating system layer, USIC layer, application layer, and the inter-board communication agent and intra-board communication agent of the USIC layer are all computer programs running on the processor of the board, and the physical communication interface is a physical interface set on the board and connected to the processor for communication;
[0082] The driver layer is used to run the software driver of the physical communication interface to drive the physical communication interface to communicate with the physical communication interfaces of other boards;
[0083] The operating system layer is used to run the operating system to create processes or tasks and manage the processes or tasks;
[0084] The application layer is used to run processes or tasks to implement corresponding application functions;
[0085] The USIC layer is used to run inter-board communication agents and intra-board communication agents, and provides multiple groups of virtual ports for realizing data communication between inter-board communication agents and different processes or tasks, between intra-board communication agents and different processes or tasks, between different processes, between different tasks, and between processes and tasks, and each group of virtual ports is mapped to each other;
[0086] In the USIC layer, the inter-board communication agent is used to implement communication between different boards, specifically for:
[0087] One or more groups of virtual ports are configured between the inter-board communication agent and the process or task at the USCI layer, each group of virtual ports includes a source port and a destination port mapped to each other, and data is sent unidirectionally from the source port to the destination port;
[0088] In response to a port number configuration operation by a user, configuring a port number of each group of virtual ports;
[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] Read the data written into the shared space by the process or task from the shared space according to the communication channel ID;
[0091] Write the port number of the destination port corresponding to itself into the data, generate the target data and send it to the driver layer, so as to trigger the driver layer to drive at least one physical communication interface of the board to send the data to the physical communication interface of at least one other board. If there are multiple target data, the multiple target data are packaged and then sent to the driver layer;
[0092] The triggering driver layer drives at least one physical communication interface of the board to receive and parse the target data sent by the physical communication interface of at least one other board, obtain the port number and data of the source port corresponding to the other inter-board communication agent, and unpack and parse the received multiple packaged target data; write the parsed data into the shared space according to the communication channel ID;
[0093] In the USIC layer, the intra-board communication agent is used to implement communication between different processes in the same board, specifically for:
[0094] One or more groups of virtual ports between different processes or tasks are configured at the USCI layer, each group of virtual ports includes a source port and a destination port mapped to each other, and data is sent unidirectionally from the source port to the destination port;
[0095] In response to a port number configuration operation by a user, configuring a port number of each group of virtual ports;
[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 intra-board communication agent and inter-board communication agent are also used to:
[0098] Configure the communication channel within the same board or between different boards. The specific configuration content includes but is not limited to: source port, destination port, port number of source port, port number of destination port, communication channel ID, port type, data size, channel depth, driver type, etc.
[0099] In application, the communication method provided in the embodiment of the present application can be applied to different boards of the energy storage valve control system (including the above-mentioned boards and at least one other board), and the energy storage valve control system can be applied to flight equipment in the aviation / aerospace field, electric vehicles or car batteries in the automotive field, etc.
[0100] like Figure 2 As shown, the communication method provided in the embodiment of the present application includes the following steps S101 to S105 for implementing the first unidirectional inter-board communication (specifically, a board sends data unidirectionally to at least one other board):
[0101] Step S101: Open a source port corresponding to the first process through the first process to obtain a first communication channel ID, and write first data into a first shared space according to the first communication channel ID, and proceed to step S102;
[0102] Step S102: Open the destination port corresponding to the inter-board communication agent through the inter-board communication agent to obtain the first communication channel ID, and read the first data from the first shared space according to the first communication channel ID, and enter step S103.
[0103] In the application, the first process can be any process running on the board that needs to send data to other processes running on other boards. In advance, according to the actual needs of the user, a group of virtual ports, including a source port corresponding to the first process and a destination port corresponding to the inter-board communication agent, are configured at the USCI layer of the board through the inter-board communication agent. Then, the inter-board communication agent establishes a globally unique first communication channel ID and a globally unique first shared space according to the port numbers of the group of virtual ports, and the first communication channel ID is stored in the first shared space.
[0104] In the application, the process of the first process unidirectionally sending the first data to the inter-board communication agent is as follows:
[0105] The first process opens a source port corresponding to the first process, reads a 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 unidirectional sending of the first data by the first process to the inter-board communication agent.
[0107] Step S103, 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, generating the first target data, and proceeding to step S104;
[0108] Step S104, sending the first target data to the driver layer through the inter-board communication agent, and proceeding to step S105;
[0109] Step S105 : driving at least one physical communication interface of the board through the driver layer to send the first target data to the physical communication interface of at least one other board.
[0110] In the 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 other inter-board communication agents of other boards are set to be the same and globally unique in advance according to the actual needs of the user, so as to establish a mutual mapping relationship between the destination port corresponding to the inter-board communication agent and the source port corresponding to the other inter-board communication agents, so that after receiving the first target data carrying the port number of the destination port corresponding to the inter-board communication agent, the other boards can open the source ports corresponding to other inter-board communication agents 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 the other processes according to the correspondence between the source ports corresponding to the other inter-board communication agents and the destination ports corresponding to other processes running on the other boards.
[0111] In the application, the inter-board communication agent triggers the driver layer to drive at least one physical communication interface of the board to send the first target data to the physical communication interface of at least one other board, so as to realize one-to-one reception or one-to-multiple reception. When realizing one-to-multiple reception, each physical communication interface of the board sends the first target data to a physical communication interface on another board.
[0112] In one embodiment, before step S101, the following steps are included:
[0113] Through the inter-board communication agent, a globally unique first communication channel ID and a 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 the 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 in advance according to the actual needs of the user through the inter-board communication agent, and then a globally unique first communication channel ID and a globally unique first shared space are established according to the port numbers of this group of 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 destination port corresponding to the mutually mapped inter-board communication agent after opening the corresponding source port. The specific implementation method is: 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, thereby realizing the communication between the first process and the inter-board communication agent, and then realizing the communication between the first process and other boards, and the scalability and flexibility are good.
[0115] In one embodiment, the inter-board communication agent corresponds to multiple destination ports, and each destination port corresponding to the inter-board communication agent is mapped to a source port corresponding to a first process;
[0116] The above communication method also includes the following steps for implementing the second unidirectional inter-board communication (specifically, a board sends data in batches unidirectionally to at least one other board):
[0117] In the case where a plurality of first target data are generated through the inter-board communication agent, all the first target data are packaged and sent to the driver layer through the inter-board communication agent.
[0118] In the application, when the number of destination ports corresponding to the inter-board communication agent is multiple, multiple first processes can simultaneously send data to the inter-board communication agent unidirectionally through the corresponding source ports. The principle of each first process sending data unidirectionally to the inter-board communication agent is the same as steps S101 to S103, which will not be repeated here. The inter-board communication agent can generate multiple first target data according to the first data sent by the multiple first processes, and then package all the first target data and send them to the driver layer, so as to send them to other boards through the driver layer, thereby realizing unidirectional batch data communication between different boards.
[0119] like Figure 3 As shown, the communication method provided in the embodiment of the present application further includes the following steps S201 to S204 for implementing the third type of unidirectional inter-board communication (specifically, a board unidirectionally receives data sent by at least one other board):
[0120] Step S201: drive the physical communication interface of the board to receive second target data sent by the physical communication interface of at least one other board through the driver layer, and then proceed to 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 to receive the second target data sent by the physical communication interface of at least one other board, so as to realize one-send-one-receive or multiple-send-one-receive. When multiple-send-one-receive is realized, each physical communication interface of the driver board receives the second target data sent by a physical communication interface on another board.
[0122] Step S202: Obtain and parse the second target data through the inter-board communication agent to obtain the port number and second data of the source port corresponding to other inter-board communication agents, and then proceed to step S203.
[0123] In the 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 other inter-board communication agents are set to be the same and globally unique in advance according to the actual needs of the user, so as to establish a mutual mapping relationship between the source port corresponding to the inter-board communication agent and the destination ports corresponding to the other inter-board communication agents. In this way, 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, it can open 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 other inter-board communication agent, and send the second data to the second process according to the correspondence between the source port corresponding to the inter-board communication agent and the destination port corresponding to the second process running on the board.
[0124] Step S203: Open 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 through the inter-board communication agent to obtain the second communication channel ID, and write the second data into the second shared space according to the second communication channel ID, and enter step S204;
[0125] Step S204: Open the destination port corresponding to the second process through the second process to obtain the second communication channel ID, and read the second data from the second shared space according to the second communication channel ID.
[0126] In the application, the second process can be any process running on the board that needs to receive data sent by other processes running on other boards. In advance, according to the actual needs of the user, 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, are configured at the USCI layer of the board through the inter-board communication agent. 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 group of virtual ports, and the second communication channel ID is stored in the second shared space.
[0127] In the application, the process of the inter-board communication agent sending the second data to the second process unidirectionally is as follows:
[0128] The inter-board communication agent opens 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 agents, 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 opens 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, thereby realizing the inter-board communication agent unidirectionally sending the second data 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 type of 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 in advance according to the actual needs of the user 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 this group 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 mapped to each other after opening the corresponding source port. The specific implementation method is: 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, thereby realizing the communication between the inter-board communication agent and the second process, and then realizing the communication between the second process and other boards, with good scalability and flexibility.
[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 to a destination port corresponding to a second process;
[0134] The above communication method also includes the following steps for implementing the fourth type of unidirectional inter-board communication (specifically, a board receives data sent in batches unidirectionally by at least one other board):
[0135] When multiple packaged second target data are obtained through the inter-board communication agent, all the second target data are unpacked and parsed through the inter-board communication agent to obtain the port numbers of multiple destination ports corresponding to other inter-board communication agents and multiple second data.
[0136] In the application, when the number of source ports corresponding to the inter-board communication agent is multiple, the inter-board communication agent can receive multiple packaged second target data sent by at least one other board, and then unpack to obtain the port numbers and multiple second data of multiple destination ports corresponding to other inter-board communication agents, and then based on the mapping relationship between each group of virtual ports of different boards and the mapping relationship between each group of virtual ports of the same board, the multiple source ports corresponding to the inter-board communication agent can simultaneously send data unidirectionally to multiple second processes, thereby realizing unidirectional batch data communication between different boards. The principle of each source port of the inter-board communication agent sending data unidirectionally to the second process is the same as steps S203 and S204, which will not be repeated here.
[0137] In one embodiment, the second process and the first process can be the same process. Based on the above-mentioned steps of the first unidirectional inter-board communication and the fourth unidirectional inter-board communication, bidirectional communication between the same process in the board and the inter-board communication agent can be realized, and then bidirectional communication between the same process of the board and other boards can be realized.
[0138] In the application, the board communicates with other boards based on the above communication method. Figure 2 When the corresponding communication method sends data to at least one other board in one direction, the other board can use Figure 3 The corresponding communication method receives the data sent unidirectionally by the board; similarly, when the board adopts Figure 3 When the corresponding communication method receives data sent unidirectionally by at least one other board, the other boards can use Figure 2 The corresponding communication method sends data unidirectionally to the board.
[0139] based on Figure 1 , Figure 4 An exemplary diagram of a bidirectional communication architecture between two different boards is shown when the second process and the first process are the same process;
[0140] Among them, board 100 is Figure 1 The board in the corresponding embodiment;
[0141] In the board 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, so as to realize the unidirectional data transmission 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, so as to realize the one-way data transmission 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 to the physical communication interface 202 .
[0145] like Figure 5 As shown, the communication method provided in the embodiment of the present application further includes the following steps S301 and S302 for implementing the first unidirectional intra-board communication (specifically, the third process unidirectionally sends data to the fourth process):
[0146] Step S301: Open the source port corresponding to the third process through the third process to obtain the third communication channel ID, and write the third data into the third shared space according to the third communication channel ID, and then enter step S302;
[0147] Step S302: Open the destination port corresponding to the fourth process through the fourth process to obtain the third communication channel ID, and read the third data from the third shared space according to the third communication channel ID.
[0148] In the application, the third process and the fourth process can be two different arbitrary processes running on the board, 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, a group of virtual ports, including the source port corresponding to the third process and the destination port corresponding to the fourth process, are configured in advance at the USCI layer of the board through the intra-board communication agent, and then the intra-board communication agent establishes a globally unique third communication channel ID and a globally unique third shared space according to the port numbers of the group of virtual ports, and the third communication channel ID is stored in the third shared space.
[0149] In the application, the process of the third process sending the third data to the fourth process unidirectionally 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 enabling the third process to unidirectionally send the third data to the inter-board communication agent.
[0152] In one embodiment, before step S301, the following steps are included:
[0153] Through the intra-board communication agent, a globally unique third communication channel ID 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.
[0154] In the application, before the first intra-board communication is performed, 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 are configured in advance through the intra-board communication agent 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 this group of virtual ports. The third communication channel ID is used to implement 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 send the third data to the destination port corresponding to the mutually mapped fourth process after opening the corresponding source port.
[0155] like Figure 6 As shown, the communication method provided in the embodiment of the present application further includes the following steps S401 and S402 for implementing the second unidirectional intra-board communication (specifically, the fourth process unidirectionally sends data to the third process):
[0156] Step S401: Open the source port corresponding to the fourth process through the fourth process to obtain the fourth communication channel ID, and write the fourth data into the fourth shared space according to the fourth communication channel ID, and then enter step S402;
[0157] Step S402: Open the destination port corresponding to the third process through the third process to obtain a fourth communication channel ID, and read fourth data from the fourth shared space according to the fourth communication channel ID.
[0158] In the application, based on the same principle, the fourth process can also send fourth data to the third process, and the third process receives the fourth data sent by the fourth process. In advance, according to the actual needs of the user, a group of virtual ports, including the source port corresponding to the fourth process and the destination port corresponding to the third process, are configured at the USCI layer of the board through the intra-board communication agent. Then, the intra-board communication agent establishes a globally unique fourth communication channel ID and a globally unique fourth shared space according to the port numbers of the group of virtual ports, and the fourth communication channel ID is stored in the fourth shared space.
[0159] In the application, the process of the fourth process unidirectionally sending the fourth data to the third process is as follows:
[0160] The fourth process opens a source port corresponding to the fourth process, reads a globally unique fourth communication channel ID from the fourth shared space, and writes fourth data into the fourth shared space according to the fourth communication channel ID;
[0161] The third process opens the destination port of the third process, reads the 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, thereby enabling the fourth process to unidirectionally send fourth data to the inter-board communication proxy.
[0162] In one embodiment, before step S401, the following steps are included:
[0163] Through the intra-board communication agent, a globally unique fourth communication channel ID and a globally unique fourth shared space are established 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 the application, before the second 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 in advance through the intra-board communication agent according to the actual needs of the user, and then a globally unique fourth communication channel ID and a globally unique fourth shared space are established according to the port numbers of this group of virtual ports. The fourth communication channel ID is used to implement the 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 send the fourth data to the destination port corresponding to the mutually mapped third process after opening the corresponding source port.
[0165] In application, based on the above steps of the first unidirectional intra-board communication and the second unidirectional intra-board communication, bidirectional communication between different processes in the board can be realized.
[0166] based on Figure 1 , Figure 7 An exemplary diagram of a two-way communication architecture between different processes in the same board is shown;
[0167] 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, so as to realize unidirectional data transmission 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 mapped to each other, so as to implement unidirectional data transmission from the process 142 to the process 141 .
[0169] In one embodiment, the third process or the fourth process and the first process may be the same process, and the same process in the board may communicate with other processes in the board and other processes outside the board.
[0170] In the application, within the same board, the data transmitted between the process and the inter-board communication agent, and between different processes can be messages. Users can control the communication system according to actual needs based on any human-computer interaction method supported by the energy storage valve control system, and configure the communication channel within the same board or between different boards through the intra-board communication agent and the inter-board communication agent. The specific configuration content includes but is not limited to: source port, destination port, port number of the source port, port number of the destination port, communication channel ID, port type, data size, channel depth, driver type, etc. The port type is used to identify whether each source port and destination port is used for intra-board communication or inter-board communication. The channel depth is used to define how much data can be stored in each shared space. The driver type is used to define 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 the present application.
[0172] like Figure 8 As shown, the embodiment of the present application also 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 includes at least one physical communication interface 304. When the processor 301 executes the computer program 303, the steps in any of the above communication method embodiments are implemented.
[0173] In applications, the board may include, but is 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), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0175] In application, the memory may be an internal storage unit of the board in some embodiments, such as a hard disk or memory of the board. In other embodiments, the memory may also be an external storage device of the board, such as a plug-in hard disk equipped on the board, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Further, the memory may also include both an internal storage unit of the board and an external storage device. The memory is used to store an operating system, an application program, a boot loader (Boot Loader), data, and other programs, such as program codes of a computer program. The memory may also be used to temporarily store data that has been output or is to be output.
[0176] In applications, the energy storage valve control system may also include human-computer interaction equipment, network access equipment, etc. The human-computer interaction equipment may include a display screen, a touch screen, a touch display screen, an audio playback device, a mouse, a keyboard, a button, 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 the application, the communication module can be set to any device that can directly or indirectly perform long-distance wired or wireless communication according to actual needs. For example, the communication module can provide communication solutions including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth, Zigbee, mobile communication networks, GNSS, frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc., which are applied to network devices. The communication module may include an antenna, and the antenna may 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 signal, and send the processed signal to the processor. The communication module can also receive the signal to be sent from the processor, frequency modulate and amplify it, and convert it into electromagnetic waves for radiation through the antenna.
[0179] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned various communication method embodiments can be implemented.
[0180] An embodiment of the present application provides a computer program product. When the computer program product runs on a board, the board can implement the steps in the above-mentioned various communication method embodiments when executing the computer program product.
[0181] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera board, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.
[0182] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0183] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0184] In the embodiments provided in the present application, it should be understood that the disclosed boards and methods can be implemented in other ways. For example, the board embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0185] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0186] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A communication method, characterized in that: Based on the communication system running on the board, the communication system includes a driver layer, an operating system layer and an application layer, and also includes a unified system communication interface layer established between the operating system layer and the application layer. The communication method includes: Opening, through a first process, 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 means of an inter-board communication agent, a destination port corresponding to the inter-board communication agent is opened 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; By means of the inter-board communication agent, the port number of the destination port corresponding to the inter-board communication agent is written into the first data to generate first target data; Sending the first target data to the driver layer through the inter-board communication agent; By means of the driver layer, driving at least one physical communication interface of the board to send the first target data to a physical communication interface of at least one other board; 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.
2. The communication method according to claim 1, characterized in that: The method of opening a source port corresponding to the first process through the first process to obtain a first communication channel identifier and writing the first data into the first shared space according to the first communication channel identifier includes: Through the inter-board communication agent, a globally unique first communication channel identifier and a 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.
3. The communication method according to claim 1 or 2, characterized in that: 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 to a source port corresponding to the first process; The communication method further comprises: In the case where a plurality of first target data are generated by the inter-board communication agent, all the first target data are packaged and sent to the driver layer by the inter-board communication agent.
4. The communication method according to claim 1 or 2, characterized in that: Also includes: By means of the driver layer, driving the physical communication interface of the board to receive second target data sent by the physical communication interface of at least one other board; The second target data is acquired and parsed through the inter-board communication agent to obtain the port number of the destination port corresponding to the other inter-board communication agent and the second data, the port number of the destination port corresponding to the other inter-board communication agent is the same as the port number of the source port corresponding to the inter-board communication agent, and the other inter-board communication agent runs on the other board card; By means of the inter-board communication agent, according to the port number of the destination port corresponding to the other inter-board communication agent, the source port corresponding to the inter-board communication agent is opened to obtain a second communication channel identifier, and the second data is written into the second shared space according to the second communication channel identifier; Opening, by the second process, 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 unified system communication interface layer further includes a source port corresponding to the inter-board communication agent and a destination port corresponding to the second process.
5. The communication method according to claim 4, characterized in that: Before the physical communication interface of the board is driven by the driver layer to receive the second target data sent by the physical communication interface of other boards, the method includes: 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 in that: 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 to a destination port corresponding to the second process; The communication method further comprises: When multiple packaged second target data are obtained through the inter-board communication agent, all the second target data are unpacked and parsed through the inter-board communication agent to obtain the port numbers of multiple source ports corresponding to the inter-board communication agent and multiple second data.
7. The communication method according to claim 4 or 5, characterized in that: 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 in that: Also includes: Opening, through a third process, a source port corresponding to the third process to obtain a third communication channel identifier, and writing the third data into a third shared space according to the third communication channel identifier; Opening, through a 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; The unified system communication interface layer further includes a source port corresponding to the third process and a destination port corresponding to the fourth process.
9. The communication method according to claim 8, characterized in that: The unified system communication interface layer also includes an intra-board communication agent; The method of opening the source port corresponding to the third process through the third process to obtain the third communication channel identifier and writing the third data into the third shared space according to the third communication channel identifier includes: 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 in that: The third process and the first process are the same process.
11. A board comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: The computer program further comprises at least one physical communication interface, and the processor implements the steps of the communication method according to any one of claims 1 to 10 when executing the computer program.
12. An energy storage valve control system, characterized in that: The method comprises the board as claimed in claim 11 and the at least one other board.
13. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the communication method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Method for inter-board communication
CN102821055A
Method for communication among business boards in distributed equipment
CN105227463A
Data forwarding method, network equipment and computer readable storage medium
CN110535771A
Inter-board-card data exchange method, device and equipment and storage medium
CN113836058A
Platform for facilitating development of intelligence in an industrial internet of things system
WO2020227429A1