CN-121985058-A - Method, device, equipment and storage medium for analyzing charging message
Abstract
The invention belongs to the technical field of charging piles and discloses a method for analyzing a communication message of a charging pile, which comprises the steps of selecting a target electronic form file corresponding to the communication message of the charging pile from a plurality of preset electronic form files, and inputting the communication message of the charging pile into the target electronic form file; determining the initial byte position and byte length of each field in the communication message, presetting a field interception function taking the initial byte position and the byte length as parameters for each field, intercepting the communication message field by calling the field interception function, outputting each field obtained by interception, carrying out binary conversion on the fields obtained by interception to obtain initial time and end time, determining corresponding rate time according to the initial time and the end time, calculating and generating rate amount and outputting according to the rate time and preset charging rules. The invention solves the problems of low efficiency and poor accuracy in manual analysis.
Inventors
- SHEN ZHICHAO
Assignees
- 深圳市车电网络有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20251230
Claims (10)
- 1. The method for analyzing the communication message of the charging pile is characterized by comprising the following steps of: Selecting a target electronic table file corresponding to a charging pile communication message from a plurality of preset electronic table files, and inputting the charging pile communication message into the target electronic table file; determining the initial byte position and byte length of each field in the communication message according to the communication rule definition of the charging pile; For each field, presetting a field interception function taking the initial byte position and the byte length as parameters, intercepting the communication message segment by calling the field interception function, and outputting each intercepted field; Carrying out binary conversion on the fields obtained by interception to obtain a starting time and an ending time; And determining a corresponding rate period according to the starting time and the ending time, calculating and generating rate amount according to the rate period and a preset charging rule, and outputting the rate amount.
- 2. The method for parsing a communication message of a charging pile according to claim 1, wherein before selecting a target electronic form file corresponding to the communication message of the charging pile from a plurality of preset electronic form files, the method further comprises: setting a plurality of field analysis rows in a plurality of preset electronic table files, and marking semantic information corresponding to each field of the communication message for a first column of the field analysis rows.
- 3. The method for parsing a communication message of a charging pile according to claim 2, wherein selecting a target electronic form file corresponding to the communication message of the charging pile from a plurality of preset electronic form files comprises: Intercepting a frame type mark from a communication message according to the position and the length of the frame type mark in the communication message; Matching the intercepted frame type mark with frame type codes corresponding to a plurality of pre-configured electronic table files respectively; and according to the matching result, determining the electronic form file associated with the frame type code consistent with the frame type mark as a target electronic form file.
- 4. The method for parsing a communication message of a charging pile according to claim 2, wherein the presetting a field interception function using the starting byte position and the byte length as parameters, and performing the field interception function to intercept the communication message field by field, comprises: Setting an MID function as a field interception function in a second column of a field analysis row for each field, wherein parameters of the MID function refer to a cell address for storing a communication message, a cell address for storing a starting byte position of the field and a cell address for storing the byte length of the field; And running the field interception function, intercepting the data of each field from the communication message and outputting the data to a second column of a corresponding field analysis row in the electronic table file.
- 5. The method for parsing a communication message of a charging pile according to claim 3, wherein the performing a binary conversion on the fields obtained by the interception to obtain a start time and an end time includes: And converting the intercepted hexadecimal coded time field into a readable time format according to preset year, month, day, time, minute, second and week coding rules through combined operation of the MID function, the HEX2DEC function and the BITAND function.
- 6. The method for parsing a communication message of a charging pile according to claim 4, wherein determining a corresponding rate period according to the start time and the end time, and calculating a generated rate amount according to the rate period and a preset charging rule, comprises: dividing a day into four rate time periods of sharp, peak, flat and valley, wherein each time period corresponds to a preset time range and unit price, and judging and selecting one or more rate time periods related to the charging process according to the starting time and the ending time; Calculating the electric quantity, the electric charge amount, the service charge amount and the electricity consumption amount in the time period according to the rate type and the unit price corresponding to the rate time period; And calculating the total amount in the charging time according to the electric charge amount and the service charge amount in each time period.
- 7. The method for parsing a communication message of a charging pile according to claim 6, wherein the calculating and outputting the generated rate amount comprises: and filling the electric quantity, the electric charge amount, the service charge amount and the electricity consumption amount in each period and the total amount in the charging time into a third column of a corresponding field analysis row in the electronic table file.
- 8. The utility model provides a fill analytical equipment of electric pile communication message which characterized in that includes: A communication message input unit, configured to select a target electronic form file corresponding to a charging pile communication message from a plurality of preset electronic form files, where the target electronic form file receives the charging pile communication message, and determine a starting byte position and a byte length of each field in the communication message according to a communication rule industry definition of the charging pile; The field dividing unit is used for presetting a field intercepting function taking the initial byte position and the byte length as parameters for each field, intercepting the communication message segment by calling the field intercepting function, and outputting each field obtained by interception; The analysis operation unit is used for carrying out the binary conversion on the fields obtained by interception to obtain the starting time and the ending time, determining the corresponding rate time period according to the starting time and the ending time, calculating the generated rate amount according to the rate time period and the preset charging rule and outputting the generated rate amount.
- 9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor, when executing the computer program, implements the steps of the method for parsing a communication message for a charging pile according to any one of claims 1 to 7.
- 10. A computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the method for parsing a communication message for a charging pile according to any one of claims 1 to 7.
Description
Method, device, equipment and storage medium for analyzing charging message Technical Field The invention belongs to the technical field of charging piles, and relates to a method, a device, equipment and a storage medium for analyzing a charging message. Background The charging pile is used as core equipment for electric automobile energy supply, and the data interaction between the charging pile and a background management system depends on a predefined communication protocol. Such protocols typically include a large number of instruction sets, field definitions, and encoding rules. Traditional communication message parsing methods mainly rely on manual field-by-field comparison protocol documents for manual decoding and calculation. The analysis mode has the defects of low analysis efficiency, high labor cost, high possibility of introducing errors in manual analysis, difficult guarantee of accuracy and poor cooperativity in the traditional mode. The new staff needs to learn and understand the complex protocol specification for a long time, the whole process is time-consuming and labor-consuming, and the efficiency of research and development and debugging, protocol joint debugging and problem investigation is severely restricted. In the cross-platform, cross-manufacturer joint debugging or remote fault positioning scene, technicians often need to analyze the same message independently, so that quick alignment cognition is difficult, and once a problem occurs, the technicians often need to go to and from the scene to grasp and analyze the message, so that response delay is caused, travel and time cost is increased, and operation and maintenance efficiency and customer satisfaction are influenced. Therefore, a method for automatically analyzing the communication message of the charging pile is needed to overcome the efficiency bottleneck and the hidden trouble of manual analysis and improve the overall efficiency of the links of research, debugging and operation and maintenance. Disclosure of Invention The invention provides a method, a device, equipment and a storage medium for analyzing a charging message, which solve the problems of low efficiency and poor accuracy during manual analysis. In a first aspect, the present invention provides a method for parsing a communication message of a charging pile, including: Selecting a target electronic table file corresponding to a charging pile communication message from a plurality of preset electronic table files, and inputting the charging pile communication message into the target electronic table file; determining the initial byte position and byte length of each field in the communication message according to the communication rule definition of the charging pile; For each field, presetting a field interception function taking the initial byte position and the byte length as parameters, intercepting the communication message segment by calling the field interception function, and outputting each intercepted field; Carrying out binary conversion on the fields obtained by interception to obtain a starting time and an ending time; And determining a corresponding rate period according to the starting time and the ending time, calculating and generating rate amount according to the rate period and a preset charging rule, and outputting the rate amount. In a second aspect, the present invention provides a device for parsing a communication packet of a charging pile, including: A communication message input unit, configured to select a target electronic form file corresponding to a charging pile communication message from a plurality of preset electronic form files, where the target electronic form file receives the charging pile communication message, and determine a starting byte position and a byte length of each field in the communication message according to a communication rule industry definition of the charging pile; The field dividing unit is used for presetting a field intercepting function taking the initial byte position and the byte length as parameters for each field, intercepting the communication message segment by calling the field intercepting function, and outputting each field obtained by interception; The analysis operation unit is used for carrying out the binary conversion on the fields obtained by interception to obtain the starting time and the ending time, determining the corresponding rate time period according to the starting time and the ending time, calculating the generated rate amount according to the rate time period and the preset charging rule and outputting the generated rate amount. In a third aspect, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method for parsing a communication packet of a charging pile when the processor executes the computer program. In a fourth