[go: up one dir, main page]

CN119603145A - Micro-service configuration method and device - Google Patents

Micro-service configuration method and device Download PDF

Info

Publication number
CN119603145A
CN119603145A CN202411524386.6A CN202411524386A CN119603145A CN 119603145 A CN119603145 A CN 119603145A CN 202411524386 A CN202411524386 A CN 202411524386A CN 119603145 A CN119603145 A CN 119603145A
Authority
CN
China
Prior art keywords
computing device
configuration information
configuration
micro
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411524386.6A
Other languages
Chinese (zh)
Inventor
季伟男
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Huawei Cloud Computing Technology Co ltd
Original Assignee
Shenzhen Huawei Cloud Computing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Huawei Cloud Computing Technology Co ltd filed Critical Shenzhen Huawei Cloud Computing Technology Co ltd
Priority to CN202411524386.6A priority Critical patent/CN119603145A/en
Publication of CN119603145A publication Critical patent/CN119603145A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • H04L41/083Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability for increasing network speed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/085Retrieval of network configuration; Tracking network configuration history
    • H04L41/0853Retrieval of network configuration; Tracking network configuration history by actively collecting configuration information or by backing up configuration information

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method and a device for configuring micro services, and relates to the technical field of computers. The first computing device obtains a first request carrying first configuration information of a micro-service deployed on a second computing device, the second computing device being subscribed to message middleware for communicating 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 persistently stores the first configuration information locally. The first computing device receives a configuration result sent by the second computing device, where the configuration result is used to instruct the second computing device to persist the first configuration information locally to success or failure. When the micro-service execution service on the second computing device is realized, the first configuration information is not required to be acquired from the database, but the first configuration information can be acquired from the local, so that the network I/O operation is reduced, the network overhead is reduced, and the service throughput of the micro-service which can be processed in unit time is improved.

Description

