Battery replacement data processing method and device, electronic equipment and medium
Through the battery swap platform, the dual verification of the identity information and target token of the external platform is solved, and the problem of low security of data transmission between different battery swap platforms is achieved, and the security and protection of data transmission are achieved.
Patent Information
- Application Number
- CN202311863680.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-08
AI Technical Summary
Data transmission between different battery swap platforms has low security problems, which are prone to data leakage, identity counterfeiting and data tampering.
The identity information of the external platform is verified through the battery swap platform, and the target token is included in the data packet for two-factor verification, ensuring the security of data transmission.
Improve the security of data transmission between the battery swap platform and the external platform, preventing data from being tampered with and leaked during transmission, and preventing malicious requests to impersonate an identity to attack.
Smart Images

Figure CN120281490A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of battery swapping, and particularly relates to a method and device for processing battery swapping data, an electronic device, and a medium. Background Art
[0002] A battery swapping platform, which can also be called a battery swapping management system, is used to process data reported by battery swapping stations and handle battery swapping, control, abnormal warning, and other services based on this data. There are many battery swapping platforms on the market, and different battery swapping platforms are usually provided by different operators. Currently, there are problems with low security in the data transmission process between different battery swapping platforms, such as easy leakage of battery swapping data, identity forgery, data tampering, etc. How to improve the security of data transmission between different battery swapping platforms has become an urgent problem to be solved. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to overcome the defect of low security in the data transmission process between different battery swapping platforms in the prior art, and provide a method and device for processing battery swapping data, an electronic device, and a medium to improve the security of data transmission between the battery swapping platform and external platforms.
[0004] The present invention solves the above technical problem through the following technical solutions:
[0005] The first aspect of the present invention provides a method for processing battery swapping data, which is applied to a battery swapping platform. The method for processing battery swapping data includes:
[0006] Respond to a login request from an external platform and verify the identity information of the external platform;
[0007] When it is determined that the identity information of the external platform is verified successfully, send a target token to the external platform;
[0008] Receive a data packet transmitted by the external platform. The data packet includes a request header and battery swapping data;
[0009] When it is determined that the request header includes the target token, process the corresponding battery swapping service according to the battery swapping data.
[0010] In this solution, the battery swapping platform combines the verification of the identity information of the external platform and the verification of the target token for the data packet transmitted by the external platform to realize the transmission of battery swapping data between the battery swapping platform and the external platform. By double-verifying the identity information and the target token, the security of transmitting battery swapping data between the battery swapping platform and the external platform can be effectively improved, preventing the battery swapping data from being tampered with during the transmission process, avoiding the leakage of battery swapping data during the transmission process, and at the same time preventing malicious requests from impersonating identities for attacks.
[0011] Optionally, the login request includes the code and key configured by the battery swapping platform obtained by the external platform; the step of verifying the identity information of the external platform includes:
[0012] When it is determined that the code sent by the external platform is consistent with the pre-stored code and the key sent by the external platform is consistent with the pre-stored key, it is determined that the identity information verification of the external platform passes.
[0013] In this solution, the battery swapping platform pre-configures the code and key for the external platform, and the battery swapping platform verifies the identity information of the external platform according to the configured code and key, improving the convenience and accuracy of identity verification.
[0014] Optionally, the step of sending the target token to the external platform includes: sending the target token and the validity period corresponding to the target token to the external platform.
[0015] In this solution, the target token sent by the battery swapping platform to the external platform has a validity period. After the validity period of the target token arrives, the battery swapping platform will send a new target token to the external platform again, which can further improve the security of data transmission between the battery swapping platform and the external platform.
[0016] Optionally, the step of processing the corresponding battery swapping service according to the battery swapping data in the case of determining that the request header includes the target token includes:
[0017] When it is determined that the request header includes the target token, obtain the interval duration from the current moment to the last verification of the identity information of the external platform;
[0018] When it is determined that the interval duration does not reach the validity period corresponding to the target token, process the corresponding battery swapping service according to the battery swapping data.
[0019] In this solution, when the request header includes the target token and the interval duration from the current moment to the last verification of the identity information of the external platform does not reach the validity period corresponding to the target token, the battery swapping platform processes the corresponding battery swapping service according to the battery swapping data, that is, the battery swapping platform verifies both the target token and its corresponding validity period, further improving the security of data transmission between the battery swapping platform and the external platform.
[0020] Optionally, the step of processing the corresponding battery swapping service according to the battery swapping data includes:
[0021] Perform ASCII code sorting, signature verification, and decryption processing on the battery swapping data in sequence;
[0022] Process the corresponding battery swapping service according to the decrypted battery swapping data.
[0023] In this solution, the battery swapping data received by the battery swapping platform is the result after ASCII code sorting, encryption, and signature processing. Therefore, it is necessary to perform ASCII code sorting, signature verification, and decryption processing on the received battery swapping data to decrypt the battery swapping data and ensure the security of the transmission of the battery swapping data.
[0024] Optionally, after the step of processing the corresponding battery swapping service according to the battery swapping data, the method further includes: sending the processing result of the battery swapping service to the external platform.
[0025] In this solution, based on the battery swapping data received by the battery swapping platform from the external platform, the battery swapping platform returns the corresponding processing result to the external platform after processing the battery swapping service corresponding to the battery swapping data, realizing the two-way data transmission between the battery swapping platform and the external platform.
[0026] The second aspect of the present invention provides a method for processing battery swapping data, which is applied to an external platform. The method for processing battery swapping data includes:
[0027] Sending a login request to the battery swapping platform;
[0028] Receiving the target token sent by the battery swapping platform, where the target token is sent by the battery swapping platform after verifying the identity information of the external platform based on the login request;
[0029] Transmitting a data packet containing a request header and battery swapping data to the battery swapping platform, so that the battery swapping platform processes the battery swapping service corresponding to the battery swapping data after determining that the request header includes the target token.
[0030] In this solution, the external platform receives the target token sent by the battery swapping platform after verifying the identity information of the external platform, and encapsulates the target token in the request header and sends it to the battery swapping platform together with the battery swapping data, so that the battery swapping platform can process the battery swapping service corresponding to the battery swapping data after successfully verifying the target token. Through the double verification of the identity information and the target token, the security of the transmission of the battery swapping data can be effectively improved, preventing the battery swapping data from being tampered with during the transmission process, avoiding the leakage of the battery swapping data during the transmission process, and at the same time preventing malicious requests from impersonating identities for attacks.
[0031] Optionally, the step of sending a login request to the battery swapping platform includes: sending the login request to the battery swapping platform by calling the login interface of the battery swapping platform.
[0032] Optionally, the login request includes the code, key, and interface address configured by the battery swapping platform obtained by the external platform.
[0033] In this solution, the battery swapping platform pre-configures the encoding, key, and interface address for the external platform in advance. The battery swapping platform verifies the identity information of the external platform based on the encoding and key configured for the external platform, improving the convenience and accuracy of identity verification. In addition, the external platform can transmit data packets to the battery swapping platform by calling the interface corresponding to the interface address.
[0034] Optionally, before the step of transmitting a data packet including a request header and battery swapping data to the battery swapping platform, it further includes: sequentially performing ASCII code sorting, encryption, and signature processing on the battery swapping data.
[0035] In this solution, the external platform encrypts the battery swapping data by performing ASCII code sorting, encryption, and signature processing on the battery swapping data, and only transmits the data after encrypting the battery swapping data, ensuring the security of the transmission of the battery swapping data.
[0036] Optionally, after the step of transmitting a data packet including a request header and battery swapping data to the battery swapping platform, it further includes: receiving the processing result of the battery swapping service sent by the battery swapping platform.
[0037] In this solution, based on the external platform sending battery swapping data to the battery swapping platform, the external platform can also receive the processing result of the battery swapping service corresponding to the battery swapping data, realizing two-way data transmission between the external platform and the battery swapping platform.
[0038] The third aspect of the present invention provides a processing device for battery swapping data, which is applied to a battery swapping platform and includes:
[0039] An identity verification module, configured to verify the identity information of the external platform in response to a login request from the external platform;
[0040] A token sending module, configured to send a target token to the external platform when it is determined that the identity information of the external platform is verified;
[0041] A data receiving module, configured to receive a data packet transmitted by the external platform, where the data packet includes a request header and battery swapping data;
[0042] A service processing module, configured to process the corresponding battery swapping service according to the battery swapping data when it is determined that the request header includes the target token.
[0043] Optionally, the login request includes the encoding and key configured by the battery swapping platform obtained by the external platform; the identity verification module is specifically configured to determine that the identity information of the external platform is verified when it is determined that the encoding sent by the external platform is consistent with the pre-stored encoding and the key sent by the external platform is consistent with the pre-stored key.
[0044] Optionally, the token sending module is specifically configured to send the target token and the validity period corresponding to the target token to the external platform.
[0045] Optionally, the service processing module is specifically configured to, when determining that the request header includes the target token, obtain the interval duration from the current moment to the last verification of the identity information of the external platform, and, when determining that the interval duration does not reach the validity period corresponding to the target token, process the corresponding battery swapping service according to the battery swapping data.
[0046] Optionally, the service processing module is specifically configured to perform ASCII code sorting, signature verification, and decryption processing on the battery swapping data in sequence, and process the corresponding battery swapping service according to the decrypted battery swapping data.
[0047] Optionally, the processing device further includes a result sending module, configured to send the processing result of the battery swapping service to the external platform.
[0048] A fourth aspect of the present invention provides a processing device for battery swapping data, which is applied to an external platform and includes:
[0049] A request sending module, configured to send a login request to the battery swapping platform;
[0050] A token receiving module, configured to receive the target token sent by the battery swapping platform, where the target token is sent by the battery swapping platform after verifying the identity information of the external platform based on the login request;
[0051] A data sending module, configured to transmit a data packet including a request header and battery swapping data to the battery swapping platform, so that the battery swapping platform processes the battery swapping service corresponding to the battery swapping data after determining that the request header includes the target token.
[0052] Optionally, the request sending module is specifically configured to send the login request to the battery swapping platform by calling the login interface of the battery swapping platform.
[0053] Optionally, the login request includes the encoding, key, and interface address configured by the battery swapping platform obtained by the external platform.
[0054] Optionally, the processing device further includes a data processing module, configured to perform ASCII code sorting, encryption, and signature processing on the battery swapping data in sequence.
[0055] Optionally, the processing device further includes a result receiving module, configured to receive the processing result of the battery swapping service sent by the battery swapping platform.
[0056] The fifth aspect of the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements the method for processing replacement power data described in the first aspect or the method for processing replacement power data described in the second aspect.
[0057] The sixth aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the method for processing replacement power data described in the first aspect or the method for processing replacement power data described in the second aspect.
[0058] On the basis of conforming to the common knowledge in the art, the above optional conditions can be combined arbitrarily, so as to obtain various preferred embodiments of the present invention.
[0059] The positive and progressive effects of the present invention are as follows: The replacement power platform combines the verification of the identity information of the external platform and the verification of the target token for the data packet transmitted by the external platform, realizing the transmission of replacement power data between the replacement power platform and the external platform. By double-verifying the identity information and the target token, the security of transmitting replacement power data between the replacement power platform and the external platform can be effectively improved, preventing the replacement power data from being tampered with during the transmission process, avoiding the leakage of replacement power data during the transmission process, and at the same time preventing malicious requests from impersonating identities for attacks. Description of the Drawings
[0060] Figure 1 It is a flowchart of a method for processing replacement power data provided in Embodiment 1 of the present invention.
[0061] Figure 2 It is a schematic flow diagram of step S14 provided in Embodiment 1 of the present invention.
[0062] Figure 3 It is another schematic flow diagram of step S14 provided in Embodiment 1 of the present invention.
[0063] Figure 4 It is a flowchart of another method for processing replacement power data provided in Embodiment 1 of the present invention.
[0064] Figure 5 It is a structural block diagram of a device for processing replacement power data provided in Embodiment 1 of the present invention.
[0065] Figure 6 It is a flowchart of a method for processing replacement power data provided in Embodiment 2 of the invention.
[0066] Figure 7 It is a flowchart of another method for processing replacement power data provided in Embodiment 2 of the invention.
[0067] Figure 8Flowchart of another method for processing battery swapping data provided for Embodiment 2 of the invention.
[0068] Figure 9 Block diagram of a device for processing battery swapping data provided for Embodiment 2 of the invention.
[0069] Figure 10 Schematic diagram of a method for processing battery swapping data provided for Embodiment 3 of the invention.
[0070] Figure 11 Flowchart of another method for processing battery swapping data provided for Embodiment 3 of the invention.
[0071] Figure 12 Block diagram of an electronic device provided for Embodiment 4 of the invention. Detailed implementation manners
[0072] The present invention will be further described below by way of embodiments, but the present invention is not limited to the scope of the described embodiments.
[0073] Embodiment 1
[0074] Figure 1 Schematic diagram of a method for processing battery swapping data provided for this embodiment. The method for processing battery swapping data can be executed by a device for processing battery swapping data. The processing device can be implemented in software and / or hardware, and the processing device can be part or all of an electronic device. The method for processing battery swapping data provided for this embodiment will be described below with the battery swapping platform as the execution entity.
[0075] As Figure 1 shown, the method for processing battery swapping data provided for this embodiment may include the following steps S11 to S14:
[0076] Step S11, in response to a login request from an external platform, verify the identity information of the external platform. Specifically, the battery swapping platform receives a login request sent by the external platform and verifies the identity information of the external platform in response to the login request.
[0077] Step S12, when it is determined that the identity information of the external platform is verified, send a target token to the external platform. Among them, the target token can also be referred to as a token.
[0078] Step S13, receive a data packet transmitted by the external platform. The data packet includes a request header and battery swapping data. In a specific implementation, data transmission between the battery swapping platform and the external platform can be based on the Hypertext Transfer Protocol (HTTP), and the corresponding request header is an HTTP request header.
[0079] Step S14: When it is determined that the request header includes the target token, process the corresponding battery swapping service according to the battery swapping data. Specifically, when the target token is verified successfully, the battery swapping platform processes the battery swapping service according to the battery swapping data from the external platform.
[0080] In this embodiment, by performing double verification on the identity information of the external platform and the target token, the security of battery swapping data transmission can be effectively improved, preventing the battery swapping data from being tampered with during transmission, avoiding the leakage of battery swapping data during transmission, and also preventing malicious requests from impersonating identities for attacks.
[0081] In an alternative embodiment, the login request includes the encoding and key configured by the battery swapping platform obtained by the external platform. In this embodiment, step S11 specifically includes: when it is determined that the encoding sent by the external platform is consistent with the pre-stored encoding and the key sent by the external platform is consistent with the pre-stored key, it is determined that the identity information verification of the external platform is passed.
[0082] In this embodiment, the battery swapping platform pre-configures the encoding and key for the external platform in advance, and the battery swapping platform verifies the identity information of the external platform according to the configured encoding and key for the external platform, improving the convenience and accuracy of identity verification.
[0083] In an alternative embodiment, step S12 specifically includes: sending the target token and the validity period corresponding to the target token to the external platform. In this embodiment, the target token sent by the battery swapping platform to the external platform has a validity period. After the validity period of the target token arrives, the battery swapping platform will send a new target token to the external platform again, which can further improve the security of data transmission between the battery swapping platform and the external platform.
[0084] In an alternative embodiment, as Figure 2 shown, step S14 specifically includes:
[0085] Step S141a: When it is determined that the request header includes the target token, obtain the interval duration from the current moment to the last verification of the identity information of the external platform.
[0086] Step S141b: When it is determined that the interval duration has not reached the validity period corresponding to the target token, process the corresponding battery swapping service according to the battery swapping data.
[0087] In this embodiment, when the request header includes the target token and the time interval from the last verification of the identity information of the external platform to the current moment does not reach the validity period corresponding to the target token, the battery swapping platform processes the corresponding battery swapping service according to the battery swapping data. That is, the battery swapping platform verifies both the target token and its corresponding validity period, further improving the security of data transmission between the battery swapping platform and the external platform.
[0088] It should be noted that when it is determined that the request header does not include the target token, or the time interval from the last verification of the identity information of the external platform to the current moment reaches the validity period corresponding to the target token, the battery swapping platform will not process the corresponding battery swapping service according to the received battery swapping data.
[0089] In an alternative embodiment, as Figure 3 shown, the specific steps of processing the corresponding battery swapping service according to the battery swapping data in step S14 above include:
[0090] Step S142a: Sort the battery swapping data in ASCII code, verify the signature, and decrypt it in sequence. Among them, the signature verification refers to verifying the signature, which corresponds to the signature processing of the battery swapping data by the external platform. Specifically, it is to verify the signature generated by the external platform. The signature can be MD5 signature, SHA-1 signature, SHA-256 signature, HMAC-SHA256 signature, etc. The decryption process corresponds to the encryption process of the battery swapping data by the external platform. The decryption algorithm involved in the decryption process corresponds to the encryption algorithm involved in the encryption process. Among them, the encryption algorithm can specifically be AES encryption algorithm, DES encryption algorithm, RSA encryption algorithm, etc. Correspondingly, the decryption algorithm can specifically be AES decryption algorithm, DES decryption algorithm, RSA decryption algorithm, etc.
[0091] Step S142b: Process the corresponding battery swapping service according to the decrypted battery swapping data.
[0092] In this embodiment, the battery swapping data received by the battery swapping platform is the result after being sorted in ASCII code, encrypted, and signed. Therefore, it is necessary to sort the received battery swapping data in ASCII code, verify the signature, and decrypt it to realize the decryption of the battery swapping data and ensure the security of the battery swapping data transmission.
[0093] In an alternative embodiment, as Figure 4 shown, after step S14 above, it further includes: Step S15: Send the processing result of the battery swapping service to the external platform. In this embodiment, based on the battery swapping data sent by the external platform received by the battery swapping platform, the battery swapping platform returns the corresponding processing result to the external platform after processing the battery swapping service corresponding to the battery swapping data, realizing the two-way data transmission between the battery swapping platform and the external platform.
[0094] This embodiment also provides a processing device for battery swapping data, which is applied to a battery swapping platform. As Figure 5 shown, the processing device 50 for battery swapping data includes an identity authentication module 51, a token sending module 52, a data receiving module 53, and a service processing module 54. The identity authentication module 51 is configured to verify the identity information of the external platform in response to a login request from the external platform. The token sending module 52 is configured to send a target token to the external platform when it is determined that the identity information of the external platform is verified. The data receiving module 53 is configured to receive a data packet transmitted by the external platform, and the data packet includes a request header and battery swapping data. The service processing module 54 is configured to process the corresponding battery swapping service according to the battery swapping data when it is determined that the request header includes the target token.
[0095] In an alternative embodiment, the login request includes the code and key configured by the battery swapping platform obtained by the external platform; specifically, the identity authentication module is configured to determine that the identity information of the external platform is verified when it is determined that the code sent by the external platform is consistent with the pre-stored code and the key sent by the external platform is consistent with the pre-stored key.
[0096] In an alternative embodiment, the token sending module 52 is specifically configured to send the target token and the validity period corresponding to the target token to the external platform.
[0097] In an alternative embodiment, the service processing module 54 is specifically configured to, when it is determined that the request header includes the target token, obtain the interval duration from the current moment to the last verification of the identity information of the external platform, and process the corresponding battery swapping service according to the battery swapping data when it is determined that the interval duration does not reach the validity period corresponding to the target token.
[0098] In an alternative embodiment, the service processing module 54 is specifically configured to perform ASCII code sorting, signature verification, and decryption processing on the battery swapping data in sequence, and process the corresponding battery swapping service according to the decrypted battery swapping data.
[0099] In an alternative embodiment, as Figure 5 shown, the above processing device further includes a result sending module 55, which is configured to send the processing result of the battery swapping service to the external platform.
[0100] It should be noted that the processing device for battery swapping data in this embodiment may specifically be a separate chip, a chip module, or an electronic device, or may also be a chip or a chip module integrated in an electronic device.
[0101] Regarding each module / unit included in the processing device for battery swapping data described in this embodiment, it can be a software module / unit, a hardware module / unit, or it can be partially a software module / unit and partially a hardware module / unit.
[0102] Embodiment 2
[0103] Figure 6 As shown in the flowchart of a method for processing battery swapping data provided in this embodiment, this method for processing battery swapping data can be executed by a processing device for battery swapping data. This processing device can be implemented in software and / or hardware, and this processing device can be part or all of an electronic device. The method for processing battery swapping data provided in this embodiment is applied to an external platform, corresponding to the method for processing battery swapping data applied to a battery swapping platform provided in Embodiment 1. The following takes the external platform as the execution entity to introduce the method for processing battery swapping data provided in this embodiment.
[0104] As Figure 6 shown, the method for processing battery swapping data provided in this embodiment can include the following steps S21 to S23:
[0105] Step S21: Send a login request to the battery swapping platform.
[0106] Step S22: Receive the target token sent by the battery swapping platform, where the target token is sent by the battery swapping platform after verifying the identity information of the external platform based on the login request.
[0107] Step S23: Transmit a data packet containing a request header and battery swapping data to the battery swapping platform, so that the battery swapping platform processes the battery swapping service corresponding to the battery swapping data after determining that the request header includes the target token. In a specific implementation, data transmission between the battery swapping platform and the external platform can be based on the HTTP protocol, where the corresponding request header is an HTTP request header.
[0108] In this embodiment, the external platform receives the target token sent by the battery swapping platform after successfully verifying the identity information of the external platform, and encapsulates the target token in the request header and sends it to the battery swapping platform together with the battery swapping data, so that the battery swapping platform can process the battery swapping service corresponding to the battery swapping data after successfully verifying the target token. Through double verification of the identity information and the target token, the security of transmitting battery swapping data between the battery swapping platform and the external platform can be effectively improved, preventing the battery swapping data from being tampered with during transmission, avoiding the leakage of battery swapping data during transmission, and also preventing malicious requests from impersonating identities for attacks.
[0109] In an optional implementation manner, the above step S21 specifically includes sending the login request to the battery swapping platform by calling the login interface of the battery swapping platform.
[0110] In an optional implementation manner, the login request includes the encoding, key, and interface address configured by the battery swapping platform obtained by the external platform. In this implementation manner, the battery swapping platform pre-configures the encoding, key, and interface address for the external platform, and the battery swapping platform verifies the identity information of the external platform according to the encoding and key configured for the external platform, improving the convenience and accuracy of identity verification. In addition, the external platform can transmit data packets to the battery swapping platform by calling the interface corresponding to the battery swapping platform at the interface address.
[0111] In an optional implementation manner, as Figure 7 shown, before the above step S23, there is also step S223 of sequentially performing ASCII code sorting, encryption, and signature processing on the battery swapping data.
[0112] In this implementation manner, the external platform encrypts the battery swapping data by performing ASCII code sorting, encryption, and signature processing on the battery swapping data, and only transmits the data after encrypting the battery swapping data, ensuring the security of the transmission of the battery swapping data.
[0113] In an optional implementation manner, as Figure 8 shown, after the above step S23, there is also step S24 of receiving the processing result of the battery swapping service sent by the battery swapping platform. In this implementation manner, on the basis of the external platform sending the battery swapping data to the battery swapping platform, the external platform can also receive the result of the battery swapping platform processing the battery swapping service corresponding to the battery swapping data, realizing the two-way data transmission between the external platform and the battery swapping platform.
[0114] This embodiment also provides a processing device for battery swapping data, which is applied to an external platform. As Figure 9 shown, the processing device 90 for battery swapping data includes a request sending module 91, a token receiving module 92, and a data sending module 93. The request sending module 90 is used to send a login request to the battery swapping platform. The token receiving module 91 is used to receive the target token sent by the battery swapping platform, and the target token is sent by the battery swapping platform after verifying the identity information of the external platform based on the login request. The data sending module 93 is used to transmit a data packet including a request header and battery swapping data to the battery swapping platform, so that the battery swapping platform processes the battery swapping service corresponding to the battery swapping data after determining that the request header includes the target token.
[0115] In an optional implementation manner, the request sending module 91 is specifically used to send the login request to the battery swapping platform by calling the login interface of the battery swapping platform.
[0116] In an alternative embodiment, the login request includes the encoding, key, and interface address configured by the battery swapping platform obtained by the external platform.
[0117] In an alternative embodiment, as Figure 9 shown, the above-mentioned processing device 90 further includes a data processing module 94, which is used to perform ASCII code sorting, encryption, and signature processing on the battery swapping data in sequence.
[0118] In an alternative embodiment, as Figure 9 shown, the above-mentioned processing device 90 further includes a result receiving module 95, which is used to receive the processing result of the battery swapping service sent by the battery swapping platform.
[0119] It should be noted that the processing device for the battery swapping data in this embodiment may specifically be a separate chip, chip module, or electronic device, or may also be a chip or chip module integrated in an electronic device.
[0120] Regarding each module / unit included in the processing device for the battery swapping data described in this embodiment, it may be a software module / unit, a hardware module / unit, or may also be partially a software module / unit and partially a hardware module / unit.
[0121] Embodiment 3
[0122] Figure 10 FIG. is a schematic flowchart of a method for processing battery swapping data provided in this embodiment. The method for processing battery swapping data may be jointly executed by an external platform and a battery swapping platform. The external platform is the same as the external platform in Embodiment 1 or 2, and the battery swapping platform is the same as the battery swapping platform in Embodiment 1 or 2.
[0123] As Figure 10 shown, the method for processing battery swapping data provided in this embodiment may include the following steps S31 to S34:
[0124] Step S31: The external platform sends a login request to the battery swapping platform.
[0125] Step S32: The battery swapping platform verifies the identity information of the external platform in response to the login request of the external platform.
[0126] Step S33: When the battery swapping platform determines that the identity information of the external platform is verified, it sends a target token to the external platform.
[0127] Step S34: The external platform transmits a data packet including a request header and battery swapping data to the battery swapping platform.
[0128] Step S35: When the power swapping platform determines that the request header includes the target token, it processes the corresponding power swapping service according to the power swapping data.
[0129] In this embodiment, the power swapping platform combines the verification of the identity information of the external platform and the verification of the target token for the data packet transmitted by the external platform, realizing the transmission of power swapping data between the power swapping platform and the external platform. By double-verifying the identity information and the target token, the security of the power swapping data transmitted between the power swapping platform and the external platform can be effectively improved, preventing the power swapping data from being tampered with during the transmission process, avoiding the leakage of the power swapping data during the transmission process, and at the same time preventing malicious requests from impersonating identities for attacks.
[0130] In a specific example, as Figure 11 shown, the power swapping platform pre-configures the encoding, key, and interface address for the external platform in advance. The external platform sends a login request to the power swapping platform by calling the login interface of the power swapping platform. The power swapping platform verifies the identity information of the external platform according to the configured encoding and key, and returns the token and the corresponding validity period to the external platform. After obtaining the token, the external platform saves the token and regularly updates the token according to the validity period. The external platform sorts the power swapping data in ASCII code, encrypts the power swapping data using the AES encryption algorithm, generates a string to be signed, and generates an MD5 signature according to the string to be signed. The external platform encapsulates the MD5 signature into a predefined data format, adds the saved token to the HTTP request header, and calls the interface of the power swapping platform corresponding to the interface address based on the encapsulated MD5 signature to transmit the power swapping data based on the HTTP protocol. The power swapping platform validates the token in the HTTP request header, sorts the data in ASCII code according to the predefined data format, generates a string to be signed, performs MD5 signature verification, and finally decrypts the power swapping data using the AES decryption algorithm. After the power swapping platform successfully decrypts the data, it processes the power swapping service corresponding to the power swapping data. After the processing is completed, it returns the processing result of the power swapping service to the external platform.
[0131] Embodiment 4
[0132] Figure 12 The figure shows a schematic structural diagram of an electronic device provided in this embodiment. The electronic device includes at least one processor and a memory communicatively connected to the at least one processor. Among them, the memory stores a computer program that can be run by the at least one processor. The computer program is executed by the at least one processor so that the at least one processor can execute the method for processing power swapping data in Embodiment 1 or 2. Figure 12 The electronic device 3 shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present invention.
[0133] The components of the electronic device 3 may include, but are not limited to: at least one of the above-mentioned processors 4, at least one of the above-mentioned memories 5, and a bus 6 connecting different system components (including the memory 5 and the processor 4).
[0134] The bus 6 includes a data bus, an address bus, and a control bus.
[0135] The memory 5 may include volatile memory, such as random access memory (RAM) 51 and / or cache memory 52, and may further include read-only memory (ROM) 53.
[0136] The memory 5 may also include a program / utility 55 having a set (at least one) of program modules 54. Such program modules 54 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment.
[0137] The processor 4 executes various functional applications and data processing by running computer programs stored in the memory 5, such as the method for processing battery swapping data in the above-mentioned Embodiment 1 or 2.
[0138] The electronic device 3 may also communicate with one or more external devices 7 (such as a keyboard, a pointing device, etc.). Such communication may be carried out through an input / output (I / O) interface 8. And, the electronic device 3 may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 9. As Figure 12 shown, the network adapter 9 communicates with other modules of the electronic device 3 through the bus 6. It should be understood that although Figure 12 not shown in the figure, other hardware and / or software modules may be used in combination with the electronic device 3, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (redundant array of independent disks) systems, tape drives, and data backup storage systems, etc.
[0139] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, such a division is merely exemplary and not mandatory. In fact, according to the embodiments of the present invention, the features and functions of two or more of the above-mentioned units / modules may be embodied in one unit / module. Conversely, the features and functions of one unit / module described above may be further divided and embodied by multiple units / modules.
[0140] Embodiment 5
[0141] This embodiment provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, it implements the method for processing battery replacement data in Embodiment 1 or 2.
[0142] Among them, more specifically, the readable storage medium may include but is not limited to: portable disks, hard disks, random access memories, read-only memories, erasable programmable read-only memories, optical storage devices, magnetic storage devices, or any suitable combination of the above.
[0143] In a possible implementation manner, the present invention can also be implemented in the form of a program product, which includes program code. When the program product runs on an electronic device, the program code is used to cause the electronic device to execute the method for processing battery replacement data in Embodiment 1 or 2.
[0144] Among them, the program code for executing the present invention can be written in any combination of one or more programming languages. The program code can be executed entirely on the electronic device, partially on the electronic device, executed as an independent software package, partially on the electronic device and partially on a remote device, or entirely on a remote device.
[0145] Although the specific implementation manners of the present invention have been described above, those skilled in the art should understand that this is only an example, and the protection scope of the present invention is defined by the appended claims. Without departing from the principles and essence of the present invention, those skilled in the art can make various changes or modifications to these implementation manners, but these changes and modifications all fall within the protection scope of the present invention.
Claims
1. A method for processing battery swapping data, applied to a battery swapping platform, characterized in that The method for processing battery swapping data includes: Responding to a login request from an external platform, and verifying the identity information of the external platform; When it is determined that the identity information of the external platform is verified, sending a target token to the external platform; Receiving a data packet transmitted by the external platform, where the data packet includes a request header and battery swapping data; When it is determined that the request header includes the target token, processing the corresponding battery swapping service according to the battery swapping data.
2. The method for processing battery replacement data according to claim 1, wherein, The login request includes the code and key configured by the battery swapping platform obtained by the external platform; The step of verifying the identity information of the external platform includes: When it is determined that the code sent by the external platform is consistent with the pre-stored code and the key sent by the external platform is consistent with the pre-stored key, it is determined that the identity information of the external platform is verified.
3. The method for processing battery replacement data according to claim 1, wherein The step of sending a target token to the external platform includes: sending the target token and the validity period corresponding to the target token to the external platform; And / or, the step of processing the corresponding battery swapping service according to the battery swapping data when it is determined that the request header includes the target token includes: When it is determined that the request header includes the target token, obtaining the interval duration from the current moment to the last verification of the identity information of the external platform; When it is determined that the interval duration does not reach the validity period corresponding to the target token, processing the corresponding battery swapping service according to the battery swapping data.
4. The method for processing battery swapping data according to claim 1, wherein, The step of processing the corresponding battery swapping service according to the battery swapping data includes: Sequentially performing ASCII code sorting, signature verification, and decryption processing on the battery swapping data; Processing the corresponding battery swapping service according to the decrypted battery swapping data; And / or, after the step of processing the corresponding battery swapping service according to the battery swapping data, the step further includes: Sending the processing result of the battery swapping service to the external platform.
5. A method for processing battery swapping data, which is applied to an external platform, is characterized in that The method for processing battery swapping data includes: Sending a login request to the battery swapping platform; Receiving a target token sent by the battery swapping platform, where the target token is sent by the battery swapping platform after verifying the identity information of the external platform based on the login request; Transmitting a data packet containing a request header and battery swapping data to the battery swapping platform, so that the battery swapping platform processes the battery swapping service corresponding to the battery swapping data after determining that the request header includes the target token.
6. The method for processing battery replacement data according to claim 5, wherein The step of sending a login request to the battery swapping platform includes: sending the login request to the battery swapping platform by calling the login interface of the battery swapping platform; And / or, the login request includes the code, key, and interface address configured by the battery swapping platform obtained by the external platform; And / or, before the step of transmitting a data packet containing a request header and battery swapping data to the battery swapping platform, it further includes: sequentially performing ASCII code sorting, encryption, and signature processing on the battery swapping data; And / or, after the step of transmitting a data packet containing a request header and battery swapping data to the battery swapping platform, it further includes: receiving the processing result of the battery swapping service sent by the battery swapping platform.
7. A processing device for battery swapping data, which is applied to a battery swapping platform, is characterized in that Includes: An authentication module, configured to verify the identity information of the external platform in response to a login request from the external platform; A token sending module, configured to send a target token to the external platform when it is determined that the identity information of the external platform has passed the verification; A data receiving module, configured to receive a data packet transmitted by the external platform, where the data packet includes a request header and battery swapping data; A service processing module, configured to process the corresponding battery swapping service according to the battery swapping data when it is determined that the request header includes the target token.
8. A processing device for battery swapping data, which is applied to an external platform, and is characterized in that It includes: A request sending module, configured to send a login request to the battery swapping platform; A token receiving module, configured to receive the target token sent by the battery swapping platform, where the target token is sent by the battery swapping platform after verifying the identity information of the external platform based on the login request; A data sending module, configured to transmit a data packet including a request header and battery swapping data to the battery swapping platform, so that the battery swapping platform processes the battery swapping service corresponding to the battery swapping data after determining that the request header includes the target token.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method for processing battery swapping data according to any one of claims 1-4 or the method for processing battery swapping data according to any one of claims 5-6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method for processing battery swapping data according to any one of claims 1-4 or the method for processing battery swapping data according to any one of claims 5-6.