Methods, devices, equipment, media, and products for dynamic updating of distributed services
By using a countdown mechanism and dependency analysis, the timing of the static state of the distributed service system is determined, which solves the security and consistency problems of dynamic system updates and enables secure updates during continuous operation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2026-04-03
AI Technical Summary
In large-scale distributed service systems, how can we achieve dynamic updates while the system continues to run, ensuring the consistency and security of the system state, and avoiding the high costs or life-threatening situations caused by interruptions?
By introducing a countdown mechanism, the static state of the service during the countdown is determined. By utilizing the service's dependencies and transaction execution status, a suitable time is selected for dynamic updates, ensuring the safety and consistency at the start of the update.
It enables secure and reliable dynamic updates in distributed service systems, ensuring the legality and consistency of the system state before and after the update, and avoiding long waiting times and potential system interruptions.
Smart Images

Figure CN116582527B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of intelligent networking technology, specifically to a method, apparatus, device, medium, and product for dynamically updating distributed services. Background Technology
[0002] In large-scale distributed service systems, reliability, availability, trustworthiness, and maintainability have become crucial factors that computer systems must consider, especially in critical service applications such as financial data processing systems, medical service systems, remote communication systems, and online telecommunications billing systems. Such distributed system environments often require real-time decision support or event-driven processing. Once the system starts running, it must remain operational at all times; system interruptions mean high costs and even endanger user lives. However, these systems must continuously evolve throughout their software lifecycle to correct software faults, expand service functionality, and improve system performance. Therefore, a mechanism is needed to support the system's continuous evolution and functional expansion without affecting existing services—a dynamic update support mechanism for distributed services. Summary of the Invention
[0003] To address the problems in related technologies, embodiments of this disclosure provide a method, apparatus, device, medium, and product for dynamically updating distributed services.
[0004] Firstly, this disclosure provides a method for dynamically updating a distributed service.
[0005] Specifically, the dynamic update method for the distributed service includes:
[0006] Receive service update requests from devices in the network system and start a countdown;
[0007] Determine the status of the service during the countdown;
[0008] The time point when the service is in a static state during the countdown is taken as the update start time, and the service is dynamically updated.
[0009] According to embodiments of this disclosure, determining the state of the service during the countdown includes:
[0010] Analyze the dependencies of the services to determine the transactions in which the services participate;
[0011] The state of the service during the countdown is determined based on the execution status of the transaction.
[0012] According to embodiments of this disclosure, analyzing the dependencies of the service to determine the transactions in which the service participates includes:
[0013] The first transaction in which the service participates is determined based on the service instance dependency tree;
[0014] The second transaction in which the service participates is determined based on the root service dependency tree;
[0015] The first transaction and the second transaction are transactions in which the service participates.
[0016] According to embodiments of this disclosure, the service is in a static state during the countdown, including:
[0017] If the service does not participate in the first transaction or the second transaction, then the service is determined to be in a static state during the countdown.
[0018] If the service only participates in the first transaction and the execution end time of the first transaction is within the countdown, then it is determined that the service is in a static state within the countdown.
[0019] If the service only participates in the second transaction and the execution end time of the second transaction is within the countdown, then it is determined that the service is in a static state within the countdown.
[0020] If the execution end times of the first and second transactions in which the service participates are both within the countdown, then the service is determined to be in a static state within the countdown.
[0021] According to embodiments of this disclosure, the dynamic update of the service includes:
[0022] If the service only participates in the first transaction, it will be directly updated to the latest version of the service;
[0023] If the service only participates in the second transaction, then the existing version of the service will be retained and updated to the latest version of the service.
[0024] According to embodiments of this disclosure, the dynamic update of the service includes:
[0025] Configure an update flag for the service that is in a static state during the countdown;
[0026] The service is dynamically updated based on the update flag.
[0027] Secondly, this disclosure provides a dynamic update device for distributed services.
[0028] Specifically, the dynamic update device for the distributed service includes:
[0029] The startup module is configured to receive service update requests sent by devices in the network system and start a countdown.
[0030] The determination module is configured to determine the status of the service during the countdown;
[0031] The dynamic update module is configured to take the time point when the service is in a static state during the countdown as the update start time and perform dynamic updates on the service.
[0032] Thirdly, embodiments of this disclosure provide an electronic device including a memory and a processor, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method as described in any of the first aspects.
[0033] Fourthly, this disclosure provides a readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the method as described in any of the first aspects.
[0034] Fifthly, this disclosure provides a computer program product including computer instructions that, when executed by a processor, implement the steps of the method as described in any of the first aspects.
[0035] According to the technical solution provided in this disclosure, a service update request sent by a device in the network system is received and a countdown is started; the state of the service within the countdown is determined; and the time point when the service is in a static state within the countdown is taken as the update start time to perform a dynamic update of the service. The above technical solution, by introducing a countdown mechanism and using the time point when the service is in a static state within the countdown as the update start time, provides a suitable opportunity to trigger the dynamic update of the service, ensuring the security of dynamic configuration and guaranteeing that the system state before and after the update is legal and consistent.
[0036] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0037] Other features, objects, and advantages of this disclosure will become more apparent from the following detailed description of non-limiting embodiments, taken in conjunction with the accompanying drawings. In the drawings:
[0038] Figure 1 A system architecture diagram illustrating a dynamic update method for a distributed service according to an embodiment of this disclosure is shown.
[0039] Figure 2 A flowchart illustrating a dynamic update method for a distributed service according to an embodiment of this disclosure is shown.
[0040] Figure 3 A flowchart illustrating the process of determining the service's participation in transactions based on the dependencies of the analysis service according to an embodiment of this disclosure is shown.
[0041] Figure 4 A flowchart illustrating dynamic updates of services according to an embodiment of this disclosure is shown.
[0042] Figure 5 A structural block diagram of a dynamic update apparatus for a distributed service according to an embodiment of the present disclosure is shown.
[0043] Figure 6 A structural block diagram of the determining module according to an embodiment of the present disclosure is shown.
[0044] Figure 7 A schematic structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0045] Figure 8 A schematic diagram of the structure of a computer system suitable for implementing a dynamic update method for a distributed service according to embodiments of the present disclosure is shown. Detailed Implementation
[0046] In the following, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings to enable those skilled in the art to readily implement them. Furthermore, for clarity, portions unrelated to the description of exemplary embodiments have been omitted from the drawings.
[0047] In this disclosure, it should be understood that terms such as “comprising” or “having” are intended to indicate the presence of features, figures, steps, behaviors, components, parts or combinations thereof disclosed in this specification, and are not intended to exclude the possibility of the presence or addition of one or more other features, figures, steps, behaviors, components, parts or combinations thereof.
[0048] It should also be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other. This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0049] In this disclosure, the acquisition of user information or user data is done with the user's authorization or confirmation, or by the user's active choice.
[0050] In large-scale distributed service systems, reliability, availability, trustworthiness, and maintainability have become crucial factors that computer systems must consider, especially in critical service applications such as financial data processing systems, medical service systems, remote communication systems, and online telecommunications billing systems. Such distributed system environments often require real-time decision support or event-driven processing. Once the system starts running, it must remain operational at all times; system interruptions mean high costs and even endanger user lives. However, these systems must continuously evolve throughout their software lifecycle to correct software faults, expand service functionality, and improve system performance. Therefore, a mechanism is needed to support the system's continuous evolution and functional expansion without affecting existing services—a dynamic update support mechanism for distributed services.
[0051] In view of the above problems, the distributed service dynamic update method of this disclosure receives a service update request sent by a device in the network system and starts a countdown to determine the state of the service within the countdown. The time point when the service is in a static state within the countdown is taken as the update start time for dynamic service update. This technical solution, by introducing a countdown mechanism and using the time point when the service is in a static state within the countdown as the update start time, provides a suitable time to trigger dynamic service update, ensuring dynamic configuration security and guaranteeing that the system state before and after the update is legal and consistent.
[0052] Figure 1 A system architecture diagram illustrating a dynamic update method for a distributed service according to an embodiment of this disclosure is shown. Figure 1 As shown, the system architecture includes a server 101, several devices to be updated 102, and a network 103. The server 101 can be a single server, contain several servers, be a virtualization platform, be a cloud computing service center, or be a group of devices including servers and a database. The devices to be updated 102 can also be servers, contain several servers, be a virtualization platform, or be a cloud computing service center. Distributed services, also known as microservices, are deployed on the devices to be updated 102. Each service can provide one or more functions. Services interact with each other through a specified communication protocol. All services together provide the basic elements for the normal operation of the business. The network 103 serves as the medium for providing communication links between the server 101 and the several devices to be updated 102. The network 103 can include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0053] It should be understood that Figure 1The number of servers and devices to be updated shown is merely illustrative. Any number of servers and devices to be updated may be used as needed, and this disclosure does not impose any limitation on this.
[0054] Figure 2 A flowchart illustrating a dynamic update method for a distributed service according to an embodiment of this disclosure is shown. Figure 2 As shown, the dynamic update method for the distributed service includes steps S201-S203:
[0055] In step S201, a service update request sent by a device in the network system is received and a countdown is started;
[0056] In step S202, the state of the service during the countdown is determined;
[0057] In step S203, the time point when the service is in a static state within the countdown is taken as the update start time, and the service is dynamically updated.
[0058] The dynamic update method for distributed services provided in this disclosure is applied to... Figure 1 Server 101 is shown below, in conjunction with Figure 1 Provide an illustrative explanation.
[0059] According to embodiments of this disclosure, distributed services (hereinafter referred to as services) need to be deployed on different devices, and the entire set of machines where services are deployed together constitutes the business operating environment. For example, machines deploying distributed services... Figure 1 The device to be updated 102 shown, and for example Figure 1 The server 101 shown represents a publicly disclosed networking system.
[0060] According to embodiments of this disclosure, after receiving a service update request from the device 102 (also referred to as the device) to be updated in the networking system, the server 101 starts a countdown and identifies the service status. The service is dynamically updated only when it is identified as being in a static state within the countdown. This ensures that the device 102 to be updated receives feedback on whether to update after the maximum countdown time, avoiding long waiting times. Moreover, the static state of the service is considered a safe state for dynamic configuration, meaning that updating the service in this state is safe for the system, thereby ensuring that the system state before and after the update is legal and consistent.
[0061] According to embodiments of this disclosure, services are typically not isolated; a service may depend on the implementation of other services, and similarly, a service may be depended upon by other services. Currently, service-oriented distributed systems provide a description of the functional behavior of a service when registering individual service information on the server side, and simultaneously provide a description of the services that depend on that service. This allows for the search of matching dependent services based on the descriptions. These dependent services may be matched with locally dependent services, or they may be accessed transparently through a locally established service proxy for accessing remote services.
[0062] According to embodiments of this disclosure, the operation of the service is based on transaction control. The device to be updated 102 is configured with a transaction processing monitor responsible for transaction operation control. The monitor generates a transaction ID when the first service request of a certain transaction arrives, and records and manages the operation of each service in units of transactions.
[0063] According to an embodiment of this disclosure, determining the state of the service within the countdown in step S202 includes:
[0064] Analyze the dependencies of the services to determine the transactions in which the services participate;
[0065] The state of the service during the countdown is determined based on the execution status of the transaction.
[0066] In this disclosed method, by analyzing the service dependencies, the service and the services that depend on it are identified, and then the transactions in which the service participates are determined. Based on the execution status of the transactions, the state of the service within the countdown is determined, thereby identifying whether the service is in a static state.
[0067] Figure 3 A flowchart illustrating the process of determining the services involved in a transaction based on the dependencies of an analysis service according to an embodiment of this disclosure is shown. Figure 3 As shown, the step of analyzing the service's dependencies to determine the transactions in which the service participates includes steps S301-S303:
[0068] In step S301, the first transaction in which the service participates is determined based on the service instance dependency tree;
[0069] In step S302, the second transaction in which the service participates is determined based on the root service dependency tree;
[0070] In step S303, the first transaction and the second transaction are treated as transactions in which the service participates.
[0071] In this disclosure, the transactions involved by the service can be divided into two categories: transactions initiated by the service itself, and transactions initiated by the service as a root service. Therefore, identifying a service in a static state requires determining these two types of transactions, namely, the first transaction and the second transaction. The first transaction, i.e., the transaction initiated by the service itself, can be determined through the service instance dependency tree. The second transaction, i.e., the transaction initiated by the service as a root service, can be determined through the root service dependency tree. The construction of the service instance dependency tree and the root service dependency tree can refer to existing technologies and is not the focus of this application, so it will not be elaborated here. After obtaining the first and second transactions, both are considered as transactions involved by the service.
[0072] According to an embodiment of this disclosure, in step S203, the service is in a static state during the countdown, including:
[0073] If the service does not participate in the first transaction or the second transaction, then the service is determined to be in a static state during the countdown.
[0074] If the service only participates in the first transaction and the execution end time of the first transaction is within the countdown, then it is determined that the service is in a static state within the countdown.
[0075] If the service only participates in the second transaction and the execution end time of the second transaction is within the countdown, then it is determined that the service is in a static state within the countdown.
[0076] If the execution end times of the first and second transactions in which the service participates are both within the countdown, then the service is determined to be in a static state within the countdown.
[0077] Figure 4 A flowchart illustrating dynamic service updates according to embodiments of this disclosure is shown. Figure 4 As shown, the dynamic update of the service is performed in step S203, including steps S401-S402:
[0078] In step S401, if the service only participates in the first transaction, it is directly updated to the latest version of the service;
[0079] In step S402, if the service only participates in the second transaction, then the service is updated to the latest version while retaining the existing version.
[0080] In this disclosed method, if the service only participates in the first transaction, there is no need to consider the coexistence of the old and new versions, and the service is directly updated to the latest version; if the service only participates in the second transaction, considering that the execution time of the second transaction is relatively long, a coexistence strategy of the old and new versions is adopted, that is, while retaining the existing version of the service, it is updated to the latest version of the service to ensure the consistency of the runtime state of the old and new versions.
[0081] This disclosure also provides another method for dynamically updating the service in step S203, including:
[0082] Configure an update flag for the service that is in a static state during the countdown;
[0083] The service is dynamically updated based on the update flag.
[0084] In this disclosure, an update flag can be configured for the service that is in a static state during the countdown. For at least one device 102 that needs to be updated, services configured with the same update flag can be updated together, thereby improving efficiency.
[0085] Figure 5 A structural block diagram of a dynamic update apparatus for a distributed service according to an embodiment of the present disclosure is shown. This apparatus can be implemented as part or all of an electronic device through software, hardware, or a combination of both.
[0086] like Figure 5 As shown, the dynamic update device 500 for the distributed service includes: a startup module 510, a determination module 520, and a dynamic update module 530.
[0087] The startup module 510 is configured to receive service update requests sent by devices in the networking system and start a countdown.
[0088] The determining module 520 is configured to determine the status of the service during the countdown;
[0089] The dynamic update module 530 is configured to take the time when the service is in a static state during the countdown as the update start time and perform dynamic updates on the service.
[0090] The distributed service dynamic update device of this disclosure introduces a countdown mechanism, which takes the time when the service is in a static state within the countdown as the update start time, providing a suitable time to trigger the dynamic update of the service, ensuring the security of dynamic configuration, and ensuring that the system state before and after the update is legal and consistent.
[0091] According to embodiments of this disclosure, distributed services (hereinafter referred to as services) need to be deployed on different devices, and the entire set of machines where services are deployed together constitutes the business operating environment. For example, machines deploying distributed services... Figure 1 The device to be updated 102 shown, and for example Figure 1 The server 101 shown represents a publicly disclosed networking system.
[0092] According to embodiments of this disclosure, after receiving a service update request from the device to be updated 102 (also referred to as the device) in the networking system, the server 101 identifies the service status by starting a countdown. The service is dynamically updated only when it is identified as being in a static state within the countdown. This ensures that the device to be updated 102 receives feedback on whether to update after the maximum countdown time, avoiding long waiting times. Moreover, the static state of the service is considered a safe state for dynamic configuration, meaning that updating the service in this state is safe for the system, thereby ensuring that the system state before and after the update is legal and consistent.
[0093] According to embodiments of this disclosure, services are typically not isolated; a service may depend on the implementation of other services, and similarly, a service may be depended upon by other services. Currently, service-oriented distributed systems provide a description of the functional behavior of a service when registering individual service information on the server side, and simultaneously provide a description of the services that depend on that service. This allows for the search of matching dependent services based on the descriptions. These dependent services may be matched with locally dependent services, or they may be accessed transparently through a locally established service proxy for accessing remote services.
[0094] According to embodiments of this disclosure, the operation of the service is based on transaction control. The device to be updated 102 is configured with a transaction processing monitor responsible for transaction operation control. The monitor generates a transaction ID when the first service request of a certain transaction arrives, and records and manages the operation of each service in units of transactions.
[0095] According to embodiments of this disclosure, the portion of the determining module that determines the state of the service during the countdown is configured as follows:
[0096] Analyze the dependencies of the services to determine the transactions in which the services participate;
[0097] The state of the service during the countdown is determined based on the execution status of the transaction.
[0098] In this disclosed method, by analyzing the service dependencies, the service and the services that depend on it are identified, and then the transactions in which the service participates are determined. Based on the execution status of the transactions, the state of the service within the countdown is determined, thereby identifying whether the service is in a static state.
[0099] Figure 6 A structural block diagram of the determining module according to an embodiment of the present disclosure is shown. Figure 6 As shown, the determining module 520 includes:
[0100] The first determining submodule 521 is configured to determine the first transaction in which the service participates based on the service instance dependency tree;
[0101] The second determining submodule 522 is configured to determine the second transaction in which the service participates based on the root service dependency tree;
[0102] Transaction module 523 is configured to include the first transaction and the second transaction as transactions in which the service participates.
[0103] In this disclosure, the transactions involved by the service can be divided into two categories: transactions initiated by the service itself, and transactions initiated by the service as a root service. Therefore, identifying a service in a static state requires determining these two types of transactions, namely, the first transaction and the second transaction. The first transaction, i.e., the transaction initiated by the service itself, can be determined through the service instance dependency tree. The second transaction, i.e., the transaction initiated by the service as a root service, can be determined through the root service dependency tree. The construction of the service instance dependency tree and the root service dependency tree can refer to existing technologies and is not the focus of this application, so it will not be elaborated here. After obtaining the first and second transactions, both are considered as transactions involved by the service.
[0104] According to embodiments of this disclosure, the service is in a static state during the countdown, including:
[0105] If the service does not participate in the first transaction or the second transaction, then the service is determined to be in a static state during the countdown.
[0106] If the service only participates in the first transaction and the execution end time of the first transaction is within the countdown, then it is determined that the service is in a static state within the countdown.
[0107] If the service only participates in the second transaction and the execution end time of the second transaction is within the countdown, then it is determined that the service is in a static state within the countdown.
[0108] If the execution end times of the first and second transactions in which the service participates are both within the countdown, then the service is determined to be in a static state within the countdown.
[0109] According to embodiments of this disclosure, the portion of the dynamic update module that performs the dynamic update of the service is configured as follows:
[0110] If the service only participates in the first transaction, it will be directly updated to the latest version of the service;
[0111] If the service only participates in the second transaction, then the existing version of the service will be retained and updated to the latest version of the service.
[0112] In this disclosed method, if the service only participates in the first transaction, there is no need to consider the coexistence of the old and new versions, and the service is directly updated to the latest version; if the service only participates in the second transaction, considering that the execution time of the second transaction is relatively long, a coexistence strategy of the old and new versions is adopted, that is, while retaining the existing version of the service, it is updated to the latest version of the service to ensure the consistency of the runtime state of the old and new versions.
[0113] According to embodiments of this disclosure, the portion of the dynamic update module that performs the dynamic update of the service is configured as follows:
[0114] Configure an update flag for the service that is in a static state during the countdown;
[0115] The service is dynamically updated based on the update flag.
[0116] In this disclosure, an update flag can be configured for the service that is in a static state during the countdown. For at least one device 102 that needs to be updated, services configured with the same update flag can be updated together, thereby improving efficiency.
[0117] This disclosure also discloses an electronic device. Figure 7 A schematic structural block diagram of an electronic device according to an embodiment of the present disclosure is shown, such as Figure 7 As shown, the electronic device 700 includes a memory 701 and a processor 702; wherein,
[0118] The memory 701 is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor 702 to implement any method in the embodiments of this disclosure.
[0119] Receive service update requests from devices in the network system and start a countdown;
[0120] Determine the status of the service during the countdown;
[0121] The time point when the service is in a static state during the countdown is taken as the update start time, and the service is dynamically updated.
[0122] The distributed service dynamic update method of this disclosure receives a service update request sent by a device in the network system and starts a countdown to determine the state of the service within the countdown. The time point when the service is in a static state within the countdown is taken as the update start time, and the service is dynamically updated. This technical solution, by introducing a countdown mechanism and using the time point when the service is in a static state within the countdown as the update start time, provides a suitable time to trigger the dynamic update of the service, ensuring the security of dynamic configuration and guaranteeing that the system state before and after the update is legal and consistent.
[0123] According to embodiments of this disclosure, determining the state of the service during the countdown includes:
[0124] Analyze the dependencies of the services to determine the transactions in which the services participate;
[0125] The state of the service during the countdown is determined based on the execution status of the transaction.
[0126] According to embodiments of this disclosure, analyzing the dependencies of the service to determine the transactions in which the service participates includes:
[0127] The first transaction in which the service participates is determined based on the service instance dependency tree;
[0128] The second transaction in which the service participates is determined based on the root service dependency tree;
[0129] The first transaction and the second transaction are transactions in which the service participates.
[0130] According to embodiments of this disclosure, the service is in a static state during the countdown, including:
[0131] If the service does not participate in the first transaction or the second transaction, then the service is determined to be in a static state during the countdown.
[0132] If the service only participates in the first transaction and the execution end time of the first transaction is within the countdown, then it is determined that the service is in a static state within the countdown.
[0133] If the service only participates in the second transaction and the execution end time of the second transaction is within the countdown, then it is determined that the service is in a static state within the countdown.
[0134] If the execution end times of the first and second transactions in which the service participates are both within the countdown, then the service is determined to be in a static state within the countdown.
[0135] According to embodiments of this disclosure, the dynamic update of the service includes:
[0136] If the service only participates in the first transaction, it will be directly updated to the latest version of the service;
[0137] If the service only participates in the second transaction, then the existing version of the service will be retained and updated to the latest version of the service.
[0138] According to embodiments of this disclosure, the dynamic update of the service includes:
[0139] Configure an update flag for the service that is in a static state during the countdown;
[0140] The service is dynamically updated based on the update flag.
[0141] Figure 8 A schematic diagram of the structure of a computer system suitable for implementing a dynamic update method for a distributed service according to embodiments of the present disclosure is shown.
[0142] like Figure 8 As shown, the computer system 800 includes a processing unit 801, which can execute various processes described in the above embodiments according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage section 808 into a random access memory (RAM) 803. The RAM 803 also stores various programs and data required for the operation of the system 800. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0143] The following components are connected to I / O 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 LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed. The processing unit 801 can be implemented as a CPU, GPU, TPU, FPGA, NPU, etc.
[0144] In particular, according to embodiments of this disclosure, the methods described above can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising computer instructions that, when executed by a processor, implement the steps of the methods described above. In such embodiments, the computer program product can be downloaded and installed from a network via communication section 809, and / or installed from removable media 811.
[0145] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. 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 the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0146] The units or modules described in the embodiments of this disclosure can be implemented in software or programmable hardware. The described units or modules can also be located in a processor, and the names of these units or modules do not necessarily constitute a limitation on the unit or module itself.
[0147] In another aspect, this disclosure also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the electronic device or computer system described above; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to perform the methods described in this disclosure.
[0148] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
Claims
1. A method for dynamically updating a distributed service, comprising: Receive service update requests from devices in the network system and start a countdown; Determine the status of the service during the countdown; The time point when the service is in a static state during the countdown is taken as the update start time, and the service is dynamically updated. The dynamic updating of the service includes: If the service only participates in the first transaction, it will be directly updated to the latest version of the service; the first transaction is a transaction initiated by the service itself. If the service only participates in the second transaction, then the service will be updated to the latest version while retaining its existing version; the second transaction is the related transaction that is started as the root service.
2. The method according to claim 1, wherein determining the state of the service during the countdown includes: Analyze the dependencies of the services to determine the transactions in which the services participate; The state of the service during the countdown is determined based on the execution status of the transaction.
3. The method according to claim 2, wherein analyzing the service dependencies to determine the transactions in which the service participates includes: The first transaction in which the service participates is determined based on the service instance dependency tree; The second transaction in which the service participates is determined based on the root service dependency tree; The first transaction and the second transaction are transactions in which the service participates.
4. The method of claim 3, wherein the service is in a static state during the countdown, comprising: If the service does not participate in the first transaction or the second transaction, then the service is determined to be in a static state during the countdown. If the service only participates in the first transaction and the execution end time of the first transaction is within the countdown, then it is determined that the service is in a static state within the countdown. If the service only participates in the second transaction and the execution end time of the second transaction is within the countdown, then it is determined that the service is in a static state within the countdown. If the execution end times of the first and second transactions in which the service participates are both within the countdown, then the service is determined to be in a static state within the countdown.
5. The method according to claim 1, wherein dynamically updating the service includes: Configure an update flag for the service that is in a static state during the countdown; The service is dynamically updated based on the update flag.
6. A dynamic update device for a distributed service, comprising: The startup module is configured to receive service update requests sent by devices in the network system and start a countdown. The determination module is configured to determine the status of the service during the countdown; The dynamic update module is configured to take the time point when the service is in a static state during the countdown as the update start time and perform dynamic updates on the service. The dynamic updating of the service includes: If the service only participates in the first transaction, it will be directly updated to the latest version of the service; the first transaction is a transaction initiated by the service itself. If the service only participates in the second transaction, then the service will be updated to the latest version while retaining its existing version; the second transaction is the related transaction that is started as the root service.
7. An electronic device comprising a memory and a processor; wherein, The memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the steps of the method according to any one of claims 1-5.
8. A readable storage medium having computer instructions stored thereon, characterized in that, When executed by a processor, the computer instructions implement the steps of the method described in any one of claims 1-5.
9. A computer program product comprising computer instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1-5.
Citation Information
Patent Citations
Micro-service version safety revocation system and method based on time window division
CN115904408A