Micro-service configuration method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for configuring a micro service.
Background
In distributed systems, a large number of micro services (micro services) are deployed, and the micro services run depending on configuration information, such as a black-and-white list of access users, query volume per second (queries per second, QPS), etc. When the micro service executes the service, the micro service obtains corresponding configuration information from the database through an input/output (I/O) operation of the network. However, micro services frequently read configuration information from databases, resulting in a large number of network I/O operations. More network I/O operations tend to create network congestion and delays, and the overall processing power of the distributed system may decrease, resulting in reduced throughput of traffic that the microservice can handle per unit time.
Disclosure of Invention
The application provides a method and a device for configuring micro services, which are used for solving the problem that the throughput of business which can be processed by the micro services in unit time is reduced.
In a first aspect, the present application provides a method for configuring a micro service. The configuration method of the micro-service can be applied to a computer system or a computing device supporting the configuration method of the micro-service implemented by the computer system, for example, the computer system can be called a distributed system, and the computing device is a server or a terminal. In one possible example, the aforementioned distributed system includes a first computing device, a second computing device, and a micro-service disposed on the first computing device and the second computing device. The configuration method of the micro-service comprises the steps that a first computing device obtains a first request carrying first configuration information of the micro-service deployed on a second computing device, the second computing device subscribes to a message middleware, and the message middleware is used for transmitting 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 persistently stores the first configuration information locally. The first computing device receives a configuration result sent by the second computing device, where the configuration result is used to instruct the second computing device to persist the first configuration information locally to success or failure.
In the application, the first computing device and the second computing device transmit the configuration information in a message middleware mode, and the second computing device is used for storing the first configuration information in a local place in a lasting manner after acquiring the first configuration information from the message middleware, so that when the micro service on the second computing device executes the service, the first configuration information is not required to be acquired from a database and can be directly acquired from the local place, thereby reducing network I/O operation, reducing network overhead and improving the service throughput which can be processed by the micro service in unit time.
In one possible scenario, the second computing device persists the first configuration information locally for instructing the second computing device to persist the first configuration information in a memory or hard disk of the second computing device.
In one possible implementation, the message middleware is a message queue. The second computing device is subscribed to the message middleware including the second computing device subscribing to a target topic in the message queue. The first computing device sending the first configuration information to the message middleware includes the first computing device sending the first configuration information to a group under a target topic in the message queue. The second computing device obtaining the first configuration information from the message middleware includes the second computing device obtaining the first configuration information from a group under a target topic in the message queue.
According to the application, the message queue is used as the message middleware, so that the first computing equipment and the second computing equipment are decoupled, the first computing equipment is allowed to return immediately after the message is sent, the second computing equipment is not required to be waited for processing, the response speed of the distributed system is improved, and the service throughput which can be processed by the micro service in unit time is further improved.
In one possible implementation, the message middleware is a publish/subscribe model or an enterprise service bus.
In one possible implementation manner, the method for configuring the micro-service further comprises the step that the first computing device outputs a configuration result.
In one possible scenario, the first computing device outputting the configuration result includes the first computing device outputting the configuration result to a front end connected to the first computing device, and the front end displaying the configuration result.
In one possible implementation, the distributed system further includes a database, wherein the database stores second configuration information of the micro service, the configuration time of the second configuration information is earlier than the configuration time of the first configuration information, and before the first computing device acquires the first request, the first computing device acquires the second configuration information from the database, and further, the second configuration information is stored locally in a persistent manner.
In the application, the first computing device can reduce the times of acquiring the second configuration information from the database when the micro service on the first computing device executes the service by storing the second configuration information in the database locally, thereby reducing network I/O operation, reducing network overhead and improving the throughput of the service which can be processed by the micro service in unit time.
In one possible scenario, the second configuration information is configuration information of a micro-service deployed on the first computing device.
In one possible implementation manner, the distributed system further comprises a database, and the method for configuring the micro-service further comprises the steps that the first computing device obtains a second request carrying the identification of the first configuration information and further sends the identification of the first configuration information to the message middleware, wherein the message middleware is used for transmitting the identification of the first configuration information, and the identification of the first configuration information is used for indicating the second computing device to store the first configuration information to the database. The first computing device obtains first configuration information stored by the second computing device from the database, and outputs the first configuration information stored by the second computing device.
According to the method and the device for confirming the first configuration information, the first configuration information is identified between the first computing device and the second computing device through the message middleware, so that when a user needs to confirm the first configuration information, the first computing device can transmit the identification of the first configuration information to the second computing device through the message middleware, further the second computing device is instructed to send the local first configuration information to the database, the first computing device acquires the first configuration information stored by the second computing device from the database, and the first configuration information is output to the user for confirmation, and accuracy and consistency of the configuration information are ensured.
In one possible implementation manner, the configuration method of the micro-service further comprises the steps that the first computing device obtains a second request carrying the identification of the first configuration information and then sends the identification of the first configuration information to the message middleware, wherein the message middleware is used for transmitting the identification of the first configuration information, and the identification of the first configuration information is used for indicating the second computing device to store the first configuration information to the database. The first computing device checks 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 a check result. The check result is used to indicate agreement or disagreement.
In the application, the first computing device checks/compares the first configuration information stored in the first computing device with the first configuration information stored in the database by the second computing device, so that the configuration information used by the micro-service in the second computing device is ensured to be accurate, and the accuracy and consistency of the configuration information are improved.
In one possible scenario, the first computing device also outputs the first configuration information stored by the second computing device to the database and the first configuration information stored by the first computing device to the database.
In one possible implementation, the method for configuring a micro service further includes the first computing device storing the first configuration information to a database.
In a second aspect, the present application provides a micro-service configuration apparatus. The configuration device of the micro-service is applied to a computer system or a computing device supporting the configuration device of the computer system for realizing the micro-service, and the configuration device of the micro-service comprises various modules for executing the configuration method of the micro-service in the first aspect or any optional implementation manner of the first aspect. The micro-service configuration device comprises a first acquisition module, a subscription module, a sending module, a second acquisition module and a receiving module.
The first acquisition module is used for acquiring a first request; the first request carries first configuration information of a micro-service deployed on the second computing device.
The subscription module is used for subscribing the message middleware, and the message middleware is used for transmitting the first configuration information.
And the sending module is used for sending the first configuration information to the message middleware.
And the second acquisition module is used for acquiring the first configuration information from the message middleware and storing the first configuration information in a local manner in a lasting manner.
The second computing device is used for storing the first configuration information in a local manner, and the second computing device is used for storing the first configuration information in the local manner.
For more detailed implementation of the micro-service configuration device, reference may be made to the description of any implementation manner of the first aspect, and the following detailed description will be omitted here.
In a third aspect, the present application provides a provisioning system for a micro-service. The system includes a first computing device, a second computing device, and a micro-service disposed on the first computing device and the second computing device. The first computing device is configured to obtain a first request carrying first configuration information for a micro-service deployed on the second computing device. The second computing device is configured to subscribe to message middleware, the message middleware configured to communicate the first configuration information. The first computing device is configured to send the first configuration information to the message middleware. And the second computing device is used for acquiring the first configuration information from the message middleware and storing the first configuration information in a local manner in a persistence mode. The first computing device is used for receiving a configuration result sent by the second computing device, and the configuration result is used for indicating whether the second computing device is successful or failed in storing the first configuration information in a local persistence mode.
For more detailed implementation of the micro-service configuration system, reference may be made to the description of any implementation manner of the above first aspect, and the following detailed description will be omitted here.
In a fourth aspect, the present application provides a chip comprising a processor and interface circuitry for obtaining a first request, the processor for performing the method of the first aspect or any of the possible implementations of the first aspect.
In a fifth aspect, the present application provides a cluster of computing devices. The cluster of computing devices comprises at least one computing device comprising a memory for storing computer instructions and a processor which, when executing the computer instructions, implements the method of the first aspect or any one of the possible implementations of the first aspect.
In a sixth aspect, the present application provides a computer readable storage medium having stored therein a computer program or instructions which, when executed by a processing device, implement a method according to the first aspect or any one of the possible implementations of the first aspect.
In a seventh aspect, the present application provides a computer program product comprising a computer program or instructions which, when executed by a processing device, implement the method of the first aspect or any one of the possible implementations of the first aspect.
The advantages of the above second to seventh aspects may refer to the first aspect or any possible implementation manner of the first aspect, and are not described herein. Further combinations of the present application may be made to provide further implementations based on the implementations provided in the above aspects.
Drawings
FIG. 1 is a schematic diagram of a computer system according to the present application;
FIG. 2 is a flow chart of a method for configuring a micro service according to the present application;
FIG. 3 is a second flow chart of a method for configuring a micro service according to the present application;
Fig. 4 is a flow chart diagram III of a method for configuring a micro service according to the present application;
FIG. 5 is a schematic diagram of a configuration apparatus for micro services according to the present application;
FIG. 6 is a schematic diagram II of a configuration apparatus for micro services according to the present application;
FIG. 7 is a schematic diagram of a computing device according to the present application;
FIG. 8 is a schematic diagram illustrating a computing device cluster according to the present application;
fig. 9 is a schematic diagram of a connection between computing devices according to the present application.
Detailed Description
The application provides a configuration method of micro service, which aims to solve the problem that the throughput of the business which can be processed by the micro service in unit time is reduced. The first computing device obtains a first request carrying first configuration information of a micro-service deployed on a second computing device, the second computing device being subscribed to message middleware for communicating 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 persistently stores the first configuration information locally. The first computing device receives a configuration result sent by the second computing device, where the configuration result is used to instruct the second computing device to persist the first configuration information locally to success or failure.
In the application, the first computing device and the second computing device transmit the configuration information in a message middleware mode, and the second computing device is used for storing the first configuration information in a local place in a lasting manner after acquiring the first configuration information from the message middleware, so that when the micro service on the second computing device executes the service, the first configuration information is not required to be acquired from a database and can be directly acquired from the local place, thereby reducing network I/O operation, reducing network overhead and improving the service throughput which can be processed by the micro service in unit time.
For ease of understanding, the technical terms to which the present application relates will first be described.
Microservices, a style of software architecture, aims to break down a single application into a small, independent set of services. These services can be independently developed, deployed, and extended, each assuming specific business functions.
Message middleware is a supportive software system that provides synchronous or asynchronous, reliable message transmission for application systems in a network environment based on queue and message delivery techniques. Common message middleware may include message queuing (message queue), publish/subscribe model (publish/subscribe model), enterprise service bus (ENTERPRISE SERVICE bus, ESB), lightweight messaging (LIGHTWEIGHT MESSAGING), and so on.
The message queue is a message passing mechanism that allows applications or devices to send and receive messages asynchronously through the queue, and is used as an intermediary between a producer (e.g., a first computing device as described below) and a consumer (e.g., a second computing device as described below) that sends messages into the queue and the consumer reads messages from the queue. The publish/subscribe model is a messaging mode that allows a publisher of a message (e.g., a first computing device described below) to send a message to a topic (topic) to which multiple subscribers can subscribe to receive related messages, and decouples the message from subscribers by the topic, allowing multiple subscribers to receive the same message. The enterprise service bus is an architecture mode and provides an integrated platform for connecting and coordinating different application programs, services and devices, and the enterprise service bus is used as an intermediate layer for processing communication, data conversion and routing between the services or devices. Lightweight messaging, which is a simplified messaging mechanism, is generally simple to implement, has a small resource footprint, and is suitable for small and fast-to-develop applications, does not rely on complex middleware or heavy-duty frameworks, and uses compact application programming interfaces (application programming interface, APIs) for messaging.
Reflection (reflection) refers to the ability to dynamically acquire and operate state information (second configuration information described below) of an object at the time of execution of an application program, service, or the like. For example, a second configuration in the database is reflected to the first computing device.
Referring to fig. 1, fig. 1 is a schematic diagram of a computer system according to the present application. As shown in FIG. 1, the computer system includes a cluster of computing devices 110, a database 120. The computing device clusters 110 and the database 120 can communicate with each other in a wired manner or in a wireless manner.
The computing device cluster 110 is provided with a micro service, and the application is not limited to the type of micro service execution service, for example, the micro service for providing the query function and the micro service for providing the payment function can be used.
In the present application, the computing devices included in the computing device cluster 110 externally provide an access interface (such as an API) for obtaining the first configuration information configured by the user. For a detailed description of the first configuration information, refer to the following fig. 2, and will not be described herein.
For example, a front end (e.g., deployed with a console) coupled to the computing device may access the computing device via the API described above, and the front end may send a first request to the computing device via the console, the first request carrying first configuration information configured by a user on the console.
The computing devices in the cluster of computing devices 110 cooperatively perform the persistent storage of configuration information locally thereto. Such as memory or hard disk, of each computing device in the cluster 110 of computing devices.
The wired communication may be ethernet, optical fiber, and various peripheral component interconnect express (PERIPHERAL COMPONENT INTERCONNECT EXPRESS, PCIe) buses, universal serial bus (universal serial bus, USB) or unified bus (unified bus, ubus or UB), computing fast link (compute express link, CXL), cache coherent interconnect protocol (cache coherent interconnect for accelerators, CCIX), etc. disposed within the computer system for connecting the computing device cluster 110 and the database 120.
The wireless communication may be internet, wireless communication (WIRELESS FIDELITY, WIFI), ultra Wide Band (UWB) technology, or the like.
In one possible scenario, the computing devices in the computing device cluster 110 described above may include one or more processing units, which may be graphics processors (graphics processing unit, GPU), neural network processors (neural network processing unit, NPU), central processors (central processing unit, CPU), field programmable gate arrays (field programmable GATE ARRAY, FPGA), application processors (Application processor, AP), modem processors, image signal processors (IMAGE SIGNAL processor, ISP), controllers, video codecs, digital signal processors (DIGITAL SIGNAL processor, DSP), tensor processing units (tensor processing unit, TPU), application SPECIFIC INTEGRATED Circuits (ASIC), discrete gates, transistor logic, discrete hardware components, and/or baseband processors. Or a processing device, such as a terminal, server, etc., comprising any one or more of the processing units described above.
In another possible scenario, the computing devices in the computing device cluster 110 described above may also include one or more memories. The memory includes volatile memory such as random access memory (random access memory, RAM). The memory may also include non-volatile memory, such as read-only memory (ROM), flash memory, mechanical hard disk (HARD DISK DRIVE, HDD) or Solid State Disk (SSD) STATE DRIVE. The memory has stored therein executable program code or data generated during execution of the components, which the computing device executes to perform the functions of the components disposed thereon.
For the detailed structure of the computing device, reference may be made to the following descriptions of fig. 7-9, which are not repeated here.
Wherein the cluster of computing devices 110 includes a plurality of computing devices. For example, the plurality of computing devices includes computing device 111, computing device 112, computing device 113. For example, the plurality of computing devices may communicate via wires or wirelessly. The computing device may be a server, a terminal, or the like.
In one possible example, one or more micro-services are deployed in at least one of the plurality of computing devices.
In one possible example, the computer system described above may be referred to as a distributed system, a cloud computing platform, a cloud service.
In one possible example, the computer system described above may further include terminal 130, terminal 140, terminal 150.
The terminals 130, 140, 150 may be mobile phones, tablet computers, handheld computers, personal computers (personal computer, PC), cellular phones, personal digital assistants (personal DIGITAL ASSISTANT, PDA), wearable devices (e.g., smart watches), smart home devices (e.g., televisions), car-mounted computers, game consoles, and augmented reality (augmented reality, AR)/Virtual Reality (VR) devices, etc., and the specific device configurations of the terminals 130, 140, 150 are not particularly limited by the present application.
In another possible example, terminals 130, 140, 150 are provided separately and in communication with a computer system, i.e., a distributed system.
It should be noted that the architecture of the computer system illustrated in fig. 1 is merely an example, and the device types or the number of devices inside the system may be configured according to actual requirements, which is not limited in the embodiment of the present application. For example, a computer system may also include more computing devices, storage devices.
The implementation of the method for configuring a micro service according to the embodiment of the present application will be described in detail below with reference to the accompanying drawings, based on the computer system shown in fig. 1.
Fig. 2 is a flowchart illustrating a method for configuring a micro service according to the present application, where the method provided in the present embodiment may be applied to the computer system shown in fig. 1. Here, taking the configuration method of the micro service shown in the present application as an example to be executed by the computing device 111, the computing device 111 is deployed with the micro service, the database 120 stores configuration information a of the micro service, the configuration time of the configuration information a is earlier than the configuration time of the configuration information b, the configuration information a may be called second configuration information, the configuration information b may be called first configuration information, and the computing device 111 may be called first computing device. As shown in fig. 2, the configuration method of the micro service includes the following steps S210 and S220.
S210, the computing device 111 acquires the configuration information a from the database 120.
Illustratively, the computing device 111 obtains the configuration information a corresponding to the micro service a from the database 120 according to the micro service a deployed on the computing device 111.
For example, the computing device 111 obtains configuration information a indicated by the identification of the micro service a from the database 120 according to the identification of the micro service a deployed on the computing device 111.
The identifier of the micro service a may be the name, the identification number (identity document, ID) or the like of the micro service a.
S220, the computing device 111 persists the configuration information a locally.
Illustratively, the computing device 111 persists the configuration information a in the memory of the computing device 111.
For example, computing device 111 persists configuration information a in database 120 to memory by way of reflection.
Illustratively, the computing device 111 persists the configuration information a in a hard disk of the computing device 111.
It should be noted that, in the foregoing description, only the computing device 111 in the computing device cluster is taken as an example, in other embodiments of the present application, other computing devices (such as the computing device 112 and the computing device 113) in the computing device cluster may also obtain the configuration information from the database 120, and store the configuration information in a local manner, so that when the micro service on the computing device executes the service, the corresponding configuration information may be obtained only from the local memory or the hard disk, thereby reducing the I/O operation when the computing device obtains the configuration information from the database 120, and accelerating the response speed when the micro service executes the service, and further improving the service throughput that the micro service can process in unit time.
Fig. 2 illustrates the persisting of configuration information a stored in database 120 to computing device 111, and, based on the content illustrated in fig. 1 and 2, computing device 111 may also broadcast newly received configuration information (configuration information b) to cause other computing devices (e.g., computing device 112) to obtain and persist configuration information b locally.
As shown in fig. 3, fig. 3 is a second flowchart of a method for configuring a micro service according to the present application, where the method provided in this embodiment may be applied to the computer system shown in fig. 1, where the micro service is deployed on the computing device 111 or the computing device 112, and the micro service deployed on the computing device 112 may be referred to as a micro service b, and the request a may be referred to as a first request. As shown in fig. 3, the configuration method of the micro service includes the following steps S310 to S350.
S310, the computing device 111 acquires the request a.
In one possible scenario, request a carries configuration information b for a micro service (micro service b) deployed on computing device 112.
In another possible scenario, request a carries the identity of micro service b, and configuration information b of micro service b.
Illustratively, the configuration information b includes any one or more of a network configuration, a database configuration, an environment variable, a log configuration, a message queue configuration, a security configuration, a current limit configuration, a load balancing configuration, a monitoring and alarm configuration, and the like of the micro service b.
For example, the network configuration includes a hostname or Internet protocol (internet protocol, IP) address of the micro-service, a port number for micro-service monitoring, an API of the micro-service. The database configuration includes a database connection string, credentials to indicate identity to the database. Environment variables including development/production environment identification, configuration of a particular environment, such as API keys, credentials for external services, etc. The log configuration comprises log level, log storage path and the like. Message queue configuration including message proxy address (e.g., rabbitMQ, kafka, etc. connection information), queue name. The security configuration includes authentication and authorization information, certificates and keys for encrypted communications, and black and white lists of access users. The current limiting configuration includes QPS limits, request frequency, etc. Load balancing, including load balancing policies (e.g., polling, weighting, randomization, etc.), monitoring check configurations (e.g., defining anchor points and frequencies for health monitoring). The monitoring and alarm configuration comprises monitoring indexes (such as API call times, response time and the like) and alarm rules, wherein the alarm rules are used for defining when to trigger an alarm, and the alarm is triggered if the API call times exceed 20 times within 10 seconds.
In one possible implementation, the computing device 111 obtains the request a, including the computing device 111 obtaining the request a sent by the terminal 130.
In one possible example, terminal 130 accesses computing device 111 through an API provided by computing device 111 to enable a user interface to be displayed on computing device 111. Further, the user performs a trigger operation on the control unit 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 trigger operation, and further sends a request a carrying the configuration information b to the computing device 111.
For a specific implementation of the triggering operation, three possible examples are provided below.
Example 1, the triggering operation may be a user confirmation of the control part through a keyboard, such as a user-triggered confirmation (enter) key, to determine the configuration information b configured by the user.
Example 2, the triggering operation may be a click of the control part by the user through the mouse.
The control component corresponding to the multiple to-be-selected items is displayed on the user interface, and the user can click on the control component through the mouse, so that the threshold value of the QPS, the black-and-white list of the user and the like corresponding to the control component clicked by the mouse are determined.
For example, the plurality of options to be selected are a plurality of values (such as 50, 60, 80, 85, 92, etc.) of the QPS, a user identifier included in a black list or a white list, and the like.
Example 3, the triggering operation may be an input operation of the user in the control part through the keyboard, or the like, such as input configuration information or contents included in the configuration information (e.g., a threshold value of QPS, a black-and-white list of the user, or the like).
S320, the computing device 112 subscribes to the message middleware.
In one possible scenario, message middleware is used to communicate configuration information b.
For example, message middleware is used to communicate configuration information b among a plurality of computing devices included in the computing device cluster 110.
In one possible scenario, the message middleware is any one of message queuing, publish/subscribe model, enterprise service bus, lightweight messaging.
One possible embodiment is provided below for the message middleware to be the content of the message queue, and will not be described herein. For the content of the message middleware that is a publish/subscribe model, an enterprise service bus, or lightweight messaging, reference may be made to the following description of the message middleware as a message queue, which is not repeated herein.
One possible implementation is provided below for computing device 112 to subscribe to message middleware.
Computing device 112 validates the message middleware used by computing device 111 and in turn installs on computing device 112 a corresponding client (client library) configured to connect to the server where the message middleware resides and declares the message middleware to subscribe to, thereby enabling computing device 112 to subscribe to the message middleware.
Illustratively, the computing device 112 configures connection parameters such as the address, port number, etc. of the server on the client to enable connection of the client to the server where the message middleware resides.
Illustratively, the computing device 112 subscribes to the message middleware by configuring an identification of the message middleware, or an identification of a group (grooup) in the message middleware, on the client to enable declaring the message middleware to subscribe to.
In one possible scenario, a callback function is also configured on computing device 112, for processing messages (e.g., configuration information b) obtained from the message middleware.
Notably, the names of the message middleware to which the client states to subscribe are consistent with the names used when computing device 111 sends configuration information b. Computing device 112 may continually obtain messages from the message middleware after subscribing to the message middleware.
S330, the computing device 111 sends the configuration information b to the message middleware.
In one possible implementation, computing device 111 sends configuration information b to the message middleware, including computing device 111 sending configuration information b to the device in which the message middleware is located. The device may be a server or a terminal.
In another possible implementation, computing device 111 sends configuration information b to the message middleware, including computing device 111 sending configuration information b to a target topic in the message middleware.
S340, the computing device 112 obtains the configuration information b from the message middleware and persists the configuration information b locally.
In one possible implementation, the computing device 112 obtains the configuration information b from the message middleware, including the computing device 112 obtaining the configuration information b from the message middleware by polling.
For example, the computing device 112 obtains the configuration information b from the target subject in the message middleware by polling.
In another possible implementation, the computing device 112 obtains configuration information b from the message middleware, including the computing device 112 receiving configuration information b pushed by the message middleware.
For example, after the computing device 112 defines the target topic, when there is configuration information b sent by the computing device 111 under the target topic, the message middleware pushes the configuration information b to the computing device 112.
In one possible implementation, computing device 112 persists configuration information b locally, including computing device 112 persisting configuration information b in a memory of computing device 112.
In another possible implementation, computing device 112 persists configuration information b locally, including computing device 112 persisting configuration information b in a hard disk of computing device 112.
In one possible scenario, if the historical configuration information for micro service b (e.g., configuration information a described above) is already stored in computing device 112, computing device 112 will delete the historical configuration information, thereby enabling updating the configuration information stored persistently locally by computing device 112.
In one possible scenario, after the computing device 112 obtains the configuration information b from the message middleware, the method further includes the computing device 112 performing an accuracy check on the configuration information b. And if the verification is not passed, deleting the configuration information b.
For the above-described accuracy check, two possible examples are provided below.
Example 1, computing device 112 verifies the user identification indicated by configuration information b.
For example, computing device 112 only persists configuration information b specifying the user configuration. Designated users, such as administrators, users within a whitelist, etc. The user identifier is an identifier of an administrator, a user in a white list, and the like.
Example 2, computing device 112 compares the hash value of configuration information b.
For example, the computing device 112 calculates the hash value a of the acquired configuration information b, and acquires the hash value b transmitted by the computing device 111 through the message queue, and compares whether the hash value a and the hash value b agree. If the hash value a and the hash value b are consistent, the verification is passed, and if the hash value a and the hash value b are inconsistent, the verification is not passed. The hash value b is calculated by the computing device 111 according to the configuration information b sent by the terminal 130.
S350, the computing device 111 receives the configuration result sent by the computing device 112.
Wherein the configuration result is used to indicate whether computing device 112 has been successful or failed to persist configuration information b locally.
In one possible scenario, the configuration results may be presented in the form of configuration information b persisted locally on computing device 112, i.e., a field indicating "configuration success" or "configuration failure," which indicates that configuration information b persisted locally on computing device 112 and configuration failure indicates that configuration information b persisted locally on computing device 111.
In another possible scenario, the configuration result may be in the form of configuration information stored locally on computing device 112, with configuration information b persisting locally on computing device 112 if the configuration information stored locally on computing device 112 includes configuration information b, and with configuration information b persisting locally on computing device 112 if the configuration information stored locally on computing device 112 does not include configuration information b.
In one possible implementation, computing device 111 receives the configuration results sent by computing device 112, including computing device 111 directly receiving the configuration results sent by computing device 112.
In another possible implementation, computing device 111 receives the configuration results sent by computing device 112, including computing device 111 receiving the configuration results sent by computing device 112 through a message queue.
It should be noted that, the foregoing description only uses the configuration of the micro service b in the computing device 112 in the computing device cluster 110 as an example, and in other embodiments of the present application, the micro service b may be configured in other computing devices (such as the computing device 111 and the computing device 113) in the computing device cluster 110 (except for the computing device 112), so that the computing device 111 and the computing device 113 may execute the contents executed by the computing device 112, which is not described herein.
Illustratively, computing device 111 has the same micro-service b deployed on computing device 112, and computing device 111 also persists configuration information b locally.
For example, after receiving request a, computing device 111 persists configuration information b in request a locally on computing device 111. Such as memory or a hard disk in computing device 111 local to computing device 111.
As another example, computing device 111 likewise subscribes to the message queue, and in turn obtains configuration information b from the message queue and persists configuration information b locally on computing device 111.
In one possible scenario, computing device 111 outputs the configuration result.
Illustratively, the computing device 111 outputs the configuration results to a front end connected to the computing device 111, which in turn displays the configuration results.
For example, the front end may be a display device, a terminal, such as terminal 130, terminal 140, terminal 150. Such as the front end displaying the configuration results on a console (console) interface.
In one possible scenario, computing device 111 also stores configuration information b to database 120, thereby enabling backup of configuration information b or for verification of persistently stored configuration information in the computing device. Checking the persisted configuration information in the computing device may be described with reference to the following description of fig. 4, which is not repeated herein.
Based on the content shown in fig. 3, the present application also provides a possible embodiment, which is used to describe the method for configuring the micro service when the message middleware is a message queue. The content of this embodiment may include the following steps ① - ⑤.
Step ① computing device 111 obtains request a.
Step ② computing device 112 subscribes to the target topic in the message queue.
The topic is used as a classification identifier of a message (configuration information) in a message queue, and the target topic is the classification identifier to which the configuration information b belongs. Only computing devices that subscribe to the target topic in the message queue can receive messages in the target topic.
In one possible example, the classification identifier of the target topic matches the identifier of the micro service, e.g., only configuration information b of micro service b is saved in the target topic.
In another possible example, the classification identifier of the target topic matches the type of micro-service, e.g. only the configuration information b of the micro-service b implementing the query function is saved in the target topic.
At step ③, computing device 111 sends configuration information b to the target topic in the message queue.
At step ④, computing device 112 obtains configuration information b from the target topic in the message queue and persists configuration information b locally.
Illustratively, the computing device 112 persists the configuration information b in the memory after obtaining the configuration information b through the callback function, so as to reduce network I/O operations when the micro service obtains the configuration information from the database 120 when reading the configuration information, thereby reducing network overhead and improving traffic throughput that can be handled by the micro service in unit time.
At step ⑤, computing device 111 receives the configuration result sent by computing device 112.
For the contents of step ① and step ⑤, reference may be made to the descriptions of S310 and S350, which are not described herein.
It should be noted that, in this embodiment, only the micro service b is deployed in the computing device 112, and thus the computing device 112 subscribes to the target topic in the message queue, and in other embodiments of the present application, other computing devices except the computing device 112 in the computing device cluster 110 are also deployed with the micro service b, and thus the other computing devices will subscribe to the target topic in the message queue, and the contents of steps ③ - ⑤ are implemented.
For example, the other computing devices and the computing device 112 subscribe to the same target theme, and thus the other computing devices and the computing device 112 can obtain the configuration information b.
The present application also provides a possible embodiment based on the content shown in fig. 3, where the content shown in this embodiment is used to confirm the configuration information stored in the computing device persistence in the computer cluster 110. Fig. 4 is a flowchart illustrating a method for configuring a micro service according to the present application, as shown in fig. 4, where the method for configuring a micro service includes the following steps S410 to S440.
S410, the computing device 111 acquires the request b.
Wherein the request b carries an identification of the configuration information b.
Illustratively, the identification of the configuration information b is the name or ID of the configuration information b, etc.
For the content of the acquisition request b by the computing device 111, reference may be made to the description of S310 described above, and will not be repeated here.
S420, the computing device 111 sends the identification of the configuration information b to the message middleware.
In one possible scenario, the message middleware is further configured to communicate an identification of configuration information b, where the identification of configuration information b is used to instruct computing device 112 to store configuration information b to database 120.
Illustratively, computing device 112 subscribes to the message middleware, and computing device 111 sends the identity of configuration information b to the message middleware, which computing device 112 obtains from the message queue. The computing device 112 is configured with a callback function, and the callback function is used for sending the configuration information b stored in the computing device 112 in a lasting manner to the database 120 for storage after the identification of the configuration information b is acquired.
For example, computing device 112 sends the persisted configuration information b to a designated region store in database 120. The aforementioned designated area may be configured into computing device 112, computing device 111 in advance by a user, such as configuring an address or sector of the designated area, etc.
For the identifier of the configuration information b sent by the computing device 111 to the message middleware, reference may be made to the description of S330, which is not described herein.
S430, the computing device 111 obtains the configuration information b stored by the computing device 112 from the database 120.
Illustratively, computing device 111 obtains configuration information b stored by computing device 112 from a designated area in database 120.
S440, the computing device 111 outputs the configuration information b stored by the computing device 112.
Illustratively, the computing device 111 outputs the configuration information b stored by the computing device 112 to a front end connected to the computing device 111, which in turn displays the configuration information b stored by the computing device 112.
It should be noted that, the content shown in fig. 4 is only described by taking the configuration of the micro service b in the computing device 112 as an example, in other embodiments of the present application, the micro service b may be configured in other computing devices (such as the computing device 111 and the computing device 113) of the computing device cluster 110 besides the computing device 112, and the computing device 111 and the computing device 113 may execute the content executed by the computing device 112, which is not described herein.
Illustratively, the same micro service b is deployed on the computing device 113 and the computing device 112, and then the computing device 113 sends the configuration information b to the database 120 for storage according to the identifier of the configuration information b, and then the computing device 111 obtains the configuration information b stored in the computing device 113 and the configuration information b stored in the computing device 112 from the database 120, and outputs the configuration information b stored in the computing device 113 and the configuration information b stored in the computing device 112 to the terminal 130, and the terminal 130 displays, such as displaying on a console of the terminal 130.
In another possible embodiment of the present application, after 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. Further, the computing device 111 outputs the verification result to the terminal 130, and a console on the terminal 130 displays the verification result.
The above-mentioned verification result is used to indicate that the configuration information b stored by the computing device 112 is consistent with the configuration information b stored by the computing device 111, or that the configuration information b stored by the computing device 112 is inconsistent with the configuration information b stored by the computing device 111.
It will be appreciated that in order to implement the functionality of the above-described embodiments, the computing device includes corresponding hardware structures and/or software modules that perform the various functions. Those of skill in the art will readily appreciate that the various illustrative elements and method steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application scenario and design constraints imposed on the solution. The configuration method of the micro service provided according to the present embodiment is described in detail above with reference to fig. 2 to 4, and the configuration apparatus of the micro service provided according to the present embodiment will be described below with reference to fig. 5.
Fig. 5 is a schematic structural diagram of a micro-service configuration device provided by the present application. The configuration device of the micro service can be used for realizing the functions of the computing device 111 and the computing device 112 in the method embodiment, so that the beneficial effects of the method embodiment can be realized. In this embodiment, the configuration apparatus 500 of the micro service may be a module (e.g. a chip) of the computing device 111 or the computing device 112.
As shown in fig. 5, the configuration apparatus 500 of the micro service includes a first acquisition module 510, a subscription module 520, a transmission module 530, a second acquisition module 540, and a reception module 550. The configuration means 500 of the microservice are used to implement the functionality of the computing device 111 described above in the method embodiments shown in fig. 2 to 4. In one possible example, the specific process of the micro service configuration apparatus 500 for implementing the micro service configuration method includes the following processes:
a first obtaining module 510 is configured to obtain a first request, where the first request carries first configuration information of a micro-service deployed on the second computing device.
The subscription module 520 is configured to subscribe to a message middleware, where the message middleware is configured to communicate the first configuration information.
A sending module 530, configured to send the first configuration information to the message middleware.
A second obtaining module 540, configured to obtain the first configuration information from the message middleware, and persistently store the first configuration information locally.
And the receiving module 550 is configured to receive a configuration result sent by the second computing device, where the configuration result is used to instruct the second computing device to persist the first configuration information in a local success or failure.
To further implement the functionality of the computing device described above in the method embodiments shown in fig. 2-4. The application also provides a micro-service configuration device, as shown in fig. 6, fig. 6 is a schematic structural diagram II of the micro-service configuration device. The configuration device 500 of the micro service further comprises an output module 560, a persistence module 570, and a validation module 580.
And an output module 560 for outputting the configuration result.
The persistence module 570 is configured to obtain the second configuration information from the database, and persist the second configuration information locally. The database stores second configuration information of the micro-service, and the configuration time of the second configuration information is earlier than that of the first configuration information.
The confirmation module 580 is configured to obtain a second request, where the second request carries the identifier of the first configuration information. The message middleware is used for transmitting the identification of the first configuration information, and the identification of the first configuration information is used for indicating the second computing device to store the first configuration information into the database. And acquiring the first configuration information stored by the second computing device from the database, and outputting the first configuration information stored by the second computing device.
It should be noted that, in other embodiments, the first obtaining module 510 may be configured to perform any step in a configuration method of a micro service, the subscription module 520 may be configured to perform any step in a configuration method of a micro service, the sending module 530 may be configured to perform any step in a configuration method of a micro service, the second obtaining module 540 may be configured to perform any step in a configuration method of a micro service, and the receiving module 550 may be configured to perform any step in a configuration method of a micro service. The steps that the first obtaining module 510, the subscribing module 520, the sending module 530, the second obtaining module 540, and the receiving module 550 are responsible for implementing may be specified according to needs, and all functions of the configuration device 500 of the micro service are implemented by different steps in the configuration method of the micro service that the first obtaining module 510, the subscribing module 520, the sending module 530, the second obtaining module 540, and the receiving module 550 implement respectively.
It should be noted that, the computing device according to the embodiment of the present application may correspond to the configuration apparatus 500 of the micro service in the application embodiment, and may correspond to the respective main bodies corresponding to fig. 2 to 4 for executing the method according to the embodiment of the present application, and the operations and/or functions of the respective modules in the configuration apparatus 500 of the micro service are respectively for implementing the respective flows of the respective methods corresponding to the embodiment of fig. 2 to 4, which are not repeated herein for brevity.
When the configuration device 500 for micro services implements the configuration method for micro services shown in any of the foregoing drawings through software, the configuration device 500 for micro services and each unit thereof may be a software module. The software module is called by the processor to realize the configuration method of the micro-service. The processor may be a CPU, ASIC implementation, or programmable logic device (programmable logic device, PLD), which may be a complex program logic device (complex programmable logical device, CPLD), field programmable gate array (field programmable GATE ARRAY, FPGA), general-purpose array logic (GENERIC ARRAY logic, GAL), or any combination thereof.
For more details about the configuration device 500 of the micro service, reference may be made to the related description in the embodiment shown in the foregoing drawings, which is not repeated here. It will be appreciated that the configuration device 500 of the micro service shown in the foregoing drawings is merely an example provided in this embodiment, and the configuration device 500 of the micro service may include more or less units according to different usage scenarios, which is not limited by the present application.
When the configuration device 500 of the micro service is implemented by hardware, the hardware may be implemented by a processor or a chip. The chip includes an interface circuit and a processor. The interface circuit is used for receiving requests (such as request a and request b) from other devices outside the processor and transmitting the requests to the processor, or sending data (such as configuration information b) from the processor to the other devices outside the processor.
The processor and interface circuits are operable to implement the method of any one of the possible implementations of the above embodiments by logic circuitry or executing code instructions. The advantages may be seen from the description of any of the above embodiments, and are not repeated here.
It is to be appreciated that the processor in embodiments of the application may be a CPU, NPU, or GPU, but may also be other general purpose processor, digital Signal Processor (DSP), ASIC, FPGA, or other programmable logic device, transistor logic device, hardware components, or any combination thereof. The general purpose processor may be a microprocessor, but in the alternative, it may be any conventional processor.
The configuration apparatus 500 of the micro service shown in fig. 5 and 6 may be implemented by a computing device, such as the computing device 111 and 112 shown in fig. 1, or a computer system including the computing device 111 and 112.
The method steps of embodiments of the present application may also be implemented by way of a processor executing software instructions. The software instructions may be comprised of corresponding software modules that may be stored in RAM, flash memory, ROM, programmable read-only memory (programmable read only memory, PROM), erasable programmable read-only memory (erasable programmable read only memory, EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an ASIC. In addition, the ASIC may reside in a communication device. The processor and the storage medium may reside as discrete components in a communication device.
The application also provides a chip system which comprises a processor and is used for realizing the functions of the storage device in the method. In one possible design, the chip system further includes a memory for holding program instructions and/or data. The chip system can be composed of chips, and can also comprise chips and other discrete devices.
The embodiment of the application also provides a computing device, please refer to fig. 7, fig. 7 is a schematic structural diagram of the computing device. Computing device 700 includes bus 702, processor 704, memory 706, and communication interface 708. Wherein the processor 704, the memory 706, and the communication interface 708 enable communication connections therebetween via the bus 702. Computing device 700 may be a server or a terminal device. It should be understood that the present application is not limited to the number of processors, memories in computing device 700. For example, the computing device 700 may be the computing device 111 described above, or the computing device 112.
Bus 702 may be a PCIe bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, or the like. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, only one line is shown in fig. 7, but not only one bus or one type of bus. Bus 702 may include a path for transferring information between various components of computing device 700 (e.g., processor 704, memory 706, communication interface 708).
The processor 704 may include any one or more of CPU, GPU, FPGA, a Microprocessor (MP), or a DSP.
The memory 706 may include volatile memory such as RAM. The processor 704 may also include non-volatile memory, such as ROM, flash memory, HDD, or SSD.
The memory 706 stores executable program codes, and the processor 704 executes the executable program codes to implement the functions of the first acquisition module 510, the subscription module 520, the transmission module 530, the second acquisition module 540, and the reception module 550, respectively, so as to implement a configuration method of the micro service. That is, the memory 706 has instructions stored thereon for performing the configuration method of the micro-service.
Communication interface 708 enables communication between computing device 700 and other devices or communication networks using a transceiver module such as, but not limited to, a network interface card, transceiver, or the like. 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.
The embodiment of the application also provides a computing device cluster. The cluster of computing devices includes at least one computing device, which may 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 may also be a terminal device such as a desktop, notebook, or smart phone. For example, the cluster of computing devices may be the computer system described above.
Fig. 8 is a schematic structural diagram of a computing device cluster according to the present application. The cluster of computing devices includes at least one computing device 700. The same instructions for performing the configuration method of the micro-service may be stored in the memory 706 in one or more computing devices 700 in the cluster of computing devices.
In some possible implementations, the memory 706 of one or more computing devices 700 in the computing device cluster may also have stored therein respective portions of instructions for performing a configuration method of a micro-service. In other words, a combination of one or more computing devices 700 may collectively execute instructions for performing a configuration method of a micro-service.
It should be noted that the memory 706 in different computing devices 700 in the computing device cluster may store different instructions for performing part of the functions of the configuration method of the micro service, respectively. That is, the instructions stored by the memory 706 in the different computing devices 700 may implement the functionality of one or more of the first acquisition module 510, the subscription module 520, the transmission module 530, the second acquisition module 540, and the reception module 550.
In some possible implementations, one or more computing devices in a cluster of computing devices may be connected through a network. Wherein the network may be a wide area network or a local area network, etc. Fig. 9 shows one possible implementation. Fig. 9 is a schematic diagram of a connection between two computing devices according to the present application, where two computing devices 700A and 700B are connected via a network, as shown in fig. 9. Specifically, the connection to the network is made through a communication interface in each computing device. In this type of possible implementation, the memory 706 in the computing device 700A has stored therein instructions that perform the functions of the first acquisition module 510, the transmission module 530, and the reception module 550. Meanwhile, the memory 706 in the computing device 700B has stored therein instructions for performing the functions of the subscription module 520, the second acquisition module 540.
It should be appreciated that the functionality of computing device 700A shown in fig. 9 may also be performed by multiple computing devices 700. Likewise, the functionality of computing device 700B may also be performed by multiple computing devices 700.
Embodiments of the present application also provide a computer program product comprising instructions. The computer program product may be software or a program product containing instructions capable of running on a computing device or stored in any useful medium. The computer program product, when run on at least one computing device, causes the at least one computing device to perform the method of configuring a micro-service described above.
The embodiment of the application also provides a computer readable storage medium. The computer readable storage medium may be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., solid state disk), etc. The computer-readable storage medium includes instructions that instruct a computing device to perform a method of provisioning a micro-service.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may 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 instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are performed 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 apparatus. The computer program or instructions 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 instructions 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 can be accessed by a computer or a data storage device such as a server, data center, etc. that integrates one or more available media. The usable medium may be a magnetic medium, e.g. a floppy disk, a hard disk, a magnetic tape, an optical medium, e.g. a DVD, or a semiconductor medium, e.g. an SSD.
In various embodiments of the application, where no special description or logic conflict exists, terms and/or descriptions between the various embodiments are consistent and may reference each other, and features of the various embodiments may be combined to form new embodiments based on their inherent logic. The various numbers referred to in the embodiments of the present application are merely for ease of description and are not intended to limit the scope of the embodiments of the present application. The sequence number of each process does not mean the sequence of the execution sequence, and the execution sequence of each process should be determined according to the function and the internal logic.

