Data processing method and device, electronic equipment, medium and program product
By processing and storing component status data of regional clusters and directly responding to query requests, the problem of low efficiency in obtaining product status data in the existing technology is solved, and real-time monitoring and querying of the status of multiple regional cluster product instances are realized.
Patent Information
- Application Number
- CN202310341288.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-31
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2043-03-31
AI Technical Summary
The product status data acquisition method deployed on the query cluster requires calling multiple interfaces and performing complex splicing operations, resulting in low data query efficiency.
By obtaining the component status data in the regional cluster, determining the data type and applying corresponding processing methods, the component status data is processed to generate product status data, and stored in the status database to directly respond to query requests.
It improves the query efficiency of product status data, reduces dependence on interfaces and splicing operations, and enables real-time monitoring and unified management of product instance status in multiple regional clusters.
Smart Images

Figure CN118733853A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, electronic device, medium and program product. Background Art
[0002] At present, when querying the product status data of products deployed on the cluster, it is usually necessary to call the corresponding interfaces of each application under the product to obtain the status data of the corresponding application, and after obtaining the status data of each application, it is necessary to splice the status data of each application to obtain the product status data of the product, and the splicing of product status data is usually complex and difficult to calculate. Based on this, it can be seen that this method of obtaining product status data not only requires calling multiple interfaces, but also requires complex and difficult splicing operations, which leads to low data query efficiency of product status data. Summary of the invention
[0003] The embodiments of the present application provide a data processing method, device, electronic device, medium and program product, which can improve the query efficiency of product status data.
[0004] In a first aspect, an embodiment of the present application provides a data processing method, including:
[0005] Obtain component status data of associated components associated with product instances deployed on each of the one or more regional clusters;
[0006] Determine one or more data types of component status data of associated components associated with the product instances deployed on each regional cluster, and determine data processing methods corresponding to the one or more data types;
[0007] Based on the data processing methods corresponding to the one or more data types, status data of the corresponding data types in the component status data of the associated components associated with the product instance deployed on each regional cluster are processed to obtain product status data of the product instance deployed on each regional cluster;
[0008] Storing product status data of the product instances deployed on each regional cluster in a status database;
[0009] If a query request for product status data of a specified product instance is obtained, the product status data requested by the query request is searched from the status database in response to the query request.
[0010] In a second aspect, an embodiment of the present application provides a data processing device, including:
[0011] An acquisition unit, used to acquire component status data of associated components associated with product instances deployed on each of the one or more regional clusters;
[0012] A determination unit, configured to determine one or more data types of component status data of associated components associated with a product instance deployed on each regional cluster, and determine data processing modes corresponding to the one or more data types;
[0013] A processing unit, configured to process status data of a corresponding data type in component status data of an associated component associated with a product instance deployed on each regional cluster based on data processing modes corresponding to the one or more data types, to obtain product status data of the product instance deployed on each regional cluster;
[0014] A storage unit, used to store product status data of the product instances deployed on each regional cluster in a status database;
[0015] The query unit is configured to search the status database for the product status data requested by the query request in response to a query request for product status data of a specified product instance.
[0016] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising: a processor and a memory, the processor being used to execute the method of the first aspect above.
[0017] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which program instructions are stored, and the program instructions, when executed, implement the method of the first aspect mentioned above.
[0018] In a fifth aspect, an embodiment of the present application further provides a computer program product or a computer program, wherein the computer program product or the computer program comprises program instructions, and when the program instructions are executed by a processor, the method of the first aspect described above is implemented.
[0019] In an embodiment of the present application, the component status data of the associated components associated with the product instances deployed on each regional cluster in one or more regional clusters can be obtained; and one or more data types of the component status data of the associated components associated with the product instances deployed on each regional cluster can be determined, and further the data processing methods corresponding to the one or more data types can be determined, so as to process the status data of the corresponding data types in the component status data of the associated components associated with the product instances deployed on each regional cluster based on the data processing methods corresponding to the one or more data types, and obtain the product status data of the product instances deployed on each regional cluster; further, the product status data of the product instances deployed on each regional cluster can be stored in the status database; if a query request for the product status data of the specified product instance is obtained, the product status data requested by the query request can be searched from the status database in response to the query request. Through the above method, the product status data of the product instances deployed on multiple regional clusters can be monitored in real time, and the status information of all associated components under the product instances can be calculated in real time to obtain the corresponding product status data; by storing the product status data in the status database, in the subsequent query tasks, all the status data under the product can be directly obtained at one time without assembly, thereby effectively improving the data query efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] Figure 1a It is a schematic diagram of the architecture of a data processing system provided in an embodiment of the present application;
[0022] Figure 1b is a schematic diagram of the architecture of another data processing system provided in an embodiment of the present application;
[0023] Figure 2 It is a flowchart of a data processing method provided in an embodiment of the present application;
[0024] Figure 3a It is a schematic diagram of a process of deploying a product configuration file provided in an embodiment of the present application;
[0025] Figure 3b It is a flowchart of another data processing method provided in an embodiment of the present application;
[0026] Figure 4It is a flowchart of another data processing method provided in an embodiment of the present application;
[0027] Figure 5a This is a flowchart of a product status data change process provided by an embodiment of the present application;
[0028] Figure 5b This is a flow chart of a configuration change process provided by an embodiment of the present application;
[0029] Figure 5c This is another flow chart of processing configuration changes provided by an embodiment of the present application;
[0030] Figure 6 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;
[0031] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0033] Cloud Technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.
[0034] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, image websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.
[0035] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, so that various application systems can obtain computing power, storage space and information services as needed. The network that provides resources is called "cloud". The resources in the "cloud" are infinitely expandable in the eyes of users, and can be obtained at any time, used on demand, expanded at any time, and paid for by use.
[0036] The present application can store the product status data obtained by data processing in the "cloud", and the product status data in the cloud can be obtained and expanded at any time according to needs. For example, after determining the product status data of a product instance, the product status data of the product instance can be associated and stored in the "cloud". When the product status data of the product instance is queried, the product status data of the product instance can be obtained from the "cloud".
[0037] In the application embodiment, the product (Porduct) can be highly abstracted, such as finding the common points of different products on the application, and building an open product model (Open Product Model, OPM) through a series of capabilities (such as cloud native capabilities). The open product model can be understood as a specification standard for defining cloud native products. Among them, the CRD (Custom Resource Definition) in the cloud native capability is a custom resource definition based on the Kubernetes cluster. In simple terms, CRD itself is a resource type built into the Kubernetes cluster, through which various resources (such as CR) can be deployed and accessed in the Kubernetes cluster, such as the CRD resources defined in the Kubernetes cluster can be viewed through the kubectlget command. For example, the resource in the embodiment of the present application can be a product instance (Product Instance) resource deployed on the cluster, and the product instance resource can refer to the product status data of the product. For example, the product status data can include status data for each associated component, and the product instance resource can include resources for each associated component. Among them, the associated components can include applications, containers (Pod), middleware (Component), virtual machines, etc., and the resources of the associated components can refer to application resources, middleware resources, etc.
[0038] For ease of understanding, the following explains the relevant terms. A product instance refers to the entity after the product is deployed. One product can deploy multiple instances. A product refers to a collection of applications that are closely related and can be combined to provide unified functions to the outside world. An application is the smallest unit that can be independently deployed and maintained, and can also provide services to the outside world. It is part of the product, that is, one product can include 1 to n applications.
[0039] Among them, the "Open" in the open product model can be understood as supporting heterogeneous platforms, container operations, scheduling systems, cloud providers, hardware configurations, etc. In short, it is independent of the underlying layer; the "Product" can be understood as a product that includes 1 to n applications and the cluster information to which the product belongs; the "Model" can be understood as defining standards to make it independent of the underlying platform.
[0040] As mentioned above, the open product model can describe the product instances running in the cluster based on the cloud native capability. It should be understood that based on the monitoring (Watch) capability supported by the cloud native capability, the open product model can monitor all resources related to the product and calculate the current product status in real time. Secondly, the cloud native capability also has the tuning capability for the final state. Among them, real-time calculation can be understood as the information of the associated components (such as applications) under the product changes, the product status of the product instance will be calculated in real time, and the corresponding results will be generated; the coordination strategy can be understood as the evolution of the resources on the cluster (such as the K8s cluster) to the target state expected by the user, and the target state can be understood as the result the user wants. Based on this, it can be seen that under the open product model, a series of real-time calculations and coordination strategies can be performed on the product instances deployed in the cluster. It should be noted that the open product model proposed in the embodiment of the present application can continuously improve the current CRD definition for the product. For example, the similarities of different products can be highly abstracted so that the open product model is not limited to the real-time calculation of product status data proposed in this application.
[0041] In an embodiment of the present application, in a specific scenario using OPM, an embodiment of the present application proposes a product instance real-time computing service that performs real-time computing on product status data of a product instance. Through the product instance real-time computing service, management of product status data of product instances on one or more regional clusters is implemented, such as the management may include monitoring, real-time computing, etc.
[0042] Based on the above description, the present application embodiment proposes a schematic diagram of the architecture of a data processing system, for example, see Figure 1a The architecture of the data processing system involves three parts: product instance real-time computing services, background services, and business scenarios.
[0043] In one embodiment, the product instance real-time computing service can be deployed on the main regional cluster in one or more regional clusters. The product instance real-time computing service can be implemented by a controller deployed on the main regional cluster, and the controller can be used to manage the resources deployed on one or more regional clusters. Among them, a unified controller can be used to manage the resources deployed on one or more regional clusters, and a controller can also be used to manage the resources deployed on a regional cluster. It should be noted that for multiple regional clusters, the regional cluster where the product instance real-time computing service is deployed can be called the main regional cluster, and the other regional clusters in the multiple regional clusters can be called backup regional clusters, wherein the main regional cluster can be any regional cluster in one or more regional clusters. Based on this, it can be seen that the controller can monitor the Application resources, Pod resources, Component resources, etc. under the product instances on the main regional cluster and the backup regional cluster.
[0044] In one embodiment, the component status data of the associated components associated with the product instances deployed on the regional cluster may involve one or more data types; wherein the status data under a data type can be processed using a data processing method to obtain the product status data under the data type, and the product status data under each data type can constitute the product status data of the product instance. Exemplarily, the one or more data processing methods may include a data processing method for calculating the health status of the product, a data processing method for calculating the resource usage of the product, a data processing method for calculating the health status of the application, a data processing method for tracing the modification of the product configuration, and so on. Based on the above description, it can be seen that the controller can obtain the product status data of the product instance through one or more data processing methods.
[0045] In one embodiment, the processing of a data processing method can be integrated into a state processing unit (or a computing unit) for processing, and the controller can call the state processing unit to perform real-time calculation of product status data. For example, one or more state processing units can be called to calculate the product status data of a product instance. Exemplarily, the one or more state processing units may include a state processing unit that calculates the health status of a product, a state processing unit that calculates the resource usage of a product, a state processing unit that calculates the health status of an application, a state processing unit that traces back changes to product configurations, and the like.
[0046] The calculation result of the real-time calculation of the product status data can be recorded on the primary regional cluster, such as being stored in a database (such as a status database) on the primary regional cluster, which can be used to store the product status data of the product instance. In one embodiment, the calculation result of the real-time calculation of the product status data can be used to update the product status data of the product instance recorded on the primary regional cluster. The product status data of the product instance recorded on the primary regional cluster can be used for subsequent query tasks, that is, the user can directly initiate a query request to the primary regional cluster to find the product status data corresponding to the query request.
[0047] From the above, it can be seen that by designing a controller based on the definition of an open product model, it is possible to achieve real-time observation and calculation of various data such as resource occupancy, operating status, and applications of product instances under multiple regional clusters. In addition, the product instance real-time computing service proposed in the embodiment of the present application can achieve multi-version compatibility and forward compatibility. As described above, the real-time calculation of the product status data of the product instance only depends on the regional cluster (such as the K8s cluster) and associated components (such as Application, etc.). There will be no impact on the real-time calculation in the historically deployed version. It is only necessary to deploy the product instance real-time computing service to the environment (i.e., the regional cluster) to immediately achieve real-time calculation of the product status data.
[0048] In one embodiment, the background service may include a query service (such as DawnService), a product status synchronization (Product Status Sync) service, and a data storage service of a data engine (Data Engine). In one embodiment, the product status synchronization service can be used to obtain product status data (or ProductInstance data, ProductInstance status, etc.) of a product instance from the environment, and the obtained product status data can be synchronized to the data engine, that is, the product status data calculated in real time can be synchronized to the data engine. The query service can integrate the product status data of the product instance in the data engine and provide a query interface for the product status data to the outside world. The data engine can be understood as a status database. The status database here and the status database mentioned above for the main regional cluster refer to two different status databases. Both status databases can provide data query services for product status data. Both status databases can be deployed, or only one of them can be deployed, without limitation.
[0049] In one embodiment, based on the capability of real-time computing services for product instances, the product status data stored in the status database can provide data query services for a variety of business scenarios; for example, business scenarios can be change scenarios, data collection scenarios, real-time data visualization scenarios, abnormal alarm scenarios, etc.
[0050] For example, in a change scenario, the real-time version of the application that needs to be used can be determined through the application version information contained in the product status data stored in the status database.
[0051] For example, in a data collection scenario, the required product status data can be obtained from the status database based on the actual needs of the user. That is, in the embodiment of the present application, the data collection capability can be realized based on the Watch mechanism provided by the product instance real-time computing service. For example, the version information of the product's deployed applications, deployment time, etc. can be collected in combination with the product market's own data and real-time data in the environment.
[0052] For example, in a real-time data visualization scenario, if a product page is involved, the product status data (such as health status, application readiness ratio, application status data, etc.) required for use can be obtained from the status database to visualize the product on the page. In an embodiment of the present application, a dual-channel preview of real-time product status data can be achieved. For example, the product status data can be directly previewed through the kubectl command form, and the product status data collection rules can be modified; the real-time product status data can also be previewed through the product market interface (i.e., the terminal interface).
[0053] For another example, in an abnormal alarm scenario, when the controller detects that the product status is abnormal, an alarm can be triggered, such as directly pushing a message to the front end. The abnormal product status may refer to a certain item of product status data being abnormal data, such as the abnormal data may refer to the data being different from the data planned for the product. For example, the product rule requires the deployment of 5 applications, but the product actually only deploys 3 applications. In this case, an alarm can also be triggered. That is, in an embodiment of the present application, an alarm capability for abnormal product status can be introduced based on the Watch mechanism provided by the real-time computing service of the product instance.
[0054] From the above, it can be seen that in the embodiment of the present application, the process of obtaining real-time product status data can be simplified. Here, it is not necessary to rely on the interface capabilities provided by each application under the product to obtain the status data of each application separately and then perform splicing processing to obtain the product status data. Instead, all the status data of the product calculated by the real-time calculation service of the product instance can be directly obtained from the status database. In addition, unified management of products deployed on one or more regional clusters can be achieved without calling query services across regional clusters, that is, users do not need to consider the acquisition of product status data when the product is deployed in multiple regional clusters; this problem can be solved directly at the Controller layer, that is, the product status data of the product instance on the backup regional cluster can be calculated in real time on the primary regional cluster.
[0055] In one implementation, Figure 1b FIG. 2 is a schematic diagram of another data processing system provided by an embodiment of the present application. Figure 1b As shown:
[0056] In the product instance real-time computing service, the controller can monitor product instance resources on multiple regional clusters. For example, the application resources (App CR) and middleware resources (Comp CR) under the product instance on the primary regional cluster and the backup regional cluster can be monitored. If the application, middleware and other resources are monitored to have deletion, update, creation and other operations, the recalculation of the product status data can be triggered, and the calculation results can be synchronized to the data engine. In one embodiment, when calculating the product status data, it can be achieved by calling multiple status processing units, such as the multiple status processing units can include a product health calculation unit, a product application status data calculation unit, a product configuration real-time monitoring calculation unit, and so on.
[0057] In one embodiment, when synchronizing product status data, the product status synchronization service can be called to obtain the product status data of the product instance and synchronize it to the data engine to implement the addition (Insert) or update (Update) of the product status data originally stored in the data engine. Users can select (Select) the product status data of the required product instance from the data engine through the query service. The query service can also provide users with a service to create (Create) product instances on the main regional cluster. For example, if a user needs to create a new product instance (such as the main regional cluster creates product instance 1, product instance 2, product instance 3, and product instance 4), the creation of the product instance can be achieved by performing relevant operations on the operation interface provided by the query service.
[0058] It should be noted that the functions of the controller can be integrated and run on an electronic device, which can be a server. The server mentioned here can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, etc.
[0059] Based on the above description, the embodiment of the present application provides a data processing method, which is applied to an electronic device and can be executed by a controller on the electronic device. Figure 2 The data processing method includes but is not limited to the following steps:
[0060] S201, obtaining component status data of associated components associated with product instances deployed on each of one or more regional clusters.
[0061] Among them, the number of product instances deployed on a regional cluster may include one or more, and the embodiment of the present application takes one as an example for relevant explanation. The associated components under the product instance may include applications, middleware, virtual machines, etc. under the product. A regional cluster can be understood as a cluster in a certain area or region. Usually, a set of K8s clusters will be deployed in each region. Under the same cloud, multi-regional networks can communicate with each other.
[0062] In one implementation, for any one of the one or more regional clusters, the product instance on the regional cluster is pre-deployed (applied). It should be understood that when deploying a product, it is first necessary to create a cluster (such as a K8s cluster) resource for the product instance for real-time calculation of subsequent product status data, that is, the product instance needs to be deployed on the cluster first. It is understandable that product instances can be deployed on clusters in different regions (Regions), then in the embodiment of the present application, the cluster can also be referred to as a regional cluster. The following is an elaboration on the deployment of product instances; to implement the deployment of product instances on regional clusters, that is, to deploy the product configuration file of the product instance on the regional cluster, the product configuration file may contain relevant configuration information of the product instance. Among them, the product configuration file may be a ymal file.
[0063] As mentioned above, the embodiment of the present application can use the open product model (OPM) to complete the real-time calculation of product status data. In the open product model, the product configuration file of the product instance may include the following configuration information of the product instance: the API version (APIVersion) corresponding to the product instance; the resource object corresponding to the product instance (the resource object can be called kind). In the embodiment of the present application, the resource object is identified as a product instance (ProductInstance); the metadata (metadata) of the product instance; the description information of the product instance (the description information can be called Spec); and so on.
[0064] The metadata of a product instance may include: the product name (name) of the product. If the product is deployed on clusters in multiple regions, the product name may be followed by the region ID (regionID) corresponding to the region, such as 50010002. The metadata of a product instance may also include the relevant tag definitions of the product instance, so that the API of the K8s cluster can use these tags for related searches. For example, the tag definition may include the product version tag, such as 1.0.0; the product region (RegionID) tag, such as 50000001; the product number (productCode) tag, such as dawn; and the product instance name (productInstanceName) tag, such as dawn-1.
[0065] The description information of the product instance may include: product number, product instance name, product region, product namespace (appNameSpace) where the application in the product is located, a list of state processing units required for product state data (the list of state processing units may be referred to as rules), and the like.
[0066] For example, the product number in the description information of the product instance is dawn, the product instance name is dawn-1, the product is located in 50000001, and the state processing units in the state processing unit list are enumerated as: product real-time resource occupancy calculation unit (or productResource), product health status calculation unit (or productHealthy), product application status information calculation unit (or productApps), product middleware information calculation unit (or productServiceInstances), application configuration update monitoring calculation unit (or applicationUpdateMonitor). Other state processing units may also be included, which are not limited to this.
[0067] It should be noted that when configuring rules, you can control whether the state processing unit is turned on, the product state calculation rules corresponding to the state processing unit, etc. by controlling the input parameters. For example, in the configuration of the state processing unit in rules, the setting of the params parameter and the isOpen parameter may be involved. Among them, params represents the input parameter map, which can be a mapping in the form of key-value pairs, that is, the input parameter can be expressed as key:value, where the data type of the data corresponding to the key and value can be a string type. In general, the input parameter map can be understood as a key:value map[string]string type. isOpen indicates whether the state processing unit is turned on; isOpen is a bool type variable. It should be noted that by default, all state processing units in the product development model are turned on. If the user needs to use a specific state processing unit to calculate the product status data, it can be defined in params.
[0068] In one implementation, the process of deploying a product configuration file for a product instance on a regional cluster can be found in Figure 3a as shown; Figure 3a As shown, the developer can perform relevant operations on the front end (or the product market front end) so that the front end can call the target interface (such as the StartOperationSheet interface) to obtain the query service (or the operation and maintenance center). For example, the front end can provide an operation interface, which can have a deployment control of a product instance. The developer can trigger (press, click, etc.) the deployment control, and after the deployment control is triggered, the front end can call the target interface to obtain the query service for subsequent operations.
[0069] Then, relevant descriptive information of the product instance can be obtained from the database through the query service, such as the product name, product number, regional information (i.e., the region where the product instance is deployed), etc. of the product instance. The database here can be the above-mentioned status database, or it can be another database, which is not limited to this. After obtaining the relevant descriptive information, a product configuration file corresponding to the product instance can be made based on the relevant descriptive information. Optionally, the product configuration file can be generated by R&D personnel writing code based on the relevant descriptive information after the corresponding relevant descriptive information is obtained; or, the product configuration file can be automatically generated based on the obtained relevant descriptive information using a preset configuration file template, and the configuration file module can be pre-set. Through this automatic generation method, the file generation speed can be effectively improved, thereby improving the deployment speed of the product instance.
[0070] After the product configuration file is created, it can be deployed on the regional cluster to implement the deployment of product instances in the regional cluster. In summary, the creation and update of product instance resources can be written in the StartOperationSheet interface and can be deployed along with the deployment or update of the product; for example, in a K8s cluster scenario, the go package in the K8s cluster can be used to deploy the product instance resources of the main regional cluster.
[0071] It should be noted that when deploying a product configuration file, it can be deployed on the required regional cluster. If a product instance needs to be deployed on one or more regional clusters, the corresponding product configuration file can also be deployed on the one or more regional clusters, that is, in the process of creating product instance resources, it is not necessary to distinguish between the primary and backup regional clusters. Among them, there can be a distinction between the primary regional cluster and the backup regional cluster in one or more regional clusters. Among them, the primary regional cluster is deployed with a product instance real-time computing service, that is, the product instance real-time computing service deployed by the primary regional cluster is used to monitor all regional clusters and realize real-time computing of product status data.
[0072] In one implementation, the main regional cluster may be any one of one or more regional clusters, and the main regional cluster may be randomly selected from one or more regional clusters, or may be selected from one or more regional clusters according to a preset selection rule. For example, the preset selection rule may refer to selecting according to the performance parameters of each regional cluster, and taking a regional cluster with the best performance parameters as the main regional cluster. In this case, the specific implementation of selecting the main regional cluster from one or more regional clusters based on the preset selection rule may be: obtaining the performance parameters of each regional cluster, and the performance parameters may include one or more of computing power and safety factor, and the safety factor is used to measure the probability of successful data theft of the regional cluster; after obtaining the performance parameters of each regional cluster, the main regional cluster may be selected from one or more regional clusters according to the performance parameters of each regional cluster. It should be noted that the performance parameters may also include other parameters, and the computing power and safety factor are used for relevant explanation here.
[0073] Optionally, assuming that the performance parameters include computing power, the computing power of each regional cluster can be obtained, and the regional cluster with the highest computing power can be used as the main regional cluster. It can be understood that a set of product instance real-time computing services are deployed on the main regional cluster, and the product instance real-time computing service needs to provide real-time computing. In order to improve the computing speed, thereby improving the storage speed of product status data and ensuring the accuracy and reliability of subsequent query services, when selecting the main regional cluster, a regional cluster with the highest computing power can be selected so as to improve the computing speed. Among them, the computing power of the regional cluster can be evaluated using the MIPS (Million Instructions Per Second) parameter. The MIPS parameter can be used to indicate the number of instructions that can be executed per second. The higher the MIPS parameter value, the higher the corresponding computing power. The computing power of the regional cluster can also be determined by other methods, which are not limited in this application.
[0074] Optionally, assuming that the performance parameters include a safety factor, the safety factor of each regional cluster can be obtained, and the regional cluster with the highest safety factor can be used as the main regional cluster. It should be understood that the product status data of the product instance calculated in real time can be stored in the main regional cluster. In order to ensure the storage reliability of the product status data, when selecting the main regional cluster, a regional cluster with the highest security performance can be selected. Among them, the specific implementation method for determining the safety factor of the regional cluster can be: counting the amount of product status data stored and the amount of product status data successfully stolen, and taking the ratio between the amount of product status data successfully stolen and the amount of product status data stored as the safety factor. The safety factor of the regional cluster can also be determined by other methods, which are not limited in this application.
[0075] Optionally, assuming that the performance parameters include computing power and safety factor, the computing power and safety factor of each regional cluster can be obtained; after obtaining the computing power and safety factor of each regional cluster, each regional cluster can be sorted in order from high to low in computing power to obtain a sorting result for computing power, and each regional cluster can be sorted in order from high to low in safety factor to obtain a sorting result for safety factor. After obtaining these two sorting results, a main regional cluster can be selected from one or more regional clusters based on these two sorting results. For example, the ranking of each regional cluster in the sorting result of computing power and the ranking of each regional cluster in the sorting result of safety factor can be obtained; for any regional cluster, the sum of the ranking of any regional cluster in the sorting result of computing power and the ranking of any regional cluster in the sorting result of safety factor can be used as the target ranking of any regional cluster; after obtaining the target ranking of each regional cluster, the regional cluster corresponding to the highest target ranking in the target ranking of each regional cluster can be used as the main regional cluster. It can be seen that in this way, multiple dimensions can be combined to select a regional cluster with better computing power and safety factor as the main regional cluster.
[0076] It should be understood that, at present, when the business layer (such as dawn-servcie) handles multi-region clusters, it is usually completed by requesting the Ingress (Ingress is a URL that can configure the service in the cluster as accessible to the external network) of the application manager (app-manager) under different regional clusters. It can be seen that when obtaining product status data under multiple regional clusters, different Ingresses need to be involved, and the processing is more cumbersome.
[0077] Based on the above considerations, the embodiment of the present application considers helping the upper layer (such as the business layer) to isolate the adaptation problem of the multi-region cluster, so as to realize the adaptation problem of the multi-region cluster at the controller (Controller, Operator) layer. In a specific implementation method, a set of product instance real-time computing services can be deployed in a main regional cluster, and the product instances on each regional cluster can be calculated in real time based on the product instance real-time computing service. The real-time status calculation is to calculate the product status data of the product instance in real time. Among them, the function of the product instance real-time computing service is realized by the controller, that is, the controller can monitor multiple regional clusters, and the product instance resources on the main regional cluster can be updated. The product instance resources are the product status data of the product instance, so as to synchronize the data of the multi-region cluster. That is, the Controller layer provided by the product instance real-time computing service realizes data processing on multiple regional clusters, so the business layer does not need to consider the ingress information of multiple sets of regional clusters, or all upper-layer services using the product instance real-time computing service do not need to consider the ingress information, so that the processing for the multi-region cluster can be effectively simplified.
[0078] In one implementation, the specific process of using a controller to monitor multiple regional clusters can be as follows: Figure 3b For example, see Figure 3b As shown: you can first obtain the configuration file for the authentication configuration of each regional cluster (such as authentication configuration file, KubeConfig, etc.), and store the authentication configuration file for each regional cluster in the database. The database here can be the state database mentioned above, or another database, which is not limited to this. Among them, the authentication configuration file corresponding to any regional cluster is used to configure the controller's management authority for any regional cluster, that is, the controller has the ability to monitor and perform real-time calculations on the product instances deployed on any regional cluster.
[0079] After storing the authentication profiles of each regional cluster in the database, a medium for interacting with the regional cluster can be created, such as an access link for accessing the regional cluster, so that the controller can obtain the status data of the relevant components under the production instance from the corresponding cluster based on the access link of each regional cluster. The access link can be called client, and the access link of each regional cluster can be stored in a map, such as in the form of client.Client.
[0080] By deploying the authentication configuration file and creating access links for each regional cluster, the controller is initialized, and the controller has the function of monitoring each regional cluster. In one embodiment, the product instance real-time computing service deployed on the primary regional cluster can realize the product instance resources (i.e., product status data of the product instance) deployed on the primary regional cluster and the backup regional cluster through the controller, and can tune the product instance resources on the primary regional cluster, that is, when monitoring the product instance resources deployed on the primary regional cluster and the backup regional cluster, the status processing unit can be called to calculate the product status data of the product instance, and the product instance data on the primary regional cluster can be updated based on the calculated product instance data.
[0081] To summarize, the embodiment of the present application can store the client.Client of each regional cluster into a map, and monitor the applications, middleware, etc. under the product instance based on the client.Client of each regional cluster, and can adjust the product status data of the product instance on the main regional cluster based on the monitoring results (i.e., product status data).
[0082] In one implementation, there may be a corresponding trigger condition for obtaining component status data of associated components associated with a product instance deployed on a regional cluster, that is, when the trigger condition is met, the component status data of associated components associated with the product instance deployed on the regional cluster can be obtained, and the product status data for the product instance can be further determined based on the obtained component status data.
[0083] Optionally, the target product instance in the product instance deployed on each regional cluster is used as an example for explanation, wherein the target product instance is any one of the product instances deployed on each regional cluster. The trigger condition may be: it is detected that the target product instance has a target operation for the component status data, and the target operation may include any one or more of a modification operation, a deletion operation, and a new operation. In other words, if it is detected that the target product instance has a target operation for the component status data, the step of obtaining the component status data of the associated component associated with the target product instance may be triggered. Considering that the product status data of the product instance finally obtained can be synchronously stored in the status database, through this acquisition method, the product status data stored in the status database can be updated in real time based on the changes in the product status data of the product instance on the regional cluster, thereby ensuring the accuracy and reliability of the data storage.
[0084] Optionally, the trigger condition may be: detecting that the current time is a preset acquisition time. The preset acquisition time may be pre-set, and the preset acquisition time may be a periodic time, that is, the preset acquisition time may be a time under the data acquisition cycle of the target product instance, and the data acquisition cycle may be used to indicate the time interval for acquiring the component status data of the associated components associated with the target product instance, wherein the time interval indicated by the data acquisition cycle is not specifically limited. Based on this, it can be known that the component status data of the associated components associated with the product instance may be periodically acquired, so that the product status data of the product instance stored in the status database may be periodically updated later, thereby ensuring the real-time nature of the data in the status database. In other words, if the current time is detected to be the preset acquisition time, the step of acquiring the component status data of the associated components associated with the target product instance may be triggered.
[0085] In one embodiment, for each product instance, the corresponding data acquisition cycle may be the same or different. For example, the data acquisition cycle for each product instance may be determined based on the product status data of the product instance requested by the historical query request. In a specific implementation, historical query requests within a historical time period may be obtained; wherein the so-called historical time period refers to a time period that is before the current time and is separated from the current time by a preset time period (e.g., 7 days), and the current time here may refer to the moment when the storage demand for the product status data of the product instance is detected; the number of historical query requests may be multiple. The data acquisition cycle for the product instance may be determined based on multiple historical query requests.
[0086] Optionally, the historical query request may include an instance identifier for indicating the product instance to be queried, then all instance identifiers contained in multiple historical query requests may be determined, and the number of each instance identifier may be counted, such as the number of an instance identifier may be referred to as the identifier number; after the identifier number of each instance identifier is obtained by counting, the data acquisition cycle of each product instance in the product instance deployed on each regional cluster may be determined based on the identifier number of each instance identifier. Among them, the data acquisition cycle of each product instance may be set according to the idea that the data acquisition cycle is negatively correlated with the identifier number of the instance identifier; that is, if the number of identifiers of a product instance is more, the data acquisition cycle corresponding to the product instance may be shorter, and conversely, if the number of identifiers of a product instance is less, the data acquisition cycle corresponding to the product instance may be longer. Through this setting method, a shorter data acquisition cycle may be set for a product instance with a higher query frequency, so that the product status data of the product instance in the status database may be updated in a timely manner, thereby improving the query accuracy, and a longer data acquisition cycle may be set for a product instance with a lower frequency, thereby reducing the computational overhead.
[0087] As mentioned above, the above-mentioned method uses each product instance as a dimension to determine the data acquisition cycle corresponding to each product instance. In another embodiment, the data acquisition cycle corresponding to each product instance can also be determined based on the regional cluster as a dimension, that is, the data acquisition cycle of all product instances deployed on a regional cluster is the same. In this case, the data acquisition cycle for each regional cluster can also be determined by multiple historical query requests. In a specific implementation, after obtaining multiple historical query requests within a historical time period, it can be determined which regional cluster the product instance requested by each historical query request is, that is, the regional cluster corresponding to each historical query request is determined; for example, a cluster identifier can be carried in a historical query request, and the cluster identifier can be used to indicate the requested regional cluster.
[0088] Based on this, it can be known that the number of identifiers corresponding to each cluster identifier included in multiple historical query requests can be counted. After the number of identifiers of each cluster identifier is obtained, the data acquisition period of each regional cluster can be determined based on the number of identifiers of each cluster identifier. Among them, the data acquisition period of each regional cluster can be set according to the idea that the data acquisition period is negatively correlated with the number of identifiers of the cluster identifier; that is, if the number of identifiers of a regional cluster is more, the data acquisition period corresponding to the regional cluster can be shorter, and conversely, if the number of identifiers of a regional cluster is less, the data acquisition period corresponding to the regional cluster can be longer. Through this setting method, a shorter data acquisition period can be set for a regional cluster with a higher query frequency, so that the product status data of the product instance on the regional cluster in the status database can be updated in time, thereby improving the query accuracy. Setting a longer data acquisition period for a regional cluster with a lower frequency can also reduce the computing overhead.
[0089] In one implementation, when a product configuration file (such as a ymal file) is deployed to a regional cluster, a real-time calculation can be performed so that subsequent updates can be made based on the product status data obtained by the initial calculation, which also facilitates historical tracing.
[0090] S202, determining one or more data types of component status data of associated components associated with the product instance deployed on each regional cluster, and determining data processing methods corresponding to the one or more data types.
[0091] The one or more data types may include: a first data type for resource occupancy, a second data type for component running status, a third data type for status data of an associated component as an application, a fourth data type for status data of an associated component as a middleware, etc. The embodiment of the present application uses the above four data types as examples to explain the determination of product status data of a product instance.
[0092] It should be understood that the first data type for resource occupancy can be understood as: the component status data of the associated component associated with the product instance includes relevant data on the resource occupancy. For example, the number of central processing units (CPUs), memory size, storage size, etc. can all be understood as data on resource occupancy. Based on this, for any of the one or more regional clusters, if it is detected that the component status data of the associated component associated with the product instance deployed on the any regional cluster contains data on resource occupancy, it can be determined that the data type of the component status data of the associated component associated with the product instance deployed on the any regional cluster includes the first data type.
[0093] The second data type for the component running status can be understood as: the component status data of the associated component associated with the product instance includes the component running status of the associated component. For example, the application application status of the application, the middleware running status of the middleware, etc. can all be understood as the component running status for the associated component. Based on this, if it is detected that the component status data of the associated component associated with the product instance deployed on any regional cluster contains the component running status for the associated component, it can be determined that the data type of the component status data of the associated component associated with the product instance deployed on the any regional cluster includes the second data type.
[0094] The third data type for the status data of the associated component being an application can be understood as: the component status data of the associated component associated with the product instance includes the status data of the application. For example, the application name, application running status, application version, application version update time, etc. of the application can all be understood as the status data for the application. Based on this, it can be seen that if it is detected that the component status data of the associated component associated with the product instance deployed on any regional cluster contains status data for the application, it can be determined that the data type of the component status data of the associated component associated with the product instance deployed on the any regional cluster includes the third data type.
[0095] The fourth data type for the status data of the associated component being a middleware can be understood as: the component status data of the associated component associated with the product instance includes the status data of the middleware. For example, the middleware name, the middleware type, the middleware running status, etc. can all be understood as the status data for the middleware. Based on this, if it is detected that the component status data of the associated component associated with the product instance deployed on any regional cluster contains status data for the middleware, it can be determined that the data type of the component status data of the associated component associated with the product instance deployed on the any regional cluster includes the fourth data type.
[0096] Among them, the data processing method corresponding to the first data type may be a first data processing method for processing the resource occupancy of the product instance, the data processing method corresponding to the second data type may be a second data processing method for processing the operating health of the product instance, the data processing method corresponding to the third data type may be a third data processing method for counting the status data of the application under the product instance, and the data processing method corresponding to the fourth data type may be a fourth data processing method for counting the status data of the middleware under the product instance.
[0097] Based on the above description, it can be known that in one implementation, for any one of the one or more regional clusters, the data type involved in the component status data of the associated component associated with the product instance deployed on the any regional cluster can be directly determined based on the component status data of the associated component associated with the product instance deployed on the any regional cluster, and after the data type is determined, the data processing method corresponding to the data type can be further determined. For example, if the determined data type includes a first data type, a second data type, and a third data type, it can be determined that the data processing method corresponding to the first data type is the first data processing method, the data processing method corresponding to the second data type is the second data processing method, and the data processing method corresponding to the third data type is the third data processing method.
[0098] S203, based on the data processing methods corresponding to one or more data types, process the status data of the corresponding data type in the component status data of the associated components associated with the product instance deployed on each regional cluster to obtain the product status data of the product instance deployed on each regional cluster.
[0099] In one implementation, after obtaining the component status data of the associated components associated with the product instances deployed on each regional cluster, the product status data of the product instances deployed on each regional cluster can be determined based on the component status data of the associated components associated with the product instances deployed on each regional cluster, so as to obtain the product status data of the product instances deployed on each regional cluster. Optionally, for any one of the one or more regional clusters, the status data of the corresponding data type in the component status data of the associated components associated with the product instances deployed on the any regional cluster can be processed using data processing methods corresponding to one or more data types, so as to obtain the product status data of the product instance. The product status data may include product health status, product resource usage, number of product applications, number of middleware, real-time status information of the middleware, and the like.
[0100] As mentioned above, the component status data of the associated components associated with the product instance may include status data of one or more data types, and the status data of any data type may be processed using a data processing method. For example, the data processing method may include the aforementioned data processing method for processing the resource occupancy of the product instance, the data processing method for processing the operational health of the product instance, the data processing method for collecting statistics on the status data of the application under the product instance, and so on.
[0101] It can be seen that, in the embodiment of the present application, for the status data under different data types of the component status data of the associated components associated with the product instance deployed on the regional cluster, different data processing methods can be used to perform relevant processing to obtain the product status data under the corresponding data type, and the product status data of the product instance can include the product status data under these different data types. Through this method, the data processing under different data types can be effectively distinguished to ensure the accuracy and reliability of data processing. Moreover, when using multiple data processing methods to process the status data under the corresponding data type, a parallel processing method can be used, thereby effectively improving the status data processing speed, and also improving the speed of determining the product status data, and the determined product status data needs to be stored in the status database, and the data in the status database can be used to provide query services, so when improving the speed of determining the product status data, the query accuracy and reliability can also be improved.
[0102] In one implementation, considering the computational overhead, the status data under some data types may also be processed to obtain the product status data under these data types, and the product status data under these data types constitute the product status data of the product instance. It is understandable that when relevant personnel query the product status data, they may query all the product status data included in the product instance, or they may query only the product status data under certain data types. For example, you may query only the product status data on resource occupancy in the product status data of the product instance and the product status data on the running health in the product status data of the product instance; for another example, you may query only the application status data in the product status data of the product instance; and so on. Then, for data types with a higher query frequency, relevant processing may be performed in a timely manner to obtain the product status data under the corresponding data type, so as to facilitate subsequent query services. In this way, real-time calculation may be guaranteed while minimizing the computational overhead.
[0103] Based on this, it can be known that the data type of the status data to be processed can be determined based on the data type requested in the historical query request. Optionally, the historical query request can carry a type identifier, which can be used to indicate the data type, and the type identifier also indicates the data type of the status data to be queried. In a specific implementation, multiple historical query requests within a historical time period can be obtained, and the number of identifiers corresponding to each type identifier included in the multiple historical query requests can be counted. After the number of identifiers of each type identifier is obtained, the data type to be processed can be determined based on the number of identifiers of each type identifier. For example, each type identifier can be sorted in order from large to small in terms of the number of identifiers to obtain the corresponding sorting result; after obtaining the sorting result, the data type to be processed can be determined based on the sorting result. For example, the data type indicated by the type identifier in the first N digits can be determined as the data type to be processed; wherein, the N value can be a value such as 1, 2, etc., and its specific value is not limited.
[0104] S204: Store the product status data of the product instance deployed on each regional cluster in a status database.
[0105] In one implementation, the state database may store product state data of product instances deployed on each regional cluster, so as to provide a data source for product state data of the product instance for the business layer. Optionally, the product state data of the product instances deployed on each regional cluster determined in step S203 may be stored in the state database, so as to ensure real-time update of the product state data in the state database.
[0106] As mentioned above, in one embodiment, the product status data of the product instances deployed on each regional cluster can be recorded on the master regional cluster to achieve the update of the product instance resources on the master regional cluster, or the real-time update of the product status data of the product instance. That is, when the product status data of the product instance is recorded on the master regional cluster, it can be specifically stored in the state database of the master regional cluster. In another embodiment, the product status data of the product instances deployed on each regional cluster can also be stored in another state database, which is different from the state database for the master regional cluster.
[0107] In one implementation, the product status data of the product instances in each regional cluster may be obtained by polling and synchronized to the status database. For example, the polling method may specifically refer to periodically obtaining the product status data of the product instances in each regional cluster.
[0108] S205: If a query request for product status data of a specified product instance is obtained, searching a status database for the product status data requested by the query request in response to the query request.
[0109] In one implementation, the query request may carry an instance identifier of a specified product instance, and the instance identifier may be used to indicate the specified product instance, so that the product status data corresponding to the specified product instance may be found from the status database based on the instance identifier. The specified product instance may be any product instance, and the query request may be a query request initiated to the status database on the primary regional cluster, or may be a query request initiated to another status database, without limitation.
[0110] As mentioned above, product status data may include product health status, product resource usage, number of product applications, number of middleware, real-time status information of middleware, etc. By searching the product status data of the product instance from the status database, all product status information under the product can be obtained at one time. Compared with obtaining the application status data by calling the application management (app-manager) interface of each application under the product instance separately, and then splicing the status data of each application to obtain the product status data for the product, the embodiment of the present application can simplify the process of obtaining the real-time status data of the product. It does not need to rely on the interface capabilities of the application management interface. It only needs to use a unified query interface to directly obtain the product status data obtained by real-time calculation, so as to achieve one-time acquisition without splicing, thereby effectively improving data query efficiency.
[0111] Furthermore, when obtaining the health status of a product, there is no need to perform temporary calculations on the health status of the product when using the business layer interface request. The embodiment of the present application can serve as a real-time calculation of the health status of the product instance. Furthermore, there will be no problem of slow acquisition speed caused by multiple interface calls to first request an application list and then request application details. The embodiment of the present application can directly obtain the health status of the product from the status database through the business layer, without the need for multiple interface calls, and can also effectively improve data query efficiency.
[0112] In one implementation, the query request can also be security-checked to prevent the product status data in the status database from being leaked, thereby improving the security of the product status data. Optionally, the query request can carry an object identifier, which can be used to indicate the object (user) that initiated the query request. Based on this, it can be seen that in one embodiment, the query request can be security-checked based on the object identifier; in a specific implementation, it can be determined whether the object identifier exists in a preset object identifier set. Among them, each preset object identifier in the preset object identifier set is successfully registered in the status database, allowing the status database to respond to the query request corresponding to the preset object identifier and perform a search operation.
[0113] If the object identifier exists in the preset object identifier set, it can be determined that the query request is successfully verified, and the step of searching the status database for the product status data requested by the query request in response to the query request is triggered. If the object identifier does not exist in the preset object identifier set, it can be determined that the query request fails to be verified, and a query request failure prompt message is output.
[0114] In one implementation, when storing product status data of different product instances in a status database, differentiated storage may be performed. For example, when storing product status data of product instances with confidentiality requirements, corresponding query permissions may be set for them, while when storing product status data of product instances without confidentiality requirements, query permissions may not need to be set for them. Among them, which product instances have confidentiality requirements or do not have confidentiality requirements may be pre-set, such as based on actual business needs, and there is no specific limitation on this.
[0115] Among them, the specific process of setting query permissions for a product instance can be: if an object wants to have query permissions for the product status data of the product instance, it can register an object identifier in the status database, and the object identifier is used to uniquely indicate the object; if the object identifier is successfully registered in the status database, it indicates that the object has query permissions for querying the product status data of the product instance. Based on this, it can be seen that for product instances with query permissions, such product instances can also be associated with a corresponding reference object identifier set, and the reference object identifier set can include one or more reference object identifiers, and a reference object identifier is used to indicate an object; the object indicated by the reference object identifier in the reference object identifier set is the object with query permissions. From the above description, it can be seen that the security of product status data can also be improved by setting query permissions.
[0116] In this case, after obtaining a query request for product status data of a specified product instance, it can be determined whether the instance identifier of the specified product instance carried in the query request exists in the preset instance identifier. The preset instance identifier set may include one or more preset instance identifiers, and a preset instance identifier is used to indicate a product instance; the product instance indicated by the preset instance identifier in the preset instance identifier set is the product instance for which the query permission is set.
[0117] If the instance identifier does not exist in the preset instance identifiers, the step of searching the status database for the product status data requested by the query request in response to the query request can be directly triggered. If the instance identifier exists in the preset instance identifiers, it can be further determined whether the query permission for the product status data of the specified product instance is available based on the object identifier carried in the query request. Optionally, it can be determined whether the object identifier exists in the reference object identifier set corresponding to the specified product instance.
[0118] If the object identifier exists in the reference object identifier set corresponding to the specified product instance, a step of searching the status database for product status data requested by the query request in response to the query request can be triggered. If the object identifier does not exist in the reference object identifier set corresponding to the specified product instance, a query request failure prompt message can be output.
[0119] In the embodiment of the present application, the products deployed on multi-region clusters can be uniformly managed through cloud native capabilities, and product instances deployed on multiple regional clusters can be monitored in real time. The component status data of the associated components associated with the product instance can be calculated to obtain the product status data of the corresponding product instance, and the product status data can include all status data under the product. By synchronizing the determined product status data to the status database in real time, it can also provide a data source for the subsequent business layer, and when acquiring data from the status database, it can be acquired in one go without assembly or multiple interface calls. All product status data can be directly acquired through a unified query interface, thereby effectively improving data query efficiency.
[0120] Based on the above embodiment, the present application embodiment provides another data processing method, which can be executed by the controller mentioned above. Figure 4 The data processing method includes but is not limited to the following steps:
[0121] S401: Obtain access links for accessing each of one or more regional clusters.
[0122] In one implementation, as described above, the controller and each regional cluster can realize interactive communication through the access link corresponding to each regional cluster. In order to obtain the component status data of the associated component associated with the product instance deployed on any regional cluster in one or more regional clusters, the access link of any regional cluster can be obtained first. The access link of any regional cluster is created after configuring the controller's management authority over any regional cluster; the access link of each regional cluster can be stored in a designated storage area, so that when the subsequent controller needs to use the access link to access the regional cluster, it can directly obtain the required access link from the designated storage area.
[0123] S402: Acquire component status data of associated components associated with product instances deployed on corresponding regional clusters based on access links of respective regional clusters.
[0124] In one implementation, for any one of the one or more regional clusters, the any regional cluster may be accessed based on an access link corresponding to the any regional cluster to obtain component status data of an associated component associated with a deployed product instance from the any regional cluster.
[0125] For other specific implementations of steps S401 and S402, reference may be made to the description of step S201, which will not be repeated here. For example, the triggering condition mentioned in step S201 may be equivalent to the triggering condition for obtaining the access link here, and so on.
[0126] S403: Determine one or more data types of component status data of associated components associated with the product instance deployed on each regional cluster, and determine data processing methods corresponding to the one or more data types.
[0127] The specific implementation of this step may refer to the description in the above step S202, and will not be repeated here.
[0128] S404, based on the data processing methods corresponding to one or more data types, process the status data of the corresponding data types in the component status data of the associated components associated with the product instance deployed on each regional cluster to obtain the product status data of the product instance deployed on each regional cluster.
[0129] In one implementation, when the controller determines the product status data of a product instance, the specific implementation of a data processing method can be integrated into a state processing unit (or a computing unit) for implementation. That is to say, for some closely related data, they can be processed by a unified state processing unit, and for different data, different state processing units can be called for processing. The following specifically describes the determination of the product status data of the product instance in combination with the data processing method and the state processing unit. Considering that the principle of determining the product status data of the product instances deployed on each regional cluster is consistent, the following specifically describes the process of determining the product status data of the product instance using the target regional cluster as an example.
[0130] In one implementation, when one or more data types of component status data of an associated component associated with a product instance deployed on a target regional cluster include a first data type for resource occupancy, the data processing method corresponding to the first data type may be a first data processing method for processing resource occupancy of the product instance. In this case, the specific implementation of step S404 may be:
[0131] First, the resource occupancy data of each associated component in all associated components under the product instance can be obtained from the component status data of the associated component associated with the product instance deployed on the target regional cluster. Among them, any associated component can be any of the applications, middleware, and virtual machines under the product instance; for any associated component, the resource occupancy data of any associated component can include one or more of the number of central processing units (CPUs), memory size, and storage size occupied by any associated component. For example, if any associated component is a middleware, the resource occupancy data of the middleware obtained can be: CPU: 1, memory: 2Gi, storage: 10G.
[0132] Then, the first processing unit can be called to determine the resource occupancy data of the product instance based on the resource occupancy data of each associated component, and the resource occupancy data of the product instance can reflect the real-time resource usage of the product. For example, the resource occupancy data of the product instance may include: one or more of the maximum usage of the resource occupancy and the minimum usage of the resource occupancy, wherein the maximum usage of the resource occupancy may be the maximum usage of one or more of the CPU, memory, storage, etc., and the minimum usage of the resource occupancy may be the minimum usage of one or more of the CPU, memory, storage, etc. In one embodiment, the maximum usage and minimum usage of the CPU are used as an example for explanation, and the sum of the maximum usage of each associated component under the CPU can be used as the maximum usage of the product instance under the CPU, and the sum of the minimum usage of each associated component under the CPU can be used as the minimum usage of the product instance under the CPU.
[0133] Finally, the resource usage data of the product instance may be used as product status data of the resource usage of the product instance deployed on the target regional cluster.
[0134] For example, product status data of a product instance for resource usage may include: limits (maximum usage): cpu is 2, memory is 2Gi; requests (minimum usage): cpu is 8, menory is 16Gi.
[0135] As mentioned above, the first data processing method can be integrated into a state processing unit, such as the state processing unit can be called the first processing unit, that is, the state processing unit corresponding to the first data type can be the first processing unit for processing the resource occupancy of the product instance, and the first processing unit can also be called the product real-time resource occupancy calculation unit. In this case, the specific implementation of step S404 can be:
[0136] First, the first processing unit can be called to obtain resource occupancy data of each associated component in all associated components under the product instance from the component status data of the associated component associated with the product instance deployed on the target regional cluster. Then, the first processing unit can be called to determine the resource occupancy data of the product instance based on the resource occupancy data of each associated component, and the resource occupancy data of the product instance can reflect the real-time resource usage of the product. Finally, the resource occupancy data of the product instance can be used as the product status data of the resource occupancy of the product instance deployed on the target regional cluster.
[0137] In one implementation, when one or more data types of component status data of an associated component associated with a product instance deployed on a target regional cluster include a second data type for component operation status, the data processing method corresponding to the second data type may be a second data processing method for processing the operation health status of the product instance. In this case, the specific implementation of step S404 may be:
[0138] First, the component running status of each associated component in all associated components under the product instance can be obtained from the component status data of the associated component associated with the product instance deployed on the target regional cluster.
[0139] Then, the reference components to be deployed under the product instance can be obtained, wherein the reference components to be deployed can refer to the components to be deployed planned under the product instance. Furthermore, the running state of the product instance can be determined based on the component running state of each associated component and the parameter components to be deployed under the product instance. In one embodiment, a product status calculation rule can be adopted, and the running state of the product instance can be determined based on the component running state of each associated component and the parameter components to be deployed under the product instance. Finally, the running state of the product instance can be used as the product status data for the running health of the product instance deployed on the target area cluster.
[0140] Among them, the running status of the product instance can reflect the health status of the product, that is, the running status of the product instance here can also be called the health status of the product instance; for example, the running status (health status) of a product instance can be: healthy (Healthy), unhealthy (Unhealthy), any one of undeployed (UnDeploy).
[0141] The specific implementation of adopting the product status calculation rule and determining the running status of the product instance based on the component running status of each associated component and the parameter components to be deployed under the product instance can be described as follows. The product status calculation rule indicates how to determine the running status of the corresponding product instance based on the component running status of each associated component and the parameter components to be deployed under the product instance.
[0142] In one embodiment, if all associated components under the product instance are consistent with the reference components to be deployed, and the ratio between the first component quantity of associated components whose component running status is a healthy state and the second component quantity of all associated components is greater than or equal to a preset ratio, it can be determined that the running status of the product instance is a healthy state.
[0143] It can be understood that when all associated components under the product instance are consistent with the reference components to be deployed, for example, the reference components to be deployed include: component 1, component 2, component 3, then the associated components obtained in the actual environment also include: component 1, component 2, component 3, which means that the components planned under the product instance have all been deployed in the actual environment.
[0144] Among them, the preset ratio can be set in advance, such as the preset ratio can be 1, 0.9, etc. In actual scenarios, the preset ratio can be set to a larger value, such as it can be set to 1 as much as possible. When the preset ratio is 1, it means that the component operation status of all associated components under the product instance must be in a healthy state. It is understandable that if the component operation status of some associated components in the product instance is not in a healthy state, it may affect the normal use of the product. Then, in order to more accurately determine the operation status of the product instance, the preset ratio can be set to 1. Based on this, if the components planned under the product instance have all been deployed in the actual environment, and the component operation status of each associated component is in a healthy state, it can be determined that the operation status of the product instance is a healthy state.
[0145] In one embodiment, as described above, if all associated components under the product instance are consistent with the reference components to be deployed, and the ratio between the first component quantity of associated components whose component running status is a healthy state and the second component quantity of all associated components is less than a preset ratio, then it can be determined that the running status of the product instance is an unhealthy state.
[0146] In one embodiment, if all associated components under the product instance are inconsistent with the reference components to be deployed, the running state of the product instance can be determined to be unhealthy or undeployed. It is understandable that in the case where all associated components under the product instance are inconsistent with the reference components to be deployed, for example, the reference components to be deployed include component 1, component 2, and component 3, while the associated components obtained in the actual environment are only component 1 and component 3, which means that the components planned under the product instance are not all deployed in the actual environment. It is easy to understand that if all components planned under the product are not deployed in the actual environment, some functions of the product may not be used normally, which means that the product is unhealthy, and the running state of the product instance can be determined to be unhealthy, or it can also refer to the undeployed state.
[0147] As mentioned above, the second data processing method can be integrated into a state processing unit, such as the state processing unit can be called a second processing unit, that is, the state processing unit corresponding to the second data type can be a second processing unit for processing the running health status of the product instance, and the second processing unit can also be called a product health status calculation unit. In this case, the specific implementation of step S404 can be:
[0148] First, the second processing unit can be called to obtain the component running status of each associated component in all associated components under the product instance from the component status data of the associated components associated with the product instance deployed on the target regional cluster. Then, the second processing unit can be called to obtain the reference component to be deployed under the product instance, wherein the reference component to be deployed can refer to the component to be deployed planned under the product instance. Further, the second processing unit can be called to determine the running status of the product instance based on the component running status of each associated component and the parameter component to be deployed under the product instance. Finally, the running status of the product instance can be used as the product status data for the running health of the product instance deployed on the target regional cluster.
[0149] In one implementation, when it is determined that the running state of a product instance is in an unhealthy state (such as unhealthy or not deployed), an alarm mechanism is triggered. For example, an alarm can be issued to relevant personnel so that the relevant personnel can promptly understand the health status of the product, and when the product instance is in an unhealthy state, relevant processing can be carried out in a timely manner to ensure the healthy operation of the product instance.
[0150] Optionally, if it is determined that the operating state of the product instance is an unhealthy state, the abnormal level corresponding to the abnormal factor (cause) causing the unhealthy state can be further determined; then, the mapping relationship between the reference abnormal level and the reference alarm method can be obtained, and the alarm method corresponding to the abnormal level can be determined based on the mapping relationship. For example, a reference abnormal level consistent with the abnormal level can be found from the mapping relationship, and the reference alarm method corresponding to the reference abnormal level found can be determined as the alarm method corresponding to the abnormal level. Finally, an alarm prompt can be given based on the alarm method.
[0151] Among them, the mapping relationship between the reference abnormality level and the reference alarm mode can be pre-set. When setting the mapping relationship between the reference abnormality level and the reference alarm mode, it can be set according to the idea that the abnormality degree of the reference abnormality level is positively correlated with the alarm degree of the reference alarm mode, that is, if the abnormality degree of the reference abnormality level is higher, a reference alarm mode with a higher alarm degree can be set for it. On the contrary, if the abnormality degree of the reference abnormality level is lower, a reference alarm mode with a lower alarm degree can be set for it. For example, the reference alarm mode may include telephone, email, text message and other methods, and the alarm degrees of telephone, email, and text message decrease in turn. As mentioned above, differentiated alarm modes can be implemented based on the different abnormality degrees of the abnormality levels to improve user experience.
[0152] Exemplarily, taking the reference alarm method including telephone, email, and text message as an example, the mapping relationship between the reference abnormal level and the reference alarm method is explained, wherein the reference abnormal level includes the first level, the second level, and the third level, and the abnormal degree of the first level, the second level, and the third level is: the third level is higher than the second level, and the second level is higher than the first level. If the reference abnormal level is the third level, the corresponding reference alarm method is the telephone method, that is, the alarm can be made by telephone, such as a telephone call with a designated object. If the reference abnormal level is the second level, the corresponding reference alarm method is the email method, that is, the alarm can be made by email, such as sending an email to the mailbox of the designated object. If the reference abnormal level is the first level, the corresponding reference alarm method is the text message method, that is, the alarm can be made by text message, such as sending a text message to the designated object. Wherein, the designated object can be one or more pre-set users, which is not limited to this.
[0153] Among them, the abnormal level corresponding to the specific implementation method can be pre-defined. For example, the abnormal level is described by taking the following three specific implementation methods that cause the unhealthy state as examples. If the abnormal factor is factor 1 (all associated components under the product instance are consistent with the reference components to be deployed, and the ratio between the first component number of the associated components with the component running state in a healthy state and the second component number of all associated components is less than the preset ratio), the abnormal level is determined to be the first level; if the abnormal factor is factor 2 (all associated components under the product instance are inconsistent with the reference components to be deployed, and the ratio between the first component number of the associated components with the component running state in a healthy state and the second component number of all associated components is greater than or equal to the preset ratio), the abnormal level is determined to be the second level; if the abnormal factor is factor 3 (all associated components under the product instance are inconsistent with the reference components to be deployed, and the ratio between the first component number of the associated components with the component running state in a healthy state and the second component number of all associated components is less than the preset ratio), the abnormal level is determined to be the third level.
[0154] It should be noted that the above-mentioned setting of the abnormal level is only an illustrative example, and the abnormal level may also be set in other ways, which is not limited to this.
[0155] In one implementation, when one or more data types of component status data of an associated component associated with a product instance deployed on a target regional cluster include a third data type for status data of an associated component being an application, the data processing method corresponding to the third data type may be a third data processing method for performing statistics on the status data of the application under the product instance. In this case, the specific implementation of step S404 may be:
[0156] First, the status data of each application in all applications under the product instance can be obtained from the component status data of the associated component associated with the product instance deployed on the target regional cluster. Among them, the status data of any application may include: one or more of the application name, application running status, application version, and application version update time of any application; the application version update time may refer to the last update time of the application. For example, the status data of an application includes: the application name is dawn-xxx, the application running status is Succeeded, the application version is 1.0.2, and the application version update time is 2022-12-2922:51:58.
[0157] Then, the number of all applications under the product instance can be counted based on the status data of each application in all applications under the product instance, and the number here can be referred to as the first application number. For example, the first application number can be counted based on the application name of the application. It can be understood that an application can have an application name, and the number of application names is the number of applications under the product instance. For another example, it can be based on the application running state. It can be understood that an application can have an application running state, and the number of application running states is the number of applications under the product instance.
[0158] The number of applications whose application running status is healthy can also be counted, and the number here can be referred to as the second application number. For example, the number of applications whose application running status is healthy can be determined from the application running status corresponding to each application. It should be noted that the application ready ratio mentioned above can refer to the ratio between the second application number and the first application number.
[0159] Finally, the first application quantity, the second application quantity, and the status data of each application may be used as product status data of the product instance deployed on the target regional cluster with respect to the status data of the application.
[0160] As mentioned above, the third data processing method can be integrated into a state processing unit, such as the state processing unit can be called the third processing unit, that is, the state processing unit corresponding to the third data type can be a third processing unit for counting the state data of the application under the product instance, and the third processing unit can also be called the product application state information calculation unit. In this case, the specific implementation of step S404 can be:
[0161] First, the third processing unit may be called to obtain the status data of each application in all applications under the product instance from the component status data of the associated component associated with the product instance deployed on the target regional cluster. Then, the third processing unit may be called to count the number of first applications in all applications under the product instance and the number of second applications in which the application running status is a healthy state based on the status data of each application in all applications under the product instance. Finally, the number of first applications, the number of second applications, and the status data of each application may be used as product status data for the status data of the application of the product instance deployed on the target regional cluster.
[0162] Based on the above description, it can be known that the third processing unit can be used to summarize the application information corresponding to the applications (apps) included in the product instance. The application information here may refer to the above-mentioned first application quantity, second application quantity and status data of each application.
[0163] In one implementation, when one or more data types of component status data of an associated component associated with a product instance deployed on a target regional cluster include a fourth data type for status data of an associated component being a middleware, the data processing method corresponding to the fourth data type may be a fourth data processing method for collecting statistics on the status data of the middleware under the product instance. In this case, the specific implementation of step S404 may be:
[0164] The status data of each middleware in all the middleware under the product instance can be obtained from the component status data of the associated component associated with the product instance deployed on the target regional cluster; and the status data of each middleware can be used as the product status data of the product instance deployed on the target regional cluster for the status data of the middleware.
[0165] The status data of any middleware may include: middleware name, middleware type, middleware running status and one or more of the middleware planning data, and the middleware planning data is the resource occupancy data configured for any middleware. For example, the middleware type may be mariadb, redis, etc., and the middleware planning data may be understood as the service rules set by the product instance for the middleware, which may include the settings of the resource occupancy configured for one or more of cpu, memory, and storage.
[0166] For example, the status data of a middleware includes: the middleware name is dawn-mariadb, the middleware type is mariadb, the middleware running status is Ready, the number of CPUs is 1, the memory size is 2Gi, and the storage size is 10G. Among them, the number of CPUs, the memory size, and the storage size are the middleware planning data.
[0167] As mentioned above, the fourth data processing method can be integrated into a state processing unit, such as the state processing unit can be called the fourth processing unit, that is, the state processing unit corresponding to the fourth data type can be a fourth processing unit for counting the state data of the middleware under the product instance, and the fourth processing unit can also be called the product middleware information calculation unit. In this case, the specific implementation of step S404 can be:
[0168] The fourth processing unit can be called to obtain the status data of the middleware under the product instance from the component status data of the associated component associated with the product instance deployed on the target regional cluster; and the status data of the middleware can be used as the product status data of the product instance deployed on the target regional cluster for the status data of the middleware.
[0169] To summarize, the embodiments of the present application can link the planning data of product instances, the status data of associated components in the actual environment of the product instances (such as application status data, middleware status data, virtual machine status data, etc.), and regional cluster resources (such as K8s CR) data, and use monitoring capabilities to aggregate and calculate real-time product status data.
[0170] In one implementation, as mentioned above, based on cloud native capabilities, that is, supporting monitoring (Watch) capabilities, the real-time computing service of product instances on the main regional cluster can monitor all resources related to the product and calculate the status of the current product in real time. Based on this, it can be seen that based on the binding of the product instance and all applications and middleware under the current product (i.e., the Watch mechanism), as long as there are target operations for applications, middleware, etc. under the product, such as the target operation can include any of the addition (Create), deletion (Delete), modification (Update), etc., it will trigger the product status data of the product instance to be recalculated to ensure the real-time nature of the product status data.
[0171] For example, see Figure 5a As shown, the product instance real-time computing service (i.e., controller) on the main regional cluster can monitor the status changes of product instances on the main regional cluster and the backup regional cluster. In one embodiment, if the product instance real-time computing service on the main regional cluster detects that resources (such as application, middleware, etc.) on the main regional cluster have been deleted, added, or modified, the status processing unit can be called to calculate the product status data of the product instance based on the component status information of the associated components under the product instance; and the product status data recorded on the main regional cluster can be updated based on the calculated product status data. At the same time, the calculated product status data can also be synchronized to the status database.
[0172] Similarly, in one embodiment, when the real-time computing service for product instances on the primary regional cluster detects that resources (such as status data of applications, middleware, etc.) on the backup regional cluster have been deleted, added, or modified, the status processing unit may be called to calculate the product status data of the product instance based on the component status information of the associated components under the product instance; and the product status data recorded on the primary regional cluster may be updated based on the calculated product status data. At the same time, the calculated product status data may also be synchronized to the status database.
[0173] In one implementation, the product instance real-time computing service (i.e., controller) can also monitor configuration updates of product instances. For example, once a modification to the product configuration is detected, such as deploying a new product configuration file (e.g., a yaml file) through a productization interface, or compiling (editing) a new product configuration file through a kubectl command in the environment, a modification record can be inserted into the state database, which can include a comparison between the old version configuration (i.e., the product configuration before the modification) and the new version configuration (i.e., the product configuration after the modification), so that the product configuration change history can be traced based on the data stored in the state database.
[0174] Optionally, if an update (Update) event of a product configuration file of a product instance deployed on a target regional cluster is detected, the update time of the update event can be obtained. The target regional cluster can be any one of one or more regional clusters, and the product configuration file can include configuration information of a product instance deployed on the target regional cluster. The update event can specifically be a modification of information in the product configuration file, such as the update event is that the Spec field of the application, middleware, etc. in the product configuration file is modified. After obtaining the update time, the product configuration file before the update and the product configuration file after the update can also be obtained. Further, the update time, the product configuration file before the update, and the product configuration file after the update can be stored in a state database, so that the application configuration (yaml) change history can be traced based on the data stored in the state database. In one embodiment, in addition to directly obtaining the product configuration file before the update and the product configuration file after the update, it is also possible to obtain only the pre-modification data (content) and the post-modification data in the product configuration file only for the modification operation, without limitation.
[0175] For example, the specific implementation of monitoring product configuration files can be found in Figure 5b See Figure 5bAs shown, the product instance real-time computing service (i.e., controller) on the primary regional cluster can monitor the update of the product configuration file. In one embodiment, the product instance real-time computing service on the primary regional cluster monitors the update event of the description information about the associated component in the product configuration file on the primary regional cluster; then the corresponding modification information (such as the update time, the product configuration file before the update, and the product configuration file after the update) can be obtained and recorded in the state database.
[0176] Similarly, in one embodiment, the product instance real-time computing service on the primary regional cluster monitors an update event of the description information about the associated components in the product configuration file on the backup regional cluster; then the corresponding modification information (such as the update time, the product configuration file before the update, and the product configuration file after the update) can be obtained and recorded in the status database.
[0177] In one implementation, the event handler (EventHandler) in the product instance controller (ProductInstance Controller) can be modified so that the controller can process update events. For example, when the event handler processes an Update event (such as when the Spec field of App or Comp is modified), it can obtain the newObj object and the oldObj object. Both objects are the obj base class of K8s. After obtaining these two objects, the relevant configuration can be modified and the modification information can be recorded in the state database. Among them, the oldObj object can be understood as the data before the modification in the product configuration file, and the newObj object can be understood as the data after the modification in the product configuration file.
[0178] For example, the specific implementation of monitoring the product configuration file can be found in Figure 5c See Figure 5c In one embodiment, the real-time computing service of the product instance on the primary cluster detects the update event of the product configuration file on the primary cluster; the newObj object and the oldObj object can be obtained through the event processor, and the newObj object and the oldObj object can be used to modify the product configuration file. The corresponding modification information can also be obtained and recorded in the state database.
[0179] Similarly, in one embodiment, the product instance real-time computing service on the primary regional cluster detects an update event of the product configuration file on the backup regional cluster; the newObj object and the oldObj object can be obtained through the event processor, and the newObj object and the oldObj object can be used to modify the product configuration file. The corresponding modification information can also be obtained and recorded in the state database.
[0180] In one implementation, the above-mentioned configuration change monitoring function for the product configuration file can be integrated into a state processing unit, such as the state processing unit can be called a configuration change monitoring unit. The configuration change monitoring unit can monitor the configuration modifications of each associated component (such as application, middleware, etc.) deployed on the regional cluster, and record each new and old configuration content in the state database.
[0181] Through the above monitoring of configuration changes, in the product data visualization business scenario, the corresponding modification records can be directly obtained from the status database to facilitate the relevant personnel to trace the configuration modification records. In the change business scenario, if it involves the comparison of the configuration in the plan and the actual environment (such as the product configuration file), and the configuration has been temporarily adjusted in the actual environment, it is also necessary to let the relevant personnel know where the configuration has been modified based on the traceability capability, so as to make further judgments and adjustments.
[0182] In summary, in the embodiments of the present application, some closely related data in the product instance can be uniformly processed by a state processing unit. For example, as mentioned above, the product real-time resource occupancy calculation unit can be used to count and summarize the resource usage of applications, middleware, virtual machines, etc. associated with the product; the product health status calculation unit can be used to calculate the health status of the product in real time according to the running status of the components associated with the product and the product status calculation rules; the application status information calculation unit under the product can be used to count the status data of the application associated with the product in real time, which is convenient for upper-level business queries; the middleware information calculation unit under the product can be used to count the status data of the middleware associated with the product in real time, which is convenient for upper-level business queries; the configuration change monitoring unit can be used to monitor the configuration changes of products under the product (such as applications under the product) in real time, and generate comparison records and store them in the status database.
[0183] Based on this design idea, the calculation of the product status data of the product instance is pluggable, configurable, and horizontally scalable, that is, the calculation unit used to calculate the product status data can be arbitrarily configured. Among them, pluggable can be understood as: the processing of one or more status processing units can be removed to obtain product status data, or the processing of one or more status processing units can be added to obtain product status data; configurable can be understood as: a new status processing unit can be configured to obtain product status data; horizontally scalable can be understood as: the processing of a status processing unit can involve data of more dimensions, for example, the status data of the middleware under the product instance can include the data described above (such as the middleware name, middleware type, middleware running status, middleware planning data), and can also include other data.
[0184] S405: Store the product status data of the product instance deployed on each regional cluster in a status database.
[0185] In one implementation, when the product status data of a product instance is stored in a status database, the following data storage concept can be used for storage: product status data determined by different status processing units can be stored in different ways. The following specifically describes the storage of different product status data.
[0186] In one embodiment, when storing product status data for resource occupancy, each time the storage of product status data is increased, the corresponding record identifier, product instance identifier, product number, regional identifier, product status data (such as product instance health status, product instance resource occupancy, etc.), application readiness, creation time, update time, etc. can be stored here.
[0187] In one embodiment, when storing product status data for status data of an application under a product instance, each time the storage of product status data for status data of an application is increased, the corresponding record identifier, application instance identifier, application instance name, application instance running status, application instance running version, product instance identifier, product number, creation time, update time, etc. can be stored here.
[0188] In one embodiment, when storing change records for product configuration files, each time storage for configuration change records is added, the corresponding record identifier, product configuration file content, K8s resource type to which the product configuration file belongs, application instance identifier, application instance name, application instance running version, update time, etc. of the record stored here can be stored.
[0189] S406: If a query request for product status data of a specified product instance is obtained, searching a status database for the product status data requested by the query request in response to the query request.
[0190] The specific implementation of step S405 and step S406 may refer to the description of the above step S204 and step S205, which will not be repeated here.
[0191] In the embodiment of the present application, in the embodiment of the present application, the products deployed on the multi-region clusters can be uniformly managed through the cloud native capability, and the product instances deployed on the multi-region clusters can be monitored in real time. The component status data of the associated components associated with the product instance can be processed by one or more data processing methods to obtain the corresponding product status data, and the specific implementation of a data processing method can be integrated into the processing of a state processing unit, that is, the controller can call one or more state processing units to calculate and obtain the product status data of the corresponding product instance. By utilizing the parallel processing of one or more state processing units, the data processing efficiency can be effectively improved. By synchronizing the determined product status data to the state database in real time, it can also provide a data source for the subsequent business layer, and when acquiring data from the state database, it can be acquired at one time without assembly or multiple interface calls. All product status data can be directly acquired through a unified query interface, thereby effectively improving data query efficiency.
[0192] Based on the description of the above data processing method embodiment, the present application embodiment also discloses a data processing device, which can be a computer program (including program code) running in the above-mentioned electronic device. Figure 2 or Figure 4 See the method shown in Figure 6 , the data processing device can run the following units:
[0193] An acquisition unit 601 is used to acquire component status data of associated components associated with product instances deployed on each of the one or more regional clusters;
[0194] A determination unit 602 is used to determine one or more data types of component status data of associated components associated with the product instance deployed on each regional cluster, and determine data processing methods corresponding to the one or more data types;
[0195] The processing unit 603 is used to process the status data of the corresponding data type in the component status data of the associated component associated with the product instance deployed on each regional cluster based on the data processing modes corresponding to the one or more data types, so as to obtain the product status data of the product instance deployed on each regional cluster;
[0196] A storage unit 604, configured to store the product status data of the product instance deployed on each regional cluster in a status database;
[0197] The query unit 605 is configured to search the status database for the product status data requested by the query request in response to a query request for product status data of a specified product instance if the query request is obtained.
[0198] In one implementation, the obtaining unit 601 is specifically configured to:
[0199] Obtaining access links to each of the one or more regional clusters; the access link for any regional cluster is created after configuring management permissions for the any regional cluster;
[0200] Component status data of associated components associated with product instances deployed on corresponding regional clusters are obtained based on the access links of the respective regional clusters.
[0201] In one implementation, the obtaining unit 601 is specifically configured to:
[0202] If it is detected that the target product instance has a target operation for the component status data, the step of obtaining the component status data of the associated component associated with the target product instance is triggered; the target operation includes any one or more of a modification operation, a deletion operation and a new addition operation; or,
[0203] If it is detected that the current time is the preset acquisition time, triggering the step of acquiring component status data of the associated component associated with the target product instance;
[0204] The target product instance is any one of the product instances deployed on each of the regional clusters.
[0205] In one implementation, the preset acquisition time is a time in a data acquisition cycle of the target product instance, and the data acquisition cycle is used to indicate a time interval for acquiring component status data of an associated component associated with the target product instance; the acquisition unit 601 is further used to:
[0206] Acquire multiple historical query requests within a historical time period; each of the multiple historical query requests includes an instance identifier for indicating a product instance;
[0207] Counting the number of each instance identifier among all instance identifiers included in the multiple historical query requests;
[0208] Based on the number of identifiers of the respective instance identifiers, a data acquisition period for each of the product instances deployed on the respective regional clusters is determined.
[0209] In one implementation, the one or more data types include a first data type for resource occupancy, and the data processing method corresponding to the first data type is a first data processing method for processing resource occupancy of a product instance; the processing unit 603 is specifically configured to:
[0210] Obtain resource occupancy data of each associated component in all associated components under the product instance from component status data of associated components associated with the product instance deployed on the target regional cluster; the target regional cluster is any one of the one or more regional clusters, and any associated component is any one of an application, middleware, or virtual machine under the product instance;
[0211] Based on the resource occupation data of each associated component, the resource occupation data of the product instance is determined, and the resource occupation data of the product instance is used as product status data for resource occupation of the product instance deployed on the target regional cluster.
[0212] In one implementation, the one or more data types are a second data type for a component running state, and a data processing method corresponding to the second data type is a second data processing method for processing a running health condition of a product instance; the processing unit 603 is specifically configured to:
[0213] Obtaining the component running status of each associated component in all associated components under the product instance from the component status data of the associated components associated with the product instance deployed on the target regional cluster; the target regional cluster is any one of the one or more regional clusters;
[0214] Obtain reference components to be deployed under the product instance;
[0215] If all associated components under the product instance are consistent with the reference components to be deployed, and the ratio between the number of first components of associated components whose component operation status is healthy and the number of second components of all associated components is greater than or equal to a preset ratio, it is determined that the operation status of the product instance is healthy;
[0216] The running status of the product instance is used as product status data of the product instance deployed on the target regional cluster in terms of running health.
[0217] In one implementation, the one or more data types are third data types for status data of an application whose associated component is a third data type, and the data processing method corresponding to the third data type is a third data processing method for performing statistics on status data of applications under a product instance; the processing unit 603 is specifically used to:
[0218] Obtaining, from component status data of associated components associated with a product instance deployed on a target regional cluster, status data of each application in all applications under the product instance; the target regional cluster is any one of the one or more regional clusters, and the status data of any application includes one or more of an application name, an application running status, an application version, and an update time of the application version of the any application;
[0219] Based on the status data of each application in all the applications under the product instance, count the number of first applications in all the applications under the product instance and the number of second applications in which the application running status is a healthy state;
[0220] The first application quantity, the second application quantity, and the status data of each application are used as product status data of the product instance deployed on the target regional cluster for application status data.
[0221] In one implementation, the one or more data types are a fourth data type for status data of a middleware whose associated component is a middleware, and the data processing method corresponding to the fourth data type is a fourth data processing method for performing statistics on the status data of the middleware under the product instance; the processing unit 603 is specifically used to:
[0222] Obtaining status data of each middleware in all middleware under the product instance from component status data of associated components associated with the product instance deployed on the target regional cluster; the target regional cluster is any one of the one or more regional clusters, and the status data of any middleware includes: one or more of the middleware name, the middleware type, the middleware running status, and the middleware planning data, and the middleware planning data is the resource occupation data configured by any middleware;
[0223] The status data of each middleware is used as product status data of the product instance deployed on the target regional cluster for the status data of the middleware.
[0224] In one implementation, the processing unit 603 is further configured to:
[0225] If an update event of a product configuration file of a product instance deployed on a target regional cluster is detected, then an update time of generating the update event is obtained; the product configuration file includes configuration information of the product instance deployed on the target regional cluster; the target regional cluster is any one of the one or more regional clusters;
[0226] Obtain the product configuration file before and after the update;
[0227] The update time, the product configuration file before the update, and the product configuration file after the update are stored in the status database.
[0228] It is understood that the division of units in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. The functional units in the embodiments of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software functional units.
[0229] See also Figure 7 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device described in this embodiment includes: a processor 701, a memory 702, and a network interface 703. The processor 701, the memory 702, and the network interface 703 can exchange data.
[0230] The processor 701 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0231] The memory 702 may include a read-only memory and a random access memory, and provide program instructions and data to the processor 701. A portion of the memory 702 may also include a non-volatile random access memory. When the processor 701 calls the program instructions, it is used to execute:
[0232] Obtain component status data of associated components associated with product instances deployed on each of the one or more regional clusters;
[0233] Determine one or more data types of component status data of associated components associated with the product instances deployed on each regional cluster, and determine data processing methods corresponding to the one or more data types;
[0234] Based on the data processing methods corresponding to the one or more data types, status data of the corresponding data types in the component status data of the associated components associated with the product instance deployed on each regional cluster are processed to obtain product status data of the product instance deployed on each regional cluster;
[0235] Storing product status data of the product instances deployed on each regional cluster in a status database;
[0236] If a query request for product status data of a specified product instance is obtained, the product status data requested by the query request is searched from the status database in response to the query request.
[0237] In one implementation, the processor 701 is specifically configured to:
[0238] Obtaining access links to each of the one or more regional clusters; the access link for any regional cluster is created after configuring management permissions for the any regional cluster;
[0239] Component status data of associated components associated with product instances deployed on corresponding regional clusters are obtained based on the access links of the respective regional clusters.
[0240] In one implementation, the processor 701 is specifically configured to:
[0241] If it is detected that the target product instance has a target operation for the component status data, the step of obtaining the component status data of the associated component associated with the target product instance is triggered; the target operation includes any one or more of a modification operation, a deletion operation and a new addition operation; or,
[0242] If it is detected that the current time is the preset acquisition time, triggering the step of acquiring component status data of the associated component associated with the target product instance;
[0243] The target product instance is any one of the product instances deployed on each of the regional clusters.
[0244] In one implementation, the preset acquisition time is a time in a data acquisition cycle of the target product instance, and the data acquisition cycle is used to indicate a time interval for acquiring component status data of an associated component associated with the target product instance; the processor 701 is further used to:
[0245] Acquire multiple historical query requests within a historical time period; each of the multiple historical query requests includes an instance identifier for indicating a product instance;
[0246] Counting the number of each instance identifier among all instance identifiers included in the multiple historical query requests;
[0247] Based on the number of identifiers of the respective instance identifiers, a data acquisition period for each of the product instances deployed on the respective regional clusters is determined.
[0248] In one implementation, the one or more data types include a first data type for resource occupancy, and a data processing method corresponding to the first data type is a first data processing method for processing resource occupancy of a product instance; the processor 701 is specifically configured to:
[0249] Obtain resource occupancy data of each associated component in all associated components under the product instance from component status data of associated components associated with the product instance deployed on the target regional cluster; the target regional cluster is any one of the one or more regional clusters, and any associated component is any one of an application, middleware, or virtual machine under the product instance;
[0250] Based on the resource occupation data of each associated component, the resource occupation data of the product instance is determined, and the resource occupation data of the product instance is used as product status data for resource occupation of the product instance deployed on the target regional cluster.
[0251] In one implementation, the one or more data types are a second data type for a component operating state, and a data processing method corresponding to the second data type is a second data processing method for processing an operating health status of a product instance; the processor 701 is specifically configured to:
[0252] Obtaining the component running status of each associated component in all associated components under the product instance from the component status data of the associated components associated with the product instance deployed on the target regional cluster; the target regional cluster is any one of the one or more regional clusters;
[0253] Obtain reference components to be deployed under the product instance;
[0254] If all associated components under the product instance are consistent with the reference components to be deployed, and the ratio between the number of first components of associated components whose component operation status is healthy and the number of second components of all associated components is greater than or equal to a preset ratio, it is determined that the operation status of the product instance is healthy;
[0255] The running status of the product instance is used as product status data of the product instance deployed on the target regional cluster in terms of running health.
[0256] In one implementation, the one or more data types are third data types for status data of an application whose associated component is a third data type, and the data processing method corresponding to the third data type is a third data processing method for performing statistics on status data of an application under a product instance; the processor 701 is specifically configured to:
[0257] Obtaining, from component status data of associated components associated with a product instance deployed on a target regional cluster, status data of each application in all applications under the product instance; the target regional cluster is any one of the one or more regional clusters, and the status data of any application includes one or more of an application name, an application running status, an application version, and an update time of the application version of the any application;
[0258] Based on the status data of each application in all the applications under the product instance, count the number of first applications in all the applications under the product instance and the number of second applications in which the application running status is a healthy state;
[0259] The first application quantity, the second application quantity, and the status data of each application are used as product status data of the product instance deployed on the target regional cluster for application status data.
[0260] In one implementation, the one or more data types are a fourth data type for status data of a middleware whose associated component is a middleware, and the data processing method corresponding to the fourth data type is a fourth data processing method for performing statistics on the status data of the middleware under the product instance; the processor 701 is specifically used to:
[0261] Obtaining status data of each middleware in all middleware under the product instance from component status data of associated components associated with the product instance deployed on the target regional cluster; the target regional cluster is any one of the one or more regional clusters, and the status data of any middleware includes: one or more of the middleware name, the middleware type, the middleware running status, and the middleware planning data, and the middleware planning data is the resource occupation data configured by any middleware;
[0262] The status data of each middleware is used as product status data of the product instance deployed on the target regional cluster for the status data of the middleware.
[0263] In one implementation, the processor 701 is further configured to:
[0264] If an update event of a product configuration file of a product instance deployed on a target regional cluster is detected, then an update time of generating the update event is obtained; the product configuration file includes configuration information of the product instance deployed on the target regional cluster; the target regional cluster is any one of the one or more regional clusters;
[0265] Obtain the product configuration file before and after the update;
[0266] The update time, the product configuration file before the update, and the product configuration file after the update are stored in the status database.
[0267] The present application also provides a computer storage medium in which program instructions are stored. When the program instructions are executed, the following may be included: Figure 2 or Figure 4 Part or all of the steps of the data processing method in the corresponding embodiment.
[0268] It should be noted that, for the above-mentioned various method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.
[0269] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0270] The embodiment of the present application also provides a computer program product or computer program, which includes program instructions, and the program instructions are stored in a computer-readable storage medium. The processor of the electronic device reads the program instructions from the computer-readable storage medium, and the processor executes the program instructions, so that the electronic device performs the steps performed in the embodiments of the above methods.
[0271] The above is a detailed introduction to a data processing method, device, electronic device, medium and program product provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A data processing method, characterized in that: The method comprises: Obtain component status data of associated components associated with product instances deployed on each of the one or more regional clusters; Determine one or more data types of component status data of associated components associated with the product instances deployed on each regional cluster, and determine data processing methods corresponding to the one or more data types; Based on the data processing methods corresponding to the one or more data types, status data of the corresponding data types in the component status data of the associated components associated with the product instance deployed on each regional cluster are processed to obtain product status data of the product instance deployed on each regional cluster; Storing product status data of the product instances deployed on each regional cluster in a status database; If a query request for product status data of a specified product instance is obtained, the product status data requested by the query request is searched from the status database in response to the query request.
2. The method according to claim 1, characterized in that The obtaining of component status data of associated components associated with product instances deployed on each of the one or more regional clusters includes: Obtaining access links to each of the one or more regional clusters; the access link for any regional cluster is created after configuring management permissions for the any regional cluster; Component status data of associated components associated with product instances deployed on corresponding regional clusters are obtained based on the access links of the respective regional clusters.
3. The method according to claim 1, characterized in that The obtaining of component status data of associated components associated with product instances deployed on each of the one or more regional clusters includes: If it is detected that the target product instance has a target operation for the component status data, the step of obtaining the component status data of the associated component associated with the target product instance is triggered; the target operation includes any one or more of a modification operation, a deletion operation and a new addition operation; or, If it is detected that the current time is the preset acquisition time, triggering the step of acquiring component status data of the associated component associated with the target product instance; The target product instance is any one of the product instances deployed on each of the regional clusters.
4. The method according to claim 3, characterized in that The preset acquisition time is a time in the data acquisition cycle of the target product instance, and the data acquisition cycle is used to indicate the time interval for acquiring the component status data of the associated component associated with the target product instance; and further comprising: Acquire multiple historical query requests within a historical time period; each of the multiple historical query requests includes an instance identifier for indicating a product instance; Counting the number of each instance identifier among all instance identifiers included in the multiple historical query requests; Based on the number of identifiers of the respective instance identifiers, a data acquisition period for each of the product instances deployed on the respective regional clusters is determined.
5. The method according to any one of claims 1 to 4, characterized in that: The one or more data types include a first data type for resource occupancy, and a data processing method corresponding to the first data type is a first data processing method for processing resource occupancy of a product instance; The processing of the status data of the corresponding data type in the component status data of the associated component associated with the product instance deployed on each regional cluster based on the data processing modes respectively corresponding to the one or more data types to obtain the product status data of the product instance deployed on each regional cluster includes: Obtain resource occupancy data of each associated component in all associated components under the product instance from component status data of associated components associated with the product instance deployed on the target regional cluster; the target regional cluster is any one of the one or more regional clusters, and any associated component is any one of an application, middleware, or virtual machine under the product instance; Based on the resource occupation data of each associated component, the resource occupation data of the product instance is determined, and the resource occupation data of the product instance is used as product status data for resource occupation of the product instance deployed on the target regional cluster.
6. The method according to any one of claims 1 to 4, characterized in that: The one or more data types are second data types for component operation status, and the data processing method corresponding to the second data type is a second data processing method for processing the operation health status of the product instance; The processing of the status data of the corresponding data type in the component status data of the associated component associated with the product instance deployed on each regional cluster based on the data processing modes respectively corresponding to the one or more data types to obtain the product status data of the product instance deployed on each regional cluster includes: Obtaining the component running status of each associated component in all associated components under the product instance from the component status data of the associated components associated with the product instance deployed on the target regional cluster; the target regional cluster is any one of the one or more regional clusters; Obtain reference components to be deployed under the product instance; If all associated components under the product instance are consistent with the reference components to be deployed, and the ratio between the number of first components of associated components whose component operation status is healthy and the number of second components of all associated components is greater than or equal to a preset ratio, it is determined that the operation status of the product instance is healthy; The running status of the product instance is used as product status data of the product instance deployed on the target regional cluster in terms of running health.
7. The method according to any one of claims 1 to 4, characterized in that: The one or more data types are third data types for status data of an application whose associated component is a third data type, and the data processing method corresponding to the third data type is a third data processing method for performing statistics on status data of applications under a product instance; The processing of the status data of the corresponding data type in the component status data of the associated component associated with the product instance deployed on each regional cluster based on the data processing modes respectively corresponding to the one or more data types to obtain the product status data of the product instance deployed on each regional cluster includes: Obtaining, from component status data of associated components associated with a product instance deployed on a target regional cluster, status data of each application in all applications under the product instance; the target regional cluster is any one of the one or more regional clusters, and the status data of any application includes one or more of an application name, an application running status, an application version, and an update time of the application version of the any application; Based on the status data of each application in all the applications under the product instance, count the number of first applications in all the applications under the product instance and the number of second applications in which the application running status is a healthy state; The first application quantity, the second application quantity, and the status data of each application are used as product status data of the product instance deployed on the target regional cluster for application status data.
8. The method according to any one of claims 1 to 4, characterized in that: The one or more data types are fourth data types for status data of the associated component being a middleware, and the data processing method corresponding to the fourth data type is a fourth data processing method for performing statistics on the status data of the middleware under the product instance; The processing of the status data of the corresponding data type in the component status data of the associated component associated with the product instance deployed on each regional cluster based on the data processing modes respectively corresponding to the one or more data types to obtain the product status data of the product instance deployed on each regional cluster includes: Obtaining status data of each middleware in all middleware under the product instance from component status data of associated components associated with the product instance deployed on the target regional cluster; the target regional cluster is any one of the one or more regional clusters, and the status data of any middleware includes: one or more of the middleware name, the middleware type, the middleware running status, and the middleware planning data, and the middleware planning data is the resource occupation data configured by any middleware; The status data of each middleware is used as product status data of the product instance deployed on the target regional cluster for the status data of the middleware.
9. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: If an update event of a product configuration file of a product instance deployed on a target regional cluster is detected, then an update time of generating the update event is obtained; the product configuration file includes configuration information of the product instance deployed on the target regional cluster; the target regional cluster is any one of the one or more regional clusters; Obtain the product configuration file before and after the update; The update time, the product configuration file before the update, and the product configuration file after the update are stored in the status database.
10. A data processing device, characterized in that: include: An acquisition unit, used to acquire component status data of associated components associated with product instances deployed on each of the one or more regional clusters; A determination unit, configured to determine one or more data types of component status data of associated components associated with a product instance deployed on each regional cluster, and determine data processing modes corresponding to the one or more data types; A processing unit, configured to process status data of a corresponding data type in component status data of an associated component associated with a product instance deployed on each regional cluster based on data processing modes corresponding to the one or more data types, to obtain product status data of the product instance deployed on each regional cluster; A storage unit, used to store product status data of the product instances deployed on each regional cluster in a status database; The query unit is configured to search the status database for the product status data requested by the query request in response to a query request for product status data of a specified product instance.
11. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, and when the program instructions are executed, they are used to implement the method according to any one of claims 1 to 9.
13. A computer program product, comprising program instructions, wherein when the program instructions are executed by a processor, the program instructions are used to implement the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Life cycle management methods of distributed applications, managers, equipment and mediums
CN108595316A
Communication method, device and system
CN110463141A
Virtual machine instance data aggregation
US10733002B1
Aggregated service status reporter
US10735530B1
Deployment of software applications on server clusters
US20200192651A1
