Encryption detection method, device, storage medium and computer equipment for charging pile
By analyzing the parameter group number and corresponding relationship of the internal communication message of the charging pile, it is judged whether the charging pile communication message is encrypted, which solves the problem of internal communication analysis and encryption status detection of the charging pile, and achieves accurate analysis and analysis of the internal communication of the charging pile. Detection of encryption status.
Patent Information
- Application Number
- CN202310077344.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-16
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2043-01-16
AI Technical Summary
The existing technology cannot accurately analyze the internal communication of the charging pile, nor can it detect whether the internal communication of the charging pile is encrypted.
By obtaining the target correspondence between the parameter group number and the message description based on the communication reference file, the internal communication messages of the charging pile are analyzed, and the encryption detection results of the communication messages are determined to determine the encryption status of the charging pile.
It achieves accurate analysis and encryption status detection of the internal communication of the charging pile, and solves the problem of being unable to analyze and detect the encryption status of the internal communication of the charging pile.
Smart Images

Figure CN117014352B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication security, and in particular to an encryption detection method and device for a charging pile. Background Art
[0002] In the related art, it is impossible to identify and parse the internal communication protocol of the charging pile, and it is also impossible to identify whether the internal communication of the charging pile is encrypted.
[0003] Therefore, in the related technology, there are technical problems that the internal communication of the charging pile cannot be accurately analyzed, and the encryption status of the internal communication of the charging pile cannot be detected.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide an encryption detection method and device for a charging pile, so as to at least solve the technical problems of being unable to accurately analyze the internal communication of the charging pile and being unable to detect the encryption status of the internal communication of the charging pile.
[0006] According to one aspect of an embodiment of the present invention, there is provided an encryption detection method, comprising: obtaining a target correspondence between a reference parameter group number located in a message and a reference message description based on a communication reference file; obtaining a communication message for internal communication of a charging pile; parsing the communication message to obtain a target parameter group number located in the communication message; determining an encryption detection result of the communication message based on the target parameter group number and the target correspondence; and determining an encryption detection result of the charging pile based on the encryption detection result of the communication message.
[0007] Optionally, based on the communication reference file, a target correspondence between a reference parameter group number in a message and a reference message description is obtained, including: parsing the communication reference file to obtain a text file corresponding to the reference file; matching a string array from the text file according to a preset matching rule; parsing the string array according to a preset data type to obtain a reference parameter group number and a reference message description; and determining a target correspondence based on the reference parameter group number and the reference message description.
[0008] Optionally, according to preset matching rules, matching from a text file to obtain a string array includes: according to preset matching rules, matching from a text to obtain multiple strings; using a first predetermined character to split between adjacent strings in the multiple strings to obtain a string array.
[0009] Optionally, the communication message is parsed to obtain a target parameter group number located in the communication message, including: replacing a second predetermined character in the communication message to obtain preprocessed message data; extracting first data corresponding to a first data position and second data corresponding to a second data position from the message data; determining an initial parameter group number based on the first data and the second data; and formatting the initial parameter group number to obtain a target parameter group number.
[0010] Optionally, before extracting the first data corresponding to the first data position and the second data corresponding to the second data position from the message data, it also includes: when the length of the message data is greater than a preset threshold, determining that the message data is abnormal data, and filtering the abnormal data.
[0011] Optionally, based on the target parameter group number and the target correspondence, the encryption detection result of the communication message is determined, including: if in the target correspondence, the target message description corresponding to the target parameter group number can be matched, then the encryption detection result of the communication message is determined to be that the communication message is not encrypted; if in the target correspondence, the target message description corresponding to the target parameter group number cannot be matched, then the encryption detection result of the communication message is determined to be that the communication message is encrypted.
[0012] Optionally, based on the encryption detection result of the communication message, the encryption detection result of the charging pile is determined, including: obtaining the total number of communication messages of the internal communication of the charging pile; when the encryption detection result of the communication message is the number of unencrypted communication messages, and the ratio of the number of unencrypted communication messages to the total number of communication messages is greater than a predetermined threshold, it is determined that the encryption detection result of the charging pile is that the internal communication is unencrypted.
[0013] According to another aspect of an embodiment of the present invention, an encryption detection device is also provided, including: a first acquisition module, used to obtain a target correspondence between a reference parameter group number located in a message and a reference message description based on a communication reference file; a second acquisition module, used to obtain a communication message for internal communication of a charging pile; a parsing module, used to parse the communication message to obtain a target parameter group number located in the communication message; a first determination module, used to determine an encryption detection result of the communication message based on the target parameter group number and the target correspondence; a second determination module, used to determine the encryption detection result of the charging pile based on the encryption detection result of the communication message.
[0014] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above encryption detection methods.
[0015] According to another aspect of an embodiment of the present invention, a computer device is also provided, including: a memory and a processor, the memory storing a computer program; the processor is used to execute the computer program stored in the memory, and when the computer program is running, the processor executes any one of the above-mentioned encryption detection methods.
[0016] In an embodiment of the present invention, by first obtaining all possible parameter group numbers and their corresponding message descriptions under the current communication protocol based on a communication reference file, that is, a target correspondence relationship between a reference parameter group number and a reference message description, and then parsing the communication message of the internal communication of the charging pile to obtain a target parameter group number corresponding to the communication message, then it is possible to determine whether the communication message has been encrypted based on the target parameter group number and the target correspondence relationship, that is, an encryption detection result of the communication message. For example, if the message description corresponding to the target parameter group number can be determined based on the target correspondence relationship, it means that the communication message is not encrypted. After thus determining the encryption detection result of the communication message, it is possible to continue to determine whether the internal communication of the charging pile is encrypted based on the encryption detection result of the communication message, that is, the encryption detection result of the charging pile, thereby achieving the technical effect of parsing the internal communication of the charging pile and detecting whether the internal communication of the charging pile is encrypted, thereby solving the technical problem of being unable to accurately parse the internal communication of the charging pile and being unable to detect the encryption status of the internal communication of the charging pile. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0018] Figure 1 is a flow chart of an encryption detection method provided according to an embodiment of the present invention;
[0019] Figure 2 is a schematic diagram of internal communication of a charging pile provided according to an optional embodiment of the present invention;
[0020] Figure 3 is a flow chart of a method for encrypting and detecting CAN communication traffic inside a charging pile provided according to an optional embodiment of the present invention;
[0021] Figure 4 It is a structural block diagram of an encryption detection device provided according to an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0024] According to an embodiment of the present invention, an embodiment of a method for encryption detection is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0025] Figure 1 is a flow chart of an encryption detection method provided according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:
[0026] Step S102, based on the communication reference file, obtaining a target correspondence relationship between a reference parameter group number in the message and a reference message description;
[0027] Step S104, obtaining the communication message of the internal communication of the charging pile;
[0028] Step S106, parsing the communication message to obtain the target parameter group number in the communication message;
[0029] Step S108, determining the encryption detection result of the communication message based on the target parameter group number and the target corresponding relationship;
[0030] Step S110, based on the encryption detection result of the communication message, determine the encryption detection result of the charging pile.
[0031] Through the above steps, first, based on the communication reference file, obtain all possible parameter group numbers and their corresponding message descriptions under the current communication protocol, that is, the target correspondence between the reference parameter group number and the reference message description, and then parse the communication message of the internal communication of the charging pile to obtain the target parameter group number corresponding to the communication message. Then, it can be determined whether the communication message has been encrypted based on the target parameter group number and the target correspondence, that is, the encryption detection result of the communication message. According to the encryption detection result of the communication message, it can be further determined whether the internal communication of the charging pile is encrypted, that is, the encryption detection result of the charging pile, thereby achieving the technical effect of parsing the internal communication of the charging pile and detecting whether the internal communication of the charging pile is encrypted, thereby solving the technical problems of not being able to accurately parse the internal communication of the charging pile and not being able to detect the encryption status of the internal communication of the charging pile.
[0032] It should be noted that the internal communication of the charging pile in this embodiment adopts the CAN communication protocol. When obtaining the communication message of the internal communication of the charging pile, the CAN data receiving device can be incorporated into the CAN communication network and the CAN data receiving device can be turned on to start receiving data.
[0033] It should be noted that the parameter group number in this embodiment is the parameter group number in the CAN message, which is used for message identification.
[0034] As an optional embodiment, based on a communication reference file, a target correspondence relationship between a reference parameter group number located in a message and a reference message description is obtained, including: parsing the communication reference file to obtain a text file corresponding to the reference file; matching a string array from the text file according to a preset matching rule; parsing the string array according to a preset data type to obtain a reference parameter group number and a reference message description; and determining a target correspondence relationship based on the reference parameter group number and the reference message description.
[0035] Since the communication reference file includes other contents in addition to the reference parameter group number and the reference message description, in this embodiment, the communication reference file is first parsed to obtain a corresponding text file, and the text file is screened according to the preset matching rule to match all string arrays that meet the preset matching rule. In order to avoid omissions and improve the screening efficiency and accuracy of the string array, in this embodiment, a regular expression can be used to directly match the text file. For example, the preset matching rule can be the regular rule "[\u4e00-\u9fa5]*(\s)+[0-9]+(\s)+[0-9]+H(\s)+[0-9]+(\s)+[0-9]+(\s)+[0-9]+(\s)+BIN(\s)+[0-9]+(\s)+[0-9]+(\s)+[\u4e00-\u9fa5]*--[\u4e00-\u9fa5]*".
[0036] After obtaining the string array, the string array can be parsed according to the preset data type. For example, the entire string array can be parsed for only one data type at a time, wherein the preset data type may include multiple types, for example, it may be a message description, a parameter group number (decimal and / or hexadecimal), priority, data length, data type, message period, timeout, source address, destination address, and the like.
[0037] In this embodiment, after obtaining the parsing result according to the preset data type, the message description and parameter group number can be extracted from the parsing result, and the target correspondence can be formed by utilizing the correspondence between each message description and each parameter group number in the communication reference file.
[0038] As an optional embodiment, according to a preset matching rule, a string array is obtained by matching from a text file, including: according to the preset matching rule, a plurality of strings are matched from the text; and adjacent strings in the plurality of strings are segmented using a first predetermined character to obtain a string array. After a plurality of strings are matched from the text file, in order to improve the subsequent parsing efficiency and accuracy, this embodiment uses a first predetermined character (e.g., a space) to segment between two strings to obtain a string array.
[0039] As an optional embodiment, a communication message is parsed to obtain a target parameter group number located in the communication message, including: replacing a second predetermined character in the communication message to obtain preprocessed message data; extracting first data corresponding to a first data position and second data corresponding to a second data position from the message data; determining an initial parameter group number based on the first data and the second data; and formatting the initial parameter group number to obtain a target parameter group number.
[0040] When parsing a communication message, this embodiment first preprocesses the communication message, and then extracts data from the preprocessed message data according to a predetermined data position, that is, extracts first data corresponding to a first data position and second data corresponding to a second data position from the message data, and then determines an initial parameter group number based on the first data and the second data. For example, when the first data is greater than a preset threshold, the sum of the first data and the second data is determined as the initial parameter group number, otherwise, the sum of the first data and a predetermined character string is determined as the initial parameter group number, and finally the initial parameter group number is formatted to obtain a target parameter group number.
[0041] As an optional embodiment, before extracting the first data corresponding to the first data position and the second data corresponding to the second data position from the message data, it also includes: when the length of the message data is greater than a preset threshold, determining that the message data is abnormal data, and filtering the abnormal data.
[0042] Through the above-mentioned analysis operation on the communication message, the parameter group number can be determined from the communication message efficiently and accurately, and the standardization and readability of the analysis result can be improved.
[0043] As an optional embodiment, based on the target parameter group number and the target correspondence, the encryption detection result of the communication message is determined, including: if in the target correspondence, the target message description corresponding to the target parameter group number can be matched, then the encryption detection result of the communication message is determined to be that the communication message is not encrypted; if in the target correspondence, the target message description corresponding to the target parameter group number cannot be matched, then the encryption detection result of the communication message is determined to be that the communication message is encrypted. If the message description corresponding to the target parameter group number can be determined based on the target correspondence, it means that the command type can be directly interpreted from the communication message, that is, the communication message is not encrypted, otherwise, it means that the communication message is encrypted.
[0044] As an optional embodiment, based on the encryption detection result of the communication message, the encryption detection result of the charging pile is determined, including: obtaining the total number of communication messages of the internal communication of the charging pile; when the encryption detection result of the communication message is the number of communication messages that are not encrypted, and the ratio of the number of communication messages to the total number of communication messages is greater than a predetermined threshold, the encryption detection result of the charging pile is determined to be the internal communication is not encrypted. When determining the encryption detection result of the charging pile based on the encryption detection result of the communication message, a variety of methods can be used. For example, in the case that the encryption detection result is that the communication message is not encrypted during the internal communication process of the charging pile, the encryption detection result of the charging pile is determined to be the internal communication is not encrypted. For another example, a predetermined threshold can be set. When the encryption detection result of the communication message is the number of communication messages that are not encrypted, and the ratio of the number of communication messages to the total number of communication messages is greater than a predetermined threshold, the encryption detection result of the charging pile is determined to be the internal communication is not encrypted, that is, when the proportion of the number of unencrypted communication messages in the total number of communication messages reaches a certain level, it is determined that the internal communication of the charging pile is not encrypted.
[0045] Based on the above embodiments and optional embodiments, the present invention proposes an optional implementation mode, which is described below.
[0046] Figure 2 is a schematic diagram of internal communication of a charging pile according to an optional embodiment of the present invention, such as Figure 2 As shown, an optional implementation manner of the present invention proposes a method for encrypting and detecting the internal CAN communication traffic of a charging pile to solve the technical problems of parsing the internal communication of the charging pile and identifying the encryption status.
[0047] Figure 3 is a flow chart of a method for encrypting and detecting CAN communication traffic inside a charging pile according to an optional embodiment of the present invention. Figure 3 As shown, the method comprises the following steps:
[0048] A. Use Python script to parse the State Grid standard file and generate the corresponding dictionary of command type: data message format
[0049] A1. Use Python to parse the State Grid standard file into a txt text file.
[0050] A2. Use regular expression to match all matching texts.
[0051] The regular rule is
[0052] "[\u4e00-\u9fa5]*(\s)+[0-9]+(\s)+[0-9]+H(\s)+[0-9]+(\s)+[0-9]+(\s) +BIN(\s)+[0-9]+(\s)+[0-9]+(\s)+[\u4e00-\u9fa5]*--[\u4e00-\u9fa5]*”
[0053] A3. Split all matching rules by spaces and convert them into a string array.
[0054] A4. Parse the string array generated in the previous step in the following order: message description, PGN, PGN (Hex), priority, data length, data type, message cycle, timeout, source address -- destination address.
[0055] A5. Extract the PGN and message description, and generate a dictionary object in one-to-one correspondence.
[0056] B. Get data message
[0057] B1. Integrate the CAN data receiving device into the CAN communication network.
[0058] B2. Turn on the CAN data receiving device to start receiving data.
[0059] B3. After receiving the CAN communication data, parse the CAN message frame ID attribute and use the custom function Get_PGN. The custom function is as follows:
[0060] def Get_PGN(str_hex):
[0061] #The data comes in the form of xFFFFFFFF and XFFFFFFFF. You need to filter out x and X.
[0062] tmp_str_hex=str_hex.replace('x',”)
[0063] tmp_str_hex=tmp_str_hex.replace('X',")
[0064] #The length of the replaced data must be less than 8. If it is greater than 8, it is abnormal and filtered out
[0065] if len(tmp_str_hex)<8:
[0066] tmp_str_hex='0'*(8-len(tmp_str_hex))+tmp_str_hex
[0067] if len(tmp_str_hex)>8:
[0068] print("Data error!!!!!!")
[0069] return
[0070] #According to the data structure, extract the data at a specific location
[0071] P_R_DP = tmp_str_hex[0:2]
[0072] PF = tmp_str_hex[2:4]
[0073] PS = tmp_str_hex[4:6]
[0074] SA=tmp_str_hex[6:]
[0075] #Create temporary variables
[0076] PGN=""
[0077] #Convert the data into decimal
[0078] value_PF=int(PF,16)
[0079] #Fixed data formatting format according to standard requirements
[0080] if(value_PF>240):
[0081] PGN=PF+PS
[0082] else:
[0083] PGN=PF+"00"
[0084] #Convert hexadecimal data to decimal
[0085] value_PGN = int(PGN,16)
[0086] #Return PGN data in hexadecimal and decimal
[0087] return PGN,value_PGN
[0088] C. Match command type according to digital table text
[0089] C1. Match the dictionary based on the PGN value.
[0090] C2. Return the result taken out from the dictionary.
[0091] D. Judging from the traffic, if the data message can be matched to the corresponding command, it proves that the communication data is not encrypted.
[0092] D1. Count the number of all CAN messages.
[0093] D2. Calculate all CAN data messages that can be parsed.
[0094] D3. If the number of messages that can be parsed exceeds 60% of the total number of messages, it can be determined that the CAN communication data is not encrypted.
[0095] In summary, an optional implementation manner of the present invention can identify the internal communication protocol of the charging pile by parsing the standard file, and determine whether the communication data is encrypted by whether the internal communication command can be parsed.
[0096] According to an embodiment of the present invention, an encryption detection device is also provided. Figure 4 is a structural block diagram of an encryption detection device provided according to an embodiment of the present invention, such as Figure 4 As shown, the device includes: a first acquisition module 41, a second acquisition module 42, a parsing module 43, a first determination module 44 and a second determination module 45. The device is described below.
[0097] The first acquisition module 41 is used to obtain the target correspondence between the reference parameter group number located in the message and the reference message description based on the communication reference file; the second acquisition module 42 is connected to the above-mentioned first acquisition module 41, and is used to obtain the communication message of the internal communication of the charging pile; the parsing module 43 is connected to the above-mentioned second acquisition module 42, and is used to parse the communication message to obtain the target parameter group number located in the communication message; the first determination module 44 is connected to the above-mentioned parsing module 43, and is used to determine the encryption detection result of the communication message based on the target parameter group number and the target correspondence; the second determination module 45 is connected to the above-mentioned first determination module 44, and is used to determine the encryption detection result of the charging pile based on the encryption detection result of the communication message.
[0098] According to an embodiment of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above encryption detection methods.
[0099] According to an embodiment of the present invention, a computer device is also provided, including: a memory and a processor, the memory storing a computer program; the processor is used to execute the computer program stored in the memory, and when the computer program is running, the processor executes any one of the above-mentioned encryption detection methods.
[0100] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0101] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0102] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0103] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0104] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0105] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0106] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. An encryption detection method for a charging pile, characterized in that: include: Based on the communication reference file, obtaining a target correspondence between a reference parameter group number located in the message and a reference message description; Obtain the communication message of the internal communication of the charging pile; Parsing the communication message to obtain a target parameter group number located in the communication message; Determining an encryption detection result of the communication message based on the target parameter group number and the target corresponding relationship; Determine the encryption detection result of the charging pile based on the encryption detection result of the communication message; The step of obtaining a target correspondence between a reference parameter group number in a message and a reference message description based on the communication reference file includes: Parsing the communication reference file to obtain a text file corresponding to the communication reference file; According to the preset matching rules, a string array is obtained by matching from the text file; Parsing the string array according to a preset data type to obtain the reference parameter group number and the reference message description; Determining the target correspondence based on the reference parameter group number and the reference message description; The step of determining the encryption detection result of the communication message based on the target parameter group number and the target corresponding relationship includes: If the target message description corresponding to the target parameter group number can be matched in the target corresponding relationship, then determining that the encryption detection result of the communication message is that the communication message is not encrypted; If the target message description corresponding to the target parameter group number cannot be matched in the target corresponding relationship, then determining that the encryption detection result of the communication message is that the communication message is encrypted; The step of determining the encryption detection result of the charging pile based on the encryption detection result of the communication message includes: Obtaining the total number of communication messages of the internal communication of the charging pile; When the encryption detection result of the communication message is that the ratio of the number of communication messages that are not encrypted to the total number of communication messages is greater than a predetermined threshold, it is determined that the encryption detection result of the charging pile is that internal communication is not encrypted.
2. The method according to claim 1, characterized in that The step of matching the text file to obtain a string array according to a preset matching rule includes: According to the preset matching rule, multiple character strings are matched from the text file; Adjacent character strings among the plurality of character strings are segmented using a first predetermined character to obtain the character string array.
3. The method according to claim 1, characterized in that The step of parsing the communication message to obtain a target parameter group number in the communication message includes: Performing character replacement on a second predetermined character in the communication message to obtain preprocessed message data; Extracting first data corresponding to the first data position and second data corresponding to the second data position from the message data; Determine an initial parameter group number based on the first data and the second data; The initial parameter group number is formatted to obtain the target parameter group number.
4. The method according to claim 3, characterized in that Before extracting the first data corresponding to the first data position and the second data corresponding to the second data position from the message data, the method further includes: When the length of the message data is greater than a preset threshold, the message data is determined to be abnormal data, and the abnormal data is filtered.
5. An encryption detection device for a charging pile, characterized in that: include: A first acquisition module, used for acquiring a target correspondence relationship between a reference parameter group number located in a message and a reference message description based on a communication reference file; A second acquisition module is used to acquire the communication message of the internal communication of the charging pile; A parsing module, used for parsing the communication message to obtain a target parameter group number located in the communication message; A first determination module, used to determine the encryption detection result of the communication message based on the target parameter group number and the target corresponding relationship; A second determination module, configured to determine the encryption detection result of the charging pile based on the encryption detection result of the communication message; The step of obtaining a target correspondence between a reference parameter group number in a message and a reference message description based on the communication reference file includes: Parsing the communication reference file to obtain a text file corresponding to the communication reference file; According to the preset matching rules, a string array is obtained by matching from the text file; Parsing the string array according to a preset data type to obtain the reference parameter group number and the reference message description; Determining the target correspondence based on the reference parameter group number and the reference message description; The step of determining the encryption detection result of the communication message based on the target parameter group number and the target corresponding relationship includes: If the target message description corresponding to the target parameter group number can be matched in the target corresponding relationship, then determining that the encryption detection result of the communication message is that the communication message is not encrypted; If the target message description corresponding to the target parameter group number cannot be matched in the target corresponding relationship, then determining that the encryption detection result of the communication message is that the communication message is encrypted; The step of determining the encryption detection result of the charging pile based on the encryption detection result of the communication message includes: Obtaining the total number of communication messages of the internal communication of the charging pile; When the encryption detection result of the communication message is that the ratio of the number of communication messages that are not encrypted to the total number of communication messages is greater than a predetermined threshold, it is determined that the encryption detection result of the charging pile is that internal communication is not encrypted.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the encryption detection method according to any one of claims 1 to 4.
7. A computer device, characterized in that: include: Memory and processor, The memory stores a computer program; The processor is used to execute the computer program stored in the memory, and when the computer program is run, the processor executes the encryption detection method according to any one of claims 1 to 4.