Claims (11)

1. A method for configuring a micro-service, the method being applied to a distributed system, the distributed system including a first computing device and a second computing device, the first computing device and the second computing device having the micro-service deployed thereon, the method comprising:
The first computing device obtains a first request carrying first configuration information of a micro-service deployed on the second computing device;
The second computing device is subscribed with message middleware, wherein the message middleware is used for transmitting the first configuration information;
the first computing device sending 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, and the configuration result is used for indicating whether the second computing device is successful or failed in storing the first configuration information locally in a persistence mode.
2. The method of claim 1, wherein the message middleware is a message queue, and wherein the second computing device is subscribed to the message middleware comprising:
the second computing device subscribes to a target topic in a message queue;
the first computing device sending first configuration information to the message middleware, comprising:
The first computing device sending first configuration information to the target topic in the message queue;
the second computing device obtaining 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 of claim 1, wherein the message middleware is a publish/subscribe model or an enterprise service bus.
4. A method according to any one of claims 1 to 3, further comprising:
The first computing device outputs the configuration result.
5. The method of any of claims 1-4, wherein the distributed system further comprises a database having stored therein second configuration information for a micro-service, the second configuration information having a configuration time that is earlier than a configuration time for the first configuration information, the method further comprising, prior to the first computing device obtaining the first request:
The first computing device obtains the second configuration information from the database;
the first computing device persists the second configuration information locally.
6. The method of any one of claims 1 to 5, wherein the distributed system further comprises a database, the method further comprising:
The first computing device acquires a second request, wherein the second request carries the identification of the first configuration information;
The message middleware is used for transmitting the identification of the first configuration information, and the identification of the first configuration information is used for indicating the second computing device to store the first configuration information into the database;
the first computing device obtains 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 to the database.
8. A micro-service configuration system, wherein the system comprises a first computing device and a second computing device, and wherein the first computing device and the second computing device are provided with micro-services;
The first computing device is configured to obtain a first request; the first request carries first configuration information of a micro-service deployed on the second computing device;
the second computing device is used for subscribing to message middleware, wherein the message middleware is used for transmitting the first configuration information;
The first computing device is configured to send first configuration information to the message middleware;
the second computing device is configured to obtain the first configuration information from the message middleware and persistently store the first configuration information locally;
The first computing device is used for receiving a configuration result sent by the second computing device, and the configuration result is used for indicating whether the second computing device is successful or failed in storing the first configuration information in a local persistence mode.
9. A cluster of computing devices, 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 to cause the cluster of computing devices to perform the method of any one of claims 1 to 7.
10. A computer readable storage medium, characterized in that the storage medium has stored therein a computer program or instructions which, when executed by a computing device, implement the method of any of claims 1 to 7.
11. A computer program product comprising a computer program or instructions which, when executed by a computing device, implement the method of any one of claims 1 to 7.
CN202411524386.6A 2024-10-29 2024-10-29 Micro-service configuration method and device Pending CN119603145A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411524386.6A CN119603145A (en) 2024-10-29 2024-10-29 Micro-service configuration method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411524386.6A CN119603145A (en) 2024-10-29 2024-10-29 Micro-service configuration method and device

