A data synchronization control method, storage medium and device of a single-phase Bluetooth prepayment electric meter of type A
By collecting electrical signals, establishing Bluetooth connections, writing status flags, and receiving cloud verification results in a Type A single-phase Bluetooth prepaid electricity meter, the problem of inconsistent meter data was solved, enabling instant response and asynchronous calibration, thus improving data consistency and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HAOSHENG (ZHEJIANG) INTELLIGENT ELECTRICAL TECHNOLOGY CO LTD
- Filing Date
- 2025-08-05
- Publication Date
- 2026-04-10
AI Technical Summary
Existing Type A single-phase Bluetooth prepaid electricity meters may cause instantaneous payment data errors due to signal interference or device compatibility delays. The lack of an effective cloud verification mechanism leads to inconsistencies between meter data and system deduction records, resulting in a lack of data consistency and traceability.
The main control unit collects voltage and current signals, establishes a Bluetooth connection to receive payment information, writes it to the local storage medium and attaches a status flag, receives the secondary verification result from the cloud server to correct the balance, introduces an asynchronous calibration mechanism to ensure data consistency, and optimizes sector management through an extended mapping table and jump array.
It achieves real-time response to payment information and combines it with cloud-based secondary verification, ensuring data consistency and security, improving the system's fault tolerance and the accuracy of user power supply management, and enhancing the level of intelligence in power services.
Smart Images

Figure CN120881548B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data synchronization control and storage management, and particularly relates to a data synchronization control method, a storage medium and a device of an A-type single-phase Bluetooth prepayment electric meter. BACKGROUND
[0002] The data checking of the A-type single-phase Bluetooth prepayment electric meter mainly relies on the Bluetooth communication technology to realize the close-range interaction between the user end and the electric meter. The popularity of the Bluetooth module (such as BLE 4.0 / 5.0) makes the transaction process more efficient. The user can query the power balance in real time, pay the electricity fee, display the power consumption curve and alarm information through the mobile phone APP. Some systems also support local storage of historical data, reducing the dependence on manual meter reading. However, the A-type single-phase Bluetooth prepayment electric meter on the market may cause errors in key data such as instant payment when there is signal interference or device compatibility delay, thereby causing inconsistency between the electric meter data and the system charge record. The traditional electric meter usually relies on local processing of payment information and directly updates the balance, lacks an effective verification mechanism with the cloud server, and is prone to data inconsistency, balance errors and other problems in unstable communication or network interruption. There is no specific cloud verification research and development for electric meter payment data. SUMMARY
[0003] Therefore, in order to solve the above problems in the prior art, the present application provides a data synchronization control method, a storage medium and a device of an A-type single-phase Bluetooth prepayment electric meter.
[0004] The present application protects a data synchronization control method of an A-type single-phase Bluetooth prepayment electric meter, which comprises the following steps: collecting and processing the voltage signal and the current signal through the main control unit to obtain real-time power consumption data; establishing a wireless connection between the Bluetooth communication module and the mobile terminal to receive the payment information from the mobile terminal; after receiving the payment information, performing a local balance update operation and writing the to-be-confirmed payment record into the local storage medium. The payment record contains a state flag bit, which is used to identify the verification state of the record; receiving the secondary verification result returned by the cloud server, correcting the balance of the local storage medium, and controlling the relay to realize power supply management; in the case where the above secondary checking result cannot be obtained, delaying the balance correction operation of the local storage medium until the asynchronous calibration process is completed.
[0005] Further, after receiving the payment information, a local balance update operation is performed, and a to-be-verified payment record is written into a local storage medium, the payment record including a state flag bit for identifying a verification state of the record, and the steps include: each Bluetooth electricity meter payment record is configured as a fixed-size write unit, a state flag bit, a verification field, and an electricity payment timestamp are appended when writing, the state flag bit including three states of electricity having been received, electricity to be verified, and electricity having been calibrated; the verification field is formed at the end of the payment record unit and is used for verifying the integrity of the write unit; the electricity payment timestamp is set at the middle position of the write unit and occupies 4 bytes, and the electricity payment timestamp is generated by the Bluetooth communication module; the local storage medium is a buffer structure, the buffer structure is divided into a plurality of physical sectors, an extension mapping table item is arranged in the buffer structure to realize linkage of state identification and sector allocation; the state flag bit is arranged in each extension mapping table item and is used for identifying a data type stored in the current sector; when writing the electricity payment data, idle sector groups of corresponding state types in the extension mapping table are queried according to the state flag bit of the current payment record, and the data is routed to at least one available sector in the idle sector group.
[0006] Further, the buffer structure is divided into a plurality of physical sectors, and linkage of state identification and sector allocation is realized by arranging an extension mapping table item in the buffer structure, and the steps include: the extension mapping table defines an electricity meter including a data state enumeration type, including three state values of electricity having been received, electricity to be verified, and electricity having been calibrated; an extension mapping table item structure body is constructed, including a logical address field, a physical address field, a state flag field, a CRC verification code field, and a timestamp field; the extension mapping table item structure body is allocated to each sector in the mapping table of the storage medium, and the state flag field records a state type of current data carried by the sector; when performing the electricity meter payment data operation, the target sector is located according to the state value of the state flag field.
[0007] Further, a time-ordered jump array is maintained for each sector set of a state type; the jump array includes a plurality of nodes, each jump node including a physical address field, a timestamp field, and a multi-level pointer array; for the write operation, candidate sectors meeting a time condition are sequentially traversed and filtered in a bottom linked list of the jump array according to a preset time window range, an available sector with the largest timestamp in the current jump array structure is obtained by traversing the jump array corresponding to the candidate sector, and the available sector is located as the target sector.
[0008] Further, a to-be-verified jump array is maintained for the power charge record in the to-be-verified state, and a to-be-verified jump array node includes a physical sector address, a transaction ID, a timestamp, and a multi-level forward pointer array. When the cloud server returns a secondary verification result, a quick search is performed in the to-be-verified jump array according to the transaction ID in the verification result: the transaction ID is compared from the highest layer, the target node is located in the bottom layer chain table, and the corresponding physical sector address is obtained. After the verification is passed, the state of the power charge record is updated from the to-be-verified state to the calibrated state, and the node is removed from the to-be-verified jump array and inserted into the calibrated jump array.
[0009] Further, when the storage sectors corresponding to the calibrated jump array reach the capacity threshold, automatic cleaning based on the timestamp is performed, including the following steps: real-time monitoring of the number of nodes in the calibrated jump array, triggering the cleaning process when the preset capacity threshold is reached; traversing the bottom layer chain table of the calibrated jump array, sorting in ascending order of timestamp, and preferentially selecting the oldest sectors as the to-be-cleaned objects, and cleaning the to-be-cleaned objects.
[0010] Further, the to-be-verified state of the power charge record is verified by using a polling mechanism, and the local balance correction is delayed when the communication is abnormal, including the following steps: the polling task scheduling system periodically scans the to-be-verified jump array, and filters the transaction records that have not completed cloud verification; for each to-be-verified record, a secondary verification request is initiated to the cloud server, and the request includes a transaction ID, a charge amount, a timestamp, and a locally calculated verification code; when the verification result returned by the cloud server is received, the transaction ID is compared with the local record, and the verification code consistency is verified; if the verification is passed, the state of the power charge record is updated to the calibrated state, the local balance correction operation is performed, and the above transaction record is removed from the to-be-verified jump array; if the communication is abnormal or no response is received, the balance correction operation is delayed, and the above transaction record is retained in the to-be-verified jump array for subsequent retry.
[0011] The application protects a data synchronization control device of a type A single-phase Bluetooth prepayment electric meter, comprising: a data acquisition and processing module, configured to acquire and process voltage signals and current signals through a master control unit to obtain real-time power consumption data; a Bluetooth communication module, configured to establish a wireless connection with a mobile terminal and receive payment information from the mobile terminal; a local balance updating module, configured to perform a local balance updating operation after receiving the payment information and write a to-be-confirmed payment record into a local storage medium, the payment record containing a state flag bit for identifying a verification state of the record; a secondary verification processing module, configured to receive a secondary verification result returned by a cloud server, correct the balance of the local storage medium, and control a relay to be turned on or off to realize power supply management; and an asynchronous calibration delay module, configured to delay the balance correction operation of the local storage medium until an asynchronous verification process is completed in a case where the secondary verification result cannot be obtained.
[0012] The application protects a type A single-phase Bluetooth prepayment electric meter, comprising: a processor, a memory and a communication bus, the memory storing machine readable instructions executable by the processor, the processor and the memory performing data interaction through the communication bus when the electronic device is running, and the machine readable instructions performing steps of a data synchronization control method of the type A single-phase Bluetooth prepayment electric meter when executed by the processor.
[0013] The application protects a storage medium of a type A single-phase Bluetooth prepayment electric meter, the storage medium storing a computer program and payment data, the computer program performing steps of a data synchronization control method of the type A single-phase Bluetooth prepayment electric meter as claimed in any one of claims 1 to 7 when executed by the processor.
[0014] The application protects a data synchronization control method of a type A single-phase Bluetooth prepayment electric meter, which performs a local balance update operation after receiving payment information, and writes payment records containing a state flag bit into a local storage medium. Each payment record is configured as a fixed-size write unit, with an additional state flag bit, a check field and an electricity payment timestamp. The state flag bit is used to identify three states of "electricity has been received", "electricity is to be checked", and "electricity has been calibrated". The check field ensures data integrity. The timestamp is generated by a Bluetooth module and embedded in the middle position of the write unit. The local storage adopts a buffer structure and is divided into multiple physical sectors. The state and sector allocation linkage is realized through an extended mapping table item, thereby improving the orderliness and manageability of data writing and enhancing the fine control ability of the system on the state of the payment record. On this basis, a time-ordered jump array is further maintained for each state type of sector set. The timestamp field and multi-level pointer array in the jump array node are used to filter candidate sectors and locate the optimal target sector according to the preset time window in combination with the extended mapping table during the writing operation, thereby significantly improving the electric meter data writing efficiency and sector utilization rate. Further, a to-be-checked jump array is maintained in the memory for the payment record in the "DATA_VERIFYING" state. The jump array node contains a physical address, a transaction ID, a timestamp and a multi-level forward pointer array. When the cloud server returns a secondary verification result, the target record is located through the jump array quick search mechanism, the state update and jump array migration are completed, and the response speed and accuracy of the cloud verification feedback processing are effectively improved. In addition, a polling mechanism is introduced to periodically verify the "DATA_VERIFYING" state record in the cloud, and the local balance correction is delayed in the case of communication exception. Specifically, it includes initiating a secondary verification request, comparing the transaction ID and the check code, updating the state or retaining the retry according to the verification result, thereby ensuring data consistency and system fault tolerance, and avoiding data error update problems caused by unstable network. BRIEF DESCRIPTION OF DRAWINGS
[0015] The accompanying drawings are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and are used to explain the application, but do not constitute a limitation on the application. In the drawings:
[0016] Figure 1 A flowchart of a data synchronization control method of a type A single-phase Bluetooth prepayment electric meter provided by the embodiments of the application is provided;
[0017] Figure 2 A schematic diagram of a telecommunication signal acquisition and processing provided by the embodiments of the application is provided;
[0018] Figure 3 A schematic diagram of a payment record storage structure provided by the embodiments of the application is provided;
[0019] Figure 4 A flowchart of an electric meter data partitioning and indexing provided by an embodiment of the present application;
[0020] Figure 5 A flowchart of an electric meter calibrated data clearing provided by an embodiment of the present application;
[0021] Figure 6 A structural schematic diagram of an A-type single-phase Bluetooth prepayment electric meter provided by an embodiment of the present application;
[0022] Figure 7 A structural schematic diagram of an electronic device of an A-type single-phase Bluetooth prepayment electric meter provided by an embodiment of the present application. DETAILED DESCRIPTION
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following will be combined with the accompanying drawings for the embodiments of the present application to make a clear and complete description of the technical solutions of the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments of the present application, every other embodiment obtained by a person skilled in the art without creative work belongs to the scope of protection of the present application.
[0024] It is found through research that the existing prepayment electric meter has many deficiencies in data synchronization control. The traditional electric meter usually relies on local processing of payment information and directly updates the balance, lacks an effective verification mechanism with the cloud server, and thus leads to problems such as data inconsistency, balance error, and the like under unstable communication or network interruption. In addition, the existing prepayment electric meter lacks an effective state management mechanism when facing the asynchronous calibration process of payment records, and cannot ensure the consistency and traceability of data in different stages, thereby affecting the accuracy of power supply management and the payment experience of users.
[0025] Based on this, please refer to Figure 1 The embodiments of the present application provide a data synchronization control method of an A-type single-phase Bluetooth prepayment electric meter. The method comprises the following steps:
[0026] Collecting and processing the voltage signal and the current signal to obtain real-time power consumption data;
[0027] The wireless connection between the A-type single-phase Bluetooth prepayment electric meter and the mobile terminal is established through a Bluetooth communication module, and payment information from the mobile terminal is received; after receiving the payment information, a local balance update operation is performed, and a to-be-confirmed payment record is written into a local storage medium, the payment record containing a state flag bit for identifying the verification state of the record;
[0028] The secondary verification result returned by the cloud server is received, the balance of the local storage medium is corrected, and the relay is controlled to be turned on and off to realize power supply management;
[0029] In the case where the above-mentioned secondary verification result cannot be obtained, the balance correction operation of the local storage medium is delayed to be performed until the asynchronous calibration process is completed.
[0030] The embodiment of the application provides a data synchronization control method of an A-type single-phase Bluetooth prepayment electric meter, which can realize the combination of local instant response of payment information and secondary verification of the cloud, guarantee the fast recharging experience of the user, and ensure data consistency and security. By introducing a state flag bit and an asynchronous calibration mechanism, the system can still operate stably under network abnormal conditions, support automatic re-calibration of subsequent data, improve the fault tolerance and reliability of the system. At the same time, through accurate control of the relay, the power supply state of the user is effectively managed, and the intelligent level and user experience of the power service are improved.
[0031] The data synchronization control method is described in detail as follows:
[0032] S101: Collect and process voltage signals and current signals to obtain real-time power consumption data;
[0033] In step S101, the data synchronization control system of the A-type single-phase Bluetooth prepayment electric meter realizes the collection and processing of voltage signals and current signals through a master control unit (MCU), so as to obtain real-time power consumption data of the user. Specifically, the master control unit is internally integrated with a high-precision analog-to-digital converter (ADC) for converting the analog voltage signals and current signals collected from the outside into digital signals, and performing real-time analysis and processing on these digital signals through a built-in calculation module.
[0034] The master control unit collects voltage waveforms and current waveforms in the power grid through voltage transformers and current transformers, and the sampling frequency is set to several thousand to several ten thousand times per second, so as to ensure that the dynamic changes in the user's power consumption process can be accurately captured. The collected original signals are preprocessed through filtering, amplification, etc., and then input to the ADC module for digital processing.
[0035] After the signal digitization is completed, the host unit uses integral algorithm or fast Fourier transform (FFT) and other methods to further process the voltage and current data, and calculates the current instantaneous power, active power, reactive power and cumulative power and other key parameters. These parameters constitute the core content of real-time power consumption data, and provide a basis for subsequent cost calculation, balance update and power supply control.
[0036] In addition, the host unit also periodically stores the processed real-time power consumption data to the local cache area, and uploads to the mobile terminal or cloud server through the communication module, so that the user can view the power consumption at any time, and at the same time provides reference data for the verification of payment information. The whole acquisition and processing process is driven by the timing interrupt mechanism in the host unit, ensuring the timeliness and continuity of data update, thereby ensuring the stability of system operation and the accuracy of billing.
[0037] Please refer to Figure 2 , Figure 2 A schematic diagram of an electric signal acquisition and processing provided by the embodiment of the present application. As shown in Figure 2 , the voltage sampling circuit 2a obtains the grid voltage signal through the voltage dividing resistor network 2a-1, and inputs the ADC interface 2b-1 of the host unit 2b after being processed by the signal conditioning circuit 2a-2; the current sampling circuit 2c obtains the load current signal through the current transformer 2c-1, and inputs another ADC interface 2b-2 of the host unit 2b after being amplified by the operational amplifier 2c-2. The host unit 2b performs digital filtering, effective value calculation and other processing on the collected voltage and current signals through the built-in DSP module 2b-3, and finally outputs the real-time power consumption data 2d, including voltage value 2d-1, current value 2d-2, power value 2d-3 and cumulative power 2d-4 and other parameters.
[0038] Among them, the voltage sampling circuit uses a high-precision resistor voltage dividing network to ensure that a 0-3.3V adaptive voltage signal is obtained within a 220V AC input range; the current sampling circuit uses a 5A / 2.5mA current transformer in combination with a programmable gain amplifier to achieve accurate measurement within a 0-5A current range.
[0039] For example, when the electric meter is connected to a 220V / 10A power load, the host unit collects 1000 voltage and current signals per second, and outputs the real-time power consumption data after the above processing: voltage 220.5V, current 9.8A, power 2150W, cumulative power 0.6kWh. These data will serve as the basis for subsequent billing and control. After obtaining the basic data, the mobile terminal device can be communicated based on the basic data.
[0040] S102: Establish a wireless connection with the mobile terminal through the Bluetooth communication module, receive the payment information from the mobile terminal; after receiving the payment information, perform a local balance update operation, and write the to-be-confirmed payment record into the local storage medium, the payment record contains a state flag bit, which is used to identify the verification state of the record;
[0041] In step S102, the data synchronization control system of the A-type single-phase Bluetooth prepayment electric meter establishes a stable wireless connection with the mobile terminal (such as a smart phone or a tablet computer) of the user through the built-in Bluetooth communication module (BLE module).
[0042] When the user completes the payment operation through the application program on the mobile terminal, the mobile terminal will generate a payment information package containing the payment amount, order number, transaction timestamp, and user identity, and send it to the Bluetooth communication module of the electric meter through the established Bluetooth connection. After receiving the payment information, the Bluetooth communication module forwards it to the host unit for subsequent processing.
[0043] After analyzing the payment information, the host unit first verifies its integrity and legality, including checking whether the data format is correct, whether the transaction ID is repeated, whether the payment amount is within the system set range, etc. If the verification is passed, the host unit constructs a structured payment record, which is composed of fixed-length data units, including payment amount, order number, transaction timestamp, user identity, state flag bit, and verification field. Among them, the state flag bit is used to identify the current verification state of the payment record, including "electricity has been received", "electricity to be verified" and "electricity has been calibrated", which provides the basis for the subsequent asynchronous verification process.
[0044] After the construction of the payment record, the host unit writes it into the local storage medium (such as Flash or EEPROM buffer), and automatically allocates the corresponding physical sector address according to the state flag bit, ensuring that different types of data are physically isolated in the storage space. During the writing process, the system also calculates and attaches the verification field (such as CRC16 checksum) for subsequent data integrity verification.
[0045] Finally, the payment record is saved as a complete transaction in the local storage medium, and its state flag bit is initially set to "received", indicating that the payment has completed local reception and preliminary processing, and is waiting for subsequent verification request to the cloud server, entering the asynchronous verification process. The entire communication and writing process is coordinated by the task scheduling module in the host unit, ensuring the efficiency and consistency of data flow, thereby improving the response speed and data security of the system.
[0046] Please refer to Figure 3 , Figure 3A payment record storage structure diagram is provided for the embodiments of the present application. As shown in Figure 3 The payment record 3a adopts a fixed-size write unit structure, including a state flag bit 3a-1, an electricity payment timestamp 3a-2, a payment amount 3a-3, a transaction ID 3a-4, and a verification field 3a-5. The state flag bit 3a-1 occupies 1 byte, and is used to identify the current verification state of the record, including "electricity has been received", "electricity to be verified", and "electricity has been calibrated". The electricity payment timestamp 3a-2 occupies 4 bytes, and is generated by the Bluetooth communication module when the payment information is received. The verification field 3a-5 is a 2-byte CRC check code, located at the end of the record, and is used to verify the integrity of the record.
[0047] In step S1021, the meter formats the received payment information and constructs a fixed-size payment record write unit. Specifically, each payment record is constructed as a fixed-size write unit, and a state flag bit, a verification field, and an electricity payment timestamp are appended when writing. The state flag bit is initially set to the "electricity has been received" state; the verification field is generated by using the CRC-16 algorithm; and the electricity payment timestamp records the accurate time of receiving the payment information, and is set in the middle position (bytes 33-36) of the write unit.
[0048] In step S1022, the meter divides the buffer structure into multiple physical sectors, and sets an extended mapping table item in the buffer structure to realize the linkage of state identification and sector allocation. Specifically, the extended mapping table defines a meter data state enumeration type, including DATA_RECEIVED, DATA_VERIFYING, and DATA_APPROVED state values; an extended mapping table item structure body is constructed, including a logical address field, a physical address field, a state marker field, a CRC check code field, and a timestamp field; the extended mapping table item structure body is allocated to each sector in the mapping table of the storage medium, and the state marker field records the state type of the data currently carried by the sector.
[0049] When writing the electricity payment data, the idle sector group of the corresponding state type in the extended mapping table is queried according to the state flag bit of the current payment record, and the data is routed to a certain available sector in the group.
[0050] For example, when a 100-yuan payment information is received, the meter performs the following operations:
[0051] 1. Update the local balance to the original balance + 100 yuan (temporary state)
[0052] 2. Construct a payment record write unit, and set the state flag bit to "electricity has been received"
[0053] 3. Query the extension mapping table to find an idle sector group with state DATA_RECEIVED
[0054] 4. Write the record into the latest timestamp available sector in the group
[0055] 5. Update the jump array, add the sector address to the corresponding jump array
[0056] The meter further maintains a time-ordered jump array for each state type of sector set on the basis of allocating an extension mapping table entry for each sector. The jump array is composed of jump array nodes in memory, and each jump array node contains a physical address field, a timestamp field, and a multi-level pointer array. For a write operation, within a preset time window range, sequentially traverse and filter the candidate sectors that meet the time condition in the bottom linked list of the jump array, traverse the jump array corresponding to the candidate sectors to obtain the available sector with the largest timestamp in the current table structure, and the available sector is located as the target sector.
[0057] The scheme optimizes the sector positioning efficiency through a multi-level index structure. The jump array is divided into three layers. The first array serves as a state classification entry and stores the first address pointer of the sector group of each state type (such as DATA_RECEIVED), realizing fast access. The second layer is a time index layer, which organizes sparse indexes according to the time window (timestamp_range_begin / end) and quickly locates the target period through binary search. The third array stores the specific sector linked list, and the node contains a physical address, a millisecond-level timestamp, a CRC check flag, and a bidirectional pointer, supporting accurate traversal.
[0058] In the target sector determination process, the three-layer array structure is sequentially filtered: first, state screening is performed, and the second array of the target state type is directly accessed through the first array. The format of the second array is shown in the following figure, including the time window start point, the time window end point, the offset pointing to the L2 array, and the number of sectors within the current time window.
[0059] struct JumpArray_L2 {
[0060] uint32_t timestamp_range_begin;
[0061] uint32_t timestamp_range_end;
[0062] uint16_t L2_array_offset;
[0063] int8_t sector_count;};
[0064] The second array is a time index layer, which organizes sparse indexes in time windows, and quickly locates the target period through binary search; the third array stores specific sector link lists, and the nodes contain physical addresses, millisecond-level timestamps, CRC check flags, and bidirectional pointers, supporting accurate traversal.
[0065] struct JumpArray_L3 {
[0066] uint32_t physical_addr;
[0067] uint32_t timestamp;
[0068] uint8_t crc_verified;
[0069] struct JumpArray_L2* next;
[0070] struct JumpArray_L2* prev;
[0071] };
[0072] In the second array, binary search is used to match the time window, and the corresponding third array offset is obtained; the third array link list is traversed, and CRC check (crc_verified=1) and timestamp comparison (max_timestamp is maintained) are combined to finally lock the target sector.
[0073] The sector is quickly located through the cooperative design of the extended mapping table and the jump array, wherein the extended mapping table persistently records the complete attributes of each sector, such as physical address, status flag, and CRC check code; the jump array constructs a multi-level dynamic index structure in the memory, and organizes sector physical addresses according to state classification and time sequence. When sector positioning is needed, the system first realizes state grouping of complexity through the state index layer of the jump array, then quickly reduces the search range through binary search of the time index layer, and finally accurately locks the target sector in the physical address layer in combination with the CRC verification result of the extended mapping table.
[0074] In step S1023, the electric meter maintains a to-be-verified jump array for the payment record in the DATA_VERIFYING state in the memory. The node of the to-be-verified jump array contains a physical sector address, a transaction ID, a timestamp, and a multi-level forward pointer array. When the cloud server returns a secondary verification result, according to the transaction ID in the verification result, fast search is performed in the to-be-verified jump array: starting from the highest layer of the jump array, the transaction ID is compared layer by layer to narrow the search range; finally, the target node is located in the bottom layer link list to obtain the corresponding physical sector address.
[0075] In step S1023, the electric meter performs a write operation on the local storage medium. Specifically, according to the state flag bit of the current payment record, the free sector group corresponding to the state type in the extension mapping table is queried, the latest available sector is quickly located through the jump array, the payment record is written into the sector, and the extension mapping table item and jump array node information are updated.
[0076] S103: receiving the secondary verification result returned by the cloud server, correcting the balance of the local storage medium, and controlling the relay to realize power supply management;
[0077] In step S103, the data synchronization control system of the A-type single-phase Bluetooth prepayment electric meter initiates an asynchronous verification request to the cloud server through the Bluetooth communication module or the built-in cellular communication module after completing the local reception and preliminary processing of the payment information, uploads the payment record to be confirmed (the state flag bit is "received" or "to be verified") to the cloud for legality verification.
[0078] After receiving the payment record, the cloud server performs multiple verification logic including transaction authenticity verification, user account matching, amount validity check, and anti-replay attack detection. After verification, the cloud server returns a response data packet containing the verification result to the electric meter, where the verification result includes "verification passed" or "verification failed" two state identifiers, and possibly additional error codes or supplementary information.
[0079] After receiving the secondary verification result returned by the cloud server, the main control unit first parses the response content and verifies its integrity, and then performs the corresponding balance correction operation according to the verification result. If the verification result is "verification passed", the main control unit updates the temporary balance value in the current cache to the final confirmed balance, writes it into the trusted area in the local storage medium, modifies the state flag bit of the corresponding payment record from "received" or "to be verified" to "calibrated", and updates the verification field and timestamp to ensure data consistency.
[0080] If the verification result is "verification failed", the main control unit will cancel the balance change caused by this payment and restore it to the original balance state, mark the state flag bit of the payment record as "verification failed", and record the failure reason for subsequent manual review or system log analysis. All balance modification operations are completed through atomic transaction mechanism to ensure data consistency in abnormal interruption.
[0081] While completing the balance correction, the main control unit also determines whether the power supply condition is met according to the latest account balance state. When the balance is greater than or equal to the minimum power supply threshold, the main control unit sends a closing instruction to the relay control module, so that the relay is turned on, and normal power supply to the user is restored or maintained; otherwise, if the balance is less than the minimum power supply threshold, a disconnecting instruction is sent to cut off the power supply line, thereby preventing the occurrence of underpayment behavior.
[0082] The entire verification result processing flow is driven by a state machine in the main control unit, combined with a timing task and an event triggering mechanism, to ensure that the system can respond to cloud server feedback in a timely manner and dynamically adjust the power supply strategy, thereby realizing a safe, reliable, and controllable prepayment meter management mechanism.
[0083] For example, when receiving the verification pass result of the transaction ID "20231128001":
[0084] 1. Quickly locate the transaction record in the to-be-verified jump array
[0085] 2. Update the record state to "calibrated"
[0086] 3. Confirm that the 100 yuan payment amount is valid
[0087] 4. If the corrected balance is greater than the 50 yuan arrears threshold, keep the relay closed
[0088] 5. Move the record from the to-be-verified jump array to the approved jump array
[0089] This step ensures the authenticity and reliability of the payment data through the cloud-based secondary verification mechanism, and realizes intelligent power supply control based on accurate balance management, which not only safeguards the interests of the power supplier, but also improves the user experience.
[0090] S104: In the case where the above secondary verification result cannot be obtained, the balance correction operation of the above local storage medium is delayed until the asynchronous calibration process is completed;
[0091] In step S104, the data synchronization control system of the A-type single-phase Bluetooth prepayment meter enters the asynchronous calibration process and delays the correction operation of the balance in the local storage medium if the verification result returned by the cloud server cannot be obtained in time due to network disconnection, cloud server response timeout, or communication module abnormality during the cloud-based secondary verification process of the payment record.
[0092] Specifically, the master unit starts a timing waiting task after initiating the cloud verification request, and sets a reasonable response waiting time window (for example, 30 seconds to 2 minutes). If no valid verification result feedback is received within the time window, it is determined that the communication is abnormal or the service is unreachable, and the system marks the state flag bit of the current payment record as "to be verified" and modifies the record to the to-be-verified jump array, and marks the record to participate in the subsequent asynchronous calibration process.
[0093] During this period, the temporary balance in the local cache remains valid and is used to support the user's immediate electricity demand, ensuring that the user can immediately restore power after completing the payment, improving the user experience. At the same time, the temporary balance will not be written into the trusted storage area, avoiding inconsistent account data caused by unverified payment information.
[0094] The master unit periodically attempts to re-establish communication connection with the cloud server and actively queries whether there are payment records that have not been verified. Once the network is restored or the secondary verification result from the cloud server is successfully received, the system enters the verification result processing stage, performs the corresponding balance correction operation according to the actual verification result, and updates the state flag bit and verification field of the payment record, completing data persistence.
[0095] During the entire asynchronous calibration process, the system ensures the continuity and reliability of communication through the heartbeat mechanism and retry strategy, and uses transaction logs to record key operation nodes, so that in the event of power failure or system restart, it can accurately recover to the latest valid state, ensuring data integrity and consistency.
[0096] Thus, the mechanism ensures system availability while taking into account data security and billing accuracy, achieving flexible processing capability in unstable network or unavailable service scenarios.
[0097] This physical isolation mechanism based on jump array and state identification not only improves data access efficiency, but also enhances system security and stability. For example, data in the "electricity received" state is written into a dedicated sector group, while data in the "electricity to be verified" or "electricity calibrated" state is written into corresponding physical areas, avoiding mutual interference between different types of data, and facilitating efficient execution of subsequent asynchronous verification and cleaning processes.
[0098] S1041: When the storage sector corresponding to the calibrated jump array reaches the capacity threshold, perform automatic cleaning based on the timestamp;
[0099] In step S1041, the system further optimizes the local storage management strategy, and implements a timestamp-based automatic cleaning mechanism for the payment records in the "electricity fee calibrated" state. To this end, an approved skip list is maintained in memory, which is used to index the physical sector addresses corresponding to all payment records in the "electricity fee calibrated" state.
[0100] The system periodically monitors the number of nodes in the skip list and sets a capacity threshold (e.g., 90% of the total capacity of the local storage medium). Once the number of nodes exceeds the threshold, the cleaning process is triggered to prevent the storage space from being exhausted and affecting the writing of new payment records.
[0101] After the cleaning process is started, the system traverses the underlying linked list of the approved skip list, arranges the sectors in ascending order of the electricity payment timestamp, and selects the sectors with the earliest time as the cleaning objects. If there are multiple records with the same timestamp, the transaction ID is used as the secondary sorting key in ascending order to ensure the uniqueness and predictability of the cleaning order.
[0102] Subsequently, the system performs an atomic deletion operation on the selected cleaning sectors, removes their metadata entries in the extended mapping table, and releases them back to the free pool for subsequent write operations. The entire cleaning process is completed without affecting the normal business logic, ensuring the continuity and stability of the system operation.
[0103] S1042: Adopt a polling mechanism to verify the payment records in the "electricity fee to be verified" state, and delay the local balance correction when communication is abnormal;
[0104] In step S1042, the system further introduces a polling mechanism to handle payment records in the "electricity fee to be verified" state. To this end, another verifying skip list is maintained in memory, which contains physical sector addresses, transaction IDs, timestamps, and verification codes, etc. key information, supporting fast lookup and state update.
[0105] The system periodically scans the skip list (e.g., every 5 minutes), filters out payment records that have not completed the cloud-side secondary verification, and initiates a verification request to the cloud server for each record. The request content includes the transaction ID, payment amount, electricity payment timestamp, and locally calculated verification code (such as CRC32), which is used to verify the integrity and legality of the payment record.
[0106] When receiving the check result returned by the cloud server, the system first compares whether the transaction ID matches the local record, and then verifies the consistency of the check code. If the check is passed, the state of the payment record is updated from "electricity to be checked" to "electricity has been calibrated", and the local balance correction operation is performed to update the temporary balance to the final confirmed balance. At the same time, the record is removed from the to-be-checked jump array and inserted into the approved jump array, completing the state migration.
[0107] If the communication is abnormal or no response is received, the system delays the balance correction operation, keeps the payment record in the to-be-checked jump array, and marks it as a retry state. The system will try to submit the check request again in the subsequent periodic polling task until valid feedback is obtained.
[0108] This mechanism effectively solves the data consistency problem in the case of unstable network or unreachable service, and ensures that the integrity of local data and the accuracy of power control can be maintained even in the case of communication interruption, thereby realizing a high-reliability prepayment meter data synchronization control scheme.
[0109] Please refer to Figure 6 , Figure 6 The structure diagram of an A-type single-phase Bluetooth prepayment meter provided by an embodiment of the present application is shown in the figure. Figure 6 As shown in the figure, the data synchronization control device 600 comprises:
[0110] The data acquisition and processing module 610 is configured to collect and process the voltage signal and the current signal through the master control unit to obtain real-time power consumption data.
[0111] The Bluetooth communication module 620 is configured to establish a wireless connection with the mobile terminal and receive payment information from the mobile terminal.
[0112] The local balance updating module 630 is configured to perform a local balance updating operation after receiving the payment information, and write a to-be-verified payment record into a local storage medium, the payment record containing a state flag bit used to identify a verification state of the record; wherein each electric meter payment record is configured as a fixed-size write unit, and the state flag bit, a verification field and an electricity payment timestamp are attached when writing, the state flag bit including three states of "electricity received", "electricity to be verified" and "electricity verified"; the verification field is formed at the end of the payment record unit and is configured as 2 bytes, and is used to verify the integrity of the write unit; the electricity payment timestamp is set at a middle position of the write unit and occupies 4 bytes, and is generated by the Bluetooth communication module; the local storage medium is a buffer structure, and the buffer structure is divided into a plurality of physical sectors, and an extended mapping table item is arranged in the buffer structure to realize linkage between state identification and sector allocation; each extended mapping table item is added with a state marking bit used to identify a data type stored in a current sector; when writing the electricity payment data, a free sector group corresponding to a state type in the extended mapping table is queried according to the state flag bit of the current payment record, and the data is routed to an available sector in the group.
[0113] The secondary verification processing module 640 is configured to receive a secondary verification result returned by the cloud server, correct the balance of the local storage medium, and control a relay to realize power supply management; wherein the extended mapping table defines an electric meter data state enumeration type, including three state values of DATA_RECEIVED, DATA_VERIFYING and DATA_APPROVED; an extended mapping table item structure is constructed, including a logical address field, a physical address field, a state marking field, a CRC check code field and a timestamp field; the extended mapping table item structure is allocated to each sector in the mapping table of the storage medium, and the state marking field is used to record a state type of data currently carried by the sector; when performing a read-write electric meter payment data operation, a target sector is located according to a state value of the state marking field; further, on the basis of allocating the extended mapping table item to each sector, a jump array sorted by time is also maintained for a sector set of each state type; the jump array is composed of jump array nodes in the memory, and each jump array node includes a physical address field, a timestamp field and a multi-level pointer array; for a write operation, candidate sectors meeting a time condition are sequentially traversed and filtered in a bottom linked list of the jump array according to a preset time window range, an available sector with the largest timestamp in a current jump array is obtained by traversing the jump array corresponding to the candidate sectors, and the available sector is located as the target sector;
[0114] The asynchronous calibration delay module 650 is used for delaying the balance correction operation of the local storage medium until the asynchronous calibration process is completed when the secondary verification result cannot be obtained; wherein, a to-be-verified jump array is maintained for the payment record in the DATA_VERIFYING state in the memory; the to-be-verified jump array node includes a physical sector address, a transaction ID, a timestamp and a multi-level forward pointer array; when the cloud server returns the secondary verification result, a quick search is performed in the to-be-verified jump array according to the transaction ID in the verification result: starting from the highest layer of the jump array, the transaction ID is compared layer by layer to narrow the search range; finally, the target node is located in the bottom layer chain table, and the corresponding physical sector address is obtained; after the verification is passed, the state of the payment record is updated from DATA_VERIFYING to DATA_APPROVED; the node is removed from the to-be-verified jump array and inserted into the calibrated jump array; when the storage sectors corresponding to the calibrated (DATA_APPROVED) jump array reach the capacity threshold, the number of nodes in the calibrated jump array is monitored in real time, and when the preset capacity threshold is reached, the cleaning process is triggered; the bottom layer chain table of the approved jump array is traversed, sorted in ascending order of timestamp, and the oldest sectors are preferentially selected as the to-be-cleaned objects, and the to-be-cleaned objects are cleaned; the payment record in the to-be-verified (DATA_VERIFYING) state is verified by the cloud using a polling mechanism, and the local balance correction is delayed when the communication is abnormal; specifically, the polling task scheduling system periodically scans the to-be-verified jump array, and screens the transaction records that have not completed cloud verification; for each to-be-verified record, a secondary verification request is initiated to the cloud server, and the request includes a transaction ID, a payment amount, a timestamp and a locally calculated verification code; when the verification result returned by the cloud server is received, the transaction ID is compared with the local record, and the verification code consistency is verified; if the verification is passed, the payment record state is updated to calibrated (DATA_APPROVED), the local balance correction operation is performed, and the record is removed from the to-be-verified jump array; if the communication is abnormal or no response is received, the balance correction operation is delayed, and the record is retained in the to-be-verified jump array for subsequent retry.
[0115] The data synchronization control device of the A-type single-phase Bluetooth prepayment electric meter provided by the embodiments of the present application can effectively solve the problem of unreliable data synchronization of the traditional prepayment electric meter in the case of unstable communication, realize a double protection mechanism combining local instant feedback and cloud asynchronous verification, and improve data consistency and user payment experience.
[0116] Please refer to Figure 7 , Figure 7 A structure schematic diagram of the A-type single-phase Bluetooth prepayment electric meter provided by the embodiments of the present application. As Figure 7As shown, the electric meter 700 includes a processor 710, a memory 720 and a communication bus 730;
[0117] The memory 720 stores machine readable instructions executable by the processor 710, and when the electric meter 700 is running, the processor 710 and the memory 720 exchange data through the communication bus 730; when the machine readable instructions are executed by the processor 710, the steps of the data synchronization control method of the A-type single-phase Bluetooth prepayment electric meter in the foregoing method embodiments can be performed, and the specific implementation manners can be referred to the method embodiments, which will not be described here.
[0118] The application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data synchronization control method of the A-type single-phase Bluetooth prepayment electric meter in the foregoing method embodiments can be performed, and the specific implementation manners can be referred to the method embodiments, which will not be described here.
[0119] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0120] In several embodiments provided in the application, it should be understood that the disclosed system, device and method can be implemented by other manners. The device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some communication interfaces, devices or units, which can be electrical, mechanical or other forms.
[0121] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment scheme.
[0122] In addition, each functional unit in each embodiment of the application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit.
[0123] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a nonvolatile computer readable storage medium executable by a processor. Based on this understanding, the technical solutions of the present application essentially or the part of the prior art or the part of the technical solutions of the present application can be embodied in the form of software products. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present application. The foregoing storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and various program code storage media.
[0124] Finally, it should be noted that: the above-described embodiments, only for the specific embodiments of the present application, to illustrate the technical solutions of the present application, rather than limit it, the protection scope of the present application is not limited to this, although the prior art is described in detail, those skilled in the art should understand: any familiar with the technical field of the technical personnel in the technical range disclosed by the present application, it still can be modified or easily thought of changes to the technical solutions recorded in the foregoing examples, or part of the technical features of the equivalent replacement; and these modifications, changes or replacement, do not make the corresponding technical solutions of the essence of the present application deviate from the spirit and scope of the technical solutions of the present application, all should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A data synchronization control method of a single-phase Bluetooth prepayment electric meter of type A, comprising the following steps: collecting and processing voltage signals and current signals to obtain real-time power consumption data; establishing a wireless connection with a mobile terminal through a Bluetooth communication module and receiving payment information from the mobile terminal; after receiving the payment information, performing a local balance update operation and writing a to-be-verified payment record into a local storage medium, the payment record containing a state flag bit for identifying the verification state of the record; the local storage medium is a buffer structure, the buffer structure is divided into a plurality of physical sectors, and an extended mapping table item is arranged in the buffer structure to realize linkage between state identification and sector allocation; each extended mapping table item is provided with the state flag bit for identifying the data type stored in the current sector; when writing payment data, the idle sector group corresponding to the state type is queried in the extended mapping table according to the state flag bit of the current payment record, and the data is routed to at least one available sector in the idle sector group; when performing an electric meter payment data operation, the target sector is located according to the state value of the state flag field; a time-ordered jump array is maintained for each sector set of a state type, the jump array is divided into three layers, the first layer array is used as a state classification entrance and stores a sector group first address pointer of each state type to realize fast access, the second layer array is a time index layer and is organized in a time window to quickly locate a target period through binary search, and the third layer array stores a specific sector linked list; the jump array is composed of a plurality of nodes, each jump node contains a physical address field, a timestamp field and a multi-level pointer array; for the writing operation, candidate sectors meeting the time condition are sequentially traversed and filtered in the bottom layer linked list of the jump array according to a preset time window range, an available sector with the largest timestamp in the current jump array structure is obtained by traversing the jump array corresponding to the candidate sectors, and the available sector is located as the target sector; a secondary verification result returned by a cloud server is received, the balance of the local storage medium is corrected, and a relay is controlled to realize power supply management; a to-be-verified jump array is maintained for payment records in a to-be-verified state; the node of the to-be-verified jump array contains a physical sector address, a transaction ID, a timestamp and a multi-level forward pointer array; when the secondary verification result is returned by the cloud server, a quick search is performed in the to-be-verified jump array according to the transaction ID in the verification result: the transaction ID is compared from the first layer, the target node is located in the bottom layer linked list, and the corresponding physical sector address is obtained; after the verification passes, the state of the payment record is updated from a to-be-verified state to a verified state; the node is removed from the to-be-verified jump array and inserted into a verified jump array; in the case where the secondary verification result cannot be obtained, the balance correction operation of the local storage medium is delayed until the asynchronous verification process is completed. 2.The data synchronization control method of the single-phase Bluetooth prepayment electric meter of type A according to claim 1. The local balance update operation is performed after receiving the payment information, and a to-be-verified payment record is written into the local storage medium, and the payment record contains a state flag bit for identifying the verification state of the record. Each Bluetooth electricity payment record is configured as a fixed-size write unit, and a state flag bit, a verification field, and an electricity payment timestamp are appended when writing, the state flag bit includes three states of electricity received, electricity to be verified, and electricity calibrated; the verification field is 2 bytes long and is formed at the end of the payment record unit to verify the integrity of the write unit; The electricity payment timestamp is set in the middle of the write unit and occupies 4 bytes, and the electricity payment timestamp is generated by the Bluetooth communication module.
3. The data synchronization control method of the A-type single-phase Bluetooth prepayment electricity meter according to claim 2, characterized in that, The buffer structure is divided into multiple physical sectors, and the extension mapping table item in the buffer structure is used to realize the linkage between state identification and sector allocation. The extension mapping table defines the data state enumeration type of the electricity meter, including three state values of electricity received, electricity to be verified, and electricity calibrated. An extension mapping table item structure body is constructed, including a logical address field, a physical address field, a state marker field, a CRC check code field, and a timestamp field. The extension mapping table item structure body is allocated to each sector in the mapping table of the storage medium, and the state marker field is used to record the state type of the data currently carried by the sector.
4. The data synchronization control method of the A-type single-phase Bluetooth prepayment electricity meter according to claim 1, characterized in that, When the storage sectors corresponding to the calibrated jump array reach the capacity threshold, an automatic cleaning based on the timestamp is performed, including the following steps: Real-time monitoring of the number of nodes in the calibrated jump array, when reaching the preset capacity threshold, triggering the cleaning process; Sort the bottom-up link list of the calibrated jump array in ascending order of timestamp, and preferentially select the oldest sectors as the to-be-cleaned objects, and clean the to-be-cleaned objects.
5. The data synchronization control method of the A-type single-phase Bluetooth prepayment electricity meter according to claim 1, characterized in that, The payment record in the to-be-verified state is verified by the polling mechanism, and the local balance correction is delayed when the communication is abnormal, including the following steps: The polling task scheduling system periodically scans the to-be-verified jump array to filter the transaction records that have not completed the cloud verification; For each to-be-verified record, a second verification request is sent to the cloud server, and the request contains the transaction ID, the payment amount, the timestamp, and the locally calculated check code; When receiving the verification result returned by the cloud server, compare the transaction ID with the local record to verify the consistency of the check code; If the verification is passed, update the payment record state to calibrated, perform the local balance correction operation, and remove the transaction record from the to-be-verified jump array; If the communication is abnormal or no response is received, delay the balance correction operation, and keep the transaction record in the to-be-verified jump array for subsequent retry.
6. A data synchronization control device for an A-type single-phase Bluetooth prepayment electricity meter, characterized in that, Comprise: Data acquisition and processing module, for collecting and processing voltage signal and current signal through the host unit, to obtain real-time power consumption data; Bluetooth communication module, for establishing wireless connection with mobile terminal, receiving payment information from mobile terminal; In the execution of the meter payment data operation, according to the state value of the state mark field to locate the target sector; For each state type of sector set to maintain a time ordered jump array, the jump array is divided into three layers, the first layer array is used as the state classification entrance, stores the sector group first address pointer of each state type, realizes fast access, the second layer array is time index layer, organizes sparse index according to time window, quickly locates target period through binary search, the third layer array stores specific sector chain table; The jump array is composed of multiple nodes, each jump node contains physical address field, timestamp field and multi-level pointer array; Local balance update module, for receiving payment information, executing local balance update operation, and writing the to-be-confirmed payment record into the local storage medium, the payment record contains state flag bit, used to identify the check state of the record; The above local storage medium is buffer structure, the buffer structure is divided into multiple physical sectors, the buffer structure is provided with extension mapping table item to realize the linkage of state identification and sector allocation; Each extension mapping table item is provided with the above state mark bit, used to identify the data type stored in the current sector; When writing the electricity payment data, according to the state flag bit of the current payment record, query the idle sector group of the corresponding state type in the extension mapping table, and route the data to at least one available sector in the idle sector group; For the above write operation, according to the preset time window range, the candidate sectors meeting the time condition are sequentially traversed and screened in the bottom chain table of the jump array, the jump array corresponding to the candidate sector is traversed to obtain the available sector with the maximum timestamp in the current jump array structure, and the available sector is located as the target sector; Secondary verification processing module, for receiving the secondary verification result returned by the cloud server, correcting the balance of the local storage medium, and controlling the relay on-off to realize power supply management; For the payment record of the electricity to be checked state, a to-be-checked jump array is maintained; The to-be-checked jump array node contains physical sector address, transaction ID, timestamp and multi-level forward pointer array; When the cloud server returns the secondary verification result, according to the transaction ID in the verification result, fast search is performed in the to-be-checked jump array: the transaction ID is compared from the first layer, the target node is located in the bottom chain table, and the corresponding physical sector address is obtained; After the verification, the state of the payment record is updated from electricity to be checked to electricity to be calibrated; The node is removed from the to-be-checked jump array and inserted into the calibrated jump array; Asynchronous calibration delay module, for delaying the balance correction operation of the above local storage medium when the above secondary verification result cannot be obtained, until the asynchronous calibration process is completed.
7. A type A single-phase Bluetooth prepayment meter, characterized in that, Comprise: The processor, the memory and the communication bus, the memory stores the machine readable instructions executable by the processor, when the electronic device runs, the processor and the memory through the communication bus for data interaction, the machine readable instructions are executed by the processor when executing the steps of the data synchronization control method of the A type single-phase Bluetooth prepayment electric meter of any one of claims 1 to 5.
8. A storage medium for an A type single-phase Bluetooth prepayment electric meter, characterized in that, The storage medium stores a computer program and payment data, and the computer program is executed by the processor to execute the steps of the data synchronization control method of the A type single-phase Bluetooth prepayment electric meter of any one of claims 1 to 5.
Citation Information
Patent Citations
Special IC card intelligent water meter capable of being stored for rural water supply and remote payment method
CN119625889A
Embedded data storage method and device, terminal equipment and storage medium
CN120353386A