Charging pile and communication method and communication device of control board thereof
Patent Information
- Application Number
- CN202610780052.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-02
- Publication Date
- 2026-08-28
- Estimated Expiration
- 2046-06-02
AI Technical Summary
然而,充电桩内部不同通信介质在带宽、传输延迟和误码率方面存在显著差异,例如,CAN总线的有效数据场长度受限,最多8字节,且总线负载过高时会导致消息延迟增加;RS485的典型应用速率远低于百兆以太网,且在长距离传输时误码率更高
[0020] This invention determines the target communication link through an address mapping table and configures a corresponding retransmission strategy according to the medium type of the link and the type of data to be sent. This allows different communication media to obtain a transmission strategy that is compatible with their transmission characteristics, avoiding unnecessary retransmission of low-priority data on bandwidth-limited media, thereby reducing interference with the transmission of critical data.
Smart Images

Figure CN122316830B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, specifically to a communication method for the control board of a charging pile, a communication device for the control board of a charging pile, and a charging pile. Background Technology
[0002] Charging pile control systems generally adopt a distributed control architecture, including a main control board and slave control boards such as power control board, energy metering board, and human-machine interface board. Different communication methods are used between the control boards according to functional requirements: the main control board communicates with the power control board via CAN (Controller Area Network) bus, with the power metering board via RS485, and with the human-machine interface board via RS232 or Ethernet.
[0003] In related technologies, data interaction between charging pile control boards generally adopts a unified retransmission mechanism, that is, configuring the same retransmission parameters (such as the number of retransmissions and timeout time) for all data types and communication media. However, different communication media within the charging pile have significant differences in bandwidth, transmission delay, and bit error rate. For example, the effective data field length of the CAN bus is limited to a maximum of 8 bytes, and excessive bus load can lead to increased message delays; the typical application rate of RS485 is much lower than that of 100 Mbps Ethernet, and the bit error rate is higher during long-distance transmission. Using the same retransmission strategy for non-critical data such as device status and logs as for critical data such as charging parameter adjustments and fault alarms will create unnecessary load on the bandwidth-limited medium, leading to increased transmission delays for critical control commands. In extreme cases, commands may even be lost, affecting the stability and safety of the charging process. Summary of the Invention
[0004] To address the aforementioned technical problems, the first aspect of this invention proposes a communication method for the control board of a charging pile.
[0005] A second aspect of the present invention provides a communication device for the control board of a charging pile.
[0006] A third aspect of the present invention provides a charging pile.
[0007] The technical solution adopted in this invention is as follows:
[0008] An embodiment of the first aspect of the present invention provides a communication method for the control board of a charging pile, comprising the following steps: listening to events and determining the classification of the events; if a data transmission request event is detected, the control board transmitter encapsulates the transmission data, obtains the communication link corresponding to the target address according to the address mapping table, calls the corresponding link to complete the transmission of the data, and after the data transmission is successful, determines whether the transmitted data requires an ACK (Acknowledge) response message from the receiving end based on the identifier of the transmitted data. If an ACK response message is required, the transmitted data is cached in a pending confirmation queue, and a retransmission detection timer is started; if a retransmission detection timer trigger event is detected, the control board transmitter checks the pending confirmation queue. If the pending confirmation queue is detected... If there is data sent that has not received the ACK response message within a timeout period, the system further checks whether the number of retransmissions of the data has reached a preset threshold. If the preset threshold is reached, the data is removed from the pending acknowledgment queue. If the preset threshold is not reached, the data is retransmitted. The retransmission parameters are set according to the medium and data type of the communication link corresponding to the data being sent. If a data reception event is detected, the control board receiver receives and determines the type of the received data. If the received data is an ACK response message, it searches for data in the pending acknowledgment queue that matches the source data identifier of the received data. If the match is successful, the data corresponding to the pending acknowledgment queue is removed, and the corresponding retransmission detection timer is stopped. If the match is unsuccessful, the received data is discarded.
[0009] The communication method for the control board of the charging pile proposed above may also have the following additional technical features:
[0010] According to an embodiment of the present invention, the above-described control board communication method for charging piles further includes: if the received data is not the ACK response message, the control board receiving end further determines whether the received data needs to be replied with an ACK response message; if the received data does not need to be replied with an ACK response message, the received data is sent to the service layer for processing; if the received data needs to be replied with an ACK response message, the receiving end generates and encapsulates an ACK response message according to the protocol and sends the ACK response message to the sending end, and searches for data matching the identifier of the received data in the ACK response queue. If the match is successful, the received data is discarded; if the match is unsuccessful, the identifier of the received data is cached in the ACK response queue, and the received data is sent to the service layer for processing.
[0011] According to an embodiment of the present invention, the queue to be confirmed is stored in a two-dimensional array. The row index of the two-dimensional array of the queue to be confirmed corresponds to the target address encoding CodeB of the data, and the column index corresponds to the message sequence number Seq of the data modulo the column length threshold. The elements of the two-dimensional array of the queue to be confirmed are structure pointers. The contents encapsulated in the structure include: data content, current retransmission count, and retransmission detection timer duration.
[0012] According to one embodiment of the present invention, caching the transmitted data to a pending acknowledgment queue specifically includes: obtaining the source address code CodeA, the destination address code CodeB, and the message sequence number Seq of the transmitted data; obtaining the corresponding element in the address mapping table according to the source address code CodeA and the destination address code CodeB to obtain retransmission parameters; obtaining the column length threshold of the pending acknowledgment queue; obtaining the placement position Pos of the pending acknowledgment queue by taking the remainder of the destination address code CodeB and the message sequence number Seq divided by the column length threshold; determining whether the placement position Pos already contains data; if the placement position Pos does not contain data, creating a new structure for the placement position Pos element and assigning values to its fields; linking the structure to the placement position Pos; if the placement position Pos contains data, updating the fields in the placement position Pos structure according to the transmitted data.
[0013] According to one embodiment of the present invention, searching for data matching the identifier of the received data in the queue to be confirmed specifically includes: obtaining the source address code CodeA, the destination address code CodeB, and the message sequence number Seq of the received data; obtaining the corresponding element in the address mapping table according to the source address code CodeA and the destination address code CodeB to obtain retransmission parameters; obtaining the column length threshold of the queue to be confirmed; obtaining the placement position Pos of the queue to be confirmed by taking the remainder of the column length according to the destination address code CodeB and the message sequence number Seq; determining whether data already exists at the placement position Pos; if data exists at the placement position Pos, comparing the message sequence number Seq of the received data with the message sequence number Seq of the element at the placement position Pos; if the comparison matches, the received data is successfully matched with the queue to be confirmed.
[0014] According to one embodiment of the present invention, the ACK response queue is stored in a two-dimensional array. The row index of the two-dimensional array of the ACK response queue corresponds to the source address encoding CodeA of the data, and the column index corresponds to the message sequence number Seq of the data modulo the column length threshold. The two-dimensional array elements of the ACK response queue are structure pointers, and the contents encapsulated in the structure include: the identifier of the received data.
[0015] According to one embodiment of the present invention, searching for data matching the source data identifier of the received data from the ACK response queue specifically includes: obtaining the source address code CodeA, the destination address code CodeB, and the message sequence number Seq of the received data; obtaining the corresponding element in the address mapping table according to the source address code CodeA and the destination address code CodeB to obtain retransmission parameters; obtaining the column length threshold of the ACK response queue according to the retransmission parameters; obtaining the placement position Pos of the pending acknowledgment queue by taking the remainder of the column length threshold according to the source address code CodeA and the message sequence number Seq; determining whether data already exists at the placement position Pos; if no data exists at the placement position Pos, the received data fails to match the ACK response queue; if data already exists at the placement position Pos, the identifier of the received data is compared with the identifier of the element at the placement position Pos; if the comparison matches, the received data successfully matches the ACK response queue; if the comparison does not match, the received data fails to match the ACK response queue.
[0016] According to one embodiment of the present invention, the message sequence number Seq is stored in a two-dimensional array. The row index of the two-dimensional array of message sequence number Seq corresponds to the communication link between the current control board and other control boards, and the sequence number of each communication link is counted independently in a sequential loop. The column index of the two-dimensional array of message sequence number Seq is obtained by taking the modulo operation between the message sequence number and the column length of the row.
[0017] A second aspect of the present invention provides a communication device for a control board of a charging pile, comprising: a listening end, the listening end being used to listen for events and determine the classification of the events; and a sending end, the sending end being used to, when the listening end detects a data transmission request event, encapsulate transmission data, obtain the communication link corresponding to the target address according to an address mapping table, call the corresponding link to complete the transmission of the data, and after successful data transmission, determine whether the transmitted data requires an ACK response message from the receiving end based on the identifier of the transmitted data. If an ACK response message is required, the transmitted data is cached in a pending confirmation queue, and a retransmission detection timer is started. The sending end is also used to, when the listening end detects a retransmission detection timer trigger event, check the pending confirmation queue, and if the retransmission detection timer is detected in the pending confirmation queue... If there is data transmission that has not received the ACK response message within a timeout period, the system further checks whether the number of retransmissions of the transmitted data has reached a preset threshold. If the preset threshold is reached, the transmitted data is removed from the pending acknowledgment queue. If the preset threshold is not reached, the transmitted data is retransmitted. The retransmission parameters are set according to the medium and data type of the communication link corresponding to the transmitted data. At the receiving end, when the listening end detects a data reception event, the receiving end receives and determines the type of the received data. If the received data is an ACK response message, the system searches for data in the pending acknowledgment queue that matches the identifier of the received data. If the match is successful, the data corresponding to the pending acknowledgment queue is removed, and the corresponding retransmission detection timer is stopped. If the match is unsuccessful, the received data is discarded.
[0018] A third aspect of the present invention provides a charging pile, including the control board communication device of the charging pile described above.
[0019] The beneficial effects of this invention are:
[0020] This invention determines the target communication link through an address mapping table and configures a corresponding retransmission strategy according to the medium type of the link and the type of data to be sent. This allows different communication media to obtain a transmission strategy that is compatible with their transmission characteristics, avoiding unnecessary retransmission of low-priority data on bandwidth-limited media, thereby reducing interference with the transmission of critical data.
[0021] This invention adopts a unified communication framework to adapt to various communication media inside the charging pile, thereby improving the reusability of the communication scheme in different charging pile products.
[0022] The message cache queue of this invention adopts a two-dimensional array structure based on address encoding index and message sequence number index. The dual-index positioning mechanism reduces the retrieval time in the matching process and improves the real-time performance of heterogeneous communication between control boards. Attached Figure Description
[0023] Figure 1 This is a flowchart of a communication method for the control board of a charging pile according to an embodiment of the present invention;
[0024] Figure 2 This is a schematic diagram of the communication link of the control board of a charging pile according to an embodiment of the present invention;
[0025] Figure 3 This is a flowchart of a control board communication method for a charging pile according to another embodiment of the present invention;
[0026] Figure 4 This is a schematic diagram of a two-dimensional array structure of a queue to be confirmed according to an embodiment of the present invention;
[0027] Figure 5 This is a flowchart illustrating the process of buffering transmitted data into an acknowledgment queue according to an embodiment of the present invention;
[0028] Figure 6 This is a flowchart illustrating the process of searching for data that matches the source data identifier of received data in a queue to be acknowledged, according to an embodiment of the present invention.
[0029] Figure 7 This is a schematic diagram of a two-dimensional array structure of an ACK response queue according to an embodiment of the present invention;
[0030] Figure 8 This is a flowchart illustrating the process of searching for data matching the identifier of received data in the ACK response queue according to an embodiment of the present invention;
[0031] Figure 9 This is a schematic diagram of a two-dimensional array structure of message sequence numbers according to an embodiment of the present invention;
[0032] Figure 10 This is a block diagram of a communication device for the control board of a charging pile according to an embodiment of the present invention. Detailed Implementation
[0033] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0034] Figure 1 This is a flowchart of a communication method for the control board of a charging pile according to an embodiment of the present invention, as shown below. Figure 1 As shown, the method includes the following steps:
[0035] S1 listens for events and determines the event category.
[0036] S2, if a data transmission request event is detected, the control board's transmitting end encapsulates the data to be transmitted, obtains the communication link corresponding to the target address according to the address mapping table, calls the corresponding link to complete the transmission of the data, and after the data is successfully transmitted, it determines whether the receiving end needs to reply with an ACK response message based on the identifier of the transmitted data. If an ACK response message is required, the transmitted data is buffered in the pending confirmation queue and a retransmission detection timer is started.
[0037] Specifically, such as Figure 2 As shown, the control board of the charging pile includes a main control board and multiple slave control boards. When the main control board interacts with different slave control boards, the communication methods may be different depending on the functional requirements and transmission scenarios. Different physical media are used, and specific communication links are used.
[0038] The control board continuously monitors three types of events: data transmission request events, data reception events, and retransmission detection timer trigger events. If a data transmission request event is detected, the application layer encapsulates the data according to the data transmission request protocol. The sending end obtains the communication link corresponding to the target address based on the address mapping table, calls the corresponding link to complete the data transmission, and after successful transmission, determines whether the received end needs to reply with an ACK message based on the identifier in the transmitted data header. If no ACK message is needed, the data transmission process ends, and no further caching or retransmission processing occurs. If an ACK message is needed, the transmitted data is cached in the pending acknowledgment queue, and a retransmission detection timer is started for this message. If the timer for this transmitted data already exists, the start operation is ignored. The duration of the retransmission detection timer represents the retransmission frequency.
[0039] An address mapping table maps different communication links for sending and receiving data.
[0040] S3, if a retransmission detection timer trigger event is detected, the control board's sending end checks the pending acknowledgment queue. If it finds that there is data in the pending acknowledgment queue that has timed out and has not received an ACK response message, it further checks whether the number of retransmissions of the data has reached a preset threshold. If the preset threshold is reached, the data is removed from the pending acknowledgment queue. If the preset threshold is not reached, the data is retransmitted. The retransmission parameters are set according to the medium and data type of the communication link corresponding to the data being transmitted.
[0041] Specifically, after the retransmission detection timer expires, a retransmission detection timer event is triggered. The system then searches the pending acknowledgment queue to check if any transmitted data has expired without receiving an ACK response message. If so, it further checks whether the number of retransmissions has reached a preset threshold. If the threshold has not been reached, the transmitted data is retrieved, repackaged and retransmitted according to the original transmission process, and the retransmission count and retransmission detection timer time in the pending acknowledgment queue are updated. If the threshold has been reached, the transmitted data is removed from the pending acknowledgment queue, and no further retransmission checks are performed, completing a full reliable transmission.
[0042] In this invention, the retransmission parameters corresponding to the transmitted data (including the retransmission detection timer duration and the maximum number of retransmissions) are preset with differentiated basic retransmission parameters based on the inherent transmission rate of the medium type of the inter-board communication link. On the other hand, the retransmission parameters are dynamically fine-tuned in combination with the importance of the data type and the real-time requirements. For high-priority instructions, the shortest retransmission interval and a reasonable number of retries are adopted to ensure that critical instructions are delivered in time. For non-real-time data, the interval is optimized according to the medium characteristics to avoid retransmission storms and balance transmission efficiency and reliability.
[0043] Data can be categorized by business importance. Generally, charging parameter adjustments, fault alarms, and emergency stop commands are classified as important data; periodic device status reports and log data are classified as general data. Only important data is subject to a receive confirmation + timeout retransmission mechanism to ensure zero loss of critical data. General data is subject to a no-confirmation, no-retransmission strategy to reduce bandwidth consumption. Data updates are naturally overwritten by subsequent periodic reports, which both guarantees the transmission resources of critical commands and avoids wasting bandwidth on non-critical data.
[0044] S4. If a data reception event is detected, the control board receiver receives and determines the type of the received data. If the received data is an ACK response message, it searches for data in the pending confirmation queue that matches the identifier of the source data of the received data. If the match is successful, the data corresponding to the pending confirmation queue is removed and the corresponding retransmission detection timer is stopped. If the match is unsuccessful, the received data is discarded.
[0045] Specifically, after successfully receiving the data, the receiving end first parses the message type. If the received data is an ACK response message, the receiving end parses the original message identifier in the ACK response message and searches for a message matching that identifier in its local pending acknowledgment queue. If a match is found, it means that the original message has been successfully received by the other party, and the received data is removed from the pending acknowledgment queue, and its corresponding retransmission timer is stopped. If a match fails, it means that an invalid or expired ACK response message has been received, and the ACK response message is discarded without further processing.
[0046] In one embodiment of the present invention, such as Figure 3 As shown, the above-mentioned communication method for the control board of the charging pile also includes:
[0047] S51, if the received data is not an ACK response message, the control board receiver further determines whether an ACK response message is required for the received data.
[0048] S52: If no ACK response message is required after receiving data, the received data will be sent to the service layer for processing.
[0049] S53, if receiving data requires an ACK response message, the receiving end generates and encapsulates the ACK response message according to the protocol and sends the ACK response message to the sending end. It then searches for data in the ACK response queue that matches the identifier of the received data. If the match is successful, the received data is discarded. If the match is unsuccessful, the identifier of the received data is cached in the ACK response queue, and the received data is sent to the business layer for processing.
[0050] Specifically, if the received data is not an ACK response message (i.e., business data), the header and protocol rules of the received data are checked to determine whether an ACK response message is required. If no ACK response message is required, the received data is immediately handed over to the business layer for processing. If an ACK response message is required, an ACK response message is immediately generated according to the protocol and sent to the sender to prevent unnecessary retransmissions due to timeout failure to receive a response. The unique identifier of the message is used to search and compare the data in the local ACK response queue. If a match is found, it indicates that the data already exists and is considered a duplicate reception; the data is discarded and not passed to the upper business layer. If no match is found, it indicates that the data does not exist and is considered a first reception; the unique identifier of the data is cached in the ACK response queue, and then the data content is submitted to the business layer for processing.
[0051] In one embodiment of the present invention, such as Figure 4 As shown, the queue to be confirmed is stored in a two-dimensional array. The row index of the two-dimensional array corresponds to the target address code CodeB of the data, and the column index corresponds to the message sequence number Seq modulo the column length threshold. The elements of the two-dimensional array of the queue to be confirmed are pointers to structures. The contents encapsulated in the structure include: data content, current retransmission count and retransmission detection timer duration, data length, source address code CodeA, target address code CodeB, message sequence number Seq, and sending timestamp, etc.
[0052] Specifically, each control board acts as an independent communication entity, maintaining its own dedicated queue of messages awaiting acknowledgment to ensure isolation and efficiency in message retransmission management. The queue is stored in a two-dimensional array. The row index of the array corresponds to the target address code (CodeB) of the message, used for quick location of the communication object. The column index of the array is obtained by taking the remainder of the message sequence number (Seq) modulo the column length threshold, used to evenly distribute messages across different columns and avoid single-point bottlenecks. Each element of the array is a pointer to a structure, which encapsulates key information about the message to be retransmitted, including: data content, current retransmission count, retransmission detection timer duration, and other retransmission parameters. The row index is determined by the target address code (CodeB), and the column index is determined by taking the remainder of the message sequence number (Seq) modulo the column length threshold. Using these two indices, the corresponding structure pointer can be directly located in the two-dimensional array. The time complexity of the entire search process is O(1), ensuring efficient matching and searching of the queue of messages awaiting acknowledgment.
[0053] The column length threshold of the two-dimensional array and the retransmission parameters in each message structure (such as the maximum number of retransmissions and the duration of the retransmission detection timer) are dynamically set according to the predefined retransmission parameters related to the communication medium in the address mapping table. This allows the retransmission strategy to adapt to the characteristics of different communication media and optimizes the overall reliable transmission performance.
[0054] In one specific embodiment of the present invention, such as Figure 5 As shown, the data to be sent is buffered in the pending confirmation queue, specifically including:
[0055] S21, obtain the source address code CodeA, destination address code CodeB, and message sequence number Seq of the data to be sent.
[0056] S22, obtain the corresponding element in the address mapping table based on the source address code CodeA and the destination address code CodeB, in order to obtain the retransmission parameters.
[0057] Specifically, the corresponding elements in the address mapping table are obtained based on the source address code CodeA and the destination address code CodeB, thereby obtaining the medium type of the corresponding communication link. Based on the medium type and the data type, the retransmission parameters can be obtained.
[0058] S23, obtain the column length threshold of the queue to be confirmed based on the retransmission parameters.
[0059] S24, obtain the placement position Pos of the queue to be confirmed by taking the remainder of the target address code CodeB and the message sequence number Seq on the column length threshold.
[0060] S25, determine whether the placement position Pos already contains data.
[0061] S26. If the placement location Pos does not contain data, create a new structure for the placement location Pos element and assign values to its fields.
[0062] S27, link the structure to the placement location Pos.
[0063] S28. If data exists in the placement location Pos, then update the fields in the placement location Pos structure according to the sent data.
[0064] In one embodiment of the present invention, such as Figure 6 As shown, the process of searching the pending confirmation queue for data that matches the source data identifier of the received data specifically includes:
[0065] S29, obtain the source address encoding CodeA, destination address encoding CodeB, and message sequence number Seq of the received data.
[0066] S210: Obtain the corresponding element in the address mapping table based on the source address code CodeA and the destination address code CodeB to obtain the retransmission parameters.
[0067] S211, Obtain the column length threshold of the queue to be confirmed based on the retransmission parameters.
[0068] S212, obtain the placement position Pos of the queue to be confirmed by taking the remainder of the column length based on the target address code CodeB and the message sequence number Seq.
[0069] S213, determine whether the placement position Pos already contains data.
[0070] S214, if data exists at the placement position Pos, then the message sequence number Seq of the received data is compared with the message sequence number Seq of the element at the placement position Pos.
[0071] S215, if the comparison matches, the received data is successfully matched with the queue to be confirmed.
[0072] In one embodiment of the present invention, such as Figure 7 As shown, the ACK response queue is stored using a two-dimensional array. The row index of the two-dimensional array of the ACK response queue corresponds to the source address encoding CodeA of the data, and the column index corresponds to the message sequence number Seq of the data modulo the column length threshold. The two-dimensional array elements of the ACK response queue are structure pointers, and the contents encapsulated in the structure include: the identifier of the received data.
[0073] Specifically, each control board independently maintains its own dedicated ACK response queue to achieve isolated management and precise matching of response messages. The ACK response queue uses a two-dimensional array storage structure. The row index corresponds to the source address code CodeA of the message, and the column index is obtained by taking the remainder between the message sequence number Seq and the column length threshold (evenly distributing messages to avoid single-point bottlenecks). The array elements are pointers to structures that encapsulate the identifiers of the message to be responded to (including: source address code CodeA, destination address code CodeB, message sequence number Seq, and reception timestamp, etc.). The column length threshold of the ACK response queue's two-dimensional array is dynamically configured according to the retransmission parameters bound to the communication link medium in the address mapping table, adapting to the differences in transmission characteristics of different communication media. By locating the row index through the message's source address code CodeA and obtaining the column index by taking the remainder between the message sequence number Seq and the column length threshold, the target structure is directly located using dual indices. This efficient and fast queue lookup ensures real-time response matching.
[0074] In one embodiment of the present invention, such as Figure 8 As shown, searching the ACK response queue for data that matches the identifier of the received data specifically includes:
[0075] S216, obtain the source address encoding CodeA, destination address encoding CodeB, and message sequence number Seq of the received data.
[0076] S217: Obtain the corresponding element in the address mapping table based on the source address code CodeA and the destination address code CodeB to obtain the retransmission parameters.
[0077] S218, obtain the column length threshold of the ACK response queue based on the retransmission parameters.
[0078] S219, obtain the placement position Pos of the queue to be confirmed by taking the remainder of the source address code CodeA and the message sequence number Seq on the column length threshold.
[0079] S220, determine whether the placement position Pos already contains data.
[0080] S221, if there is no data at the placement position Pos, the received data will not match the ACK response queue.
[0081] At this point, the identifier of the received data is cached in the ACK response queue. Specifically, a new structure is created for the Pos element, and the fields are assigned values. The structure is then linked to the Pos element.
[0082] S222, if data already exists at the placement location Pos, then the identifier of the received data is compared with the identifier of the element at the placement location Pos.
[0083] S223, if the comparison matches, then the received data has successfully matched the ACK response queue.
[0084] If the comparison is inconsistent, it means that the received data and the ACK response queue did not match successfully.
[0085] In one embodiment of the present invention, such as Figure 9 As shown, the message sequence number Seq is stored in a two-dimensional array. The row index of the two-dimensional array of message sequence number Seq corresponds to the communication link between the current control board and other control boards, and the sequence number of each communication link is counted independently in a sequential loop. The column index of the two-dimensional array of message sequence number Seq is obtained by taking the modulo operation between the message sequence number and the column length of the row.
[0086] Specifically, the message sequence number (Seq) is used not only to identify the order in which messages are sent, but also to indicate their importance level. General and important messages are defined by the message sequence number Seq. General messages do not require acknowledgment or retransmission mechanisms, while important messages must undergo an acknowledgment mechanism to ensure reliable transmission. Figure 9 In this context, n and m are positive integers. The row dimension of the queue corresponds to the communication link between the current control board and other control boards. For each communication link (i.e., each row), its message sequence number Seq is counted sequentially and independently. The sequence numbers between different rows (different links) do not interfere with each other. The column index is obtained by taking the modulo operation between the message sequence number and the column length threshold of the row. This design ensures that messages on the same link can be processed sequentially and lays the foundation for subsequent coverage strategies.
[0087] The message sequence number (Seq) employs an ordered storage and intelligent overwriting strategy. Ordered storage: On the same communication link, the message sequence number (Seq) is strictly incremented according to the sending order. When the sequence number reaches its maximum value, it automatically wraps around (i.e., loops). The column index is obtained by taking the remainder of the message sequence number (Seq) divided by the column length, used to distribute and store messages in an ordered manner in a two-dimensional array. Intelligent overwriting: When the storage space of a row in the queue is exhausted, a newly arriving message will overwrite the older message at the corresponding position in that row based on the remainder of its message sequence number (Seq). Since the message sequence number (Seq) increments in the sending order, this overwriting strategy achieves the effect of the newest message overwriting the oldest message, ensuring that the message cached in the queue is always the one that most needs to be retransmitted.
[0088] Thanks to the aforementioned message sequence number encoding rules and queue storage strategy, when it is necessary to check whether a message already exists in the queue, the message sequence number can be used to locate the message by taking the remainder of the column length. This greatly improves the efficiency of queue operations and ensures the high performance of the entire reliable transmission mechanism.
[0089] As described above, this invention adopts a collaborative architecture of pending confirmation queue + ACK response queue + message sequence number. On the one hand, the structured design of queues and message sequence numbers ensures the efficiency of message caching, fast clearing, and accurate lookup. On the other hand, combined with the medium characteristics associated with the address mapping table, it realizes dynamic adaptation and adjustment of retransmission parameters, providing core support for the reliability and real-time performance of data transmission in different communication medium scenarios.
[0090] In this invention, the pending confirmation queue and ACK response queue can be initialized each time the charging station is restarted.
[0091] In summary, the control board communication method for charging piles according to embodiments of the present invention determines the target communication link through an address mapping table and configures a corresponding retransmission strategy based on the medium type of the link and the type of data to be sent. This ensures that different communication media can obtain a transmission strategy adapted to their transmission characteristics, avoiding unnecessary retransmission of low-priority data on bandwidth-limited media, thereby reducing interference with the transmission of critical data. This ensures the transmission of critical data while avoiding wasting bandwidth on non-critical data. The present invention adopts a unified communication framework to adapt to multiple communication media within the charging pile, improving the reusability of the communication scheme in different charging pile products. The message cache queue adopts a two-dimensional array structure based on address encoding index and message sequence number index, reducing the retrieval time during the matching process through a dual-index positioning mechanism, and improving the real-time performance of heterogeneous communication between control boards.
[0092] The present invention also proposes a communication device for the control board of a charging pile. Since the device embodiment of the present invention corresponds to the method embodiment described above, details not disclosed in the corresponding device embodiment can be found in the method embodiment described above, and will not be repeated in the present invention.
[0093] Figure 10 This is a block diagram of a control board communication device for a charging pile according to an embodiment of the present invention, as shown below. Figure 10 As shown, the communication device of the control board includes: a listening end, a transmitting end, and a receiving end.
[0094] The listening end is used to monitor events and classify them. The sending end, when the listening end detects a data transmission request event, encapsulates the data to be sent, obtains the communication link corresponding to the target address based on the address mapping table, calls the corresponding link to complete the data transmission, and after successful data transmission, determines whether an ACK response message is required from the receiving end based on the data's identifier. If an ACK response message is required, the transmitted data is buffered in the pending acknowledgment queue, and a retransmission detection timer is started. The sending end also checks the pending acknowledgment queue when the listening end detects a retransmission detection timer trigger event. If any pending acknowledgment messages have not been received within the queue, the sending end checks the pending acknowledgment queue. When sending data, the system further checks whether the number of retransmissions has reached a preset threshold. If it has, the data is removed from the acknowledgment queue. If it has not, the data is retransmitted. The retransmission parameters are set according to the medium and data type of the communication link corresponding to the data being sent. The receiving end receives and determines the type of data when the listening end detects a data reception event. If the received data is an ACK response message, it searches for data matching the identifier of the received data in the acknowledgment queue. If the match is successful, the corresponding data in the acknowledgment queue is removed, and the corresponding retransmission detection timer is stopped. If the match is unsuccessful, the received data is discarded.
[0095] According to the communication device of the control board of the charging pile according to the embodiment of the present invention, the target communication link is determined by the address mapping table, and the corresponding retransmission strategy is configured according to the medium type of the link and the type of data to be sent. This allows different communication media to obtain a transmission strategy that is compatible with their transmission characteristics, avoiding unnecessary retransmission of low-priority data on bandwidth-limited media, thereby reducing interference with the transmission of critical data. This ensures the transmission of critical data while avoiding the waste of bandwidth for non-critical data. The present invention adopts a unified communication framework to adapt to multiple communication media within the charging pile, improving the reusability of the communication scheme in different charging pile products. The message buffer queue adopts a two-dimensional array structure based on address encoding index and message sequence number index. The dual-index positioning mechanism reduces the retrieval time in the matching process and improves the real-time performance of heterogeneous communication between control boards.
[0096] In addition, the present invention also proposes a charging pile, including the control board communication device of the charging pile described above.
[0097] According to the embodiments of the present invention, the charging pile, through the control board communication device of the charging pile, determines the target communication link through an address mapping table, and configures a corresponding retransmission strategy according to the medium type of the link and the type of data to be sent. This allows different communication media to obtain a transmission strategy that is compatible with their transmission characteristics, avoiding unnecessary retransmission of low-priority data on bandwidth-limited media, thereby reducing interference with the transmission of critical data. This ensures the transmission of critical data while avoiding wasting bandwidth on non-critical data. The present invention adopts a unified communication framework to adapt to multiple communication media within the charging pile, improving the reusability of the communication scheme in different charging pile products. The message cache queue adopts a two-dimensional array structure based on address encoding index and message sequence number index. The dual-index positioning mechanism reduces the retrieval time during the matching process and improves the real-time performance of heterogeneous communication between control boards.
[0098] In the description of this invention, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example.
[0099] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0100] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A communication method for the control board of a charging pile, characterized in that, Includes the following steps: Listen for events and determine their classification; If a data transmission request event is detected, the control board's transmitting end encapsulates the transmission data, obtains the communication link corresponding to the target address according to the address mapping table, calls the corresponding link to complete the transmission of the data, and after the data is successfully transmitted, it determines whether the transmitting data needs to be replied to by the receiving end with an ACK response message based on the identifier of the transmitted data. If an ACK response message is required, the transmitted data is cached in the pending confirmation queue, and a retransmission detection timer is started. If a retransmission detection timer trigger event is detected, the control board sending end checks the pending acknowledgment queue. If it finds that there is data in the pending acknowledgment queue that has timed out and has not received the ACK response message, it further checks whether the number of retransmissions of the data has reached a preset threshold. If the preset threshold is reached, the data is removed from the pending acknowledgment queue. If the preset threshold is not reached, the data is retransmitted. The retransmission parameters are set according to the medium and data type of the communication link corresponding to the data. If a data reception event is detected, the control board receiver receives and determines the type of the received data. If the received data is an ACK response message, it searches for data in the pending confirmation queue that matches the source data identifier of the received data. If the match is successful, the data corresponding to the pending confirmation queue is removed, and the corresponding retransmission detection timer is stopped. If the match is unsuccessful, the received data is discarded.
2. The communication method for the control board of a charging pile according to claim 1, characterized in that, Also includes: If the received data is not the ACK response message, the control board receiver further determines whether the received data needs to be replied with an ACK response message; If the received data does not require an ACK response message, the received data will be sent to the service layer for processing. If the received data requires an ACK response message, the receiving end generates and encapsulates the ACK response message according to the protocol, sends the ACK response message to the sending end, and searches for data matching the identifier of the received data in the ACK response queue. If the match is successful, the received data is discarded; if the match is unsuccessful, the identifier of the received data is cached in the ACK response queue, and the received data is sent to the service layer for processing.
3. The communication method for the control board of a charging pile according to claim 1, characterized in that, The queue to be confirmed is stored in a two-dimensional array. The row index of the two-dimensional array corresponds to the target address encoding CodeB of the data, and the column index corresponds to the message sequence number Seq of the data modulo the column length threshold. The elements of the two-dimensional array of the queue to be confirmed are structure pointers. The contents encapsulated in the structure include: data content, current retransmission count, and retransmission detection timer duration.
4. The communication method for the control board of the charging pile according to claim 3, characterized in that, Cache the transmitted data in the pending confirmation queue, specifically including: Obtain the source address code CodeA, destination address code CodeB, and message sequence number Seq of the transmitted data; Based on the source address code CodeA and the destination address code CodeB, obtain the corresponding element in the address mapping table to obtain the retransmission parameters; The column length threshold of the queue to be confirmed is obtained based on the retransmission parameters; The placement position Pos of the queue to be confirmed is obtained by taking the remainder of the target address code CodeB and the message sequence number Seq on the column length threshold. Determine whether the placement location Pos already contains data; If the placement location Pos does not contain data, then create a new structure for the placement location Pos element and assign values to its fields; Link the structure to the placement location Pos; If data exists at the placement location Pos, then the fields in the placement location Pos structure are updated according to the sent data.
5. The communication method for the control board of a charging pile according to claim 3, characterized in that, Searching for data in the pending confirmation queue that matches the source data identifier of the received data specifically includes: Obtain the source address code CodeA, destination address code CodeB, and message sequence number Seq of the received data; Based on the source address code CodeA and the destination address code CodeB, obtain the corresponding element in the address mapping table to obtain the retransmission parameters; The column length threshold of the queue to be confirmed is obtained based on the retransmission parameters; The placement position Pos of the queue to be confirmed is obtained by taking the remainder of the column length based on the target address code CodeB and the message sequence number Seq. Determine whether the placement location Pos already contains data; If data exists at the placement location Pos, the message sequence number Seq of the received data is compared with the message sequence number Seq of the element at the placement location Pos. If the comparison matches, the received data is successfully matched with the queue to be confirmed.
6. The communication method for the control board of a charging pile according to claim 2, characterized in that, The ACK response queue is stored in a two-dimensional array. The row index of the two-dimensional array of the ACK response queue corresponds to the source address encoding CodeA of the data, and the column index corresponds to the message sequence number Seq of the data modulo the column length threshold. The two-dimensional array elements of the ACK response queue are structure pointers, and the contents encapsulated in the structure include: the identifier of the received data.
7. The communication method for the control board of a charging pile according to claim 6, characterized in that, Searching the ACK response queue for data that matches the identifier of the received data specifically includes: Obtain the source address code CodeA, destination address code CodeB, and message sequence number Seq of the received data; Based on the source address code CodeA and the destination address code CodeB, obtain the corresponding element in the address mapping table to obtain the retransmission parameters; The column length threshold of the ACK response queue is obtained based on the retransmission parameters; The placement position Pos of the queue to be confirmed is obtained by taking the remainder of the column length threshold based on the source address code CodeA and the message sequence number Seq. Determine whether the placement location Pos already contains data; If there is no data at the placement location Pos, then the received data will not match the ACK response queue. If data already exists at the placement location Pos, the identifier of the received data is compared with the identifier of the placement location Pos element; If the comparison matches, the received data is successfully matched with the ACK response queue; If the comparison is inconsistent, the received data does not match the ACK response queue.
8. The communication method for the control board of a charging pile according to claim 3 or 6, characterized in that, The message sequence number Seq is stored in a two-dimensional array. The row index of the two-dimensional array of message sequence number Seq corresponds to the communication link between the current control board and other control boards. The sequence number of each communication link is counted independently in a sequential loop. The column index of the two-dimensional array of message sequence number Seq is obtained by taking the modulo operation between the message sequence number and the column length of the row.
9. A communication device for the control board of a charging pile, characterized in that, include: A listening terminal, used to listen for events and determine the category of the events; The sending end is configured to encapsulate the data to be sent when the listening end detects a data sending request event, obtain the communication link corresponding to the target address according to the address mapping table, call the corresponding link to complete the sending of the data, and after the data is successfully sent, determine whether the sending data needs to be replied with an ACK message by the receiving end according to the identifier of the sending data. If an ACK message is required, the sending data is cached in the pending confirmation queue and a retransmission detection timer is started. The sending end is also configured to check the pending confirmation queue when the listening end detects a retransmission detection timer trigger event. If the pending confirmation queue contains sending data that has timed out and has not received an ACK message, it further checks whether the number of retransmissions of the sending data has reached a preset threshold. If the preset threshold is reached, the sending data is removed from the pending confirmation queue. If the preset threshold is not reached, the sending data is retransmitted. The retransmission parameters are set according to the medium and data type of the communication link corresponding to the sending data. The receiving end is used to receive and determine the type of received data when the listening end detects a data reception event. If the received data is an ACK response message, it searches for data that matches the identifier of the received data in the pending confirmation queue. If the match is successful, the data corresponding to the pending confirmation queue is removed and the corresponding retransmission detection timer is stopped. If the match is unsuccessful, the received data is discarded.
10. A charging pile, characterized in that, It includes the control board communication device for the charging pile as described in claim 9.
Citation Information
Patent Citations
Multi-interface self-adaptive wireless heterogeneous network protocol conversion method and communication device
CN104901877A
Communication method and system for real-time downloading of vehicle-mounted data
CN120358490A