Publications (1)

Publication Number Publication Date
CN119603145A true CN119603145A (en) 2025-03-11

Family

ID=94832974

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411524386.6A Pending CN119603145A (en) 2024-10-29 2024-10-29 Micro-service configuration method and device

Country Status (1)

Country Link
CN (1) CN119603145A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190089809A1 (en) * 2017-09-15 2019-03-21 Oracle International Corporation Dynamic message queues for a microservice based cloud service
CN110190997A (en) * 2019-05-31 2019-08-30 深圳前海微众银行股份有限公司 Configuration information acquisition method, device, equipment and computer-readable storage medium
CN115562757A (en) * 2022-10-20 2023-01-03 中电金信软件有限公司 Data processing method, configuration center system, electronic device, and storage medium
CN116567080A (en) * 2023-04-26 2023-08-08 深圳奇迹智慧网络有限公司 Micro-service management system and method based on embedded system
WO2024136913A1 (en) * 2022-12-22 2024-06-27 Rakuten Mobile, Inc. Method and system for reading configuration data for rapp
CN118467637A (en) * 2024-05-27 2024-08-09 北京百度网讯科技有限公司 Database synchronization system, method, device, electronic equipment and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190089809A1 (en) * 2017-09-15 2019-03-21 Oracle International Corporation Dynamic message queues for a microservice based cloud service
CN110190997A (en) * 2019-05-31 2019-08-30 深圳前海微众银行股份有限公司 Configuration information acquisition method, device, equipment and computer-readable storage medium
CN115562757A (en) * 2022-10-20 2023-01-03 中电金信软件有限公司 Data processing method, configuration center system, electronic device, and storage medium
WO2024136913A1 (en) * 2022-12-22 2024-06-27 Rakuten Mobile, Inc. Method and system for reading configuration data for rapp
CN116567080A (en) * 2023-04-26 2023-08-08 深圳奇迹智慧网络有限公司 Micro-service management system and method based on embedded system
CN118467637A (en) * 2024-05-27 2024-08-09 北京百度网讯科技有限公司 Database synchronization system, method, device, electronic equipment and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
冯志勇;徐砚伟;薛霄;陈世展;: "微服务技术发展的现状与展望", 计算机研究与发展, no. 05, 15 May 2020 (2020-05-15) *

