Microservice-based meter data processing methods, equipment, and storage media
By using a microservice architecture and the mapping relationship with the service registry, combined with dependency injection in the constructor, the problem of high service coupling in traditional electricity meter data processing systems is solved, enabling flexible expansion and efficient maintenance of the electricity meter data processing system.
Patent Information
- Application Number
- CN202611254206.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-18
- Publication Date
- 2026-11-17
AI Technical Summary
Traditional electricity meter data processing systems have high service coupling, with business logic and service implementation hard-bound, resulting in low code reusability, high expansion and iteration costs, and an inability to adapt to the continuous iteration needs of electricity meter data processing.
By adopting a microservice architecture, the mapping relationship between microservice interfaces and microservice instances is maintained through a service registry center, and dependency injection is implemented using constructors. This breaks the strong coupling between business logic and service implementation, enabling the discovery and flexible construction of service capabilities.
It improves code reusability, reduces the cost of expansion and iteration, and enables flexible combination of business services and system scalability and maintainability.
Smart Images

Figure CN123114792A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of electricity meter data processing, specifically involving electricity meter data processing methods, devices, and storage media based on microservice architecture. Background Technology
[0002] With the rapid development of smart grid technology, electricity information collection systems have become a core component of the power metering system. Efficient processing of meter data is a crucial foundation for supporting electricity metering, load monitoring, and operation and maintenance management. The architecture design of the meter data processing system directly affects the system's functional scalability, operational stability, and operational economy.
[0003] Currently, traditional electricity meter data processing systems generally adopt a monolithic architecture, where all services are compiled and linked into a single executable business service program. Interaction between services is achieved through direct function calls, and the construction of business services is hard-bound to the implementation of specific services. In this architecture, services are highly coupled, and modifications to a single service can easily trigger a chain reaction, making code reuse difficult. Furthermore, adding new business services or upgrading existing services requires recompiling and re-deploying the entire system, making it impossible to flexibly assemble required service capabilities based on standardized interfaces. This results in long system expansion cycles, high maintenance costs, and difficulty in adapting to the continuously evolving needs of electricity meter data processing.
[0004] Therefore, how to break the service coupling relationship of electricity meter data processing and realize the discoverability and injection of service capabilities and the flexible construction of business services is a technical problem that urgently needs to be solved in the current technology field. Summary of the Invention
[0005] The purpose of this application is to break the service coupling relationship of electricity meter data processing, and to realize the discoverability and injection of service capabilities and the flexible construction of business services.
[0006] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.
[0007] According to one aspect of the embodiments of this application, a method for processing electricity meter data based on a microservice architecture is provided. The microservice architecture has multiple microservices, and the microservice interfaces of each microservice can be discovered in a service registry. The microservice instances of the microservices have a mapping relationship with the microservice interfaces.
[0008] The electricity meter data processing method includes: Obtain the constructor function and use the microservice interface of the microservice required by the constructor function as the target interface; Obtain the microservice instance corresponding to the target interface, and use the microservice instance as the target instance; The target instance is injected through the constructor, and a business service is generated in conjunction with the target interface. The business service calls the target instance through the target interface to process the meter data.
[0009] According to one aspect of the embodiments of this application, the electricity meter data processing method further includes: The composite service is split according to the service type to obtain multiple independent microservices; For any microservice, obtain the microservice instance and microservice interface of the microservice, and establish a mapping relationship between the microservice instance and the microservice interface; Register the microservice interface and microservice instance to the service registry center so that the microservice interface can be discovered and the microservice instance can be invoked through the microservice interface.
[0010] According to one aspect of the embodiments of this application, the electricity meter data processing method further includes: For any microservice, if a new version of the microservice is detected, the microservice is treated as the old version and the new version of the microservice is downloaded. The new version of the microservice is verified. If the verification is successful, the old version of the microservice is disabled, uninstalled, and backed up, and the new version of the microservice is installed and activated. If the verification fails, the installation of the new version of the microservice is stopped. The new version of the microservice is tested. If the test fails, the new version of the microservice is uninstalled and the backed-up old version of the microservice is reactivated. If the test succeeds, the new version of the microservice continues to be used.
[0011] According to one aspect of the embodiments of this application, the electricity meter data processing method further includes: For any microservice, if a new version of the microservice is detected, the microservice is treated as the old version and the new version of the microservice is downloaded. The new version of the microservice is tested. If the test is successful, the new version of the microservice is installed. If the test fails, the installation of the new version of the microservice is stopped. The service interfaces of the old version of the microservice and the new version of the microservice are different. Based on the runtime of the new microservice, a consistent hashing weight strategy is used to allocate workload between the new and old microservices, so that the new and old microservices run according to the workload allocation until the old microservice no longer receives workload allocation; wherein, the longer the runtime of the new microservice, the more workload is allocated to the new microservice.
[0012] According to one aspect of the embodiments of this application, the electricity meter data processing method further includes: If an anomaly occurs during the operation of the new version of the microservice, all workload will be distributed to the old version of the microservice.
[0013] According to one aspect of the embodiments of this application, the electricity meter data processing method further includes: Based on the constructor, the calling order of each target interface in the business service is determined, so that the target instance is called sequentially through each target interface according to the calling order to realize the processing of the meter data.
[0014] According to one aspect of the embodiments of this application, the electricity meter data processing method further includes: The microservices are in the following states: installed, activated, disabled, and uninstalled. Each microservice is processed according to its state. The microservices change states in a fixed order and cannot undergo jump-state changes.
[0015] According to one aspect of the embodiments of this application, the electricity meter data processing method further includes: If there is a bidirectional dependency between the microservices required by the constructor, then the microservices are treated as bidirectional microservices. For each bidirectional microservice, create a service tracer for the target interface corresponding to the bidirectional microservice; If the target instance corresponding to the target interface is available, then the constructor of the target instance corresponding to the target interface is injected.
[0016] According to one aspect of the embodiments of this application, a meter data processing device based on a microservice architecture is provided, including a memory, a processor, and a readable program stored in the memory, wherein the processor executes the readable program to implement the method described in any of the above.
[0017] According to one aspect of the embodiments of this application, a readable storage medium is provided, on which a readable program / instruction is stored, which, when executed by a processor, implements the method described in any of the preceding claims.
[0018] This application provides a method for processing electricity meter data based on a microservice architecture. The microservice architecture contains multiple microservices, and the microservice interfaces of each microservice are discoverable in a service registry. There is a mapping relationship between microservice instances and microservice interfaces. The method includes: obtaining a constructor function and using the microservice interface required by the constructor function as the target interface; obtaining the microservice instance corresponding to the target interface and using the microservice instance as the target instance; injecting the target instance through the constructor function and generating a business service in conjunction with the target interface; and the business service calling the target instance through the target interface to process the electricity meter data.
[0019] This solution addresses the technical challenges of traditional electricity meter data processing systems, including high service coupling, hard binding between business logic and service implementation, low code reusability, and high costs associated with expansion and iteration. By establishing a service registry within a microservice architecture, it maintains the mapping between microservice interfaces and microservice instances, enabling microservice discovery. Dependency injection is then performed via constructors. Business services only need to declare the target interfaces they depend on in their constructors to automatically match and inject the corresponding target instances, completing the business service assembly without requiring hard-coding of specific service implementations in the business code. This breaks the strong coupling between business logic and the underlying microservice implementation, allowing each microservice to iterate and optimize independently without affecting business operations, effectively improving code reusability. Furthermore, business services can flexibly combine different microservice capabilities through interfaces, enabling rapid assembly and implementation of new business functions without requiring a complete system rewrite, significantly enhancing the system's scalability and maintainability.
[0020] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.
[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0022] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0023] Figure 1 A flowchart of a microservices-based method for processing electricity meter data is shown according to an embodiment of this application.
[0024] Figure 2 A flowchart illustrating the registration of a microservice according to an embodiment of this application is shown.
[0025] Figure 3 A flowchart illustrating the updating of a microservice according to an embodiment of this application is shown.
[0026] Figure 4 A flowchart of updating a microservice according to another embodiment of this application is shown.
[0027] Figure 5 A block diagram of a computer device structure for implementing a microservices-based meter data processing method according to an embodiment of this application is shown. Detailed Implementation
[0028] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.
[0029] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.
[0030] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0031] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0032] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0033] In some embodiments, this application provides a meter data processing device (system) based on a microservice architecture. This device (system) incorporates a meter data processing architecture—a microservice architecture: multiple independent microservices are set up within the microservice architecture. The microservice interfaces of each microservice can be discovered in a service registry, and a mapping relationship exists between microservice instances and microservice interfaces. Based on this architecture, by resolving dependencies through constructors, matching service instances, completing dependency injection, and assembling business services, meter data processing is ultimately achieved, realizing the technical effect of decoupling business logic from the specific implementation of microservices.
[0034] Please see Figure 1 , Figure 1 A flowchart illustrating a microservice-based method for processing electricity meter data according to an embodiment of this application is shown. This application provides execution steps for a microservice-based method for processing electricity meter data, including: Step S110: Obtain the constructor and use the microservice interface of the microservice required by the constructor as the target interface; Step S120: Obtain the microservice instance corresponding to the target interface, and use the microservice instance as the target instance; Step S130: Inject the target instance through the constructor and generate business services in conjunction with the target interface; In step S140, the business service calls the target instance through the target interface to process the meter data.
[0035] The four steps described above are described in detail below.
[0036] In step S110, the constructor function refers to a special initialization function used in object-oriented programming to create class instances. In this embodiment, the constructor function refers to the constructor function corresponding to the business service class. Its parameter list explicitly declares all microservice interface types that the business service depends on, and it is the core carrier for declaring service dependencies and receiving externally injected instances. The constructor function itself is not responsible for creating or finding dependent service instances; it only receives the passed-in instances to complete its own initialization.
[0037] A microservice interface refers to the standardized functional contract exposed by a microservice. It clearly defines the set of methods the service can provide, the input parameter format, and the return value specification, serving as a unified agreement followed by both parties calling the service. The caller only needs to know the interface definition (type, function) to complete the call, without needing to understand the specific implementation logic of the service. The target interface refers to the specific microservice interface that the business service to be built must depend on, selected from the dependency declaration of the constructor. It serves as the retrieval basis for subsequent service discovery.
[0038] The dependency injection container of the microservice framework first obtains the corresponding constructor from the definition of the business service class to be built. By parsing the parameter types of the constructor, it identifies all the microservices that the business service instance (business service) depends on. Based on all the dependent microservices, it determines the interface types, retrieves the interface types of these microservices in the service registry, determines the microservice interfaces that they depend on, and marks these dependent microservice interfaces as target interfaces.
[0039] In some embodiments, the service capabilities (functions) required to build a business service are determined based on the constructor, thereby determining all microservice interface types on which the business service depends.
[0040] In step S120, the service registry is the core intermediary component in a microservice architecture that handles service registration and discovery. All microservices register their interface information (microservice interfaces) and instance information (microservice instances) with the service registry upon startup. The service registry internally maintains a mapping table between microservice interfaces and microservice instances, and is responsible for responding to service query requests.
[0041] A microservice instance refers to the concrete implementation of a microservice interface. It is an executable object running in system memory, encapsulating the specific code logic of the corresponding function. It can receive microservice interface call requests and execute actual data processing operations. It's important to note that one microservice interface can correspond to one or more parallel microservice instances. The mapping relationship refers to the corresponding association rules stored in the service registry. Each rule records the binding relationship between a microservice interface and one or more microservice instances. Based on this rule, the corresponding callable service instance can be quickly located through the microservice interface.
[0042] A target instance refers to a specific microservice running entity that has a mapping relationship with the target interface. It is a service provider that meets the business service dependency requirements and is also the execution unit that is subsequently injected into the constructor and participates in the actual business processing.
[0043] The dependency injection container initiates a service query request to the service registry based on the determined target interface. After receiving the query, the service registry retrieves and matches the available microservice instance (target instance) corresponding to the target interface based on the mapping relationship between microservice interfaces and microservice instances maintained by itself, and returns the access information of the target instance to the dependency injection container. The dependency injection container then identifies the retrieved microservice instance as the target instance.
[0044] In step S130, the business service refers to a functional service instance for a specific electricity meter data processing scenario. It encapsulates the complete business processing flow logic and completes a set of electricity meter data processing operations by combining and calling the capabilities of multiple injected microservice instances. It is the direct carrier for providing business processing capabilities to the outside world.
[0045] The dependency injection container receives the target instance obtained above and passes it as an argument to the constructor according to the parameter order and type requirements declared in the constructor. After receiving the target instance, the constructor executes its internal initialization logic in conjunction with the target interface, saving each target instance as its own member variable, and establishing a stable calling association between the business service and each microservice instance (target instance) through the target interface. Finally, after the constructor completes its execution, a complete and usable business service is generated. By assembling the dispersed microservice capabilities into a complete business service through dependency injection, the business service code does not need to actively search for or create service instances throughout the process, thus decoupling the business logic from the underlying service implementation.
[0046] In some embodiments, if there is a bidirectional dependency between the microservices required by the constructor, the microservices are treated as bidirectional microservices; for each bidirectional microservice, a service tracer for the target interface corresponding to the bidirectional microservice is created; if the target instance corresponding to the target interface is available, the target instance corresponding to the target interface is injected into the constructor.
[0047] Among them, bidirectional dependency, also known as circular dependency, refers to the state in which two or more microservices depend on each other for the service interfaces provided by each other. If the microservices all obtain the dependent services synchronously during the constructor initialization phase, a deadlock state will occur where they wait for each other's services to be ready, resulting in service initialization failure.
[0048] Bidirectional microservices refer to a group of microservices with bidirectional dependencies. They are the processing objects that require a special injection mechanism in this application embodiment and cannot be initialized through the conventional synchronous dependency injection process.
[0049] Each microservice corresponding to the target interface declared in the constructor is checked one by one. The dependency chain of each microservice is sorted out to determine whether there is a bidirectional dependency relationship between the microservices. If a bidirectional dependency is found, the microservices with circular dependency relationships are marked as bidirectional microservices. The scope of processing that requires special injection mechanism is clarified, and the processing basis is provided for the subsequent creation of service tracer and execution of delayed injection.
[0050] A service tracker is a functional component used to monitor the registration status of microservices. It can continuously monitor the service instance registration status of a specified target interface in the background without needing to synchronously obtain the service instance during the initialization phase. It automatically triggers a response when it detects that the target instance is registered and available. The availability of the target instance means that the microservice instance corresponding to the target interface has completed service registration and is in a running state that can normally respond to call requests; this is a prerequisite for triggering dependency injection.
[0051] For each bidirectional microservice, a dedicated service tracer is created for its corresponding target interface. The service tracer starts a background listening process to continuously monitor the registration status of the target instance of the corresponding target interface. There is no need to wait for the target instance to be ready synchronously during microservice initialization. When the service tracer detects that the target instance corresponding to the target interface has been registered and is in an available state, the dependency injection process is triggered, and the available target instance is passed to the corresponding constructor to complete the injection and assembly.
[0052] This solution addresses bidirectional dependency scenarios between microservices by identifying the bidirectional microservices and creating service tracers for the corresponding target interfaces. It employs a delayed injection mechanism that executes the constructor injection only after the target instance is available, effectively breaking the startup deadlock problem caused by bidirectional dependencies and avoiding service initialization failures caused by circular dependencies.
[0053] In step S140, an interface call refers to the interactive process in which a business service initiates a function execution request to a target instance according to the method name, parameter format, and calling rules agreed upon by the target interface, and receives and processes the returned result. Since the call is entirely based on a unified target interface agreement, as long as the target interface specification remains unchanged, replacement of the target instance's internal implementation or version upgrade will not affect the normal operation of the business service.
[0054] Electricity meter data processing refers to the business operations performed on various types of raw data collected and generated by electricity meters. It is the core business objective that this method ultimately aims to achieve, and may include data parsing, format verification, data storage, statistical calculation, and other processing actions.
[0055] When a business service receives a meter data processing task, it executes its encapsulated business logic sequentially, initiating function calls to the corresponding target instances according to the agreed-upon calling specifications of the target interfaces. Upon receiving the call request, each target instance executes its encapsulated processing logic, completes the data processing for its corresponding stage, and returns the result to the business service. The business service then integrates the processing results from each target instance to complete the entire meter data processing flow. This demonstrates the practical effectiveness of the dependency injection mechanism: the business service only calls the underlying microservice capabilities through standardized interfaces, and the implementation details of the underlying microservices are completely transparent to the business logic.
[0056] This application's embodiments utilize a service registry center to implement microservice interface discovery and microservice interface-microservice instance mapping management. Combined with the dependency injection mechanism of the constructor, the business service construction logic is completely decoupled from the specific implementation of microservices. Business services only need to declare the microservice interfaces they depend on to automatically obtain and inject the corresponding microservice instances, without the need for hard-coding the association with specific implementations. This effectively reduces module coupling and improves code reusability. At the same time, business services can flexibly assemble different microservice capabilities through interfaces, significantly improving system scalability and maintainability, and adapting to the continuous iteration needs of electricity meter data processing business.
[0057] Please see Figure 2 , Figure 2 A flowchart illustrating the registration of a microservice according to an embodiment of this application is shown. This application embodiment provides steps for registering a microservice, including: Step S201: The composite service is split according to the service type to obtain multiple independent microservices; Step S202: For any microservice, obtain the microservice instance and microservice interface of the microservice, and establish the mapping relationship between the microservice instance and the microservice interface. Step S203: Register the microservice interface and microservice instance to the service registry center so that the microservice interface can be discovered and the microservice instance can be called through the microservice interface.
[0058] The above three steps are described in detail below.
[0059] In step S201, a composite service refers to a holistic service that couples together multiple microservice logics with different functions. It typically covers multiple types of data processing capabilities, with blurred boundaries between microservices and high internal coupling.
[0060] Service type refers to the categorization criteria for microservices based on their functional responsibilities, such as different functional dimensions like protocol encoding / decoding, data storage, and task scheduling. Service decomposition refers to breaking down a composite service into multiple independent functional units according to a unified functional boundary standard, achieving modular decoupling. An independent microservice is a service unit obtained after decomposition, possessing a single functional responsibility and capable of independent operation and deployment; each microservice is responsible for only one specific type of data processing function.
[0061] For composite services involving functional aggregation (microservice aggregation), boundaries are defined according to different functional service types. This breaks down the originally coupled processing functions into multiple independent microservices with single responsibilities. In other words, it breaks the coupling of the original monolithic service at the architectural level, achieving the physical decomposition of functional modules (microservices) and providing independent service units for subsequent service registration and invocation.
[0062] In some embodiments, microservices include: message encoding / decoding, asynchronous work, task scheduling, RPC (Remote Procedure Call) communication, data reading / writing, data initialization, and data access.
[0063] Among them, message encoding and decoding: dedicated to handling the serialization and deserialization of DLMS / AXDR and JSON formats, that is, data packaging and unpacking. Asynchronous work: providing asynchronous task execution capabilities based on the ASIO library, equivalent to a unified background thread pool for asynchronous scheduling of other modules. Task scheduling: managing tasks such as scheduled meter reading and periodic data collection, supporting both scheduled and periodic scheduling modes. RPC (Remote Procedure Call) communication: responsible for cross-process and cross-device message transmission, implemented based on message queues, serving as the communication channel between the terminal and the meter, and between the terminal and the backend. Data read and write: specifically responsible for batch writing and updating data to the database, optimizing write performance. Data initialization: automatically creating the database, creating tables, and initializing default configurations when the system starts. Data access: responsible for data querying, pagination, conditional retrieval, and other read operations.
[0064] In step S202, a microservice interface refers to the standardized function call contract exposed by a microservice, defining the methods, input parameters, and return value specifications that the service can provide. It is the only standard entry point for external calls to the microservice. A microservice instance refers to the specific running entity of a microservice function, encapsulating the implementation logic of the corresponding function. It can receive microservice interface call requests and execute actual data processing operations, serving as the actual carrier of microservice capabilities. The mapping relationship refers to the corresponding association rules stored in the service registry. Each rule records the corresponding binding relationship between a microservice interface and one or more microservice instances. Based on this rule, the corresponding callable service instance can be quickly located through the microservice interface.
[0065] For each microservice obtained from the decomposition, extract the standardized microservice interface exposed by the microservice and the corresponding runnable microservice instance, and establish a one-to-one binding relationship between the two to form a mapping relationship from microservice interface to microservice instance.
[0066] In step S203, the service registry is the core intermediary component in a microservice architecture that handles service registration and discovery. Every microservice registers its interface information (microservice interface) and instance information (microservice instance) with the service registry upon startup. The service registry internally maintains a mapping table between microservice interfaces and microservice instances, and is responsible for responding to service query requests.
[0067] Service registration refers to the process of submitting the interface and instance information of a microservice to the service registry. It is a necessary process for a microservice to publish its service capabilities. Service discoverability means that after a microservice completes registration, other service components can obtain the microservice's interface information by querying the service registry, without needing to know the service's specific location and implementation details in advance.
[0068] The microservice interface information and corresponding microservice instance information of each microservice are submitted to the service registry for registration. After registration, the service registry exposes the microservice interface of the microservice, allowing other service components to query and discover the microservice interface and locate and invoke the corresponding microservice instance through the microservice interface.
[0069] This application embodiment splits composite services according to service type (function), decomposing the coupled overall function (composite service) into microservice units with independent responsibilities. This reduces the coupling between modules (functions, microservices) at the architectural level and improves code reusability. By establishing a mapping relationship between microservice interfaces and microservice instances and uniformly registering them to the service registry, centralized management and discovery of service capabilities are achieved, providing support for dependency injection and microservice invocation, facilitating independent iteration and upgrades of each microservice, and effectively improving the scalability and maintenance efficiency of the system.
[0070] In some embodiments, microservices are not only derived from the splitting of composite services, but also support the direct access of independently developed external microservices. Users can input microservice program files into the system through external downloads, remote distribution, etc. After loading the files, parsing metadata, and verifying the version and dependency integrity, they can enter the installation state. Subsequently, they follow the same lifecycle management, service registration, and invocation rules as the split microservices.
[0071] In some embodiments, since each microservice is an independently deployed functional unit, they interact only through standardized microservice interfaces, relying solely on the input parameters, return values, and calling rules agreed upon by the microservice interfaces, without depending on each other's internal implementation logic. Furthermore, microservice instances are managed uniformly through a service registry. Therefore, the internal code, functional logic, performance optimization, or defect fixing of any single microservice can be modified individually, as long as the external microservice interface specification remains unchanged. The modification process does not require altering the code of other microservices, nor does it interrupt the operation of other microservices. Other microservices can continue to normally handle meter data processing without being affected by modifications to a single module, avoiding the drawbacks of traditional methods where modifying one part requires a complete rewrite and system shutdown.
[0072] Please see Figure 3 , Figure 3A flowchart illustrating the updating of a microservice according to an embodiment of this application is shown. Embodiments of this application provide steps for updating a microservice, including: Step S301: For any microservice, if a new version of the microservice is detected, the microservice is treated as the old version and the new version of the microservice is downloaded. Step S302: Verify the new version of the microservice. If the verification is successful, disable, uninstall, and back up the old version of the microservice, and install and activate the new version of the microservice. If the verification fails, stop the installation of the new version of the microservice. Step S303: Test the new version of the microservice. If the test fails, uninstall the new version of the microservice and re-enable the backed-up old version of the microservice. If the test succeeds, continue to use the new version of the microservice.
[0073] The above three steps are described in detail below.
[0074] In step S301, the new version of the microservice refers to a microservice package with a version number higher than the current running version after functional optimization, defect fixing, or capability expansion. It contains updated service implementation code and metadata configuration and is the replacement object for this version upgrade. The old version of the microservice refers to the original version of the microservice that is currently running normally in the system and provides meter data processing services to the outside world. It is the running entity to be replaced in this upgrade operation.
[0075] Detecting the new version of a microservice involves comparing the version number of the locally installed version with the available upgrade version to determine if an upgrade is possible. This is the trigger condition for initiating the entire upgrade process. It can be triggered by polling at a fixed period or by actively triggering it via an external upgrade command. Downloading refers to transferring the installation package of the new version of the microservice from the remote upgrade server or a specified storage path to a temporary directory on the local system. The entire process does not overwrite the old version's executable files to avoid interfering with the normal operation of current business processes.
[0076] The system iterates through every deployed microservice within the system, comparing the local microservice version number with the latest version number published remotely to detect the availability of an upgrade. When a new version of a microservice is identified, the currently running microservice is marked as the old version, and the download of the new version's installation package is initiated. The installation package is saved to a separate local temporary storage path. Throughout the process, the runtime files and service status of the old version microservice are not modified, thus preparing the necessary files for subsequent verification and version replacement.
[0077] In step S302, verification refers to the pre-installation compliance and availability checks performed before installing the new version of the microservice. In some embodiments, this verification includes three core dimensions: first, file integrity verification, which verifies whether the installation package is complete, undamaged, or tampered with; second, compatibility verification, which verifies whether the new version of the microservice is compatible with the current system operating environment and hardware platform; and third, dependency verification, which checks whether the dependent services and libraries required by the new version of the microservice have changed compared to the old version and whether they can be satisfied by the current environment. This is the first barrier to avoid upgrade risks. Deactivating the old version of the microservice refers to the operation of switching the old version of the microservice from a normal operating state to a stopped service state. During execution, the interface information of the microservice in the service registry will be deregistered, new business requests will be stopped, and runtime resources such as running threads and connection handles will be released. After deactivation, the microservice program files are still retained in the system and can be restarted.
[0078] Uninstalling an old microservice refers to removing a deactivated old microservice from the system runtime environment. This cleans up the microservice's running instances and runtime resources, retaining only the program files and configuration information needed for backup. Backing up an old microservice involves copying the old version's program files, configuration parameters, and metadata to a separate backup directory for archiving before uninstallation. This is the fundamental guarantee for version rollback in case of upgrade failure. Installing a new microservice involves loading the verified new microservice into the runtime environment. This includes parsing microservice metadata, verifying dependency integrity, and deploying program files. After installation, the microservice is in a non-running, installed state. Activating a new microservice means starting the installed new microservice into a runnable state. This creates the corresponding microservice instance, registers the service interface with the service registry, and enables the new microservice to officially provide services.
[0079] It needs to be clarified that microservices can be updated either when they are not being called by business services or when they are being called by business services. In other words, updating a microservice is not affected when it is being called by a business service.
[0080] The new microservice installation package downloaded to the local temporary directory undergoes multi-dimensional pre-verification, checking the package's file integrity, compatibility with the current system, and dependency matching to eliminate corrupt or incompatible upgrade packages at the source. If the verification fails, the upgrade process is terminated, the abnormal installation package is discarded, and no changes are made to the currently running old microservice to ensure the continuous and stable operation of the meter data processing business. If the verification passes, the old microservice is first deactivated, stopping its business service capabilities. Then, a complete backup of the old version's program files and configuration information is performed. After the backup is complete, the old microservice is uninstalled, and the corresponding runtime resources are cleaned up. Subsequently, the verified new microservice is installed and deployed. After installation, an activation operation is triggered, creating a service instance and registering it with the service registry center, completing the replacement of the old microservice with the new one.
[0081] In step S303, testing the new microservice refers to verifying its functional availability after activation. This typically includes service interface connectivity testing, core functional logic verification, and return result correctness checks. It confirms whether the new microservice can properly handle meter data processing tasks and serves as the second line of defense in verifying the upgrade's effectiveness. Reactivating the old microservice refers to redeploying and activating the backed-up old microservice to restore its external service capabilities. This is the core recovery method after an upgrade failure.
[0082] Standardized functional testing is initiated on the activated new version of the microservice. Core service interfaces are called according to the microservice interface conventions to verify whether the interfaces are accessible, whether the core data processing logic is correct, and whether the output results meet expectations, thus comprehensively confirming the operational status of the new version of the microservice. If the test fails, the upgrade is deemed a failure, and a version rollback operation is immediately performed. First, the new version of the microservice exhibiting operational errors is uninstalled. Then, the program files and configuration information of the old version of the microservice are restored from the backup directory, and the old version of the microservice is reactivated to quickly restore its external service capabilities and minimize business interruption time. Version rollback refers to the fault-tolerant process of reversing the upgrade operation and restoring the use of the old version of the microservice when the new version of the microservice fails the test. This includes actions such as uninstalling the faulty new version of the microservice, restoring the old microservice backup, and reactivating the old microservice to quickly restore business capabilities and reduce the impact of upgrade failure. If the test passes, the upgrade is deemed successful, and the new version of the microservice is officially put into continuous operation to undertake the corresponding meter data processing business.
[0083] Among these features, business services can be continued to be processed by other microservices during the intervals between microservice updates, achieving zero-downtime upgrades.
[0084] This solution enables online upgrades and updates of microservices through a complete process including version detection, multi-dimensional pre-verification, version replacement, functional testing, and exception rollback. It allows for version iteration of individual microservices without restarting the entire system, effectively improving operational efficiency. Furthermore, the dual risk barriers of pre-file verification and post-functional testing, combined with backups of older microservices and rapid exception rollback mechanisms, effectively mitigate upgrade failures and quickly restore service capabilities in case of upgrade failure, ensuring the stability of business services and the reliability of upgrades.
[0085] Please see Figure 4 , Figure 4 A flowchart illustrating the updating of a microservice according to another embodiment of this application is shown. Embodiments of this application provide steps for updating a microservice, including: Step S401: For any microservice, if a new version of the microservice is detected, the microservice is treated as the old version and the new version of the microservice is downloaded. Step S402: Verify the new version of the microservice. If the verification is successful, install the new version of the microservice; if the verification fails, stop the installation of the new version of the microservice. Note that the service interfaces of the old version of the microservice and the new version of the microservice are different. Step S403: Based on the runtime of the new microservice, the workload is allocated to the new and old microservices using a consistent hashing weight strategy, so that the new and old microservices run according to the workload allocation until the old microservice no longer receives workload allocation; wherein, the longer the runtime of the new microservice, the more workload is allocated to the new microservice.
[0086] The above three steps are described in detail below.
[0087] In step S401, the new version of the microservice refers to a microservice package with a version number higher than the current running version, which has undergone functional optimization, defect fixing, or capability expansion. It contains updated service implementation code and metadata configuration and is the replacement object for this version upgrade. In this embodiment, it will run in parallel with the old version of the microservice for a period of time, gradually taking over business.
[0088] The legacy microservice refers to the existing version of the microservice that is currently running normally within the system and providing meter data processing services. It is the main operating entity to be replaced in this upgrade operation and will remain running throughout the entire upgrade transition until the workload is completely migrated to the new microservice. Version detection refers to the process of comparing the version number of the locally installed version with the version of the available upgrade version to determine if an upgradeable version exists. It is the trigger condition for starting the entire upgrade process and can be triggered by polling at a fixed period or actively triggered by an external upgrade command.
[0089] Downloading the new version of a microservice refers to the operation of transferring the installation package of the new version of the microservice from remote storage or a specified upgrade source to a local temporary directory. The entire process does not modify or interrupt the running status of the old version of the microservice, ensuring that the existing meter data processing business is not interrupted.
[0090] The system iterates through all deployed microservices, performing version monitoring on each one. When a new, available version of a microservice is identified, the currently running microservice is marked as the old version. Simultaneously, the download of the new microservice's installation package is initiated, and the package is saved to a local, independent temporary storage path. Throughout the download process, the old version microservice continues to run normally, handling all workloads without interfering with existing meter data processing operations. This process prepares the necessary documentation for subsequent version verification and parallel deployment of the new microservice.
[0091] In step S402, the new microservice is verified. This is a pre-installation availability check performed before installing the new microservice, covering core dimensions such as file integrity, system compatibility, and dependency matching. It is used to proactively identify abnormal version packages and reduce the risk of upgrades introducing failures from the source. Installing the new microservice refers to the operation of deploying and loading the verified new microservice into the runtime environment. This includes parsing metadata, verifying dependency integrity, and deploying application files. After installation, the new microservice is in an active state but does not yet undertake business workloads.
[0092] In this application embodiment, the old and new versions of microservices use different service interface identifiers to distinguish the two versions of microservice instances in the service registry, avoid interface conflicts during parallel operation, and support version-based traffic routing scheduling (workload scheduling).
[0093] First, the new microservice installation package undergoes multi-dimensional verification to check its completeness, compatibility with the current system environment, and fulfillment of required dependencies. If the verification fails, the installation process is terminated, the faulty package is discarded, and the old microservice continues to run normally without affecting existing business operations. If the verification passes, the new microservice is installed and deployed, loading it into the runtime environment. This step clarifies that the new and old microservices use different service interfaces, ensuring they can register independently in the service registry without interference, providing an architectural foundation for subsequent parallel operation and workload allocation of both versions.
[0094] In step S403, the runtime of the new microservice refers to the cumulative time of normal, fault-free operation after the new microservice is installed and activated. It is the core basis for judging the stability of the new version and adjusting the workload allocation ratio. The consistent hashing weight strategy refers to a traffic load (workload allocation) distribution mechanism based on the consistent hashing algorithm. By setting different weight values for different versions of microservice instances, it determines the probability of business service requests being routed to the corresponding version, which can ensure that the same business service request is stably routed to the same version and avoid processing session interruptions.
[0095] Workload allocation refers to the scheduling operation of distributing meter data processing tasks to different versions of microservice instances according to a preset weight ratio. Essentially, microservice workload is the amount of data processing tasks undertaken by the corresponding service instance of the microservice.
[0096] The system continuously monitors the cumulative uptime of the new microservice and dynamically adjusts the weight parameters in the consistent hashing algorithm based on this data. When the new microservice has a short initial uptime, it is assigned a lower weight and handles less workload, allowing for limited stability testing. As the new microservice's stable uptime increases, its weight is gradually increased, allocating more meter data processing workload, while simultaneously reducing the weight and workload of the old microservice. This dynamic adjustment process continues until the old microservice is no longer assigned any workload, completing a smooth full migration of traffic (workload) without interrupting meter data processing operations. Finally, the old microservice is uninstalled.
[0097] For example, the weight parameters are determined using a consistent hashing algorithm based on the runtime of the new microservice. This yields the weight parameters for both the new and old versions of the microservice. The allocated workload (or traffic) is determined based on the total workload (or total traffic) and the weight parameters. For instance, the product of the weight parameters for the new microservice and the total workload (or total traffic) is used as the workload (or traffic) for the new microservice.
[0098] This application's embodiments employ a canary upgrade mode that runs the new and old versions of microservices in parallel. The new version can be deployed without disabling the old version. Weights are dynamically adjusted based on the runtime of the new microservice, gradually migrating workload and achieving uninterrupted version iteration, avoiding the sudden risks of a full rollout of the new microservice. Version conflicts are avoided through differentiated service interfaces, and consistent hashing ensures stable traffic routing. The upgrade process does not interrupt meter data processing, effectively reducing the impact of the upgrade on business operations and improving the smoothness of version updates and system reliability.
[0099] In some embodiments, if an anomaly occurs during the operation of the new microservice, all workload is distributed to the old microservice, and the new microservice is either uninstalled or reported as faulty. An anomaly refers to a failure state in the new microservice during parallel operation, such as functional malfunction, response timeout, data processing errors, or resource overruns, which prevents it from providing normal service. This is the criterion for triggering a full workload rollback. Full workload distribution means adjusting the consistent hashing weight strategy parameters to reset the traffic weight of the new microservice to zero, routing all meter data processing tasks to the scheduling operations of the old microservice, achieving an instantaneous full rollback of business traffic.
[0100] This application's embodiment serves as a fallback mechanism for the multi-version canary upgrade process, continuously effective throughout the entire lifecycle of parallel operation of the new and old microservices and dynamic adjustment of workload allocation. The system monitors the operational status and service quality of the new microservice in real time. When an anomaly is detected in the new microservice, preventing it from completing meter data processing tasks, the consistent hashing weight strategy configuration is immediately modified. The workload weight corresponding to the new microservice is adjusted to zero, and all meter data processing workload is immediately allocated to the continuously and stably running old microservice. This quickly switches back business traffic, preventing the abnormal version from continuing to handle tasks and causing business failures. Fault mitigation is achieved without requiring version uninstallation and reinstallation.
[0101] In some embodiments, the calling order of each target interface in the business service is determined according to the constructor, so that the target instance is called sequentially through each target interface according to the calling order to process the meter data. The constructor is the initialization function of the business service class. Besides declaring the microservice interfaces that the business service depends on, it also carries the logical timing conventions for business processing and is the core basis for determining the calling order of each target interface. The calling order refers to the sequential execution order of each target interface in the complete meter data processing flow, matching the processing steps of the business logic and determining the calling timing of different microservice capabilities. Sequential calling refers to the execution method of triggering target interface calls one by one according to a preset order. After the previous target interface call is completed and the processing result is obtained, the next target interface call is executed, ensuring the continuity and logical correctness of the process.
[0102] Based on the business processing logic and dependent interface declarations carried by the constructor, the order in which each target interface is called during the execution of meter data processing is predetermined. When the business service actually runs and processes meter data, this calling order is strictly followed. After the previous target interface calls the corresponding target instance and completes the corresponding processing step, the next target interface is called. The processing of each step is advanced step by step according to the process, and finally the entire process of meter data processing is fully realized.
[0103] In some embodiments, even if the target interfaces in two business services are the same, the order in which the two business services call the target interfaces may be different due to the different operating environments or functions implemented by the two business services.
[0104] In some embodiments, different target instances have different activation priorities. First, base target instances without dependencies (such as asynchronous work and data initialization) are activated; second, target instances that depend on base target instances (such as message encoding / decoding, task scheduling, and data reading / writing) are activated; and then comprehensive target instances (such as RPC communication) are activated, ensuring that the services it depends on are ready when each target instance is activated.
[0105] In some embodiments, the state of a microservice includes an installed state, an activated state, a disabled state, and an uninstalled state. The microservice is processed accordingly based on its state. The state of the microservice changes in a fixed order and cannot be skipped.
[0106] The "installation" state refers to the initial state of the microservice after it has completed loading program files and parsing metadata. At this time, the microservice has only completed file deployment and dependency integrity verification; it has not run business code, does not consume runtime resources, and does not provide any service capabilities. The "activation" state refers to the running state of the microservice after it has completed startup and is officially providing services to the outside world. At this time, the microservice has created a corresponding microservice instance and registered the microservice interface and microservice instance with the service registry center, and can respond to microservice interface call requests and execute meter data processing tasks.
[0107] The "discontinued" state refers to the paused state after a microservice stops providing external services. At this point, the microservice's interface information has been deregistered from the service registry, and runtime resources such as running threads and database connections have been released. It no longer accepts business requests, but the microservice instance and the mapping relationship between the microservice instance and the microservice interface remain in the system and can be reactivated. The "uninstalled" state refers to the terminated state where the microservice has been completely removed from the system runtime environment. At this point, the microservice instance, associated resources, and program files are all cleaned up and released, no longer remaining in the runtime environment.
[0108] For different states of a microservice, management operations matching the current state are executed. For example, a microservice in an active state can be disabled, while a microservice in a disabled state can be activated or uninstalled, ensuring that the operation matches the state logic. Fixed-order state changes: Microservice state changes must follow a predetermined flow path, namely the sequential flow from installed state to activated state, disabled state, and uninstalled state. This is the core constraint of state management. Cross-state change operations that violate the fixed flow order are prohibited. For example, directly executing disable from an inactive installed state to reach the disabled state, or directly executing uninstall from an activated state to reach the uninstalled state, skipping intermediate states, is explicitly prohibited in this solution.
[0109] First, four standard states are defined for each microservice: installed, activated, disabled, and uninstalled. If a microservice's state changes, the corresponding processing operation matching the changed state is executed to avoid invalid operations causing exceptions. Simultaneously, the system enforces state transition rules, requiring all state changes to proceed sequentially from installed to activated, then to disabled, and finally to uninstalled. Skipping intermediate states is not allowed, ensuring that each state transition corresponds to a complete resource allocation or release operation. This mechanism prevents resource leaks and service failures caused by state inconsistencies.
[0110] Figure 5 A block diagram of a computer device structure for implementing a microservices-based meter data processing method according to an embodiment of this application is shown.
[0111] It should be noted that, Figure 5 The computer device 800 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0112] like Figure 5 As shown, the computer device 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 802 or programs loaded from storage section 808 into random access memory (RAM). The RAM 803 also stores various programs and data required for device operation. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output interface 805 (I / O interface) is also connected to the bus 804.
[0113] The following components are connected to the input / output interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a local area network card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 810 as needed so that computer programs read from it can be installed into the storage section 808 as needed.
[0114] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit 801, it performs the various functions defined in the device of this application.
[0115] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination thereof. The computer-readable storage medium is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor devices, apparatuses, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution device, apparatus, or device. In this application, the computer-readable signal medium can include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution device, apparatus, or apparatus. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0116] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of devices, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based device that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0117] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0118] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the methods according to the embodiments of this application.
[0119] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0120] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for processing electricity meter data based on a microservice architecture, characterized in that, The microservice architecture contains multiple microservices, and the microservice interfaces of each microservice can be discovered in the service registry. There is a mapping relationship between the microservice instances and the microservice interfaces of each microservice. The electricity meter data processing method includes: Obtain the constructor function and use the microservice interface of the microservice required by the constructor function as the target interface; Obtain the microservice instance corresponding to the target interface, and use the microservice instance as the target instance; The target instance is injected through the constructor, and a business service is generated in conjunction with the target interface. The business service calls the target instance through the target interface to process the meter data.
2. The meter data processing method according to claim 1, characterized in that, The electricity meter data processing method further includes: The composite service is split according to the service type to obtain multiple independent microservices; For any microservice, obtain the microservice instance and microservice interface of the microservice, and establish a mapping relationship between the microservice instance and the microservice interface; Register the microservice interface and microservice instance to the service registry center so that the microservice interface can be discovered and the microservice instance can be invoked through the microservice interface.
3. The meter data processing method according to claim 1, characterized in that, The electricity meter data processing method further includes: For any microservice, if a new version of the microservice is detected, the microservice is treated as the old version and the new version of the microservice is downloaded. The new version of the microservice is verified. If the verification is successful, the old version of the microservice is disabled, uninstalled, and backed up, and the new version of the microservice is installed and activated. If the verification fails, the installation of the new version of the microservice is stopped. The new version of the microservice is tested. If the test fails, the new version of the microservice is uninstalled and the backed-up old version of the microservice is reactivated. If the test succeeds, the new version of the microservice continues to be used.
4. The meter data processing method according to claim 1, characterized in that, The electricity meter data processing method further includes: For any microservice, if a new version of the microservice is detected, the microservice is treated as the old version and the new version of the microservice is downloaded. The new version of the microservice is tested. If the test is successful, the new version of the microservice is installed. If the test fails, the installation of the new version of the microservice is stopped. The service interfaces of the old version of the microservice and the new version of the microservice are different. Based on the runtime of the new microservice, a consistent hashing weight strategy is used to allocate workload between the new and old microservices, so that the new and old microservices run according to the workload allocation until the old microservice no longer receives workload allocation; wherein, the longer the runtime of the new microservice, the more workload is allocated to the new microservice.
5. The meter data processing method according to claim 4, characterized in that, The electricity meter data processing method further includes: If an anomaly occurs during the operation of the new version of the microservice, all workload will be distributed to the old version of the microservice.
6. The meter data processing method according to claim 1, characterized in that, The electricity meter data processing method further includes: Based on the constructor, the calling order of each target interface in the business service is determined, so that the target instance is called sequentially through each target interface according to the calling order to realize the processing of the meter data.
7. The meter data processing method according to claim 1, characterized in that, The electricity meter data processing method further includes: The microservices are in the following states: installed, activated, disabled, and uninstalled. Each microservice is processed according to its state. The microservices change states in a fixed order and cannot undergo jump-state changes.
8. The data processing method according to claim 1, characterized in that, The electricity meter data processing method further includes: If there is a bidirectional dependency between the microservices required by the constructor, then the microservices are treated as bidirectional microservices. For each bidirectional microservice, create a service tracer for the target interface corresponding to the bidirectional microservice; If the target instance corresponding to the target interface is available, then the constructor of the target instance corresponding to the target interface is injected.
9. A meter data processing device based on a microservice architecture, comprising a memory, a processor, and a readable program stored in the memory, characterized in that, The processor executes the readable program to implement the method of any one of claims 1 to 8.
10. A readable storage medium, characterized in that, It stores a readable program / instruction that, when executed by a processor, implements the method of any one of claims 1 to 8.
