Multi-device collaborative meter reading method and system based on swan mongolian distributed soft bus
By enabling collaborative meter reading across multiple devices through the HarmonyOS distributed soft bus, the problem of data reporting and communication interruption caused by concentrator failure was solved. This enabled seamless networking of heterogeneous terminals and ensured the continuity and traceability of meter reading tasks, reducing the risk of data loss and improving operational efficiency.
Patent Information
- Application Number
- CN202511544722.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-28
- Publication Date
- 2026-01-06
AI Technical Summary
When the concentrator acts as the aggregation point of the communication link, the failure of the concentrator has low robustness in affecting the data reporting of the entire area. Furthermore, it cannot provide complex local signature storage for breakpoint resumption when the communication link is interrupted, and it lacks scalability for heterogeneous terminals, requiring additional adapter connections.
The system adopts the HarmonyOS distributed soft bus, registers device capabilities through the soft bus adapter, enables cross-device interconnection through the Bluetooth-infrared protocol conversion module, and performs meter reading task splitting and migration through the task management module. It also detects dynamic thresholds in real time to automate task migration, ensuring data signature storage and traceability.
It enables seamless networking and capability virtualization of heterogeneous terminals, ensuring the continuity of meter reading tasks and audit traceability, reducing the risk of data loss, and improving operation and maintenance efficiency.
Smart Images

Figure CN121284096A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of multi-device collaborative meter reading based on HarmonyOS distributed soft bus, specifically involving a multi-device collaborative meter reading method and system based on HarmonyOS distributed soft bus. Background Technology
[0002] Chinese patent application number CN202410538873.1 discloses a communication method and system for a concentrator and a coordinated energy meter. This invention, by identifying and adjusting communication parameter configurations, optimizing communication protocols, and adjusting the communication method between the power supply terminal and the target area, ensures an effective communication connection between the concentrator and the target area, thereby improving the efficiency and success rate of remote meter reading. Simultaneously, through channel optimization and signal enhancement, it reduces interference and noise in communication, improves the stability and reliability of communication signals, reduces the risk of communication failures and data loss, ensures the integrity and accuracy of meter reading data, and, by optimizing communication parameter configurations and communication protocols, reduces the debugging and maintenance work of operation and maintenance personnel, lowering operation and maintenance costs and workload.
[0003] In the field of communication technology, although this invention solves the problem that when power supply managers use concentrators to remotely and centrally read meters in a target area, some users' terminals in the target area may use different communication protocols than the concentrator, making the concentrator incompatible with other communication protocols and unable to communicate with these users in the target area, the concentrator, as the aggregation point of the communication link, will affect the data reporting of the entire area when the concentrator fails, resulting in low robustness. In addition, when the communication link is interrupted, the concentrator cannot provide complex local signature storage for breakpoint resume strategy, and the concentrator relies on fixed protocol adaptation, which is insufficient for scalability when facing heterogeneous terminals and requires additional adapters for connection. Therefore, there is an urgent need for a multi-device collaborative meter reading method and system based on HarmonyOS distributed soft bus to solve the above problems. Summary of the Invention
[0004] This invention provides a multi-device collaborative meter reading method and system based on HarmonyOS distributed soft bus. The purpose is to solve the problems that when the concentrator, as the aggregation point of the communication link, fails, it will affect the data reporting of the entire area, resulting in low robustness. In addition, when the communication link is interrupted, the concentrator cannot provide complex local signature storage for breakpoint resume strategy. Furthermore, the concentrator relies on fixed protocol adaptation and has insufficient scalability when facing heterogeneous terminals, requiring additional adapters for connection.
[0005] The technical solution adopted by this invention to solve the above problems is: a system for a multi-device collaborative meter reading method and system based on HarmonyOS distributed soft bus, comprising:
[0006] The specific steps for accessing the edge gateway module are as follows: the soft bus adapter submodule registers the device capabilities and forwards events to the local channel; the message parsing and local storage submodule decodes the received events and writes them to the local database; and the operation and maintenance and unit update submodule issues signed capability version packages to the adapter.
[0007] The Bluetooth-Infrared protocol conversion module includes: a capability exposure submodule that registers device capabilities on the soft bus, a command mapping table that selects physical frames based on capabilities, a session management submodule that allocates sessions, and an event packaging submodule that signs and publishes result digests to the distributed bus.
[0008] The steps for implementing the terminal module on-site are as follows: the soft bus client agent calls the adapter and forwards the results of the event status detection, triggers local data collection based on the detection results, and generates human-computer interaction display operations;
[0009] The steps implemented by the task management and checkpoint modules are as follows: by splitting the meter reading task into ordered sub-steps, filtering duplicate data according to ID number, and the migration coordinator selects the successor to perform task migration based on checkpoints and equipment scores.
[0010] In a preferred embodiment, the specific steps of the soft bus adapter submodule registering device capabilities and forwarding events to the local channel are as follows:
[0011] By encapsulating the HarmonyOS Distributed Soft Bus, the HarmonyOS Distributed Soft Bus enables cross-device interconnection by providing unified distributed communication capabilities for device discovery, capability registration, event subscription, and remote invocation. It obtains a list of nearby devices by actively discovering nearby devices and their capability descriptions in the network. By converting device capabilities into standardized descriptors, devices can be discovered by other nodes, and their capability entries can be invoked. By subscribing to notifications of device capability changes and receiving push messages in real time, upper-layer modules can achieve real-time awareness of device status.
[0012] As a preferred implementation, the specific steps of the message parsing and local storage submodule in decoding the received events and writing them to the local database are as follows:
[0013] The edge gateway access message parser decodes unified events from the HarmonyOS distributed soft bus into business fields to obtain standardized records; the parsing results are written to the local database and signed with the edge gateway's private key and timestamped.
[0014] As a preferred implementation, the specific steps for the capability exposure submodule to register device capabilities on the soft bus are as follows:
[0015] By generating standardized capability descriptors for devices and registering these descriptors on the HarmonyOS distributed soft bus, device capabilities can be discovered and invoked. The HarmonyOS distributed soft bus obtains real-time updates on device capability status by subscribing to device capability change events.
[0016] As a preferred embodiment, the specific steps for selecting physical frames based on capabilities using the command mapping table are as follows:
[0017] By associating unified upper-layer commands with infrared frames or Bluetooth operations from various manufacturers according to semantic templates, device control commands that can be directly issued are obtained. Execution is then selected by calculating the score of each device control command using a scoring function, the formula for which is:
[0018] ,
[0019] This represents the overall matching score of candidate mapping 'a', where Point is the overall matching score and 'a' is the candidate mapping. It is a weighting coefficient for format matching. B is the format matching degree of candidate mapping table a, and B is the format matching degree. It is a weighting coefficient for payload fit. C is the payload fit of candidate mapping table a. This is a manufacturer compatibility weighting coefficient. Let D be the vendor compatibility of candidate mapping table a.
[0020] As a preferred implementation, the specific steps of the event packaging submodule in signing the result digest and publishing it to the distributed bus are as follows:
[0021] The results obtained from scanning the code are summarized and encapsulated with the device ID, session ID, serial number, device signature, and timestamp into a standard event format and a private key signature is generated. This event package is then written into the HarmonyOS distributed soft bus and an event notification is published.
[0022] As a preferred embodiment, the specific steps for the soft bus client agent to invoke the adapter and forward the results of the event status detection are as follows:
[0023] By calling the discovery and subscription interface of the soft bus adapter, access to the device's capability catalog and event-driven calls are obtained, completing the initial connection of the HarmonyOS distributed soft bus; changes in device capabilities are discovered in real time by subscribing to task events and scanning result channels; and by providing a unified call entry point to the upper layer, the human-computer interaction module and task management module can transparently call the capabilities of heterogeneous devices.
[0024] As a preferred embodiment, the specific steps of the soft bus client agent calling the adapter and forwarding the results of the event status detection further include:
[0025] By periodically collecting the terminal's operating status and constructing a dynamic threshold detection formula to detect the real-time collected data, real-time status information used for migration triggering and fault determination is obtained. The dynamic threshold detection formula is as follows:
[0026] ,
[0027] G is the mean estimate of the heartbeat interval at time e, where e is the current dynamic threshold detection time, and G is the mean estimate of the heartbeat interval. It is a smoothing factor. It is the heartbeat interval observed at the current moment. It is the mean estimate of the heartbeat interval at time e-1.
[0028] Set the safety dynamic threshold SAFE. This indicates that the device is functioning normally and will not trigger automatic migration. This will trigger automatic migration, with other nearby devices performing the migration task.
[0029] In a preferred embodiment, the migration coordinator selects a successor for task migration based on checkpoints and equipment scores, and the specific steps are as follows:
[0030] By monitoring the results of dynamic threshold detection, and calculating the device's score function based on the detection results according to capability, power consumption, and latency, the peak value of the device's score function is selected as the matching strategy to select a replacement device and perform task migration.
[0031] To achieve the same inventive objective as the above-mentioned technical solutions, this invention also provides a multi-device collaborative meter reading method based on HarmonyOS distributed soft bus, including: edge gateway initialization and deployment of soft bus adapter; deployment of Bluetooth-infrared protocol conversion middleware; deployment of on-site implementation terminals and local data collection; task aggregation and reporting.
[0032] As a preferred embodiment, the specific steps of the multi-device collaborative meter reading method based on HarmonyOS distributed soft bus are as follows: Step 1, edge gateway initialization and deployment of soft bus adapter;
[0033] Firewall configuration is completed by deploying hardware and installing device certificates on the edge gateway; a remotely manageable operational entry point is obtained by assigning a fixed management IP to the edge gateway and connecting it to the operation and maintenance VLAN; a trusted credential for message signing and authentication is obtained by generating a device key on the edge gateway; an interface for reporting and management is obtained by registering an API in the HarmonyOS distributed soft bus adapter; offline persistence and fast retrieval capabilities are obtained by initializing a local database and creating checkpoints on the edge gateway; and an indicator collection and log reporting channel is established by connecting to the operation and maintenance platform.
[0034] Step 2: Deploy Bluetooth-Infrared Protocol Conversion Middleware;
[0035] By deploying Bluetooth-infrared protocol conversion middleware and loading an initial command mapping table on the edge gateway, a capability description of the device is generated through the capability exposure submodule. The generated capability description is signed using a private key generated by the edge gateway and registered on the HarmonyOS distributed soft bus. An offset identifier is assigned to each call session, and combined with local retries and failure warnings, a failure warning is triggered when the call session fails and reaches the set session security threshold. The failure warning is recorded and manual review is triggered to correct the anomaly. Meter reading events are packaged, encapsulated, and published to the HarmonyOS distributed soft bus.
[0036] Step 3: On-site terminal triggering and local data collection;
[0037] By installing a soft bus client on the terminal in the field and calling the device discovery capability to obtain a list of device capability descriptions, the user triggers a barcode scanning operation on the interface, calls the unified interface of the Bluetooth middleware, and subscribes to the barcode scanning result event to obtain the barcode scanning feedback of the session; real-time camera images and geographical location information of the terminal are collected in real time and written into the local database.
[0038] Step 4: Summarize the tasks and report them.
[0039] The task management module generates checkpoints for each sub-step of the meter reading event, and signs the meter reading event with a specified private key and writes it to the edge persistent storage to obtain an immutable breakpoint record. By detecting the results of dynamic threshold detection in real time, an automatic migration task is triggered to select a replacement device. The new replacement device pulls and verifies the signed checkpoint, and then continues to execute the command and write a new checkpoint. A two-stage submission to the cloud is adopted. The first stage of submission is to send a pre-submission containing batch hash and batch signature to the cloud. The second stage is to send a signed submission request to the edge gateway after receiving confirmation from the cloud. After the cloud returns, the signature is marked and stored in the database.
[0040] The beneficial effects of this invention are:
[0041] 1. By deploying the HarmonyOS distributed soft bus adapter on the edge gateway and registering the device's capabilities in the form of capability descriptors, heterogeneous terminals can be uniformly discovered and transparently invoked, thereby achieving seamless networking and capability virtualization of mobile phones, infrared barcode scanners, and smart meters, and significantly reducing the coupling between upper-layer applications and lower-layer protocols.
[0042] 2. By using a proprietary Bluetooth-infrared protocol conversion middleware to map control commands from heterogeneous terminals and package readings, checkpoint signatures, and events, automatic compatibility and high-success-rate interaction between infrared or Bluetooth devices from multiple manufacturers are achieved. This ensures the immutability of checkpoints and verifiable breakpoint resuming during migration, thereby improving the continuity of meter reading tasks and audit traceability.
[0043] 3. By detecting dynamic thresholds in real time and migrating tasks based on the results of dynamic threshold detection, the system can achieve automated cross-device task migration capabilities, thereby reducing the risk of data loss and improving the overall operational efficiency of the system.
[0044] Legend
[0045] Figure 1 This is a system module diagram of a multi-device collaborative meter reading method and system based on HarmonyOS distributed soft bus.
[0046] Figure 2 This is a flowchart of a multi-device collaborative meter reading method and system based on HarmonyOS distributed soft bus.
[0047] Figure 3 This is a technical effect diagram of a multi-device collaborative meter reading method and system based on HarmonyOS distributed soft bus. Detailed Implementation
[0048] To make the technical means, creative features, and achieved objectives and effects of this invention easier to understand, the invention is further described below with reference to specific embodiments. However, the following embodiments are merely preferred embodiments of this invention and not all of them. Other embodiments obtained by those skilled in the art based on the embodiments described herein without creative effort are all within the protection scope of this invention. Unless otherwise specified, the experimental methods in the following embodiments are conventional methods, and the materials and reagents used in the following embodiments are commercially available unless otherwise specified.
[0049] Example 1 Figure 1 A system module diagram of a multi-device collaborative meter reading method and system based on HarmonyOS distributed soft bus includes: an access edge gateway module; a Bluetooth-infrared protocol conversion module; a field implementation terminal module; a task management and checkpoint module; and the specific implementation steps are as follows:
[0050] The specific steps for accessing the edge gateway module are as follows: the soft bus adapter submodule registers the device capabilities and forwards events to the local channel; the message parsing and local storage submodule decodes the received events and writes them to the local database; and the operation and maintenance and unit update submodule issues signed capability version packages to the adapter.
[0051] Specifically, the steps of the soft bus adapter submodule in registering device capabilities and forwarding events to the local channel are as follows: By encapsulating the HarmonyOS distributed soft bus, which provides unified distributed communication capabilities such as device discovery, capability registration, event subscription, and remote invocation, cross-device interconnection is successfully achieved; a list of nearby devices is obtained by actively discovering nearby devices and their capability descriptions in the network; device capabilities are transformed into standardized descriptors, enabling other nodes to discover and invoke the capability entries of the discovered devices; and upper-layer modules achieve real-time awareness of device status by subscribing to notifications of device capability changes and receiving push messages in real time. By publishing notifications of device capability changes on the HarmonyOS Distributed Soft Bus, upper-layer modules can perceive the addition or version change of device capabilities in real time. Upper-layer modules orchestrate the underlying device capabilities according to the received push information by calling the capabilities of the HarmonyOS Distributed Soft Bus and coordinating the application layer components of the business process. At runtime, by distributing device capability version packages to edge adapters, edge adapters can smoothly connect to upper-layer modules with new protocols without modification. The soft bus client is a software agent running on the edge gateway. By encapsulating the registration, discovery, subscription, and remote call interfaces of the HarmonyOS Distributed Soft Bus and performing authentication and event forwarding, upper-layer modules can transparently discover and call heterogeneous device capabilities.
[0052] The specific steps for the message parsing and local storage submodule to decode received events and write them to the local database are as follows: A message parser is connected to the edge gateway, and standardized records are obtained by decoding the unified events from the HarmonyOS distributed soft bus into business fields; the parsing results are written to the local database and signed with the edge gateway's private key and a timestamp is attached to the parsing results, thereby enabling long-term data storage when the network is disconnected.
[0053] The specific steps for the Operation and Maintenance and Unit Update submodule to issue signed version packages to the adapter are as follows: by deploying the Operation and Maintenance and Unit Update module on the edge gateway, the Operation and Maintenance and Unit Update module performs online configuration issuance, thereby providing secure upgrade capabilities for the HarmonyOS distributed soft bus adapter.
[0054] The Bluetooth-Infrared Protocol Conversion Module includes: a Capability Exposure Submodule that registers device capabilities on the soft bus; a Command Mapping Table that selects physical frames based on capabilities; a Session Management Submodule that allocates sessions; and an Event Packaging Submodule that signs and publishes result digests to the distributed bus.
[0055] Specifically, the capability exposure submodule registers device capabilities on the soft bus in the following steps: by generating standardized capability descriptors for the device and registering the standardized capability descriptors on the HarmonyOS distributed soft bus, the device capabilities can be discovered and invoked; the capability descriptor includes device identifier, capability type, transmission method, supported format, version number and public key, etc.; the HarmonyOS distributed soft bus obtains real-time updates to the device capability status by subscribing to device capability change events.
[0056] The specific steps for selecting physical frames based on capabilities using the command mapping table are as follows: First, by associating the unified upper-layer command with infrared frames or Bluetooth operations from various manufacturers according to semantic templates, device control commands that can be directly issued are obtained. Second, the semantic template maps the unified control commands of the device to the control codes of that device by identifying the device's model and protocol type, and then issues these codes to other devices via Bluetooth middleware, thereby achieving unified control across brands and protocols. Third, by constructing a scoring function to calculate the score of each device control command, execution is selected to obtain a matching strategy, ensuring that multiple devices can respond. This allows the system to automatically execute operations based on the scores, resulting in more stable operation. The formula for the scoring function is:
[0057] ,
[0058] This represents the overall matching score of candidate mapping 'a', where Point is the overall matching score and 'a' is the candidate mapping. It is a weighting coefficient for format matching. B is the format matching degree of candidate mapping table a, and B is the format matching degree. It is a weighting coefficient for payload fit. C is the payload fit of candidate mapping table a. This is a manufacturer compatibility weighting coefficient. Let D be the vendor compatibility of candidate mapping table a.
[0059] The specific steps for session management and allocation are as follows: by recording the transmission time and timeout threshold and implementing retransmission, reliable retry is obtained in the case of momentary infrared disconnection; by publishing session status events to the upper layer module, the session control capability that can be tracked and traced in real time is realized. Session status events include session ID, status code and number of retries.
[0060] The specific steps of the event packaging submodule in publishing the result digest signature to the distributed bus are as follows: by summarizing and encapsulating the results obtained from scanning with the device ID, session ID, sequence number, device signature, and timestamp into a standard event format and generating a private key signature, an immutable event package is obtained; by writing the event package into the HarmonyOS distributed soft bus and publishing the event notification, the upper-layer task management module and other terminals can subscribe in real time, thereby ensuring data consistency during cross-device migration.
[0061] The steps for implementing the terminal module on-site are as follows: the soft bus client agent calls the adapter and forwards the results of the event status detection, triggers local data collection based on the detection results, and generates human-computer interaction display operations.
[0062] Specifically, the steps for the soft bus client agent to call the adapter are as follows: by calling the soft bus adapter's discovery and subscription interface, access to the device's capability catalog and event-driven calls are obtained, thereby completing the initial connection of the HarmonyOS distributed soft bus; by subscribing to task events and scanning result channels, changes in device capabilities can be detected in real time; by providing a unified call entry point to the upper layer, the human-machine interaction module and task management module can transparently call the capabilities of heterogeneous devices.
[0063] The specific steps for detecting the forwarding event status are as follows: Terminal operating status, such as battery level and network quality, is collected periodically, and a dynamic threshold detection formula is constructed to detect the real-time collected data, thereby obtaining real-time status information used for migration triggering and fault determination. The dynamic threshold detection formula is:
[0064] ,
[0065] G is the mean estimate of the heartbeat interval at time e, where e is the current dynamic threshold detection time, and G is the mean estimate of the heartbeat interval. It is a smoothing factor. It is the heartbeat interval observed at the current moment. It is the mean estimate of the heartbeat interval at time e-1.
[0066] Set the safety dynamic threshold SAFE. This indicates that the device is functioning normally and will not trigger automatic migration. This will trigger automatic migration, with other nearby devices performing the migration task.
[0067] The specific steps for triggering local data collection based on the detection results are as follows: By writing the real-time collected data into the local database and marking it as pending reporting, the data can be persistently saved when the network is interrupted or the task is migrated. After the network is restored, the locally cached data is batch-signed and uploaded to make the data traceable.
[0068] The specific steps for generating human-computer interaction display operations are as follows: the Bluetooth-infrared protocol conversion middleware is linked to the operation trigger interface to display the session status, thereby obtaining the interaction entry point for the operator; in case of network anomalies, offline caching and a batch reporting entry point are provided to ensure the capability of offline recovery.
[0069] The steps implemented by the task management and checkpoint modules are as follows: by splitting the meter reading task into ordered sub-steps, filtering duplicate data according to ID number, and the migration coordinator selects the successor to perform task migration based on checkpoints and equipment scores.
[0070] Specifically, the steps for breaking down meter reading tasks into ordered sub-steps are as follows: the meter reading task is divided into ordered sub-steps in the order of device ID → triggering barcode scanning → collecting readings → taking photos → verifying → signing and reporting. A unique identifier is generated for each sub-step, and a sequence number and capability tag are assigned to each sub-step. This allows for precise location of the current sub-step's status during migration, thus achieving data traceability.
[0071] The specific steps for filtering duplicate data by ID number are as follows: By generating a global transaction identifier and sequence number for each checkpoint and reporting record, duplicate data is judged and filtered in real time according to the device ID number; during migration, conflicting records are merged by comparing the sequence number and signature and according to the timestamp, thereby ensuring data consistency and reducing data duplication when continuing across devices.
[0072] The migration coordinator selects a replacement device for task migration based on checkpoints and device scores. The specific steps are as follows: by listening to the results of dynamic threshold detection, and calculating the device score function according to the detection results based on factors such as capability, power consumption, and latency, the peak value of the device score function is selected as the matching strategy to select the replacement device and perform task migration, thereby ensuring the reliability of task migration.
[0073] Example 2, based on Example 1, describes a multi-device collaborative meter reading method and system using HarmonyOS distributed soft bus, such as... Figure 2 A flowchart of a multi-device collaborative meter reading method and system based on HarmonyOS distributed soft bus includes: edge gateway initialization and deployment of soft bus adapter; deployment of Bluetooth-infrared protocol conversion middleware; deployment of on-site implementation terminals and local data collection; task aggregation and edge reporting; the specific solution is as follows:
[0074] Step 1: Initialize the edge gateway and deploy the soft bus adapter;
[0075] Specifically, the initialization steps of the edge gateway are as follows: by deploying hardware such as CPU, memory, storage, network port, Bluetooth, etc. on the edge gateway and installing device certificates, and completing firewall configuration, the security isolation foundation for the operation of Bluetooth middleware and HarmonyOS distributed soft bus is met; by assigning a fixed management IP to the edge gateway and connecting it to the operation and maintenance VLAN, a remotely manageable operation entry point is obtained; by generating a device key on the edge gateway, a trusted credential for message signing and authentication is obtained.
[0076] The specific steps for deploying the soft bus adapter are as follows: Register the API in the HarmonyOS distributed soft bus adapter to obtain the interface for reporting and management; initialize the local database and create checkpoints on the edge gateway to obtain offline persistence and fast retrieval capabilities; and connect to the operation and maintenance platform and establish a channel for indicator collection and log reporting to enable online monitoring and fault reporting.
[0077] Step 2: Deploy Bluetooth-Infrared Protocol Conversion Middleware;
[0078] Specifically, the steps to deploy the Bluetooth-infrared protocol conversion middleware are as follows:
[0079] By deploying Bluetooth-infrared protocol conversion middleware and loading an initial command mapping table on the edge gateway, a capability description of the device is generated through the capability exposure submodule. The generated capability description is signed using a private key generated by the edge gateway and registered on the HarmonyOS distributed soft bus, thus making the device discoverable within the soft bus and enabling it to be discovered and invoked by other devices. An offset identifier is assigned to each invocation session, and combined with local retries and failure warnings, a failure warning is triggered when the invocation session fails and reaches a set session security threshold. The failure warning is recorded and manual review is initiated to correct any anomalies, thereby achieving… Reliable interaction on the infrared link; by packaging and publishing meter reading events to the HarmonyOS distributed soft bus, upper-layer modules can subscribe to meter reading events; the Bluetooth-infrared protocol conversion middleware is a middleware software deployed on the edge gateway, which maps the unified meter reading commands of the upper layer to specific Bluetooth or infrared physical sessions, and at the same time encapsulates and signs the readings and exposes the device capabilities to the HarmonyOS distributed soft bus, thereby realizing the semantic unified invocation of heterogeneous barcode scanning devices; the initial command mapping table contains the device's unified command identifier, model identifier, protocol type, physical frame template, etc.; meter reading events include: task ID, session ID, signature, and timestamp, etc.
[0080] Step 3: On-site terminal triggering and local data collection;
[0081] Specifically, the steps for implementing on-site terminal triggering and local data collection are as follows:
[0082] By installing a soft bus client on the field implementation terminal and invoking device discovery capabilities to obtain a list of device capability descriptions, and then triggering a barcode scanning operation on the user interface, calling the unified interface of the Bluetooth middleware, and subscribing to the barcode scanning result event, the system obtains scanning feedback for the session. Real-time camera images and geographic location information from the field terminal are collected and written to a local database. The field implementation terminal is a mobile device used for meter reading on-site. By integrating a human-machine interface and data acquisition sensors, it triggers barcode scanning and generates signed checkpoints locally, thus providing verifiable on-site evidence for task migration.
[0083] Step 4: Summarize the tasks and report them.
[0084] Specifically, the steps for task aggregation and reporting are as follows: The task management module generates checkpoints for each sub-step of the meter reading event. Each sub-step includes: device ID, triggering barcode scanning, collecting readings, taking photos, verification, and signing. A designated private key is used to sign the meter reading event and write it to edge persistent storage, thus obtaining an immutable breakpoint record. Real-time detection of dynamic threshold detection results triggers an automatic migration task to select a replacement device. The replacement device acts as the new task migration subject, pulling and verifying the latest signature checkpoint before continuing to execute commands and write the new checkpoint, thus achieving seamless cross-device continuity. A two-stage submission to the cloud is adopted. The first stage involves sending a pre-submission containing batch hashes and batch signatures to the cloud. The second stage involves sending a signature submission request to the edge gateway after receiving confirmation from the cloud. After the cloud returns, the submission is marked and stored in the database, ensuring the rollback capability and eventual consistency of the reporting process.
[0085] like Figure 3 This diagram illustrates the technical performance of a multi-device collaborative meter reading method and system based on HarmonyOS distributed soft bus. The vertical axis represents the normalized performance score, with higher scores being better. Figure 3 The graph shows the final effect of the application of the present invention and the background technology. The gray bar chart represents the effect of the present invention, and the black bar chart represents the effect of the background technology. It can be seen that when the present invention is used, the final meter reading success rate, migration recovery latency, operation and maintenance time, data loss rate and reporting latency are significantly improved compared with the background technology.
[0086] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely preferred examples and are not intended to limit the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.
Claims
1. A system for multi-device cooperative meter reading based on a distributed soft bus of the Hongmeng, characterized in that: The specific steps of accessing the edge gateway module are that the soft bus adapter submodule registers the device capability and forwards the event to the local channel, the message analysis and local storage submodule decodes the received event and writes it into the local database, and the operation and unit update submodule issues the signed capability version package under the adapter; The Bluetooth-infrared protocol conversion module includes: a capability exposure submodule that registers the device capability on the soft bus, a command mapping table that selects a physical frame according to the capability, a session management that allocates a session, and an event packaging submodule that signs and publishes the result digest to the distributed bus; The steps implemented by the field implementation terminal module are: the soft bus client agent calls the adapter, forwards the result of event state detection, triggers local data collection according to the detection result, and generates human-computer interaction display operation; The steps implemented by the task management and checkpoint module are: the meter reading task is split to generate ordered sub-steps, repeated data is filtered according to the ID number, and the coordinator migrates based on the checkpoint and device score to select a replacement to migrate the task. 2.The system of claim 1, wherein the system is characterized in that: The specific steps of the soft bus adapter submodule registering the device capability and forwarding the event to the local channel are: By encapsulating the distributed soft bus of the Hongmeng, the distributed soft bus of the Hongmeng realizes cross-device interconnection by providing unified device discovery, capability registration, event subscription, and remote calling distributed communication capabilities; by actively discovering nearby devices and the capability description of the device in the network, a list of nearby devices is obtained; by converting the device capability into a standardized descriptor, the device can be discovered by other nodes and the capability entry of the discovered device can be called; By subscribing to the notification of device capability changes and receiving push messages in real time, the upper module can realize real-time sensing of the device state. 3.The system of claim 1, wherein the system is characterized in that: The specific steps of the message analysis and local storage submodule decoding the received event and writing it into the local database are: The edge gateway accesses the message parser, decodes the unified event from the distributed soft bus of the Hongmeng into a business field to obtain a standardized record, and writes the analysis result into the local database and signs the analysis result using the private key of the edge gateway and attaches a timestamp.
4. The system for multi-device cooperative meter reading based on the distributed soft bus of the Hong Meng according to claim 1, characterized in that: The specific steps of the capability exposure submodule registering the device capability on the soft bus are: By generating a standardized capability descriptor for the device and registering the standardized capability descriptor on the distributed soft bus of the Hongmeng, the device capability can be discovered and called; the distributed soft bus of the Hongmeng subscribes to the device capability change event to obtain real-time updates of the device capability state.
5. The system for multi-device cooperative meter reading based on the distributed soft bus of the Hong Meng according to claim 1, characterized in that: The specific steps of the command mapping table selecting a physical frame according to the capability are: By associating the upper unified command with each vendor infrared frame or Bluetooth operation according to the semantic template, a device control instruction that can be directly issued is obtained; by constructing a scoring function to calculate the score of each device control instruction for selection, the formula of the scoring function is: , represents the comprehensive matching score of the candidate mapping a, Point is the comprehensive matching score, a is the candidate mapping, is the weight coefficient of the format matching degree, is the format matching degree of the candidate mapping table a, B is the format matching degree, is the weight coefficient of the payload adaptation degree, is the payload adaptation degree of the candidate mapping table a, C is the payload adaptation degree, is the weight coefficient of the vendor compatibility degree, is the vendor compatibility degree of the candidate mapping table a, D is the vendor compatibility degree.
6. The system for multi-device cooperative meter reading based on the distributed soft bus of the Hong Meng according to claim 1, characterized in that: The specific steps of the event packaging submodule signing and publishing the result digest to the distributed bus are: The result obtained by scanning the code is packaged into a standard event format by being combined with the ID, session ID, serial number, device signature and timestamp of the device, and a private key signature is generated; and the event package is written into the distributed bus of the Hongmeng and an event notification is issued. 7.The system of claim 1, wherein the system is characterized in that: The specific steps in which the soft bus client agent calls the adapter and forwards the result of the event state detection are: The initialization connection of the distributed bus of the Hongmeng is completed by calling the discovery and subscription interface of the soft bus adapter to obtain access to the capability directory of the device and event-driven calling; The change of the device capability is discovered in real time by subscribing to the task event and the scanning result channel; and the human-computer interaction module and the task management module can transparently call the capability of the heterogeneous device by providing a unified calling entry to the upper layer.
8. The system for multi-device cooperative meter reading based on the distributed soft bus of the Hong Meng according to claim 7, characterized in that: The specific steps in which the soft bus client agent calls the adapter and forwards the result of the event state detection further include: The real-time state information used for migration triggering and fault judgment is obtained by collecting the terminal running state in real time and constructing a dynamic threshold detection formula to detect the real-time collected data, and the dynamic threshold detection formula is: , is the mean estimate of the heartbeat intervals at time e, e is the time of the current dynamic threshold detection, G is the mean estimate of the heartbeat intervals, is a smoothing factor, is the heartbeat interval observed at the current time, is the mean estimate of the heartbeat intervals at time e-1, Setting a safe dynamic threshold SAFE, The device is normal and will not trigger automatic migration; Then trigger automatic migration, and other nearby devices perform the migration task. 9.The system of claim 1, wherein the system is characterized in that: The specific steps in which the migration coordinator selects a replacement for task migration based on the checkpoint and device score are: The replacement device is selected and task migration is performed by listening to the result of the dynamic threshold detection, calculating the score function of the device according to the detected result according to the capability, power and delay, and selecting the peak value of the score function of the device as the matching strategy.
10. A multi-device cooperative meter reading method based on a distributed soft bus of the Honeycomb, based on the system of any one of claims 1-9, characterized in that, The method comprises the following steps: Step one, edge gateway initialization and deployment of soft bus adapter; The firewall configuration is completed by deploying hardware and installing device certificates on the edge gateway; the running entry for remote management is obtained by assigning a fixed management IP to the edge gateway and connecting to the operation and maintenance VLAN; the trusted certificate for message signature and authentication is obtained by generating a device key on the edge gateway; the interface for reporting and management is obtained by registering the API in the distributed bus adapter of the Hongmeng; the offline persistence and fast retrieval capability is obtained by initializing the local database on the edge gateway and creating a checkpoint; the index collection and log reporting channel is established by connecting to the operation and maintenance platform; Step two, deployment of Bluetooth-infrared protocol conversion middleware; The capability description of the device is generated by deploying the Bluetooth-infrared protocol conversion middleware on the edge gateway and loading the initial command mapping table; the capability description of the device is signed using the private key generated by the edge gateway and registered on the distributed bus of the Hongmeng; a displacement identifier is assigned to each calling session, and local retry and failure warning are combined to trigger a failure warning when the calling session fails to reach the set session safety threshold; the meter reading event is packaged and encapsulated and published to the distributed bus of the Hongmeng; Step three, on-site implementation of terminal triggering and local collection; By implementing the terminal installation soft bus client on site and calling the device discovery capability to obtain the list of device capability descriptions, the user triggers the code scanning operation on the interface, calls the unified interface of the Bluetooth middleware, and subscribes to the scanning code result event to obtain the scanning code feedback of the session; By collecting the real-time camera pictures and geographic position information of the terminal in real time, and writing the above evidence into the local database; Step four, task summary and reporting; Through the task management module, a checkpoint is generated for each sub-step of the meter reading event, and the meter reading event is signed by a designated private key and written into the edge persistent storage to obtain an unalterable breakpoint record; by detecting the result of dynamic threshold detection in real time, the automatic migration task is triggered according to the result of dynamic threshold detection to select a replacement device, the new replacement device pulls and verifies the signature checkpoint, then continues to execute the instruction command and writes a new checkpoint; two-phase commit is used to report to the cloud, the first phase is to send a pre-commit containing batch hash and batch signature to the cloud; The second phase is to send a signed submission request to the edge gateway after receiving the confirmation from the cloud, and mark and store in the database after the cloud returns.
Citation Information
Patent Citations
Communication method and system for concentrator cooperating with electric energy meter
CN118118819A