CN111464410A - Method and device for configuring variable information - Google Patents

Method and device for configuring variable information Download PDF

Info

Publication number
CN111464410A
CN111464410A CN202010246484.3A CN202010246484A CN111464410A CN 111464410 A CN111464410 A CN 111464410A CN 202010246484 A CN202010246484 A CN 202010246484A CN 111464410 A CN111464410 A CN 111464410A
Authority
CN
China
Prior art keywords
variable
length
variables
list
split
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.)
Pending
Application number
CN202010246484.3A
Other languages
Chinese (zh)
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.)
Weichai Power Co Ltd
Original Assignee
Weichai Power 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 Weichai Power Co Ltd filed Critical Weichai Power Co Ltd
Priority to CN202010246484.3A priority Critical patent/CN111464410A/en
Publication of CN111464410A publication Critical patent/CN111464410A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • 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/26Special purpose or proprietary protocols or architectures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Communication Control (AREA)

Abstract

The application discloses a method and a device for configuring variable information. The method comprises the following steps: acquiring a variable list, wherein the variable list comprises a plurality of variables and the length of each variable; splitting each variable based on the length of each variable to obtain a plurality of variables with target byte lengths; and packaging a plurality of variables with target byte length according to a preset rule, and transmitting the packaged messages in the CAN bus based on an XCP protocol or a CCP protocol. By the method and the device, the problem that the CAN message data transmission utilization rate based on the XCP protocol or the CCP protocol in the related technology is low is solved.

Description