Similar Documents

Publication Publication Date Title
KR20210027400A (en) Implementation of compliance settings by mobile devices to comply with configuration scenarios
CN111163130B (en) Network service system and data transmission method thereof
US20180349159A1 (en) Optimizing runtime environments
CN110795446A (en) List updating method and device, readable medium and electronic equipment
CN114090388A (en) Information acquisition method, server cluster, server and equipment
US11621950B2 (en) Data processing methods, servers, client devices and media for security authentication
CN112083945A (en) NPM installation package update prompt method, device, electronic device and storage medium
CN112667949A (en) Data processing method and device for front-end gateway
CN115604144B (en) Test method and device, electronic equipment and storage medium
US20240177200A1 (en) Business service interaction method and apparatus, device, and storage medium
CN114996557A (en) Service stability determination method, device, equipment and storage medium
US12388671B2 (en) Method, apparatus, device and medium for adding group members
CN119603145A (en) Micro-service configuration method and device
CN120021205A (en) A resource orchestration method and cloud management platform based on cloud computing technology
CN114270309A (en) Resource acquisition method and device and electronic equipment
CN116996434A (en) A back-end cluster management method, device, electronic equipment and readable storage medium
CN116074367A (en) Data processing method, device, electronic device and storage medium
CN110311935A (en) A kind of sharing method shares deployment system and client
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN116974449A (en) Function response method and device, electronic equipment and storage medium
CN117785930A (en) A data query method and cloud service system
CN116185518A (en) A BIOS configuration mode setting method, device and storage medium
CN113726885A (en) Method and device for adjusting flow quota
CN111475291A (en) Data processing method, system, server and medium
CN117883789B (en) Data acquisition method, apparatus, device, readable storage medium, and program product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination