A Bluetooth key testing method for an STS Bluetooth pre-payment electricity meter
By obtaining and verifying the key data of the power meter, generating an STS token and transmitting it to the power meter for decryption, and using standard protocols to judge its effectiveness, the problem that the STS prepaid power meter cannot identify the key is solved, and the accurate modification and recovery of the power meter key is achieved.
Patent Information
- Application Number
- CN202410986653.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2044-07-23
AI Technical Summary
The existing STS prepaid power meters cannot be effectively identified and recorded when using STS tokens, resulting in the user applying for the STS token using the wrong key factor, which affects the modification and recovery of the power meters key.
By obtaining the key data of the power meter, verifying its validity, generating an STS token and transmitting it to the power meter through Bluetooth for decryption, using standard protocols to judge the validity of the token, and returning the message data to determine the correctness of the key.
Accurate identification and modification of the power meter key is achieved, avoiding the problem of power meter unrecognition caused by the wrong key factor, and ensuring the accuracy of key recovery and modification.
Smart Images

Figure CN118741581B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electricity meter key testing, and in particular to a Bluetooth key testing method for an STS Bluetooth pre-payment electricity meter. Background Art
[0002] Currently, STS pre-payment electricity meters use STS tokens as the transmission medium. In daily use, STS tokens are often not well recognized and recorded. Frequent replacement of electricity meters or execution of electricity meter keys and modification of keys will result in inconsistent key factor data of the current electricity meter and the data recorded by customers, causing users to apply for STS tokens with incorrect key factors, which cannot be recognized by the electricity meter, thus affecting the modification of the electricity meter key and the retrieval of the electricity meter key. Summary of the Invention
[0003] The purpose of this application is to provide a Bluetooth key testing method for an STS Bluetooth pre-payment electricity meter to solve the problem that users apply for STS tokens with incorrect key factors, which cannot be recognized by the electricity meter, thus affecting the modification of the electricity meter key and the retrieval of the electricity meter key.
[0004] To solve the above technical problems, this application provides a Bluetooth key testing method for an STS Bluetooth pre-payment electricity meter, including:
[0005] Obtain and input the key data of the current electricity meter;
[0006] Verify the key data to ensure its validity;
[0007] Send the request packet of the key data to the corresponding interface of the encryption box, and the encryption box processes the key data according to the type of the interface and generates an STS token;
[0008] After pairing the encryption box and the current electricity meter by Bluetooth connection to the current electricity meter, send the STS token to the current electricity meter. The current electricity meter decrypts the STS token using the key data, and verifies the data format according to the decryption result of the STS token to determine the validity of the STS token, and returns message data through the standard protocol used by the current electricity meter;
[0009] Obtain the message data returned by the current electricity meter, intercept the data of the data status flag bit in the message data through the protocol standard, and determine whether the current electricity meter has completed the tasks in the STS token according to the value of the status flag bit data in the standard protocol;
[0010] If so, it indicates that the key of the current electricity meter is correct; if not, it indicates that the key of the current electricity meter is incorrect.
[0011] Display the message data.
[0012] Based on the above embodiments, as a preferred embodiment, the key data includes a meter number, a supply group code, a key version number, a key validity period, and a rate index.
[0013] Based on the above embodiments, as a preferred embodiment, verifying the data format according to the decryption result of the STS token to determine the validity of the STS token, and specifically returning the message data through the standard protocol used by the current electricity meter is as follows:
[0014] If the verification fails, abnormal message data is returned. If the verification passes, the STS token task is executed, and successful message data is returned.
[0015] Based on the above embodiments, as a preferred embodiment, before displaying the message data, it further includes:
[0016] Record the key data, the interface type of the encryption box, the STS token, and the message data.
[0017] It should be detailed in the solution that obtaining and inputting the key data of the current electricity meter includes:
[0018] When there are multiple pieces of key data, perform a Cartesian product on each piece of key data to obtain multiple combined key data.
[0019] Compared with the prior art, a Bluetooth key test method for an STS Bluetooth pre-payment electricity meter provided by the present invention has at least the following beneficial effects: By obtaining and inputting the key data of the current electricity meter, requesting an encryption box to obtain an STS token, and transmitting the STS token data to the current electricity meter using Bluetooth, the current electricity meter decrypts the STS token, and after determining the validity of the STS token, returns message data through the standard protocol used by the current electricity meter to determine whether the current electricity meter has completed the task in the STS token, that is, to determine whether the transmitted STS token data is recognized by the current electricity meter. If it can be recognized, it indicates that the key of the current electricity meter is correct. If it cannot be recognized, it indicates that the key of the current electricity meter is incorrect. In this way, the key of the current electricity meter can be modified or retrieved. Description of the Drawings
[0020] To more clearly illustrate the technical solutions of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.
[0021] Figure 1 This is a flowchart of a Bluetooth key test method for an STS Bluetooth pre-payment electric energy meter provided by an embodiment of the present application. Specific implementation manners
[0022] In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0023] The core of the present application is to provide a Bluetooth key test method for an STS Bluetooth pre-payment electric energy meter, which solves the problem that when a user applies for an STS token with an incorrect key factor, the electric energy meter cannot recognize it, thereby affecting the modification of the electric energy meter key and the recovery of the electric energy meter key.
[0024] Figure 1 This is a flowchart of a Bluetooth key test method for an STS Bluetooth pre-payment electric energy meter provided by an embodiment of the present application, see Figure 1 as shown.
[0025] Embodiment 1
[0026] A Bluetooth key test method for an STS Bluetooth pre-payment electric energy meter includes the following steps:
[0027] S101: Obtain and input the key data of the current electric energy meter; the key data includes data such as the meter number, supply group code, key version number, key validity period, rate index, etc.
[0028] S102: Verify the key data to ensure the validity of the key data;
[0029] Specifically, it is to verify the input key data to ensure the validity of the input key data. For example, for a 13-digit electric energy meter number, the first 12 digits are data, and the last digit is the check digit. The check of the meter number uses the modulo 10 algorithm. After obtaining the check word by checking the 12-digit data, it is compared with the data of the 13th digit to determine whether the input meter number data is valid. When the input key data is other types of data, there are also corresponding boundary value judgments for verification.
[0030] S103: Send the request packet of the key data to the corresponding interface of the encryption box, and the encryption box processes the key data according to the type of the interface and generates an STS token;
[0031] When the encryption box interface receives the request packet of the key data, it completes the corresponding work according to the type of the interface. For example, for the key modification function interface, after receiving the correct key data request packet, the encryption box decrypts, groups, and encrypts the incoming request packet according to its own root key to generate an STS token.
[0032] S104: After pairing the encryption box with the current electricity meter by connecting to the current electricity meter via Bluetooth, send the STS token to the current electricity meter. The current electricity meter decrypts the STS token using the key data, and verifies the data format based on the decryption result of the STS token to determine the validity of the STS token, and returns message data through the standard protocol used by the current electricity meter.
[0033] Specifically, after receiving the instruction to generate the STS token, connect to the current electricity meter via Bluetooth to achieve the pairing of the encryption box and the current electricity meter, and send the STS token to the current electricity meter. The current electricity meter decrypts the STS token using its own key data, and the decrypted data includes data such as the key type. The current electricity meter verifies the data format of the decrypted data, and determines whether the transmitted STS token is valid based on the verification result. At the same time, return message data through the standard protocol used by the current electricity meter.
[0034] Preferably, verifying the data format based on the decryption result of the STS token to determine the validity of the STS token, and returning message data through the standard protocol used by the current electricity meter specifically is:
[0035] If the verification fails, return abnormal message data indicating abnormal message data. If the verification passes, execute the STS token task and return successful message data indicating successful message data.
[0036] S105: Obtain the message data returned by the current electricity meter, intercept the data status flag bit data in the message data through the protocol standard, and determine whether the current electricity meter has completed the task in the STS token according to the value of the status flag bit data in the standard protocol. If so, enter step S106; if not, enter step S107.
[0037] S106: Indicate that the key of the current electricity meter is correct. S107: Indicate that the key of the current electricity meter is incorrect.
[0038] S108: Display the message data. Specifically, inform the user of the result of this operation by means of message reminders and other methods for the message data.
[0039] Based on Embodiment 1, a Bluetooth key test method for an STS Bluetooth pre-payment electricity meter further includes, before displaying the message data:
[0040] Record the key data, the interface type of the encryption box, the STS token, and the message data.
[0041] Based on Embodiment 1, a Bluetooth key testing method for an STS Bluetooth pre-payment electricity meter is characterized in that obtaining and inputting the key data of the current electricity meter includes:
[0042] When there are multiple pieces of key data, perform a Cartesian product on each piece of key data to obtain multiple combined key data.
[0043] Specifically, in the electricity meter key recovery function module, perform a Cartesian product on the electricity meter key data that the user may use. For example, perform a Cartesian product on all supply group codes, all key version numbers, all rate indexes, etc. that the user has used to obtain all possible permutations and combinations. Traverse and send these combined data to the encryption box to obtain the STS tokens corresponding to these combinations.
[0044] After that, send the generated multiple STS tokens to the electricity meter one by one via Bluetooth. When the electricity meter returns a successful message, stop sending the STS tokens and display the information identified by the current electricity meter to the user.
[0045] The Bluetooth key testing method for an STS Bluetooth pre-payment electricity meter provided in this embodiment obtains and inputs the key data of the current electricity meter, requests the encryption box to obtain the STS tokens, and uses Bluetooth to transmit the STS token data to the current electricity meter. The current electricity meter decrypts the STS tokens and determines the validity of the STS tokens. Then, by returning the message data using the standard protocol used by the current electricity meter, it is judged whether the current electricity meter has completed the tasks in the STS tokens, that is, whether the transmitted STS token data is recognized by the current electricity meter. If it can be recognized, it indicates that the key of the current electricity meter is correct; if it cannot be recognized, it indicates that the key of the current electricity meter is incorrect. In this way, the key of the current electricity meter can be modified or the key of the current electricity meter can be recovered.
[0046] After considering the specification and the practice of the present application, those skilled in the art will readily think of other implementation schemes of the present application. The present application aims to cover any variations, uses, or adaptive changes of the present application, and these variations, uses, or adaptive changes follow the general principles of the present application and include the common general knowledge or conventional technical means in the technical field disclosed in the present application. The specification and the embodiments are only regarded as exemplary, and the true scope of the present application is pointed out by the claims.
[0047] It should be understood that the present application is not limited to the exact structure described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The above-described embodiments of the present application do not constitute a limitation on the protection scope of the present application.
Claims
1. A Bluetooth key testing method for an STS Bluetooth pre-payment electricity meter, characterized in that, Including: Obtain and input the key data of the current electricity meter; wherein, the key data includes the meter number, supply group code, key version number, key validity period, and rate index; Verify the key data to ensure its validity; Send the request packet of the key data to the interface corresponding to the encryption box, and the encryption box processes the key data according to the type of the interface to generate an STS token; After pairing the encryption box and the current electricity meter by connecting to the current electricity meter via Bluetooth, send the STS token to the current electricity meter. The current electricity meter decrypts the STS token using the key data, and verifies the data format according to the decryption result of the STS token to determine the validity of the STS token, and returns the message data through the standard protocol used by the current electricity meter; Obtain the message data returned by the current electricity meter, intercept the data of the data status flag bit in the message data through the protocol standard, and determine whether the current electricity meter has completed the task in the STS token according to the value of the status flag bit data in the standard protocol; If so, it indicates that the key of the current electricity meter is correct; if not, it indicates that the key of the current electricity meter is incorrect; Record the key data, the interface type of the encryption box, the STS token, and the message data; Display the message data.
2. The Bluetooth key test method for the STS Bluetooth pre-payment electric energy meter according to claim 1, characterized in that The verification of the data format according to the decryption result of the STS token to determine the validity of the STS token and the return of the message data through the standard protocol used by the current electricity meter are specifically: If the verification fails, abnormal message data is returned; if the verification passes, the STS token task is executed and successful message data is returned.
3. The Bluetooth key testing method for the STS Bluetooth prepayment watt-hour meter according to claim 1, wherein The obtaining and inputting of the key data of the current electricity meter includes: When there are multiple pieces of key data, perform a Cartesian product on each piece of key data to obtain multiple combined key data.
Citation Information
Patent Citations
Prepaid card recharging method, system and device based on STS prepaid protocol and medium
CN113592481A