Method and device for configuring variable information
Technical Field
The present application relates to the field of information processing technologies, and in particular, to a method and an apparatus for configuring variable information.
Background
At present, the main mode of data acquisition based on the XCP/CCP protocol is described as follows (taking INCA as an example), the object of the acquisition is an ECU (EDC 17 as an example), and the number of CCP message frames actively sent by the ECU is limited, for example, 10.
Assume that the list of variable information that needs to be collected is as follows:
TABLE 1
Variable names Variable address Variable length Acquisition cycle
VAR1 ADDR1 4 10ms
VAR2 ADDR2 4 10ms
VAR3 ADDR3 4 10ms
VAR4 ADDR4 4 10ms
VAR5 ADDR5 4 10ms
VAR6 ADDR6 4 10ms
VAR7 ADDR7 4 10ms
VAR8 ADDR8 4 10ms
VAR9 ADDR9 4 10ms
VAR10 ADDR10 4 10ms
VAR11 ADDR11 2 10ms
VAR12 ADDR12 2 10ms
VAR13 ADDR13 2 10ms
VAR14 ADDR14 1 10ms
The content of each frame of CAN message is as follows, BYTE [0] ═ PID, that is, the serial number of the report message, BYTE [1] -BYTE [7] total 7 BYTEs of data, that is, each frame of CAN message reports 7 BYTEs of data at most.
PID 0 1 2 3 4 5 6
If the configuration is performed in the order of table 1, the message mode reported by the ECU is as follows.
Figure BDA0002434101410000021
Under the condition, each frame of CAN message CAN only report 4 bytes of data, so that each packet of CAN message has 3 bytes of idle, all bytes of the CAN message cannot be fully utilized, and the total frame number of the reported message is exceeded, so that the utilization rate of CAN message data transmission based on an XCP protocol or a CCP protocol is not high.
Aiming at the problem of low data transmission utilization rate of CAN messages based on an XCP protocol or a CCP protocol in the related art, an effective solution is not provided at present.
Disclosure of Invention
The present application mainly aims to provide an X to solve the problem in the related art that the utilization rate of CAN packet data transmission based on the XCP protocol or the CCP protocol is not high.
In order to achieve the above object, according to an aspect of the present application, there is provided a method of configuring variable information. The method comprises the following steps: acquiring a variable list, wherein the variable list comprises a plurality of variables and the length of each variable; splitting each variable based on the length of each variable to obtain a plurality of variables with target byte lengths; and packaging a plurality of variables with target byte length according to a preset rule, and transmitting the packaged messages in the CAN bus based on an XCP protocol or a CCP protocol.
Further, the target byte length is one byte length, and the method further includes: packing a plurality of variables with target byte length according to a preset rule, accumulating the lengths of the variables in the split variable list according to an arrangement sequence before transmitting the packed messages in a CAN bus based on an XCP (XCP) protocol or a CCP (CCP protocol), and packing the variables with the accumulated lengths in the same frame of messages when the accumulated values are equal to the total byte length of each frame of messages; and continuously performing length accumulation on the variables which are not subjected to length accumulation in the split variable list according to the sequence of arrangement so as to package the message until the last variable in the split variable list is reached, thereby obtaining the packaged multi-frame message.
Further, splitting each variable based on the length of each variable to obtain a plurality of variables with target byte lengths, including: calculating a difference value between the length of a first variable and the total byte length of each frame of message, wherein the first variable is a variable arranged at a first position in the variable list; calculating a difference between the length of the first variable and the total length of the bytes; splitting the length of a second variable in the variable list into the length of the difference if the difference is not zero, wherein the second variable is a variable arranged at a second position in the variable list; arranging the second variable with the length of the difference value after the first variable, continuing to calculate the difference value between the residual length of the second variable and the total length of the bytes, splitting and sequencing the variables until the last variable in the variable list obtains a plurality of variables with target byte lengths.
Further, the method further comprises: packaging a plurality of variables with target byte length according to a preset rule, accumulating the lengths of the variables in the split variable list according to an arrangement sequence before transmitting the packaged messages in a CAN bus based on an XCP (XCP) protocol or a CCP (CCP protocol), and packaging the variables with the accumulated lengths in the same frame of messages under the condition that the accumulated values are equal to the total byte length of each frame of messages; and continuously performing length accumulation on the variables which are not subjected to length accumulation in the split variable list according to the sequence of arrangement so as to package the message until the last variable in the split variable list is reached, thereby obtaining the packaged multi-frame message.
Further, the method is applied to an electronic control unit of the engine and/or a remote vehicle-mounted terminal.
In order to achieve the above object, according to another aspect of the present application, there is provided a variable information configuring apparatus including: the device comprises a first acquisition unit, a second acquisition unit and a processing unit, wherein the first acquisition unit is used for acquiring a variable list, and the variable list comprises a plurality of variables and the length of each variable; the second acquisition unit is used for splitting each variable based on the length of each variable to obtain a plurality of variables with target byte lengths; and the transmission unit is used for packaging a plurality of variables with target byte lengths according to a preset rule and transmitting the packaged messages in the CAN bus based on an XCP protocol or a CCP protocol.
Further, the target byte length is one byte length, and the apparatus further includes: the first calculation unit is used for packaging a plurality of variables with target byte lengths according to a preset rule, accumulating the lengths of the variables in the split variable list according to an arrangement sequence before transmitting the packaged messages in a CAN bus based on an XCP (XCP) protocol or a CCP (CCP) protocol, and packaging the variables with the accumulated lengths in the same frame of messages when the accumulated values are equal to the total byte length of each frame of messages; and the first packing unit is used for continuously carrying out length accumulation on the variables which are not subjected to length accumulation in the split variable list according to the arrangement sequence so as to pack the messages until the last variable in the split variable list is reached, so that the packed multi-frame messages are obtained.
Further, the second obtaining unit further includes: the first calculation module is used for calculating a difference value between the length of a first variable and the total byte length of each frame of message, wherein the first variable is a variable arranged at the first position in the variable list; the second calculation module is used for calculating the difference value between the length of the first variable and the total length of the bytes; a splitting module, configured to split a length of a second variable in the variable list into a length of the difference if the difference is not zero, where the second variable is a variable arranged at a second position in the variable list; and the sorting module is used for sorting a second variable with the length of the split difference value after the first variable, continuing to calculate the difference value between the residual length of the second variable and the total length of the bytes, splitting and sorting the variables until the last variable in the variable list obtains a plurality of variables with target byte lengths.
In order to achieve the above object, according to another aspect of the present application, there is provided a storage medium characterized in that the storage medium includes a stored program, wherein the program executes the method of configuring variable information according to any one of the above.
In order to achieve the above object, according to another aspect of the present application, there is provided a processor, wherein the processor is configured to execute a program, and the program executes to execute the method for configuring variable information according to any one of the above items.
Through the application, the following steps are adopted: acquiring a variable list, wherein the variable list comprises a plurality of variables and the length of each variable; splitting each variable based on the length of each variable to obtain a plurality of variables with target byte lengths; the method and the device package a plurality of variables with target byte length according to preset rules, transmit the packaged messages in the CAN bus based on an XCP protocol or a CCP protocol, and solve the problem of low data transmission utilization rate of the CAN messages based on the XCP protocol or the CCP protocol in the related technology. By splitting the variables in the variable list and then packaging and transmitting the information of the variables in the split variable list according to the preset rules, the effect of improving the message data transmission utilization rate is achieved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
fig. 1 is a flowchart of a method for configuring variable information according to an embodiment of the present application; and
fig. 2 is a schematic diagram of a configuration device for variable information provided according to an embodiment of the present application.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The present invention is described below with reference to preferred implementation steps, and fig. 1 is a flowchart of a configuration method of variable information provided according to an embodiment of the present application, and as shown in fig. 1, the method includes the following steps:
step S101, a variable list is obtained, wherein the variable list comprises a plurality of variables and the length of each variable.
For example, the list of variables obtained is shown in table 2 below:
TABLE 2
Figure BDA0002434101410000051
Figure BDA0002434101410000061
Included in table 2 are: VAR 1-VAR 14, VAR1 has a length of 4, VAR2 has a length of 4, and so on.
Step S102, splitting each variable based on the length of each variable to obtain a plurality of variables with target byte length.
For example, the target byte length is one byte length, and the variables in table 2 are split into several variables of one byte, which are shown in table 3.
TABLE 3
Variable names Variable address Variable length Acquisition cycle
VAR1_1 ADDR1_1 1 10ms
VAR1_2 ADDR1_2 1 10ms
VAR1_3 ADDR1_3 1 10ms
VAR1_4 ADDR1_4 1 10ms
VAR2_1 ADDR2_1 1 10ms
VAR2_2 ADDR2_2 1 10ms
VAR2_3 ADDR1_3 1 10ms
VAR2_4 ADDR1_4 1 10ms
VAR3_1 ADDR1_1 1 10ms
VAR3_2 ADDR1_2 1 10ms
VAR3_3 ADDR1_3 1 10ms
VAR3_4 ADDR1_4 1 10ms
VAR4_1 ADDR1_1 1 10ms
VAR4_2 ADDR1_2 1 10ms
VAR4_3 ADDR1_3 1 10ms
VAR4_4 ADDR1_4 1 10ms
…… ……
VAR12_1 ADDR12_1 1 10ms
VAR12_2 ADDR12_2 1 10ms
VAR13_1 ADDR13_1 1 10ms
VAR13_2 ADDR13_2 1 10ms
VAR14 ADDR14 1 10ms
And step S103, packaging a plurality of variables with target byte length according to a preset rule, and transmitting the packaged messages in the CAN bus based on an XCP protocol or a CCP protocol.
In the embodiment of the application, a plurality of variables with target byte lengths are packaged according to a preset rule, based on an XCP (XCP) protocol or a CCP (CCP) protocol, before the packaged messages are transmitted in a CAN (controller area network) bus, the lengths of the variables in a split variable list are accumulated according to an arrangement sequence, and when the accumulated value is equal to the total byte length of each frame of message, the variables with the accumulated length are packaged in the same frame of message; and continuously performing length accumulation on the variables which are not subjected to length accumulation in the split variable list according to the sequence of arrangement so as to package the message until the last variable in the split variable list is reached, thereby obtaining the packaged multi-frame message.
The lengths of the split variables in the table 3 are accumulated, each CAN frame message is arranged to be full, and 7 data bytes of the CAN frame CAN be utilized to the maximum extent. The procedure for packing variables is shown in table 4 below.
TABLE 4
Figure BDA0002434101410000071
The packaging configuration is performed according to the sequence of table 4 above, and then the report mode in the CAN bus of the ECU is as follows.
Figure BDA0002434101410000072
Figure BDA0002434101410000081
And splitting and packaging the parameters to be acquired according to the characteristic that the CAN data is 7. The packing rule is to combine according to the length of the collected variable, and the combined rule is to gather into a complete 7-byte CAN data area.
That is, on the premise of the limitation of the total number of the same CAN frames, the processing method of the present application CAN acquire more variables. The variables in the variable list are not split for message data transmission, for example, if the total frame number of the CAN messages is 10, the total number of the collected variables is 10. And packaging and transmitting the variable information in the split variable list according to a preset rule, wherein if the total frame number of the CAN messages is 7, the total number of the acquired variables is 14. That is, the space of CAN frame data area is fully utilized through the scheme in this application, increases the variable that CAN gather. Data processing is more convenient for data collection and return, and batch processing can be realized.
Optionally, in the method for configuring variable information provided in the embodiment of the present application, splitting each variable based on the length of each variable to obtain a plurality of variables with target byte lengths includes: calculating a difference value between the length of a first variable and the total byte length of each frame of message, wherein the first variable is a variable arranged at a first position in the variable list; calculating a difference between the length of the first variable and the total length of the bytes; splitting the length of a second variable in the variable list into the length of the difference if the difference is not zero, wherein the second variable is a variable arranged at a second position in the variable list; arranging the second variable with the length of the difference value after the first variable, continuing to calculate the difference value between the residual length of the second variable and the total length of the bytes, splitting and sequencing the variables until the last variable in the variable list obtains a plurality of variables with target byte lengths. Then accumulating the lengths of the variables in the split variable list according to the arrangement sequence, and packing the variables with the accumulated lengths in the same frame of message under the condition that the accumulated value is equal to the total byte length of each frame of message; and continuously performing length accumulation on the variables which are not subjected to length accumulation in the split variable list according to the sequence of arrangement so as to package the message until the last variable in the split variable list is reached, thereby obtaining the packaged multi-frame message.
For example, VAR1 has a length of 4, which differs by 3 from the total length in bytes 7 of the message per frame. VAR2 is split into lengths of 3 and 1. The VAR2 divided into 3 is arranged after the VAR1 and combined with the VAR1 into a frame message. And accumulating the VAR3 and the VAR2 split into 1 to obtain 5, splitting the VAR4 into 2 and 2, and combining the VAR4 split into 2, the VAR2 split into 1 and the VAR3 into a frame message. That is, the variables arranged behind are split and packed in a way of making full frames (for example, the total length of bytes is 7) with the variables arranged in front, so that the message data transmission utilization rate is improved.
In the configuration method of the variable information provided by the embodiment of the application, the method is applied to an electronic control unit of an engine and/or a remote vehicle-mounted terminal.
To sum up, in the configuration method of the variable information provided in the embodiment of the present application, a variable list is obtained, where the variable list includes a plurality of variables and a length of each variable; splitting each variable based on the length of each variable to obtain a plurality of variables with target byte lengths; the method and the device package a plurality of variables with target byte length according to preset rules, transmit the packaged messages in the CAN bus based on an XCP protocol or a CCP protocol, and solve the problem of low data transmission utilization rate of the CAN messages based on the XCP protocol or the CCP protocol in the related technology. By splitting the variables in the variable list and then packaging and transmitting the information of the variables in the split variable list according to the preset rules, the effect of improving the message data transmission utilization rate is achieved.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
The embodiment of the present application further provides a configuration device of variable information, and it should be noted that the configuration device of variable information of the embodiment of the present application may be used to execute the configuration method for variable information provided in the embodiment of the present application. The following describes a configuration apparatus of variable information provided in an embodiment of the present application.
Fig. 2 is a schematic diagram of a configuration device of variable information according to an embodiment of the present application. As shown in fig. 2, the apparatus includes: a first acquisition unit 201, a second acquisition unit 202 and a transmission unit 203.
Specifically, the first obtaining unit 201 is configured to obtain a variable list, where the variable list includes a plurality of variables and a length of each variable.
A second obtaining unit 202, configured to split each variable based on the length of each variable to obtain a plurality of variables with target byte lengths.
The transmission unit 203 is configured to package a plurality of variables with target byte lengths according to a preset rule, and transmit the packaged messages in the CAN bus based on an XCP protocol or a CCP protocol.
In the configuration apparatus for variable information provided in the embodiment of the present application, a variable list is obtained by a first obtaining unit 201, where the variable list includes a plurality of variables and a length of each variable; the second obtaining unit 202 splits each variable based on the length of each variable to obtain a plurality of variables with target byte lengths; the transmission unit 203 packages a plurality of variables with target byte length according to preset rules, transmits the packaged messages in the CAN bus based on an XCP protocol or a CCP protocol, solves the problem of low data transmission utilization rate of the CAN messages based on the XCP protocol or the CCP protocol in the related art, splits the variables in the variable list, and packages and transmits the information of the variables in the split variable list according to the preset rules, thereby achieving the effect of improving the data transmission utilization rate of the messages.
Optionally, in the apparatus for configuring variable information provided in this embodiment of the present application, the target byte length is one byte length, and the apparatus further includes: the first calculation unit is used for packaging a plurality of variables with target byte lengths according to a preset rule, accumulating the lengths of the variables in the split variable list according to an arrangement sequence before transmitting the packaged messages in a CAN bus based on an XCP (XCP) protocol or a CCP (CCP) protocol, and packaging the variables with the accumulated lengths in the same frame of messages when the accumulated values are equal to the total byte length of each frame of messages; the first packing unit is used for continuously carrying out length accumulation on variables which are not subjected to length accumulation in the split variable list according to the arrangement sequence so as to pack the messages until the last variable in the split variable list is reached, and obtaining packed multi-frame messages;
optionally, in the apparatus for configuring variable information provided in the embodiment of the present application, the second obtaining unit further includes: the first calculation module is used for calculating a difference value between the length of a first variable and the total byte length of each frame of message, wherein the first variable is a variable arranged at the first position in the variable list; the second calculation module is used for calculating the difference value between the length of the first variable and the total length of the bytes; a splitting module, configured to split a length of a second variable in the variable list into a length of the difference if the difference is not zero, where the second variable is a variable arranged at a second position in the variable list; and the sorting module is used for sorting a second variable with the length of the split difference value after the first variable, continuing to calculate the difference value between the residual length of the second variable and the total length of the bytes, splitting and sorting the variables until the last variable in the variable list obtains a plurality of variables with target byte lengths.
Optionally, in the apparatus for configuring variable information provided in the embodiment of the present application, the apparatus further includes: the second calculation unit is used for packaging a plurality of variables with target byte lengths according to a preset rule, accumulating the lengths of the variables in the split variable list according to an arrangement sequence before transmitting the packaged messages in a CAN bus based on an XCP (X-ray correlation protocol) or a CCP (common control protocol), and packaging the variables with the accumulated lengths in the same frame of message under the condition that the accumulated value is equal to the total byte length of each frame of message; the second packing unit is used for continuously carrying out length accumulation on variables which are not subjected to length accumulation in the split variable list according to the sequence of arrangement so as to pack the messages until the last variable in the split variable list is reached, and obtaining packed multi-frame messages;
optionally, in the configuration device of the variable information provided in the embodiment of the present application, the device is applied to an electronic control unit of an engine and/or a remote vehicle-mounted terminal.
The configuration device of the variable information comprises a processor and a memory, the first acquiring unit 201, the second acquiring unit 202, the transmission unit 203 and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, the variable in the variable list is split by adjusting the kernel parameters, and the information of the variable in the split variable list is packaged and transmitted according to the preset rule, so that the effect of improving the message data transmission utilization rate is achieved.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium on which a program is stored, the program implementing the method for configuring variable information when executed by a processor.
The embodiment of the invention provides a processor, which is used for running a program, wherein the configuration method of the variable information is executed when the program runs.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps: acquiring a variable list, wherein the variable list comprises a plurality of variables and the length of each variable; splitting each variable based on the length of each variable to obtain a plurality of variables with target byte lengths; and packaging a plurality of variables with target byte length according to a preset rule, and transmitting the packaged messages in the CAN bus based on an XCP protocol or a CCP protocol.
The processor executes the program and further realizes the following steps: the target byte length is one byte length, the method further comprising: packing a plurality of variables with target byte length according to a preset rule, accumulating the lengths of the variables in the split variable list according to an arrangement sequence before transmitting the packed messages in a CAN bus based on an XCP (XCP) protocol or a CCP (CCP protocol), and packing the variables with the accumulated lengths in the same frame of messages when the accumulated values are equal to the total byte length of each frame of messages; and continuously performing length accumulation on the variables which are not subjected to length accumulation in the split variable list according to the sequence of arrangement so as to package the message until the last variable in the split variable list is reached, thereby obtaining the packaged multi-frame message.
The processor executes the program and further realizes the following steps: splitting each variable based on the length of each variable to obtain a plurality of variables with target byte lengths, wherein the variables are as follows: calculating a difference value between the length of a first variable and the total byte length of each frame of message, wherein the first variable is a variable arranged at a first position in the variable list; calculating a difference between the length of the first variable and the total length of the bytes; splitting the length of a second variable in the variable list into the length of the difference if the difference is not zero, wherein the second variable is a variable arranged at a second position in the variable list; arranging the second variable with the length of the difference value after the first variable, continuing to calculate the difference value between the residual length of the second variable and the total length of the bytes, splitting and sequencing the variables until the last variable in the variable list obtains a plurality of variables with target byte lengths.
The processor executes the program and further realizes the following steps: the method further comprises the following steps: packaging a plurality of variables with target byte length according to a preset rule, accumulating the lengths of the variables in the split variable list according to an arrangement sequence before transmitting the packaged messages in a CAN bus based on an XCP (XCP) protocol or a CCP (CCP protocol), and packaging the variables with the accumulated lengths in the same frame of messages under the condition that the accumulated values are equal to the total byte length of each frame of messages; and continuously performing length accumulation on the variables which are not subjected to length accumulation in the split variable list according to the sequence of arrangement so as to package the message until the last variable in the split variable list is reached, thereby obtaining the packaged multi-frame message.
The processor executes the program and further realizes the following steps: the method is applied to an electronic control unit of the engine and/or a remote vehicle-mounted terminal.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device: acquiring a variable list, wherein the variable list comprises a plurality of variables and the length of each variable; splitting each variable based on the length of each variable to obtain a plurality of variables with target byte lengths; and packaging a plurality of variables with target byte length according to a preset rule, and transmitting the packaged messages in the CAN bus based on an XCP protocol or a CCP protocol.
When executed on a data processing device, is further adapted to perform a procedure for initializing the following method steps: the target byte length is one byte length, the method further comprising: packing a plurality of variables with target byte length according to a preset rule, accumulating the lengths of the variables in the split variable list according to an arrangement sequence before transmitting the packed messages in a CAN bus based on an XCP (XCP) protocol or a CCP (CCP protocol), and packing the variables with the accumulated lengths in the same frame of messages when the accumulated values are equal to the total byte length of each frame of messages; and continuously performing length accumulation on the variables which are not subjected to length accumulation in the split variable list according to the sequence of arrangement so as to package the message until the last variable in the split variable list is reached, thereby obtaining the packaged multi-frame message.
When executed on a data processing device, is further adapted to perform a procedure for initializing the following method steps: splitting each variable based on the length of each variable to obtain a plurality of variables with target byte lengths, wherein the variables are as follows: calculating a difference value between the length of a first variable and the total byte length of each frame of message, wherein the first variable is a variable arranged at a first position in the variable list; calculating a difference between the length of the first variable and the total length of the bytes; splitting the length of a second variable in the variable list into the length of the difference if the difference is not zero, wherein the second variable is a variable arranged at a second position in the variable list; arranging the second variable with the length of the difference value after the first variable, continuing to calculate the difference value between the residual length of the second variable and the total length of the bytes, splitting and sequencing the variables until the last variable in the variable list obtains a plurality of variables with target byte lengths.
When executed on a data processing device, is further adapted to perform a procedure for initializing the following method steps: the method further comprises the following steps: packaging a plurality of variables with target byte length according to a preset rule, accumulating the lengths of the variables in the split variable list according to an arrangement sequence before transmitting the packaged messages in a CAN bus based on an XCP (XCP) protocol or a CCP (CCP protocol), and packaging the variables with the accumulated lengths in the same frame of messages under the condition that the accumulated values are equal to the total byte length of each frame of messages; and continuously performing length accumulation on the variables which are not subjected to length accumulation in the split variable list according to the sequence of arrangement so as to package the message until the last variable in the split variable list is reached, thereby obtaining the packaged multi-frame message.
When executed on a data processing device, is further adapted to perform a procedure for initializing the following method steps: the method is applied to an electronic control unit of the engine and/or a remote vehicle-mounted terminal.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method for configuring variable information, comprising:
acquiring a variable list, wherein the variable list comprises a plurality of variables and the length of each variable;
splitting each variable based on the length of each variable to obtain a plurality of variables with target byte lengths;
and packaging a plurality of variables with target byte length according to a preset rule, and transmitting the packaged messages in the CAN bus based on an XCP protocol or a CCP protocol.
2. The method of claim 1, wherein the target byte length is one byte length, and before the plurality of variables of the target byte length are packed according to a predetermined rule, the packed messages are transmitted in a CAN bus based on an XCP protocol or a CCP protocol, the method further comprises:
accumulating the lengths of the variables in the split variable list according to the arrangement sequence, and packing the variables with the accumulated lengths in the same frame of message when the accumulated value is equal to the total byte length of each frame of message;
and continuously performing length accumulation on the variables which are not subjected to length accumulation in the split variable list according to the sequence of arrangement so as to package the message until the last variable in the split variable list is reached, thereby obtaining the packaged multi-frame message.
3. The method of claim 1, wherein splitting each variable based on the length of the variable to obtain a plurality of target byte-length variables comprises:
calculating a difference value between the length of a first variable and the total byte length of each frame of message, wherein the first variable is a variable arranged at a first position in the variable list;
calculating a difference between the length of the first variable and the total length of the bytes;
splitting the length of a second variable in the variable list into the length of the difference if the difference is not zero, wherein the second variable is a variable arranged at a second position in the variable list;
arranging the second variable with the length of the difference value after the first variable, continuing to calculate the difference value between the residual length of the second variable and the total length of the bytes, splitting and sequencing the variables until the last variable in the variable list obtains a plurality of variables with target byte lengths.
4. The method of claim 1, wherein before packing a plurality of variables of a target byte length according to a predetermined rule, transmitting the packed messages in a CAN bus based on an XCP protocol or a CCP protocol, the method further comprises:
accumulating the lengths of the variables in the split variable list according to the arrangement sequence, and packing the variables with the accumulated lengths in the same frame of message under the condition that the accumulated value is equal to the total byte length of each frame of message;
and continuously performing length accumulation on the variables which are not subjected to length accumulation in the split variable list according to the sequence of arrangement so as to package the message until the last variable in the split variable list is reached, thereby obtaining the packaged multi-frame message.
5. The method according to claim 1, characterized in that it is applied on an electronic control unit of the engine and/or on a remote on-board terminal.
6. An apparatus for configuring variable information, comprising:
the device comprises a first acquisition unit, a second acquisition unit and a processing unit, wherein the first acquisition unit is used for acquiring a variable list, and the variable list comprises a plurality of variables and the length of each variable;
the second acquisition unit is used for splitting each variable based on the length of each variable to obtain a plurality of variables with target byte lengths;
and the transmission unit is used for packaging a plurality of variables with target byte lengths according to a preset rule and transmitting the packaged messages in the CAN bus based on an XCP protocol or a CCP protocol.
7. The apparatus of claim 6, wherein the target byte length is one byte length, the apparatus further comprising:
the first calculation unit is used for packaging a plurality of variables with target byte lengths according to a preset rule, accumulating the lengths of the variables in the split variable list according to an arrangement sequence before transmitting the packaged messages in a CAN bus based on an XCP (XCP) protocol or a CCP (CCP) protocol, and packaging the variables with the accumulated lengths in the same frame of messages when the accumulated values are equal to the total byte length of each frame of messages;
and the first packing unit is used for continuously carrying out length accumulation on the variables which are not subjected to length accumulation in the split variable list according to the arrangement sequence so as to pack the messages until the last variable in the split variable list is reached, so that the packed multi-frame messages are obtained.
8. The apparatus of claim 6, wherein the second obtaining unit further comprises:
the first calculation module is used for calculating a difference value between the length of a first variable and the total byte length of each frame of message, wherein the first variable is a variable arranged at the first position in the variable list;
the second calculation module is used for calculating the difference value between the length of the first variable and the total length of the bytes;
a splitting module, configured to split a length of a second variable in the variable list into a length of the difference if the difference is not zero, where the second variable is a variable arranged at a second position in the variable list;
and the sorting module is used for sorting a second variable with the length of the split difference value after the first variable, continuing to calculate the difference value between the residual length of the second variable and the total length of the bytes, splitting and sorting the variables until the last variable in the variable list obtains a plurality of variables with target byte lengths.
9. A storage medium characterized by comprising a stored program, wherein the program executes the method of configuring variable information according to any one of claims 1 to 5.
10. A processor, characterized in that the processor is configured to execute a program, wherein the program executes the method for configuring variable information according to any one of claims 1 to 5.
CN202010246484.3A 2020-03-31 2020-03-31 Method and device for configuring variable information Pending CN111464410A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010246484.3A CN111464410A (en) 2020-03-31 2020-03-31 Method and device for configuring variable information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010246484.3A CN111464410A (en) 2020-03-31 2020-03-31 Method and device for configuring variable information

