CN114466046A - Data forwarding method and power module - Google Patents

Data forwarding method and power module Download PDF

Info

Publication number
CN114466046A
CN114466046A CN202210169324.2A CN202210169324A CN114466046A CN 114466046 A CN114466046 A CN 114466046A CN 202210169324 A CN202210169324 A CN 202210169324A CN 114466046 A CN114466046 A CN 114466046A
Authority
CN
China
Prior art keywords
peripheral
protocol
data
executor
forwarded
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210169324.2A
Other languages
Chinese (zh)
Other versions
CN114466046B (en
Inventor
马群
李睿
张�浩
司建龙
郭喜斌
郭禹
胡迎庆
徐卫东
张逾良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shijiazhuang Tonghe Electronics Co Ltd
Original Assignee
Shijiazhuang Tonghe Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shijiazhuang Tonghe Electronics Co Ltd filed Critical Shijiazhuang Tonghe Electronics Co Ltd
Priority to CN202210169324.2A priority Critical patent/CN114466046B/en
Publication of CN114466046A publication Critical patent/CN114466046A/en
Application granted granted Critical
Publication of CN114466046B publication Critical patent/CN114466046B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention provides a data forwarding method and a power module, wherein the method comprises the following steps: registering a protocol ID which can be forwarded by each peripheral inside; the requester peripheral sends request information to the data forwarding device, wherein the request information comprises an address, a protocol ID and an executor ID of data to be forwarded; the data forwarding device loads the address and the protocol ID of the data to be forwarded to a first preset cache region of the executor peripheral corresponding to the executor ID; the executor peripheral extracts the data to be forwarded according to the address in the first preset cache region, searches a corresponding protocol from the registered self-forwardable protocol ID according to the protocol ID in the first preset cache region, and calls the corresponding protocol to forward the data to be forwarded. The invention can realize the data forwarding among the peripheral equipment according to the protocol required by the peripheral equipment of the requester.

Description

Data forwarding method and power module
Technical Field
The invention belongs to the technical field of data transmission, and particularly relates to a data forwarding method and a power module.
Background
No matter fill power module, on-vehicle power module, war article power module or the electric power module in the electric pile, when carrying out the internal design, can design front and back level structure usually, coordinate through serial ports communication between the front and back level to realize power module's normal operating. However, the power module generally only communicates with the CAN externally, and a frame of received client protocol information may be an operation of controlling a front stage, and at this time, a serial communication module (herein, the communication module is referred to as an external device) is required to directly forward the protocol information received by the CAN. Namely, the peripheral equipment of the execution requester makes a data forwarding request, and the peripheral equipment of the executor executes a sending task.
When a plurality of requester peripherals request an executor peripheral to execute a sending function, the required forwarding protocols may be different, and how to forward data according to the protocol required by the requester peripheral is an urgent problem to be solved.
Disclosure of Invention
In view of this, embodiments of the present invention provide a data forwarding method and a power module, so as to forward data according to a protocol required by each requester peripheral when data forwarding is performed among the peripherals.
A first aspect of an embodiment of the present invention provides a data forwarding method, where the method is used to implement data forwarding between peripheral devices, and each peripheral device is connected to a data forwarding device;
the method comprises the following steps:
each peripheral internally registers a protocol ID which can be forwarded by itself;
the external equipment of the requester sends request information to the data forwarding device; the request information comprises an address of data to be forwarded, a protocol ID and an executor ID;
the data forwarding device loads the address and the protocol ID of the data to be forwarded to a first preset cache region of the executor peripheral corresponding to the executor ID;
the executor peripheral extracts the data to be forwarded according to the address in the first preset cache region, searches a corresponding protocol from the registered self-forwardable protocol ID according to the protocol ID in the first preset cache region, and calls the corresponding protocol to forward the data to be forwarded.
Optionally, each peripheral also internally registers a callback function and a verification mode of a forwardable protocol of the peripheral;
correspondingly, invoking the corresponding protocol to forward the data to be forwarded includes:
and calling a callback function and a verification mode of the registered corresponding protocol to forward the data to be forwarded.
Optionally, before registering a protocol ID that can be forwarded by itself in each peripheral, the method further includes:
each peripheral judges whether the number of the self-registered protocol IDs reaches the maximum value;
and if the number of the self registered protocol IDs reaches the maximum value, stopping registering the new protocol IDs.
Optionally, the request information further includes drive port information;
correspondingly, the data forwarding device is also used for loading the driving port information into a second preset cache region of the executor peripheral corresponding to the executor ID;
correspondingly, the executor peripheral extracts the data to be forwarded according to the address in the first preset cache region, searches and calls a corresponding protocol from the registered self-forwardable protocol ID according to the protocol ID in the first preset cache region, and then selects a corresponding driving port to forward the data to be forwarded based on the driving port information in the second preset cache region.
Optionally, each peripheral further externally registers its own peripheral ID, cache area write index address, and drive port information to the data forwarding apparatus.
Optionally, loading the address and the protocol ID of the data to be forwarded into a first preset buffer area of the executor peripheral corresponding to the executor ID, and loading the driver port information into a second preset buffer area of the executor peripheral corresponding to the executor ID, including:
according to the cache area writing index address, loading the address of the data to be forwarded and the protocol ID into a first preset cache area of the executor peripheral corresponding to the executor ID, and loading the driving port information into a second preset cache area of the executor peripheral corresponding to the executor ID;
and updating the cache area write index address after the loading is finished.
Optionally, the type of the peripheral device includes at least one of: CAN peripheral equipment, serial port peripheral equipment, network port peripheral equipment, SPI peripheral equipment and IIC peripheral equipment.
Optionally, the peripheral IDs of the peripherals are uniformly encoded, and the peripheral IDs of any two peripherals are different.
Optionally, the protocol IDs of the forwarding protocols of the peripherals are encoded uniformly, and any two protocol IDs are different.
A second aspect of the embodiments of the present invention provides a power module, which includes a data forwarding device and a plurality of peripheral devices, where the data forwarding device is connected to each peripheral device, and data forwarding is performed between the peripheral devices by using the data forwarding method according to the first aspect.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, when data forwarding is carried out between the peripheral equipment, the peripheral equipment of the requester and the peripheral equipment of the executor are not directly contacted, but are contacted through the arranged data forwarding device, so that under a 'many-to-many' forwarding mode with a plurality of requesters and a plurality of executors, the strong coupling between the peripheral equipment can be reduced, and the complexity and the code amount of a forwarding program are reduced; and the request information sent by the requester peripheral equipment carries a protocol ID, the protocol ID is loaded to a first preset cache region of the executor peripheral equipment through a data forwarding device, and the executor peripheral equipment can forward data according to the protocol required by each requester peripheral equipment.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic diagram of a peripheral connection relationship provided in an embodiment of the present invention;
FIG. 2 is a schematic diagram of system interaction provided by an embodiment of the invention;
FIG. 3 is a flowchart illustrating an internal registration process of a peripheral according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of data forwarding performed by an executor according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
In the embodiment of the invention, the power module needs the internal front-stage and rear-stage circuits to operate in a coordinated manner, so that the front-stage and rear-stage circuits are required to be capable of serial communication, the power module only has CAN communication to the outside, the received frame of client protocol information may control the operation of the front-stage circuit, and at the moment, the serial peripheral in the front-stage and rear-stage circuits is required to directly forward the protocol information received by the CAN peripheral. Namely, after receiving the information, the CAN peripheral does not need to directly process the information, but requests other serial peripheral to forward the information, and processes other modules or other parts of the module.
Therefore, a peripheral device needs to have a forwarding capability in addition to its own parsing capability, so as to forward data that is originally owned by another peripheral device to another peripheral device.
When data is forwarded among the plurality of peripheral devices, each peripheral device may need to request a plurality of other peripheral devices to forward data, and each peripheral device may also need to forward data according to the forwarding requests of the plurality of other peripheral devices. I.e. each peripheral may act both as a party to make a forwarding request and as a party to send. In the forwarding mode of "many-to-many", the forwarding situation is complicated and varied, it is conceivable that the coupling between the peripheral devices is strong, the coupling association is uncertain, and depending on the situation, if one of the peripheral devices is slightly changed, the other peripheral device needs to be changed accordingly, for example, if a requester or an executor needs to be added or reduced, the other peripheral device related to the requester or the executor needs to be changed, the peripheral devices are mixed randomly, and the direct coupling and the coupling are strong, which results in a complicated forwarding procedure and a large amount of codes.
In addition, when a plurality of requesters request a certain executor to execute a sending function, the data which each requester needs to be executed and forwarded by the executor is determined by each requester, and different forwarding protocols are required when each requester requests the executor to execute sending. For example: the requester is CAN or IIC, and the executor is serial port. The data forwarded by the CAN request is that the length of the DataCAN is 6, as shown in table 1:
TABLE 1 CAN request protocol Table
Figure BDA0003516853280000051
Wherein, the Byte0 frame header is a fixed value of 0x 5F; byte1 function code 1 is 0x 00; byte2 is 0x06 in length; bit7 bits of Byte3 are the write function (0); function code 3 is 0x 00; byte 5-N is DataCAN; byte (N +1) and Byte (N +2) are the lower parity and the upper parity of the Crc12 parity check method.
The data forwarded by the IIC request is DataIIC length 8, as shown in table 2:
TABLE 2 IIC request protocol Table
Figure BDA0003516853280000052
Wherein, the Byte0 frame header is a fixed value of 0xE 5; the Byte1 function code is 0x 11; byte 2-9 is DataIIC; the Byte10 and the Byte11 are the lower check bit and the upper check bit of the Crc16sum check mode.
The two forwarding protocols have different formats, different used checking modes and different frame lengths and frame data. Therefore, when the executor peripheral performs data forwarding, the following problems are faced:
(1) how to know which type of forwarding protocol the requester needs the present executor to perform forwarding.
(2) How to separate the verification mode from the protocol content, namely, decoupling the protocol content from the verification mode, is convenient for writing different forwarding protocols when a client only modifies the verification mode of the forwarding protocol.
(3) How to write different forwarding protocols on the premise of reducing code modification quantity as much as possible.
Based on the above, the present invention provides a data forwarding method, which is used to implement data forwarding between peripheral devices, as shown in fig. 1, where each peripheral device is connected to a data forwarding apparatus, and each peripheral device is a requester and an executor shown in fig. 1 (the requester is a peripheral device that requests to forward data, and the executor is a peripheral device that executes data transmission). Referring to fig. 2, the method includes:
each peripheral internally registers a protocol ID which can be forwarded by itself;
the external equipment of the requester sends request information to the data forwarding device; the request information comprises an address of data to be forwarded, a protocol ID and an executor ID;
the data forwarding device loads the address and the protocol ID of the data to be forwarded to a first preset cache region of the executor peripheral corresponding to the executor ID;
the executor peripheral extracts the data to be forwarded according to the address in the first preset cache region, searches a corresponding protocol from the registered self-forwardable protocol ID according to the protocol ID in the first preset cache region, and calls the corresponding protocol to forward the data to be forwarded.
In the embodiment of the invention, the following problems are mainly considered during design: firstly, how the data forwarding device informs the executor of the data requested to be forwarded by the requester and how to accurately match the requester with the executor, that is, screening out the executor matched with the requester from a plurality of executors, and converting 'many-to-many' into 'one-to-one'; secondly, when a plurality of requesters request the same executor to execute the forwarding function, because the executor executes the sending function and calls regularly, the data of the previous requester is not forwarded completely, and the next requester puts forward a new data forwarding request, the problem that the data of the previous requester is covered can be caused. Thirdly, how each executor forwards data according to the protocol requested by different requesters and how the protocol is convenient for writing and modifying.
For the first problem, the data forwarding apparatus of this embodiment receives the request information sent by the peripheral of the requester, and needs to include the address information of the data to be forwarded, so that the executor obtains the data to be forwarded. The address mainly stores the data to be forwarded and the length of the data to be forwarded, so that the executor can send normal amount of data when forwarding the data, and the data are not frequently sent or seldom sent. In addition, the request information also needs to carry an executor ID number, so that the data forwarding device knows which executor peripheral needs to forward data.
For the second problem, in this embodiment, a first buffer area is created in advance in the executor peripheral, where the first buffer area may store information of data to be forwarded requested by different requesters, and the executor peripheral may sequentially read the information of the data to be forwarded in the buffer area to implement forwarding, so as to prevent the data from being covered.
For the third problem, the embodiment loads the protocol ID to the first buffer of the executor peripheral through the data forwarding device by adding the protocol ID to the request information sent by the requester peripheral, so that the executor peripheral can forward data according to the protocol required by each requester peripheral. It should be noted that the protocol ID is particularly important, and the protocol ID must be uniformly encoded, so that the same ID cannot occur. The meaning of uniform coding is: all protocols of all peripherals and all ports are coded in a unified mode, no matter the protocol is a few protocols under the current peripherals, the protocol is coded in a unified mode with other protocols, the same protocol ID is not allowed to appear at any time, and the protocol ID has uniqueness, so that the condition that a requester belongs to which peripheral and which port after the same protocol ID appears needs to be distinguished. It should be noted that the types of peripheral devices in this embodiment include, but are not limited to, at least one of the following: CAN peripheral equipment, serial port peripheral equipment, network port peripheral equipment, SPI peripheral equipment and IIC peripheral equipment. I.e., the requestor and the implementer, may each be any of the several types of peripherals described above, which are not limited in this application.
Therefore, when data forwarding is performed among the peripheral devices, the peripheral devices of the requester and the executor are not directly contacted, but are contacted through the set data forwarding device, so that under a multi-to-multi forwarding mode with a plurality of requesters and a plurality of executors, strong coupling among the peripheral devices can be reduced, and complexity and code amount of a forwarding program are reduced; and the request information sent by the requester peripheral equipment carries a protocol ID, the protocol ID is loaded to a first preset cache region of the executor peripheral equipment through a data forwarding device, and the executor peripheral equipment can forward data according to the protocol required by each requester peripheral equipment.
In one possible implementation, as shown in fig. 2, each peripheral further internally registers a callback function and a verification manner of its own forwardable protocol.
Correspondingly, invoking the corresponding protocol to forward the data to be forwarded includes:
and calling a callback function and a verification mode of the registered corresponding protocol to forward the data to be forwarded.
In the embodiment of the present invention, each forwarding protocol includes:
(1) header, function codes, etc., such as Byte0-Byte4 in Table 1 and Byte0-Byte1 in Table 2.
(2) The requester requests the transmitted data content part.
(3) And verifying the part.
The peripheral equipment internally registers a verification mode capable of forwarding the protocol, can realize the separation of the protocol and the verification mode and is convenient for changing the verification mode at any time. The peripheral equipment is internally registered with a load callback function capable of forwarding the protocol, and is used for changing the protocol content at any time and reducing the modified code amount.
In a possible implementation manner, before registering a forwardable protocol ID in each peripheral, each peripheral needs to determine whether the number of registered protocol IDs reaches the maximum value, and if the number of registered protocol IDs reaches the maximum value, the peripheral stops registering a new protocol ID. The flows of registering the protocol ID, checking the external device, and loading the callback function in the external device can be seen in fig. 3.
In one possible implementation, the request information further includes drive port information.
Correspondingly, the data forwarding device is further configured to load the drive port information into a second preset buffer area of the executor peripheral corresponding to the executor ID.
Correspondingly, the executor peripheral extracts the data to be forwarded according to the address in the first preset cache region, searches and calls a corresponding protocol from the registered self-forwardable protocol ID according to the protocol ID in the first preset cache region, and then selects a corresponding driving port to forward the data to be forwarded based on the driving port information in the second preset cache region.
In embodiments of the present invention, each peripheral often has more than one port, and each port can forward data. When different requesters need the same peripheral as an executor to execute a sending function, the drive ports possibly used are different, so that the data forwarding device loads the drive port information into a second preset cache region of the executor peripheral after receiving the request information by adding the drive port information into the request information, and the executor peripheral can select a corresponding drive port to forward data according to the information in the second cache region. In one possible implementation, the executor peripheral may select any idle driver port to perform the data forwarding task when the driver port is not specified.
In a possible implementation manner, referring to fig. 2, each peripheral needs to register its own peripheral ID, cache area write index address, and drive port information to the data forwarding device in advance, and the data forwarding device can search the corresponding peripheral as an executor peripheral and load related information when receiving the request information of the requester peripheral. The peripheral ID number and the driver port number are important for distinguishing which peripheral the executor is, and which port to use for forwarding.
In this embodiment, the peripheral IDs of the respective peripherals are encoded in a unified manner, and the peripheral IDs of any two peripherals are different from each other. The present embodiment makes the following provisions:
the peripheral ID number and the driver port number follow the following rules: X0Y.
X characterizes the peripheral number, i.e. specifies: x ═ 1 represents a serial port, X ═ 2 represents CAN communication, X ═ 3 represents IIC, X ═ 4 represents SPI, X ═ 5 represents a network port, and so on, and the maximum value does not exceed 65. Y characterizes the port number, i.e. specifies: and Y-1 represents a port I, Y-2 represents a port II, and the like, and the maximum value does not exceed 99. The reason why the maximum value of X cannot exceed 65 and the maximum value of Y does not exceed 99 is that the ID number is 16-bit data and the maximum value does not exceed 65536. Where 0 is used as a separator of the peripheral number and the port number, there is no special meaning. For example, as shown in table 3:
TABLE 3 peripheral and drive Port code tables
Serial port 1: id 101 Serial port 2: id 102 Serial port 3 id 103 ....... Serial port 99 id 1099
CAN1:id=201 CAN2:id=202 CAN3:id=203 ....... CAN99:id=2099
....... ....... ....... ....... .......
In addition, the establishment of the executor cache region mainly aims to solve the problem of data coverage caused by multiple requester request triggers before the executor sends the requests regularly, and solve the problem that the number of the executor port is uncertain when the requester triggering the requests wants to send the requests by the same executor peripheral. It should be noted that the establishment of the actor cache is related to the peripheral devices, that is, one peripheral device establishes one actor cache, even though the peripheral device has a plurality of ports, one actor cache is also established. For example, the following steps are carried out: three ports (usart1, usart2 and usart3) are arranged outside a certain serial port, and a cache region is created to be a cache region 1 (a first cache region) and a cache region 2 (a second cache region); four ports (CAN1, CAN2, CAN3 and CAN4) exist in a certain CAN peripheral, and the created cache areas are still one cache area 1 and one cache area 2. Moreover, it can be understood that the length of the created buffer is irrelevant to the number of ports existing in the peripheral, and is relevant to the timing calling time of the executor and the number of times of effective triggering of the requester in the period of time, and the reasonable length can be set according to the requirement. For example, the following steps are carried out: if the executor sends one time in 100ms, and multiple requesters effectively trigger 4 times in the period, the buffer length is at least 4. It is noted that valid triggers are referred to herein as requestor data addresses that can be placed in the executor buffer after ID matching. The content of the buffer area may be information of the same executor continuously or intermittently, that is, the first position in the buffer area stores information of the requester 1, and the second position may also be information of the requester 1, and what content is specifically stored is uncertain, and is related to the current situation after ID matching screening.
In a possible implementation manner, loading an address and a protocol ID of data to be forwarded to a first preset buffer area of an executor peripheral corresponding to an executor ID, and loading drive port information to a second preset buffer area of the executor peripheral corresponding to the executor ID includes:
according to the cache area writing index address, loading the address of the data to be forwarded and the protocol ID into a first preset cache area of the executor peripheral corresponding to the executor ID, and loading the driving port information into a second preset cache area of the executor peripheral corresponding to the executor ID;
and updating the cache area write index address after the loading is finished.
In the embodiment of the invention, the writing index address of the executor peripheral is also changed along with the change of the number of the peripherals, is related to the number of the peripherals and is unrelated to the number of the ports of the executor peripheral.
In a possible implementation manner, the protocol IDs that can be forwarded by each peripheral are uniformly encoded, and any two protocol IDs are different. For example, as shown in table 4:
table 4 protocol ID table
Peripheral equipment Protocol Protocol ID
CAN1 Protocol 1 1
CAN3 Protocol 2 2
CAN2 Protocol 3 3
CAN1 Protocol 2 4
Usart2 Protocol 1 5
Usart3 Protocol 5 6
Usart1 Protocol 9 7
......... ......... .........
Referring to fig. 4, the flow of the executor executing the forwarding task is as follows:
step one, judging whether a read index and a write index are equal, if so, determining that an executor has forwarded all requester data to be forwarded, and ending the current process; if the data is not equal, the data of the requester is not forwarded, and the next step is carried out. Notably, the write index here is for: the index of data in the actor buffer 1 externally registered in the data transfer device.
And step two, if the executor does not execute and forward all requester data, the executor needs to traverse the executor protocol information registered in the case according to the executor ID and the protocol ID provided by the requester, judge whether to search all the protocol information registered in the case, if so, end the current process, and if not, enter the step three.
And thirdly, judging whether the protocol number ID in the extracted requester data is matched with the protocol number registered by the executor, if not, searching the next protocol, entering the second step, and if so, considering that the executor forwarding protocol which should be used is searched, and entering the fourth step.
And step four, when finding out the executor forwarding protocol which should be used, calling a loading callback function, extracting the data to be forwarded, updating the read index value, calling a protocol crc check function, executing a sending function after preparing all the data, and then ending the current process.
Through the process, the flow of different forwarding protocols can be abstracted by the executor, the executor can distinguish which forwarding protocol is used for executing forwarding through the protocol number, the code is simple, and the modification amount is small. When only the verification mode or the loading data is changed, the sending process of the executor does not need to be modified, only the verification mode or the loading callback function registered in the case is modified according to the current protocol ID when the executor registers in the executor, and the processes and the codes do not need to be changed, so that the code amount is reduced, the modification cost of personnel is reduced, and the error problem caused by errors in the modification process is solved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
The embodiment of the invention also provides a power supply module which comprises a data forwarding device and a plurality of peripheral equipment, wherein the data forwarding device is connected with each peripheral equipment, and the peripheral equipment performs data forwarding through the data forwarding method.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein.

Claims (10)

1. A data forwarding method is characterized in that the method is used for realizing data forwarding among all peripheral equipment, and all the peripheral equipment are connected with a data forwarding device;
the method comprises the following steps:
each peripheral internally registers a protocol ID which can be forwarded by itself;
the external equipment of the requester sends request information to the data forwarding device; the request information comprises an address of data to be forwarded, a protocol ID and an executor ID;
the data forwarding device loads the address of the data to be forwarded and the protocol ID into a first preset cache region of the executor peripheral corresponding to the executor ID;
and the executor peripheral extracts the data to be forwarded according to the address in the first preset cache region, searches a corresponding protocol from the registered forwardable protocol ID according to the protocol ID in the first preset cache region, and calls the corresponding protocol to forward the data to be forwarded.
2. The data forwarding method of claim 1, wherein each peripheral device further internally registers a callback function and a verification mode of its own forwardable protocol;
correspondingly, invoking a corresponding protocol to forward the data to be forwarded, including:
and calling a callback function and a verification mode of the registered corresponding protocol to forward the data to be forwarded.
3. The data forwarding method of claim 1, wherein before registering the forwardable protocol ID within each peripheral device, further comprising:
each peripheral judges whether the number of the self-registered protocol IDs reaches the maximum value;
and if the number of the self registered protocol IDs reaches the maximum value, stopping registering the new protocol IDs.
4. The data forwarding method of claim 1 wherein the request information further comprises drive port information;
correspondingly, the data forwarding device is further configured to load the drive port information into a second preset cache region of the executor peripheral corresponding to the executor ID;
correspondingly, the executor peripheral extracts the data to be forwarded according to the address in the first preset cache region, searches and calls a corresponding protocol from the registered self-forwardable protocol ID according to the protocol ID in the first preset cache region, and selects a corresponding driving port to forward the data to be forwarded based on the driving port information in the second preset cache region.
5. The data forwarding method of claim 4, wherein each peripheral device further externally registers its own peripheral ID, buffer write index address, and drive port information to the data forwarding apparatus.
6. The data forwarding method of claim 5, wherein loading the address of the data to be forwarded and the protocol ID into a first preset buffer of an executor peripheral corresponding to the executor ID, and loading the driving port information into a second preset buffer of the executor peripheral corresponding to the executor ID comprises:
according to the cache area writing index address, loading the address of the data to be forwarded and the protocol ID into a first preset cache area of the executor peripheral corresponding to the executor ID, and loading the driving port information into a second preset cache area of the executor peripheral corresponding to the executor ID;
and updating the cache area write index address after the loading is finished.
7. The data forwarding method of claim 1 wherein the type of the peripheral device comprises at least one of: CAN peripheral equipment, serial port peripheral equipment, network port peripheral equipment, SPI peripheral equipment and IIC peripheral equipment.
8. The data forwarding method of claim 1, wherein the peripheral IDs of the respective peripherals are uniformly encoded, and the peripheral IDs of any two peripherals are different.
9. The data forwarding method of claim 1 wherein the protocol IDs of the respective peripheral forwardable protocols are uniformly encoded, any two protocol IDs being different.
10. A power supply module, comprising a data transfer device and a plurality of peripheral devices, wherein the data transfer device is connected with each peripheral device, and data transfer is performed between the peripheral devices by the data transfer method according to any one of claims 1 to 9.
CN202210169324.2A 2022-02-23 2022-02-23 Data forwarding method and power module Active CN114466046B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210169324.2A CN114466046B (en) 2022-02-23 2022-02-23 Data forwarding method and power module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210169324.2A CN114466046B (en) 2022-02-23 2022-02-23 Data forwarding method and power module

Publications (2)

Publication Number Publication Date
CN114466046A true CN114466046A (en) 2022-05-10
CN114466046B CN114466046B (en) 2024-03-22

Family

ID=81415628

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210169324.2A Active CN114466046B (en) 2022-02-23 2022-02-23 Data forwarding method and power module

Country Status (1)

Country Link
CN (1) CN114466046B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1592270A (en) * 2003-08-26 2005-03-09 华为技术有限公司 Method and device for realizing multi-protocol conversion between intelligent network and external platforn
CN1893423A (en) * 2005-07-05 2007-01-10 北京航空航天大学 Server-end application system IPv4/IPv6 transition method based on SPI technology
CN103024056A (en) * 2012-12-17 2013-04-03 山东中创软件商用中间件股份有限公司 Data processing method, load equalizer and cloud system
US20130332605A1 (en) * 2012-06-12 2013-12-12 Dell Products L.P. Advertising and facilitating management access to added capabilities of intelligent devices in a system
CN110768930A (en) * 2018-07-25 2020-02-07 成都鼎桥通信技术有限公司 Data forwarding method and device for server
CN111901215A (en) * 2020-07-31 2020-11-06 智车优行科技(北京)有限公司 Multi-bus hybrid routing method and gateway device
CN112906025A (en) * 2021-03-03 2021-06-04 江苏保旺达软件技术有限公司 Database management and control method, device, equipment and storage medium
CN114039808A (en) * 2021-11-08 2022-02-11 深圳驰越科技有限公司 CAN-based multi-channel CAN/LIN/SENT forwarding protocol

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1592270A (en) * 2003-08-26 2005-03-09 华为技术有限公司 Method and device for realizing multi-protocol conversion between intelligent network and external platforn
CN1893423A (en) * 2005-07-05 2007-01-10 北京航空航天大学 Server-end application system IPv4/IPv6 transition method based on SPI technology
US20130332605A1 (en) * 2012-06-12 2013-12-12 Dell Products L.P. Advertising and facilitating management access to added capabilities of intelligent devices in a system
CN103024056A (en) * 2012-12-17 2013-04-03 山东中创软件商用中间件股份有限公司 Data processing method, load equalizer and cloud system
CN110768930A (en) * 2018-07-25 2020-02-07 成都鼎桥通信技术有限公司 Data forwarding method and device for server
CN111901215A (en) * 2020-07-31 2020-11-06 智车优行科技(北京)有限公司 Multi-bus hybrid routing method and gateway device
CN112906025A (en) * 2021-03-03 2021-06-04 江苏保旺达软件技术有限公司 Database management and control method, device, equipment and storage medium
CN114039808A (en) * 2021-11-08 2022-02-11 深圳驰越科技有限公司 CAN-based multi-channel CAN/LIN/SENT forwarding protocol

Also Published As

Publication number Publication date
CN114466046B (en) 2024-03-22

Similar Documents

Publication Publication Date Title
KR100711738B1 (en) Bitmap-based automatic repeat request engine and method for the same
EP0508886A1 (en) Filtering and disposition of messages in a bridge using a single address and protocol table
JP5952808B2 (en) System and method for using multiple network addresses to establish synchronization between a device under test and a test equipment that controls the test
US20100017673A1 (en) Data transmission system and data transmission method
RU2010148425A (en) PARTIAL REPORT ON THE STATUS OF RADIOLINE MANAGEMENT
WO2009030130A1 (en) A method and system for transmitting data
CN111324567B (en) Method for realizing serial port communication and single chip microcomputer system
CN109688208B (en) Data loading method based on FC-AE-ASM message
WO2021120708A1 (en) Message processing method and device, storage medium, and electronic device
CN114466046A (en) Data forwarding method and power module
CN112068963B (en) Distributed scheduling system of embedded system
US6859895B2 (en) Method of monitoring life-or-death state of host computer connected to network and life-and-death monitoring system
CN111817878A (en) Networking method and device of intelligent equipment and cloud server
CN104639379A (en) Proxy testing method and device
CN115344620B (en) Method for realizing data on-demand synchronization after front-end and back-end separation by user-defined data pool
FI112710B (en) Data communication bus system and a station for such a system
CN113992740B (en) Middleware based on autonomous control and data transmission method
CN113132468B (en) Communication method, communication device, communication system and storage medium based on ModbusTCP protocol
CN116150054A (en) Interrupt information processing method based on PCIE
CN114500654B (en) Data forwarding device, power module and data forwarding method
CN114168519A (en) Working robot control system based on serial bus communication technology
CN102291266A (en) Loopback (LB) detection method and device
CN106992923B (en) Tree structure based module communication method and device
CN114884768B (en) Detection device, system and detection method for bus idle state
TWI812355B (en) Wireless network system and data transferring method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant