Micro-service configuration method and device
Patent Information
- Application Number
- CN202411524386.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-10-29
AI Technical Summary
The service throughput that microservices can handle per unit time is reduced, mainly due to frequent network I/O operations that lead to network blockage and delay.
By using the message middleware to pass configuration information, the second computing device is allowed to obtain configuration information from the message middleware and persistently store it locally, thereby reducing dependence on the database and reducing network I/O operations.
Reduces network overhead, improves the service throughput that microservices can handle per unit time, and improves the response speed of distributed systems.
Smart Images

Figure CN119603145A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a configuration method and device for microservices. Background Art
[0002] A large number of microservices are deployed in distributed systems. The operation of microservices depends on configuration information, such as the blacklist and whitelist of access users, queries per second (QPS), etc. When a microservice executes a business, it obtains the corresponding configuration information from the database through network input / output (I / O) operations. However, microservices frequently read configuration information from the database, which will generate a large number of network I / O operations. A large number of network I / O operations are prone to network congestion and delay, which will reduce the overall processing capacity of the distributed system, resulting in a decrease in the business throughput that the microservice can handle per unit time. Summary of the invention
[0003] The present application provides a microservice configuration method and device to solve the problem of reduced business throughput that can be processed by microservices per unit time.
[0004] In the first aspect, the present application provides a configuration method for a microservice. The configuration method for the microservice can be applied to a computer system or to a computing device that supports the computer system to implement the configuration method for the microservice. For example, the computer system can be called a distributed system, and the computing device is a server or a terminal. In a possible example, the aforementioned distributed system includes a first computing device and a second computing device, and microservices are deployed on the first computing device and the second computing device. The configuration method for the microservice includes: the first computing device obtains a first request carrying first configuration information of the microservice deployed on the second computing device, and the second computing device subscribes to a message middleware, and the message middleware is used to transmit the first configuration information. The first computing device sends the first configuration information to the message middleware, and the second computing device obtains the first configuration information from the message middleware, and stores the first configuration information locally. The first computing device receives the configuration result sent by the second computing device, and the configuration result is used to indicate whether the second computing device succeeds or fails in storing the first configuration information locally.
[0005] In the present application, the first computing device and the second computing device transmit configuration information by adopting the message middleware, and then after the second computing device obtains the first configuration information from the message middleware, the first configuration information is persistently stored locally, so that when the microservice on the second computing device executes business, there is no need to obtain the first configuration information from the database, but it can be obtained directly from the local, reducing network I / O operations, thereby reducing network overhead and improving the business throughput that the microservice can handle per unit time.
[0006] In a possible scenario, the second computing device persistently stores the first configuration information locally to indicate that the second computing device persistently stores the first configuration information in a memory or hard disk of the second computing device.
[0007] In a possible implementation, the message middleware is a message queue. The second computing device subscribes to the message middleware, including: the second computing device subscribes to a target topic in the message queue. The first computing device sends the first configuration information to the message middleware, including: the first computing device sends the first configuration information to a group under the target topic in the message queue. The second computing device obtains the first configuration information from the message middleware, including: the second computing device obtains the first configuration information from the group under the target topic in the message queue.
[0008] In the present application, by using the message queue as the message middleware, the first computing device and the second computing device are decoupled, and the first computing device is allowed to return immediately after sending the message without waiting for the second computing device to complete the processing, thereby improving the response speed of the distributed system and further improving the business throughput that the microservice can handle per unit time.
[0009] In a possible implementation, the message middleware is a publish / subscribe model or an enterprise service bus.
[0010] In a possible implementation, the microservice configuration method further includes: the first computing device outputting a configuration result.
[0011] In a possible scenario, the first computing device outputs the configuration result, including: the first computing device outputs the configuration result to a front end connected to the first computing device, and then the front end displays the configuration result.
[0012] In one possible implementation, the distributed system also includes a database, which stores second configuration information of the microservice. The configuration time of the second configuration information is earlier than the configuration time of the first configuration information. Before the first computing device obtains the first request, the configuration method of the above microservice also includes: the first computing device obtains the second configuration information from the database, and then persists the second configuration information locally.
[0013] In the present application, the first computing device can reduce the number of times the microservice on the first computing device obtains the second configuration information from the database when executing business by persistently storing the second configuration information in the database locally on the first computing device, thereby reducing network I / O operations, thereby reducing network overhead and improving the business throughput that the microservice can handle per unit time.
[0014] In a possible scenario, the second configuration information is configuration information of a microservice deployed on the first computing device.
[0015] In a possible implementation, the distributed system further includes a database, and the configuration method of the microservice further includes: the first computing device obtains a second request carrying an identifier of the first configuration information, and then sends the identifier of the first configuration information to the message middleware; wherein the message middleware is used to transmit the identifier of the first configuration information, and the identifier of the first configuration information is used to instruct the second computing device to store the first configuration information in the database. The first computing device obtains the first configuration information stored by the second computing device from the database, and outputs the first configuration information stored by the second computing device.
[0016] In the present application, the identifier of the first configuration information is transmitted between the first computing device and the second computing device through the message middleware. When the user needs to confirm the first configuration information, the first computing device transmits the identifier of the first configuration information to the second computing device through the message middleware, and then instructs the second computing device to send its local first configuration information to the database. The first computing device then obtains the first configuration information stored by the second computing device from the database, and outputs the aforementioned first configuration information to the user for confirmation, thereby ensuring the accuracy and consistency of the configuration information.
[0017] In a possible implementation, the configuration method of the microservice further includes: the first computing device obtains a second request carrying an identifier of the first configuration information, and then sends the identifier of the first configuration information to the message middleware; wherein the message middleware is used to transmit the identifier of the first configuration information, and the identifier of the first configuration information is used to instruct the second computing device to store the first configuration information in the database. The first computing device verifies the first configuration information stored in the database by the second computing device and the first configuration information stored in the database by the first computing device, and outputs the verification result. The verification result is used to indicate consistency or inconsistency.
[0018] In the present application, the first computing device verifies / compares the previously stored first configuration information with the first configuration information stored in the database by the second computing device to ensure that the configuration information used by the microservice in the second computing device is accurate, thereby improving the accuracy and consistency of the configuration information.
[0019] In a possible scenario, the first computing device further outputs the first configuration information stored in the database by the second computing device and the first configuration information stored in the database by the first computing device.
[0020] In a possible implementation, the microservice configuration method further includes: the first computing device stores the first configuration information in a database.
[0021] In a second aspect, the present application provides a configuration device for a microservice. The configuration device for a microservice is applied to a computer system or a computing device that supports the computer system to implement the configuration device for a microservice, and the configuration device for a microservice includes various modules for executing the configuration method for a microservice in the first aspect or any optional implementation of the first aspect. Exemplarily, the configuration device for a microservice includes: a first acquisition module, a subscription module, a sending module, a second acquisition module, and a receiving module.
[0022] The first acquisition module is used to acquire a first request; the first request carries: first configuration information of the microservice deployed on the second computing device.
[0023] The subscription module is used to subscribe to the message middleware; the message middleware is used to transmit the first configuration information.
[0024] A sending module is used to send first configuration information to the message middleware.
[0025] The second acquisition module is used to acquire the first configuration information from the message middleware and store the first configuration information persistently locally.
[0026] A receiving module is used to receive the configuration result sent by the second computing device; the configuration result is used to indicate whether the second computing device succeeds or fails in persistently storing the first configuration information locally.
[0027] For more detailed implementation content of the configuration device for microservices, please refer to the description of any implementation method in the first aspect above, as well as the content of the following specific implementation methods, which will not be repeated here.
[0028] In a third aspect, the present application provides a configuration system for microservices. The system includes a first computing device and a second computing device, and microservices are deployed on the first computing device and the second computing device. The first computing device is used to obtain a first request, and the first request carries: first configuration information of the microservice deployed on the second computing device. The second computing device is used to subscribe to a message middleware, and the message middleware is used to transmit the first configuration information. The first computing device is used to send the first configuration information to the message middleware. The second computing device is used to obtain the first configuration information from the message middleware and store the first configuration information persistently locally. The first computing device is used to receive the configuration result sent by the second computing device, and the configuration result is used to indicate whether the second computing device succeeds or fails in persistently storing the first configuration information locally.
[0029] For more detailed implementation content of the configuration system of microservices, please refer to the description of any implementation method in the first aspect above, as well as the content of the following specific implementation methods, which will not be repeated here.
[0030] In a fourth aspect, the present application provides a chip, comprising: a processor and an interface circuit; the interface circuit is used to obtain a first request, and the processor is used to execute the method in the above-mentioned first aspect or any possible implementation of the first aspect.
[0031] In a fifth aspect, the present application provides a computing device cluster. The computing device cluster includes at least one computing device, the computing device includes a memory and a processor, the memory is used to store computer instructions; when the processor executes the computer instructions, the method in the first aspect or any possible implementation of the first aspect is implemented.
[0032] In a sixth aspect, the present application provides a computer-readable storage medium, which stores a computer program or instruction. When the computer program or instruction is executed by a processing device, the method in the above-mentioned first aspect or any possible implementation method of the first aspect is implemented.
[0033] In a seventh aspect, the present application provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processing device, the method in the above-mentioned first aspect or any possible implementation manner of the first aspect is implemented.
[0034] The beneficial effects of the second to seventh aspects above can refer to the first aspect or any possible implementation of the first aspect, and will not be described in detail here. Based on the implementations provided by the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A schematic diagram of a computer system provided for this application;
[0036] Figure 2 A schematic diagram of a microservice configuration method provided for this application Figure 1 ;
[0037] Figure 3 A schematic diagram of a microservice configuration method provided for this application Figure 2 ;
[0038] Figure 4 A schematic diagram of a microservice configuration method provided for this application Figure 3 ;
[0039] Figure 5 A schematic diagram of the structure of a microservice configuration device provided in this application Figure 1 ;
[0040] Figure 6 A schematic diagram of the structure of a microservice configuration device provided in this application Figure 2 ;
[0041] Figure 7 A schematic diagram of the structure of a computing device provided for this application;
[0042] Figure 8 A schematic diagram of the structure of a computing device cluster provided for this application;
[0043] Fig. 9 A schematic diagram of the connection between computing devices provided for this application. DETAILED DESCRIPTION
[0044] In order to solve the problem of reduced business throughput that a microservice can handle per unit time, the present application provides a configuration method for a microservice. A first computing device obtains a first request carrying first configuration information of a microservice deployed on a second computing device, and the second computing device subscribes to a message middleware, which is used to transmit the first configuration information. The first computing device sends the first configuration information to the message middleware, and the second computing device obtains the first configuration information from the message middleware and stores the first configuration information persistently locally. The first computing device receives a configuration result sent by the second computing device, and the configuration result is used to indicate whether the second computing device succeeds or fails in persistently storing the first configuration information locally.
[0045] In the present application, the first computing device and the second computing device transmit configuration information by adopting the message middleware, and then after the second computing device obtains the first configuration information from the message middleware, the first configuration information is persistently stored locally, so that when the microservice on the second computing device executes business, there is no need to obtain the first configuration information from the database, but it can be obtained directly from the local, reducing network I / O operations, thereby reducing network overhead and improving the business throughput that the microservice can handle per unit time.
[0046] To facilitate understanding, the technical terms involved in this application are first introduced.
[0047] Microservices is a software architecture style that aims to decompose a single application into a set of small, independent services. These services can be developed, deployed, and expanded independently, each with specific business functions.
[0048] Message middleware is a supporting software system based on queue and message transmission technology, which provides synchronous or asynchronous, reliable message transmission for application systems in a network environment. Common message middleware may include: message queue, publish / subscribe model, enterprise service bus (ESB), lightweight messaging, etc.
[0049] Among them, the message queue is a message transmission mechanism that allows applications or devices to send and receive messages asynchronously through queues; the message queue is used to act as an intermediary between producers (such as the first computing device described below) and consumers (such as the second computing device described below). The producer sends messages to the queue, and the consumer reads messages from the queue. The publish / subscribe model is a message transmission mode that allows the publisher of the message (such as the first computing device described below) to send messages to a topic, and multiple subscribers can subscribe to the topic to receive related messages; the publish / subscribe model decouples messages from subscribers through topics, allowing multiple subscribers to receive the same message. The enterprise service bus is an architectural model that provides an integration platform for connecting and coordinating different applications, services, and devices; the enterprise service bus acts as an intermediary layer to handle communication, data conversion, and routing between services or devices. Lightweight messaging is a simplified message transmission mechanism that is usually simple to implement and takes up less resources, and is suitable for small and rapidly developed applications; lightweight messaging does not rely on complex middleware or heavy frameworks, and uses a simple application programming interface (API) for message transmission.
[0050] Reflection refers to the ability to dynamically obtain state information of an object (such as the second configuration information described below) and operate on it when an application or service is running, for example, reflecting the second configuration in the database to the first computing device.
[0051] See also Figure 1 , Figure 1 A schematic diagram of a computer system provided in this application. Figure 1 As shown, the computer system includes a computing device cluster 110 and a database 120. The computing device cluster 110 and the database 120 can communicate with each other via wired or wireless means.
[0052] Microservices are deployed on the computing device cluster 110 . The present application does not limit the types of services performed by the microservices. For example, the types may be: microservices for providing query functions, and microservices for providing payment functions.
[0053] In the present application, the computing device included in the computing device cluster 110 provides an access interface (such as an API) to the outside, and the access interface is used to obtain the first configuration information configured by the user. For a detailed description of the first configuration information, please refer to the following Figure 2 The contents shown will not be repeated here.
[0054] For example, a front end connected to a computing device (such as a console deployed thereon) can access the computing device through the above API, and then the front end sends a first request to the computing device through the console, and the first request carries the first configuration information configured by the user on the console.
[0055] The computing devices in the computing device cluster 110 cooperate to store the configuration information persistently in their local storage, such as the memory or hard disk of each computing device in the computing device cluster 110 .
[0056] The above-mentioned wired communication can be: Ethernet, optical fiber, and various peripheral component interconnect express (PCIe) buses, universal serial bus (USB) or unified bus (Ubus or UB), compute express link (CXL), cache coherent interconnect for accelerators (CCIX), etc., which are arranged inside the computer system to connect the computing device cluster 110 and the database 120.
[0057] The wireless communication may be: Internet, wireless fidelity (WIFI) and ultra wide band (UWB) technology.
[0058] In a possible scenario, the computing device in the computing device cluster 110 may include one or more processing units, which may be a graphics processing unit (GPU), a neural network processing unit (NPU), a central processing unit (CPU), a field programmable gate array (FPGA), an application processor (AP), a modem processor, an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a tensor processing unit (TPU), an application specific integrated circuit (ASIC), a discrete gate, a transistor logic device, a discrete hardware component and / or a baseband processor. Alternatively, it may be a processing device including any one or more of the above processing units, such as a terminal, a server, etc.
[0059] In another possible scenario, the computing device in the computing device cluster 110 may further include one or more memories. The memory includes a volatile memory, such as a random access memory (RAM). The memory may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid state drive (SSD). The memory stores executable program code or data generated during the operation of the component, and the computing device executes the executable program code to implement the functions of the components deployed thereon.
[0060] For the detailed structure of the computing device, please refer to the following Figure 7-Figure 9 The contents shown will not be repeated here.
[0061] The computing device cluster 110 includes: a plurality of computing devices. For example, the plurality of computing devices include computing device 111, computing device 112, and computing device 113. For example, the aforementioned plurality of computing devices may communicate with each other via wired means or wireless means. The computing devices may be servers, terminals, and the like.
[0062] In a possible example, one or more microservices are deployed in at least one computing device among the multiple computing devices.
[0063] In one possible example, the above-mentioned computer system may be referred to as a distributed system, a cloud computing platform, or a cloud service.
[0064] In a possible example, the computer system may further include terminal 130 , terminal 140 , and terminal 150 .
[0065] Terminal 130, terminal 140, and terminal 150 can be a mobile phone, a tablet computer, a handheld computer, a personal computer (PC), a cellular phone, a personal digital assistant (PDA), a wearable device (such as a smart watch), a smart home device (such as a television), a car computer, a game console, and an augmented reality (AR) / virtual reality (VR) device, etc. This application does not impose any special restrictions on the specific device forms of terminal 130, terminal 140, and terminal 150.
[0066] In another possible example, the terminal 130 , the terminal 140 , and the terminal 150 are independently configured and are communicatively connected to a computer system, that is, a distributed system.
[0067] It should be noted that Figure 1 The illustrated computer system architecture is only an example, and the device type or number of devices in the system can be configured according to actual needs, and the embodiments of the present application are not limited to this. For example, the computer system may also include more computing devices and storage devices.
[0068] The following will Figure 1 Based on the computer system shown, the implementation method of the microservice configuration method provided in the embodiment of the present application is further described in detail in combination with the accompanying drawings.
[0069] Figure 2 A schematic diagram of a microservice configuration method provided for this application Figure 1 The method provided in this embodiment can be applied to Figure 1In the computer system shown. Here, the configuration method of the microservice shown in the present application is executed by the computing device 111 as an example for explanation. The computing device 111 is deployed with a microservice, and the database 120 stores the configuration information a of the microservice. The configuration time of the configuration information a is earlier than the configuration time of the configuration information b. The configuration information a can be called the second configuration information, the configuration information b can be called the first configuration information, and the computing device 111 can be called the first computing device. Figure 2 As shown, the configuration method of the microservice includes the following steps S210 and S220.
[0070] S210 , the computing device 111 obtains configuration information a from the database 120 .
[0071] Exemplarily, the computing device 111 obtains the configuration information a corresponding to the microservice a from the database 120 according to the microservice a deployed on the computing device 111 .
[0072] For example, the computing device 111 obtains the configuration information a indicated by the identifier of the microservice a deployed on the computing device 111 from the database 120 .
[0073] The identifier of the microservice a may be the name of the microservice a, an identity document (ID), etc.
[0074] S220 , the computing device 111 stores the configuration information a persistently locally.
[0075] Exemplarily, the computing device 111 persistently stores the configuration information a in the memory of the computing device 111 .
[0076] For example, the computing device 111 stores the configuration information a in the database 120 persistently in the memory by reflection.
[0077] Exemplarily, the computing device 111 stores the configuration information a persistently in a hard disk of the computing device 111 .
[0078] It is worth noting that the above description only takes the computing device 111 in the computing device cluster as an example. In other embodiments of the present application, other computing devices in the computing device cluster (such as computing device 112 and computing device 113) can also obtain configuration information from the database 120 and store the configuration information persistently locally. Therefore, when the microservice on the computing device executes business, it only needs to obtain the corresponding configuration information from the local memory or hard disk, which reduces the I / O operation of the computing device when obtaining the configuration information from the database 120, speeds up the response speed of the microservice when executing the business, and thus improves the business throughput that the microservice can handle per unit time.
[0079] Figure 2 The configuration information a stored in the database 120 is persistently stored in the computing device 111. Figure 1 , Figure 2 Based on the content shown, the computing device 111 can also broadcast the newly received configuration information (configuration information b) so that other computing devices (such as computing device 112) can obtain the configuration information b and store it persistently locally.
[0080] like Figure 3 As shown, Figure 3 A schematic diagram of a microservice configuration method provided for this application Figure 2 The method provided in this embodiment can be applied to Figure 1 In the computer system shown, microservices are deployed on computing devices 111 and 112. The microservice deployed on computing device 112 may be referred to as microservice b, and request a may be referred to as a first request. Figure 3 As shown, the configuration method of the microservice includes the following steps S310-S350.
[0081] S310 , the computing device 111 obtains request a.
[0082] In a possible scenario, request a carries configuration information b of a microservice (microservice b) deployed on the computing device 112 .
[0083] In another possible scenario, request a carries the identifier of microservice b and configuration information b of microservice b.
[0084] Exemplarily, the configuration information b includes any one or more of the following: network configuration, database configuration, environment variables, log configuration, message queue configuration, security configuration, current limiting configuration, load balancing configuration, monitoring and alarm configuration, etc. of microservice b.
[0085] For example, network configuration includes: the host name or Internet Protocol (IP) address of the microservice, the port number monitored by the microservice, and the API of the microservice. Database configuration includes: database connection string and credentials used to identify to the database. Environment variables include: development / production environment identifier, configuration of specific environments, such as API keys, credentials of external services, etc. Log configuration includes: log level, log storage path, etc. Message queue configuration includes: message broker address (such as connection information of RabbitMQ, Kafka, etc.), queue name. Security configuration includes: authentication and authorization information, certificates and keys for encrypted communication, and blacklists and whitelists of access users. Current limiting configuration includes: QPS limit, request frequency, etc. Load balancing includes: load balancing strategy (such as polling, weighted, random, etc.), monitoring check configuration (such as defining anchor points and frequency of health monitoring). Monitoring and alarm configuration includes: monitoring indicators (such as number of API calls, response time, etc.), alarm rules. Alarm rules are used to define when to trigger alarms. For example, an alarm is triggered when the number of API calls exceeds 20 times within 10 seconds.
[0086] In a possible implementation, the computing device 111 obtains the request a, including: the computing device 111 obtains the request a sent by the terminal 130 .
[0087] In a possible example, the terminal 130 accesses the computing device 111 through the API provided by the computing device 111 to display the user interface on the computing device 111. Then, the user triggers the control component on the user interface through various input devices (keyboard, mouse, touch screen, etc.) connected to the terminal 130, so that the terminal 130 obtains the configuration information b configured by the user according to the triggering operation, and then sends the request a carrying the configuration information b to the computing device 111.
[0088] For the specific implementation of triggering actions, three possible examples are provided below.
[0089] Example 1: The trigger operation may be the user's confirmation of the control component through the keyboard, such as the trigger operation is the confirmation (enter) key triggered by the user to confirm the configuration information b configured by the user.
[0090] Example 2: The trigger operation may be a user clicking the control component with a mouse.
[0091] Exemplarily, a plurality of control components corresponding to the candidate items are displayed on the user interface, and the user can click the aforementioned control components with a mouse to determine that the candidate item corresponding to the clicked control component is a QPS threshold, a user's blacklist or whitelist, etc.
[0092] For example, the multiple candidate items are multiple values of QPS (such as 50, 60, 80, 85, 92, etc.), user identifiers included in the blacklist or whitelist, etc.
[0093] Example 3: The trigger operation may be an input operation of the user in the control component through the keyboard, such as input configuration information or content included in the configuration information (such as QPS threshold, user blacklist and whitelist, etc.).
[0094] S320 , the computing device 112 subscribes to the message middleware.
[0095] In a possible scenario, the message middleware is used to transmit the configuration information b.
[0096] For example, the message middleware is used to transmit configuration information b between multiple computing devices included in the computing device cluster 110 .
[0097] In a possible scenario, the message middleware is any one of the following: message queue, publish / subscribe model, enterprise service bus, lightweight messaging.
[0098] For the content of the message middleware as a message queue, a possible embodiment is provided below, which is not described in detail here. For the content of the message middleware as a publish / subscribe model, enterprise service bus or lightweight messaging, the following description of the message middleware as a message queue can be referred to, which is not described in detail here.
[0099] For the computing device 112 to subscribe to the message middleware, a possible implementation is provided as follows.
[0100] The computing device 112 confirms the message middleware used by the computing device 111, and then installs the corresponding client (client library) on the computing device 112. The client is configured to connect to the server where the message middleware is located and declare the message middleware to be subscribed, thereby enabling the computing device 112 to subscribe to the message middleware.
[0101] Exemplarily, the computing device 112 configures connection parameters such as the address and port number of the server on the client to connect the client to the server where the message middleware is located.
[0102] Exemplarily, the computing device 112 configures the identifier of the message middleware or the identifier of a group in the message middleware on the client to declare the message middleware to be subscribed, so that the computing device 112 subscribes to the message middleware.
[0103] In a possible scenario, a callback function is further configured on the computing device 112 , and the callback function is used to process the message (such as configuration information b) obtained from the message middleware.
[0104] It is worth noting that the name of the message middleware that the client declares to subscribe to is consistent with the name used by the computing device 111 when sending the configuration information b. After subscribing to the message middleware, the computing device 112 can continuously obtain messages from the message middleware.
[0105] S330 , the computing device 111 sends configuration information b to the message middleware.
[0106] In a possible implementation, the computing device 111 sends the configuration information b to the message middleware, including: the computing device 111 sends the configuration information b to the device where the message middleware is located. The device may be a server or a terminal.
[0107] In another possible implementation, the computing device 111 sends the configuration information b to the message middleware, including: the computing device 111 sends the configuration information b to the target topic in the message middleware.
[0108] S340 , the computing device 112 obtains configuration information b from the message middleware, and stores the configuration information b persistently locally.
[0109] In a possible implementation, the computing device 112 obtains the configuration information b from the message middleware, including: the computing device 112 obtains the configuration information b from the message middleware by polling.
[0110] For example, the computing device 112 obtains the configuration information b from the target topic in the message middleware by polling.
[0111] In another possible implementation, the computing device 112 obtains the configuration information b from the message middleware, including: the computing device 112 receives the configuration information b pushed by the message middleware.
[0112] For example, after the computing device 112 defines the target topic, when the configuration information b sent by the computing device 111 exists under the target topic, the message middleware pushes the configuration information b to the computing device 112 .
[0113] In a possible implementation, the computing device 112 persistently stores the configuration information b locally, including: the computing device 112 persistently stores the configuration information b in the memory of the computing device 112 .
[0114] In another possible implementation, the computing device 112 persistently stores the configuration information b locally, including: the computing device 112 persistently stores the configuration information b in a hard disk of the computing device 112 .
[0115] In one possible scenario, if the computing device 112 has stored historical configuration information of microservice b (such as the above-mentioned configuration information a), the computing device 112 will delete the historical configuration information, thereby updating the configuration information persistently stored locally on the computing device 112 .
[0116] In a possible scenario, after the computing device 112 obtains the configuration information b from the message middleware, the method further includes: the computing device 112 verifies the accuracy of the configuration information b. If the verification passes, the configuration information b is persistently stored locally; if the verification fails, the configuration information b is deleted.
[0117] For the above accuracy check, two possible examples are provided below.
[0118] Example 1: The computing device 112 verifies the user identification indicated by the configuration information b.
[0119] For example, the computing device 112 only persistently stores the configuration information b configured by the designated user. The designated user is, for example, an administrator, a user in a whitelist, etc. The user identifier is the identifier of the administrator, a user in a whitelist, etc.
[0120] Example 2: The computing device 112 compares the hash value of the configuration information b.
[0121] For example, the computing device 112 calculates the hash value a of the obtained configuration information b, and obtains the hash value b sent by the computing device 111 through the message queue, and compares the hash value a and the hash value b to see if they are consistent. If the hash value a and the hash value b are consistent, the verification passes; if the hash value a and the hash value b are inconsistent, the verification fails. Among them, the hash value b is calculated by the computing device 111 according to the configuration information b sent by the terminal 130.
[0122] S350 , the computing device 111 receives the configuration result sent by the computing device 112 .
[0123] The configuration result is used to indicate whether the computing device 112 succeeds or fails in persistently storing the configuration information b locally.
[0124] In one possible scenario, the configuration result is expressed as: the configuration information b is successfully or failedly stored locally on the computing device 112, that is, a field indicating "configuration success" or "configuration failure". A successful configuration indicates that the configuration information b is successfully stored locally on the computing device 112, and a failed configuration indicates that the configuration information b is failedly stored locally on the computing device 111.
[0125] In another possible scenario, the configuration result is expressed as follows: the configuration information stored locally on the computing device 112. If the configuration information stored locally on the computing device 112 includes configuration information b, then the configuration information b is successfully persistently stored locally on the computing device 112; if the configuration information stored locally on the computing device 112 does not include configuration information b, then the configuration information b is failed to be persistently stored locally on the computing device 112.
[0126] In a possible implementation, the computing device 111 receives the configuration result sent by the computing device 112 , including: the computing device 111 directly receives the configuration result sent by the computing device 112 .
[0127] In another possible implementation, the computing device 111 receives the configuration result sent by the computing device 112 , including: the computing device 111 receives the configuration result sent by the computing device 112 through a message queue.
[0128] It is worth noting that the above description only takes the example of microservice b being deployed in computing device 112 in computing device cluster 110. In other embodiments of the present application, other computing devices (such as computing device 111, computing device 113, etc.) in computing device cluster 110 except computing device 112 may also be deployed with microservice b. Then computing device 111 and computing device 113 may execute the content executed by the above computing device 112, which is not repeated here.
[0129] Exemplarily, the same microservice b is deployed on the computing device 111 and the computing device 112 , and thus the computing device 111 also persistently stores the configuration information b locally.
[0130] For example, after receiving request a, the computing device 111 persistently stores the configuration information b in request a locally on the computing device 111 . For example, the local on the computing device 111 is a memory or a hard disk in the computing device 111 .
[0131] For another example, the computing device 111 also subscribes to the message queue, and then obtains the configuration information b from the message queue, and persistently stores the configuration information b locally on the computing device 111 .
[0132] In one possible scenario, the computing device 111 outputs the configuration result.
[0133] Exemplarily, the computing device 111 outputs the configuration result to a front end connected to the computing device 111 , and the front end displays the configuration result.
[0134] For example, the front end may be a display device or a terminal, such as terminal 130, terminal 140, and terminal 150. For example, the front end displays the configuration result on a console interface.
[0135] In one possible scenario, the computing device 111 also stores the configuration information b in the database 120, thereby backing up the configuration information b or verifying the configuration information persistently stored in the computing device. Figure 4 The description of the contents shown will not be repeated here.
[0136] exist Figure 3 Based on the content shown, the present application also provides a possible embodiment, which is used to illustrate the configuration method of microservices when the above-mentioned message middleware is a message queue. The content of this embodiment may include the following steps ① to ⑤.
[0137] Step ①: The computing device 111 obtains request a.
[0138] Step ②: The computing device 112 subscribes to the target topic in the message queue.
[0139] Exemplarily, the topic is used as a classification identifier of the message (configuration information) in the message queue, and the target topic is the classification identifier to which the configuration information b belongs. Only computing devices that have subscribed to the target topic in the message queue can receive the messages in the target topic.
[0140] In a possible example, the classification identifier of the target topic matches the identifier of the microservice, such as only the configuration information b of the microservice b is stored in the target topic.
[0141] In another possible example, the classification identifier of the target topic matches the type of the microservice, such as only the configuration information b of the microservice b that implements the query function is stored in the target topic.
[0142] Step ③: The computing device 111 sends configuration information b to the target topic in the message queue.
[0143] Step ④: The computing device 112 obtains the configuration information b from the target topic in the message queue, and stores the configuration information b persistently locally.
[0144] Exemplarily, after obtaining the configuration information b through the callback function, the computing device 112 stores the configuration information b persistently in the memory, thereby reducing the network I / O operation when the microservice reads the configuration information and obtains the configuration information from the database 120, thereby reducing the network overhead and improving the business throughput that the microservice can handle per unit time.
[0145] Step ⑤: The computing device 111 receives the configuration result sent by the computing device 112.
[0146] For the contents of the above steps ① and ⑤, please refer to the descriptions of S310 and S350 above, which will not be repeated here.
[0147] It is worth noting that this embodiment only takes the example of microservice b being deployed in computing device 112, and computing device 112 subscribing to the target topic in the message queue. In other embodiments of the present application, microservice b is also deployed on other computing devices in computing device cluster 110 except computing device 112, and the other computing devices will also subscribe to the target topic in the message queue and implement the contents of steps ③ to ⑤ above.
[0148] For example, the other computing devices and the computing device 112 subscribe to the same target topic, so that the other computing devices and the computing device 112 can obtain the configuration information b.
[0149] exist Figure 3 Based on the content shown, the present application also provides a possible embodiment. The content shown in this embodiment is used to confirm the configuration information of the persistent storage of the computing devices in the computer cluster 110. Figure 4 A schematic diagram of a microservice configuration method provided for this application Figure 3 ,like Figure 4 As shown, the configuration method of the microservice includes the following steps S410-S440.
[0150] S410 , the computing device 111 obtains request b.
[0151] The request b carries the identifier of the configuration information b.
[0152] Exemplarily, the identifier of the configuration information b is the name or ID of the configuration information b.
[0153] Regarding the computing device 111 obtaining the content of the request b, reference may be made to the description of S310 above, which will not be elaborated herein.
[0154] S420 , the computing device 111 sends the identifier of the configuration information b to the message middleware.
[0155] In a possible scenario, the message middleware is further used to transmit an identifier of the configuration information b, wherein the identifier of the configuration information b is used to instruct the computing device 112 to store the configuration information b in the database 120 .
[0156] Exemplarily, the computing device 112 subscribes to the message middleware, and then the computing device 111 sends the identifier of the configuration information b to the message middleware, and the computing device 112 obtains the identifier of the configuration information b from the message queue. The computing device 112 is configured with a callback function, and the callback function is used to send the configuration information b persistently stored in the computing device 112 to the database 120 for storage after obtaining the identifier of the configuration information b.
[0157] For example, the computing device 112 sends the persistently stored configuration information b to the designated area in the database 120 for storage. The designated area may be configured in advance by the user in the computing device 112 or the computing device 111, such as configuring the address or sector of the designated area.
[0158] For the identification of the computing device 111 sending the configuration information b to the message middleware, reference may be made to the description of S330 above, which will not be elaborated here.
[0159] S430 , the computing device 111 obtains the configuration information b stored by the computing device 112 from the database 120 .
[0160] Exemplarily, the computing device 111 obtains the configuration information b stored by the computing device 112 from a designated area in the database 120 .
[0161] S440 , the computing device 111 outputs the configuration information b stored by the computing device 112 .
[0162] Exemplarily, the computing device 111 outputs the configuration information b stored in the computing device 112 to a front end connected to the computing device 111 , and the front end then displays the configuration information b stored in the computing device 112 .
[0163] It is worth noting that Figure 4 The content shown is only illustrated by taking the example of microservice b being deployed in computing device 112. In other embodiments of the present application, other computing devices (such as computing device 111, computing device 113, etc.) in computing device cluster 110 in addition to computing device 112 may also be deployed with microservice b. Then computing device 111 and computing device 113 may execute the content executed by the above computing device 112, which is not repeated here.
[0164] Exemplarily, the same microservice b is deployed on computing device 113 and computing device 112, and computing device 113 also sends configuration information b to database 120 for storage according to the identifier of configuration information b, and computing device 111 obtains configuration information b stored in computing device 113 and configuration information b stored in computing device 112 from database 120, and outputs configuration information b stored in computing device 113 and configuration information b stored in computing device 112 to terminal 130, which displays them, such as on the console of terminal 130.
[0165] In another possible embodiment of the present application, after the above S430, the computing device 111 verifies the configuration information b stored in the computing device 112 and the configuration information b stored in the computing device 111 to obtain a verification result. Then, the computing device 111 outputs the verification result to the terminal 130, and the console on the terminal 130 displays the verification result.
[0166] The above verification result is used to indicate that the configuration information b stored in the computing device 112 is consistent with the configuration information b stored in the computing device 111, or that the configuration information b stored in the computing device 112 is inconsistent with the configuration information b stored in the computing device 111.
[0167] It is understandable that in order to implement the functions in the above embodiments, the computing device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and method steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application scenario and design constraints of the technical solution. In combination with the above Figures 2 to 4 , describes in detail the configuration method of the microservices provided in this embodiment, and will be combined with Figure 5 , describing a configuration device for microservices provided according to this embodiment.
[0168] Figure 5 A schematic diagram of the structure of a microservice configuration device provided in this application Figure 1 The configuration device of the microservice can be used to implement the functions of the computing device 111 and the computing device 112 in the above method embodiment, and thus can also achieve the beneficial effects of the above method embodiment. In this embodiment, the configuration device 500 of the microservice can be a module (such as a chip) of the computing device 111 and the computing device 112.
[0169] like Figure 5As shown, the microservice configuration device 500 includes a first acquisition module 510, a subscription module 520, a sending module 530, a second acquisition module 540, and a receiving module 550. The microservice configuration device 500 is used to implement the above Figures 2 to 4 In one possible example, the microservice configuration device 500 is used to implement the microservice configuration method, and the specific process includes the following process:
[0170] The first acquisition module 510 is used to acquire a first request; the first request carries: first configuration information of the microservice deployed on the second computing device.
[0171] The subscription module 520 is used to subscribe to a message middleware; the message middleware is used to transmit the first configuration information.
[0172] The sending module 530 is used to send the first configuration information to the message middleware.
[0173] The second acquisition module 540 is used to acquire the first configuration information from the message middleware, and store the first configuration information persistently locally.
[0174] The receiving module 550 is used to receive the configuration result sent by the second computing device; the configuration result is used to indicate whether the second computing device succeeds or fails in persistently storing the first configuration information locally.
[0175] To further achieve the above Figures 2 to 4 The present application also provides a microservice configuration device, such as Figure 6 As shown, Figure 6 A schematic diagram of the structure of a microservice configuration device provided in this application Figure 2 The microservice configuration device 500 further includes: an output module 560 , a persistence module 570 , and a confirmation module 580 .
[0176] The output module 560 is used to output the configuration result.
[0177] The persistence module 570 is used to obtain the second configuration information from the database and store the second configuration information locally in a persistent manner. The database stores the second configuration information of the microservice, and the configuration time of the second configuration information is earlier than the configuration time of the first configuration information.
[0178] The confirmation module 580 is used to obtain a second request, the second request carries an identifier of the first configuration information. The identifier of the first configuration information is sent to the message middleware; the message middleware is used to transmit the identifier of the first configuration information, and the identifier of the first configuration information is used to instruct the second computing device to store the first configuration information in a database. The first configuration information stored by the second computing device is obtained from the database, and the first configuration information stored by the second computing device is output.
[0179] It should be noted that, in other embodiments, the first acquisition module 510 can be used to execute any step in the configuration method of the microservice, the subscription module 520 can be used to execute any step in the configuration method of the microservice, the sending module 530 can be used to execute any step in the configuration method of the microservice, the second acquisition module 540 can be used to execute any step in the configuration method of the microservice, and the receiving module 550 can be used to execute any step in the configuration method of the microservice. The steps that the first acquisition module 510, the subscription module 520, the sending module 530, the second acquisition module 540, and the receiving module 550 are responsible for implementing can be specified as needed, and the first acquisition module 510, the subscription module 520, the sending module 530, the second acquisition module 540, and the receiving module 550 respectively implement different steps in the configuration method of the microservice to realize all functions of the configuration device 500 of the microservice.
[0180] It is worth noting that the computing device according to the embodiment of the present application may correspond to the configuration device 500 of the microservice in the embodiment of the application, and may correspond to executing the method according to the embodiment of the present application. Figures 2 to 4 The corresponding corresponding subjects, and the operations and / or functions of each module in the microservice configuration device 500 are respectively to achieve Figures 2 to 4 For the sake of brevity, the corresponding processes of each method in the corresponding embodiments are not repeated here.
[0181] When the configuration device 500 of the microservice implements the configuration method of the microservice shown in any of the above-mentioned figures through software, the configuration device 500 of the microservice and its various units may also be software modules. The configuration method of the above-mentioned microservice is implemented by calling the software module through a processor. The processor may be a CPU, an ASIC implementation, or a programmable logic device (PLD), and the above-mentioned PLD may be a complex programmable logical device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0182] For a more detailed description of the configuration device 500 of the above-mentioned microservice, please refer to the relevant description in the embodiment shown in the aforementioned figures, which will not be repeated here. It can be understood that the configuration device 500 of the microservice shown in the aforementioned figures is only an example provided by this embodiment. The configuration device 500 of the microservice may include more or fewer units according to different usage scenarios, and this application is not limited to this.
[0183] When the configuration device 500 of the microservice is implemented by hardware, the hardware can be implemented by a processor or a chip. The chip includes an interface circuit and a processor. The interface circuit is used to receive requests (such as request a, request b) from other devices outside the processor and transmit them to the processor, or send data (such as configuration information b) from the processor to other devices outside the processor.
[0184] The processor and the interface circuit are used to implement any possible implementation method in the above embodiments through logic circuits or execution code instructions. The beneficial effects can be found in the description of any aspect of the above embodiments, which will not be repeated here.
[0185] It is understood that the processor in the embodiments of the present application may be a CPU, NPU or GPU, or other general-purpose processors, digital signal processors (DSP), ASICs, FPGAs or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0186] in addition, Figure 5 , Figure 6 The configuration device 500 of the microservice shown can also be implemented by a computing device, such as Figure 1 The computing device 111 and the computing device 112 shown in FIG. 1 , or a computer system including the computing device 111 and the computing device 112 , etc.
[0187] The method steps in the embodiments of the present application can also be implemented by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM, flash memory, ROM, programmable read only memory (PROM), erasable programmable read only memory (EPROM), electrically erasable programmable read only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a communication device. Of course, the processor and the storage medium can also be present in a communication device as discrete components.
[0188] The present application also provides a chip system, which includes a processor for implementing the function of the storage device in the above method. In one possible design, the chip system also includes a memory for storing program instructions and / or data. The chip system can be composed of a chip or a chip and other discrete devices.
[0189] The present application also provides a computing device, please refer to Figure 7 , Figure 7 A schematic diagram of the structure of a computing device provided in the present application. The computing device 700 includes a bus 702, a processor 704, a memory 706, and a communication interface 708. The processor 704, the memory 706, and the communication interface 708 are connected to each other through the bus 702. The computing device 700 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 700. For example, the computing device 700 can be the above-mentioned computing device 111 or computing device 112.
[0190] The bus 702 may be a PCIe bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The bus 702 may include a path for transmitting information between various components of the computing device 700 (eg, the processor 704, the memory 706, and the communication interface 708).
[0191] The processor 704 may include any one or more processors such as a CPU, a GPU, an FPGA, a microprocessor (MP) or a DSP.
[0192] The memory 706 may include a volatile memory, such as a RAM. The processor 704 may also include a non-volatile memory, such as a ROM, a flash memory, a HDD or a SSD.
[0193] The memory 706 stores executable program codes, and the processor 704 executes the executable program codes to respectively implement the functions of the first acquisition module 510, the subscription module 520, the sending module 530, the second acquisition module 540, and the receiving module 550, thereby implementing the configuration method of the microservice. That is, the memory 706 stores instructions for executing the configuration method of the microservice.
[0194] The communication interface 708 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 700 and other devices or communication networks. The computing device 700 may be a computer (e.g., a server) in a cloud data center, or a computer in an edge data center, or a terminal.
[0195] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device, which can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop, a laptop, or a smart phone. For example, the computing device cluster can be the above-mentioned computer system.
[0196] like Figure 8 As shown, Figure 8 A schematic diagram of the structure of a computing device cluster provided in the present application. The computing device cluster includes at least one computing device 700. The memory 706 in one or more computing devices 700 in the computing device cluster may store the same instructions for executing the configuration method of the microservice.
[0197] In some possible implementations, the memory 706 of one or more computing devices 700 in the computing device cluster may also store partial instructions for executing the configuration method of the microservice. In other words, the combination of one or more computing devices 700 may jointly execute the instructions for executing the configuration method of the microservice.
[0198] It should be noted that the memory 706 in different computing devices 700 in the computing device cluster can store different instructions, which are respectively used to execute part of the functions of the configuration method of the microservice. That is, the instructions stored in the memory 706 in different computing devices 700 can implement the functions of one or more modules of the first acquisition module 510, the subscription module 520, the sending module 530, the second acquisition module 540, and the receiving module 550.
[0199] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig. 9 A possible implementation is shown. Fig. 9 As shown, Fig. 9 A schematic diagram of a connection between computing devices provided in the present application, wherein two computing devices 700A and 700B are connected via a network. Specifically, the connection is made to the network via a communication interface in each computing device. In this type of possible implementation, the memory 706 in the computing device 700A stores instructions for executing the functions of the first acquisition module 510, the sending module 530, and the receiving module 550. At the same time, the memory 706 in the computing device 700B stores instructions for executing the functions of the subscription module 520 and the second acquisition module 540.
[0200] It should be understood that Fig. 9 The functions of the computing device 700A shown in FIG. 7 may also be completed by multiple computing devices 700. Similarly, the functions of the computing device 700B may also be completed by multiple computing devices 700.
[0201] The embodiment of the present application also provides a computer program product including instructions. The computer program product may be a software or program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the above-mentioned configuration method of the microservice.
[0202] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by the computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (DVD)), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute a configuration method for a microservice.
[0203] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the embodiment of the present application is executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device or other programmable device. The computer program or instruction may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instruction may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, for example, a floppy disk, a hard disk, a tape; it may also be an optical medium, for example, a DVD; it may also be a semiconductor medium, for example, an SSD.
[0204] In each embodiment of the present application, if there is no special explanation and logical conflict, the terms and / or descriptions between different embodiments are consistent and can be referenced to each other, and the technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationships. The various digital numbers involved in the embodiments of the present application are only used to distinguish for the convenience of description and are not used to limit the scope of the embodiments of the present application. The size of the sequence number of the above-mentioned processes does not mean the order of execution, and the execution order of each process should be determined by its function and inherent logic.
Claims
1. A microservice configuration method, characterized in that: The method is applied to a distributed system, the distributed system includes a first computing device and a second computing device, and microservices are deployed on the first computing device and the second computing device; the method includes: The first computing device obtains a first request; the first request carries: first configuration information of a microservice deployed on the second computing device; The second computing device subscribes to a message middleware; the message middleware is used to transmit the first configuration information; The first computing device sends first configuration information to the message middleware; The second computing device obtains the first configuration information from the message middleware, and persistently stores the first configuration information locally; The first computing device receives a configuration result sent by the second computing device; the configuration result is used to indicate whether the second computing device succeeds or fails in persistently storing the first configuration information locally.
2. The method according to claim 1, characterized in that: The message middleware is a message queue; the second computing device subscribes to the message middleware, including: The second computing device subscribes to a target topic in a message queue; The first computing device sends first configuration information to the message middleware, including: The first computing device sends first configuration information to the target topic in the message queue; The second computing device obtains the first configuration information from the message middleware, including: The second computing device obtains the first configuration information from the target topic in the message queue.
3. The method according to claim 1, characterized in that The message middleware is a publish / subscribe model or an enterprise service bus.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: The first computing device outputs the configuration result.
5. The method according to any one of claims 1 to 4, characterized in that The distributed system further includes a database, wherein second configuration information of the microservice is stored in the database, wherein a configuration time of the second configuration information is earlier than a configuration time of the first configuration information, and before the first computing device obtains the first request, the method further includes: The first computing device obtains the second configuration information from the database; The first computing device persistently stores the second configuration information locally.
6. The method according to any one of claims 1 to 5, characterized in that The distributed system further includes a database, and the method further includes: The first computing device obtains a second request; the second request carries an identifier of the first configuration information; The first computing device sends an identifier of the first configuration information to the message middleware; the message middleware is used to transmit the identifier of the first configuration information, and the identifier of the first configuration information is used to instruct the second computing device to store the first configuration information in the database; The first computing device acquires the first configuration information stored by the second computing device from the database; The first computing device outputs the first configuration information stored by the second computing device.
7. The method according to claim 5 or 6, characterized in that: The method further comprises: The first computing device stores the first configuration information in the database.
8. A microservice configuration system, characterized in that: The system includes a first computing device and a second computing device, wherein microservices are deployed on the first computing device and the second computing device; The first computing device is used to obtain a first request; The first request carries: first configuration information of a microservice deployed on the second computing device; The second computing device is used to subscribe to a message middleware; the message middleware is used to transmit the first configuration information; The first computing device is used to send first configuration information to the message middleware; The second computing device is used to obtain the first configuration information from the message middleware, and store the first configuration information persistently locally; The first computing device is used to receive the configuration result sent by the second computing device; The configuration result is used to indicate whether the second computing device succeeds or fails in persistently storing the first configuration information locally.
9. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program or instructions, and when the computer program or instructions are executed by a computing device, the method according to any one of claims 1 to 7 is implemented.
11. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a computing device, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Configuration information acquisition method, device and equipment and computer readable storage medium
CN110190997A
Configuration processing method and device based on micro-service architecture and storage medium
CN115473809A
Data processing method, configuration center system, electronic equipment and storage medium
CN115562757A
Micro-service management system and management method based on embedded system
CN116567080A
Database synchronization system, method and device, electronic equipment and medium
CN118467637A