Publications (1)

Publication Number Publication Date
CN111464410A true CN111464410A (en) 2020-07-28

Family

ID=71680185

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010246484.3A Pending CN111464410A (en) 2020-03-31 2020-03-31 Method and device for configuring variable information

Country Status (1)

Country Link
CN (1) CN111464410A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105515902A (en) * 2015-11-27 2016-04-20 北京新能源汽车股份有限公司 Test method and system of vehicle control unit
CN107919947A (en) * 2017-11-28 2018-04-17 南瑞集团有限公司 A kind of coding method of CAN bus long message transmission
US20190020717A1 (en) * 2017-07-11 2019-01-17 GM Global Technology Operations LLC Vehicle network implementing xcp protocol policy and method
CN110401509A (en) * 2019-06-12 2019-11-01 广汽丰田汽车有限公司 For improving method, equipment, medium and the device of automobile CAN-bus efficiency of transmission

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105515902A (en) * 2015-11-27 2016-04-20 北京新能源汽车股份有限公司 Test method and system of vehicle control unit
US20190020717A1 (en) * 2017-07-11 2019-01-17 GM Global Technology Operations LLC Vehicle network implementing xcp protocol policy and method
CN107919947A (en) * 2017-11-28 2018-04-17 南瑞集团有限公司 A kind of coding method of CAN bus long message transmission
CN110401509A (en) * 2019-06-12 2019-11-01 广汽丰田汽车有限公司 For improving method, equipment, medium and the device of automobile CAN-bus efficiency of transmission

Similar Documents

Publication Publication Date Title
CN108683720B (en) Container cluster service configuration method and device
CN109561128B (en) Data transmission method and device
CN111949389B (en) Slurm-based information acquisition method and device, server and computer-readable storage medium
CN104184765B (en) A kind of request control method and client terminal device and server-side device
CN115390991A (en) Virtual machine import and export method, device, equipment and storage medium
CN111464410A (en) Method and device for configuring variable information
CN111526127B (en) Method and device for configuring variable information
CN112416534A (en) Agent-based task management method and device
CN111444017A (en) Multimedia data processing method, device and system, electronic equipment and storage medium
CN114553895B (en) Data synchronization method, system, storage medium and electronic equipment
CN112583742A (en) Message processing method and device
CN112118195A (en) Data packaging method and device, storage medium and processor
CN105704173B (en) A kind of cluster system data location mode and server
CN103051722A (en) Method and related equipment for determining whether page is hijacked or not
CN110753006A (en) Data processing method and device and electronic equipment
CN115695333A (en) Method and system for eliminating pcdn node resources and related equipment
CN116226045A (en) File data aggregation method, file data aggregation device and query system
CN112637151B (en) Data message transmission method, terminal device, server and storage medium
CN111597392B (en) Index processing method, device, equipment and storage medium
CN110321133B (en) H5 application deployment method and device
CN103312785A (en) Method and device for determining access relation
CN114372882A (en) Fragmentation and capacity expansion method based on network protocol
CN112579145A (en) Application deployment method and device
CN111314189B (en) Service message sending method and device
CN111290850A (en) Data storage method, device and equipment

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200728

RJ01 Rejection of invention patent application after publication