An information processing method, apparatus and electronic device
By parsing custom scheduling policies to build a base image and combining the target application's policy to determine the target node, the problem of the scheduler's inability to handle personalized processing in the Kubernetes cluster is solved, achieving more efficient scheduling.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- LENOVO (BEIJING) LTD
- Filing Date
- 2021-11-25
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, the default scheduler of Kubernetes clusters cannot perform personalized scheduling processing and cannot meet the different resource requirements of different running instances, resulting in low scheduling efficiency.
By obtaining the custom scheduling policy from the template of the instance to be scheduled, parsing the configuration file, building the base image, and analyzing and determining the target node based on the image, personalized scheduling is performed in combination with the policy of the target application.
It enables the selection of appropriate scheduling strategies based on business characteristics, improves the personalized processing capability of scheduling, meets the resource needs of different applications, and enhances scheduling efficiency.
Smart Images

Figure CN114003347B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of information technology, and more particularly, to an information processing method, device and electronic equipment. BACKGROUND
[0002] In an edge computing environment, Kubernete is the most popular container orchestration system, and a default scheduler is generally used in a Kubernetes cluster.
[0003] For each newly created running instance (Pod) or unscheduled running instance, the default scheduler selects an optimal node (Node) to run the running instance. However, each container in the running instance has different resource requirements, and the running instance itself also has different resource requirements.
[0004] However, in the prior art, the selection of the optimal node is completed before the scheduler is started, and all newly created running instances need to be processed by the same set of scheduling methods, and personalized scheduling processing cannot be achieved. SUMMARY
[0005] Therefore, the present application provides an information processing method as follows.
[0006] An information processing method comprises the following steps.
[0007] Obtaining a running instance to be scheduled;
[0008] Querying that a template of the running instance to be scheduled contains a custom scheduling strategy, analyzing the custom scheduling strategy to obtain a configuration file, and the custom scheduling strategy contains a strategy corresponding to a target application of the running instance to be scheduled;
[0009] Constructing a first base image according to the configuration file;
[0010] Based on the first base image, a first target node is determined, and the first target node is used to run the running instance to be scheduled.
[0011] Optionally, before the above method obtains the running instance to be scheduled, the method further comprises the following steps.
[0012] Starting based on a stored second base image, the second base image includes a pre-configured executable file, and the second base image is updated based on the constructed first base image.
[0013] Optionally, in the above method, the analyzing the content of the custom scheduling strategy to obtain the configuration file comprises the following steps.
[0014] parsing the declaration of the custom scheduling strategy to obtain an algorithm type contained in the declaration;
[0015] obtaining a configuration file according to an obtaining manner corresponding to the algorithm type.
[0016] Optionally, in the method described above, the obtaining of the configuration file according to the obtaining manner corresponding to the algorithm type comprises:
[0017] if the algorithm type is a first type, searching for the configuration file in a preset algorithm file;
[0018] if the algorithm type is a second type, obtaining a preset dynamic library file based on a specified storage path and basic information of the target application, and taking the dynamic library file as the configuration file;
[0019] if the algorithm type is a third type, creating the configuration file based on preset extended configuration information.
[0020] Optionally, in the method described above, after the obtaining of the configuration file by parsing the content of the custom scheduling strategy, the method further comprises:
[0021] analyzing the custom scheduling strategy to obtain target algorithm configuration information and an analysis link corresponding to the target algorithm configuration information;
[0022] generating a target plug-in according to the target algorithm configuration information, the target plug-in containing a first channel, so that parameter adjustment information of a target algorithm is accepted through the first channel in the analysis link.
[0023] Optionally, in the method described above, after the analysis and determination of the first target node, the method further comprises:
[0024] reading the parameter adjustment information of the target algorithm through the first channel;
[0025] processing a first result according to the parameter adjustment information, to obtain a second target node, the first target node being determined based on the first result, and the second target node being used to run the to-be-scheduled running instance.
[0026] Optionally, in the method described above, the processing of the first result according to the parameter adjustment information comprises:
[0027] based on the parameter adjustment information of the target algorithm including a dynamic weight value, performing weighted processing on the first result according to the dynamic weight value, to obtain a second result;
[0028] determining the second target node according to the second result.
[0029] Optionally, the method described above, the processing of the first result according to the parameter adjustment information comprises:
[0030] The parameter adjustment information of the target algorithm comprises a target normalization algorithm, and the first result is normalized according to the target normalization algorithm to obtain a third result.
[0031] The second target node is determined according to the third result.
[0032] An information processing device comprises:
[0033] An acquisition module is configured to acquire a running instance to be scheduled.
[0034] An analysis module is configured to query a template of the running instance to be scheduled to obtain a self-defined scheduling strategy, analyze the self-defined scheduling strategy to obtain a configuration file, and obtain a strategy of a target application corresponding to the running instance to be scheduled in the self-defined scheduling strategy.
[0035] A construction module is configured to construct a first base image according to the configuration file.
[0036] An analysis module is configured to analyze and determine a first target node based on the first base image, and the first target node is used to run the running instance to be scheduled.
[0037] An electronic device comprises a memory and a processor.
[0038] The memory stores an information processing program.
[0039] The processor is configured to load and execute the information processing program stored in the memory to implement each step of the information processing method described in any one of the above.
[0040] According to the technical solution described above, the present application provides an information processing method, which is applied to a scheduler, acquires a running instance to be scheduled, analyzes a template of the running instance to be scheduled to obtain a self-defined scheduling strategy, analyzes the self-defined scheduling strategy to obtain a configuration file, obtains a strategy of a target application corresponding to the running instance in the self-defined scheduling strategy, constructs a first base image according to the configuration file, and analyzes and determines a target node according to the first base image. The target node determined by the analysis is combined with the strategy of the target application, different applications select different strategies, and personalized scheduling processing is achieved. BRIEF DESCRIPTION OF DRAWINGS
[0041] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0042] Figure 1 A flowchart of an embodiment 1 of an information processing method provided in this application;
[0043] Figure 2 A flowchart of an embodiment 2 of an information processing method provided in this application;
[0044] Figure 3 A flowchart of an embodiment 3 of an information processing method provided in this application;
[0045] Figure 4 A flowchart of an embodiment 4 of an information processing method provided in this application;
[0046] Figure 5 A flowchart of an embodiment 5 of an information processing method provided in this application;
[0047] Figure 6 A schematic diagram of the process of the scheduler analyzing and determining the target node in Embodiment 5 of the information processing method provided in this application;
[0048] Figure 7 A schematic diagram illustrating an application scenario of an information processing method provided in this application;
[0049] Figure 8 A schematic diagram illustrating the application of a custom scheduler in an application scenario of the information processing method provided in this application;
[0050] Figure 9 This is a schematic diagram of an embodiment of an information processing device provided in this application. Detailed Implementation
[0051] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0052] like Figure 1 The diagram shown is a flowchart of an embodiment 1 of an information processing method provided in this application. The method is applied in a scheduler and includes the following steps:
[0053] Step S101: obtaining a running instance to be scheduled;
[0054] The running instance is an instance of a given application, or in other words, a smallest deployable computing unit.
[0055] Specifically, the running instance to be scheduled can be newly created or pre-created.
[0056] Step S102: querying whether a custom scheduling strategy is contained in a template of the running instance to be scheduled, and parsing the custom scheduling strategy to obtain a configuration file;
[0057] The custom scheduling strategy contains a strategy of a target application corresponding to the running instance to be scheduled.
[0058] Specifically, by querying the template of the scheduled running instance, it is determined that the custom scheduling strategy is contained therein. The configuration file is obtained by parsing the custom scheduling strategy. Since the custom scheduling strategy contains a strategy of a target application corresponding to the running instance to be scheduled, the configuration of the configuration file corresponds to the target application corresponding to the running instance to be scheduled.
[0059] It should be noted that different applications have great differences in sensitivity to scheduling algorithms. For example, in a 5G (5th Generation Mobile Communication Technology) scenario, the requirements for distance and network state often require the application to be deployed on the nearest base station. For example, in a factory, the application should be deployed as close as possible to the field control device to obtain the shortest operation delay, such as a mechanical arm control scene. For example, the computing power of edge and end devices differs greatly, resulting in the need for cloud-edge collaborative computing to obtain the optimal result, and thus possibly requiring secondary dynamic adjustment and redeployment. For example, the initialization stage of an AI (Artificial Intelligence) training task may not be able to determine the optimal normalization method and weight, and thus requires dynamic adjustment during training.
[0060] It should be noted that in an edge computing environment, Kubernetes is the most popular container orchestration system, kube-scheduler is the default scheduler of the Kubernetes cluster, and is part of the cluster control plane. In the design, it is allowed for developers to write a scheduling component and replace the original kube-scheduler. In this application, the kube-scheduler scheduler is used.
[0061] Step S103: constructing a first base image according to the configuration file;
[0062] The base image is constructed based on the configuration file, and the base image contains information of the configuration file. Since the configuration of the configuration file corresponds to the target application corresponding to the running instance to be scheduled, the base image contains information corresponding to the target application.
[0063] In a specific implementation, based on obtaining the configuration file, the first base image is constructed according to the configuration file by starting the container.
[0064] The base image includes all pre-prepared custom algorithms, implementation of custom scheduling framework source code, and pre-compiled executable files of custom schedulers.
[0065] Step S104: determining a first target node based on the first base image.
[0066] The first target node is used to run the running instance to be scheduled.
[0067] The scheduler analyzes the information corresponding to the target application to determine the first target node, so that the first target node runs the scheduled running instance.
[0068] Since the scheduler analyzes the information corresponding to the target application to determine the first target node, the process of determining the first target node combines the strategy of the target application, and the first target node is more suitable for running the scheduled running instance than other nodes.
[0069] Specifically, the first base image updates the previously stored base image, and the scheduler is restarted based on the updated base image (i.e., the first base image), so that the scheduler obtains the information corresponding to the target application in the first base image, and then analyzes and determines the first target node based on the restarted scheduler.
[0070] It should be noted that there are other running instances to be scheduled subsequently, and when scheduling the other running instances, the template of the other running instances is determined first. Whether the template is the same as the template of the running instance to be scheduled in the embodiment, if they are the same, the other running instance to be scheduled is directly scheduled to the first target node; otherwise, steps S101-104 are executed to determine the target node corresponding to the other running instance.
[0071] To sum up, the information processing method provided in the embodiment is applied to a scheduler, and first, a running instance to be scheduled is acquired; based on the fact that a template of the running instance to be scheduled contains a self-defined scheduling strategy, a configuration file is parsed from the self-defined scheduling strategy, the self-defined scheduling strategy contains a strategy of a target application corresponding to the running instance, a first base image is constructed according to the configuration file, and a target node is determined according to the first base image, the target node determined by the analysis is combined with the strategy of the target application, different applications select different strategies, the appropriate scheduling strategy is selected according to the business characteristics, and personalized scheduling processing is implemented.
[0072] As shown in Figure 2 the flowchart of Embodiment 2 of the information processing method provided in the application, the method comprises the following steps:
[0073] Step S201: starting based on a stored second base image;
[0074] The second base image comprises a preconfigured executable file, and the second base image is updated based on the first base image constructed;
[0075] The scheduler is started based on a stored base image when starting, the base image comprises a preconfigured executable file, and the scheduler is started based on the stored base image by default when starting, and configuration information in the executable file in the base image is obtained.
[0076] Specifically, the second base image is stored in the device, the scheduler is started based on the second base image, and the scheduler obtains configuration information of a configurable file in the second base image.
[0077] It should be noted that the second base image does not contain information of a target application corresponding to a running instance to be scheduled subsequently. The stored base image is updated after the first base image is constructed in the subsequent step S204, so that the scheduler is restarted based on the updated base image (the first base image), so as to obtain configuration information of a configurable file in the first base image, the configuration information is information corresponding to the target application, so that the restarted scheduler can analyze and determine a first target node based on the information corresponding to the target application obtained by the scheduler.
[0078] Step S202: acquiring a running instance to be scheduled;
[0079] Step S203: querying that a template of the running instance to be scheduled contains a self-defined scheduling strategy, and parsing a configuration file from the self-defined scheduling strategy;
[0080] Step S204: constructing a first base image according to the configuration file;
[0081] Step S205: Based on the first base image, analyze and determine the first target node.
[0082] Steps S202-205 are the same as steps S101-104 in Example 1, and will not be described again in this example.
[0083] In summary, the information processing method provided in this embodiment further includes: starting based on a stored second base image, the second base image including a pre-configured executable file, and the second base image being updated based on the constructed first base image. In this scheme, the scheduler first starts based on its stored second base image. In order for the scheduler to determine the target node for the target application, the stored base image is updated in subsequent steps using the first base image constructed based on the information in the configuration file corresponding to the target application, so that the scheduler can obtain the information corresponding to the target application in the first base image.
[0084] like Figure 3 The diagram shown is a flowchart of an embodiment 3 of an information processing method provided in this application. The method includes the following steps:
[0085] Step S301: Obtain the running instance to be scheduled;
[0086] Step S301 is the same as step S101 in Embodiment 1, and will not be described again in this embodiment.
[0087] Step S302: Query and obtain the template of the running instance to be scheduled, which contains a custom scheduling strategy;
[0088] In practice, in an edge computing environment, before scheduling running instances, a custom scheduler (i.e., the scheduler used in this application) is created, which can execute custom scheduling strategies.
[0089] Specifically, obtain the template of the running instance to be scheduled, and query the custom scheduling strategy contained in the template.
[0090] The custom scheduling strategy includes a ConfigMap declaration, which contains information about the running instance to be scheduled and the corresponding target application.
[0091] It should be noted that this custom scheduling strategy can be a strategy that the user customizes based on the target application.
[0092] Step S303: Parse the declaration of the custom scheduling strategy to obtain the algorithm type contained in the declaration;
[0093] The algorithm type contained in the declaration is parsed to obtain the algorithm type contained in the declaration.
[0094] The algorithm type is further processed to reduce the problem of mismatch between the determined first target node and the running instance.
[0095] It should be noted that the declarative definition method conforms to the design principles of the Kubernetes api (Application Programming Interface), and can achieve optimal scheduling without changing the overall system architecture.
[0096] In specific implementation, the custom strategy can be identified by adding a fixed prefix in the user configuration file.
[0097] Step S304: Obtain the configuration file according to the obtaining method corresponding to the algorithm type.
[0098] The algorithm type contained in the declaration corresponds to different algorithm sources, and the custom scheduler is configured according to the type of the custom scheduling algorithm declaration to complete the corresponding custom algorithm parsing and matching process. Correspondingly, different algorithm types correspond to different configuration file obtaining methods.
[0099] In specific implementation, the scheduler is based on an open parsing program (such as Config paser) to parse and obtain the configuration file of the custom algorithm.
[0100] Specifically, the configuration file is obtained according to the obtaining method corresponding to the algorithm type, including:
[0101] If the algorithm type is the first type, the configuration file is searched in the preset algorithm file;
[0102] If the algorithm type is the second type, a preset dynamic library file is obtained based on the specified storage path and basic information of the target application, and the dynamic library file is used as the configuration file.
[0103] If the algorithm type is the third type, a configuration file is created based on preset extension configuration information.
[0104] The first type is not specified / default, including all algorithms of the original default scheduling strategy, and the configuration file of the first type can be specifically searched from the preset algorithm file.
[0105] The second type is a dynamic library, that is, the file in the dynamic library is used as the configuration file, and the dynamic link library is specified accordingly.
[0106] Specifically, if the obtained is a dynamic library, an assembly container is started, which is responsible for copying the specified dynamic library file to the base image according to the image and path specified by the application, updating the environment variable related to the current dynamic library, adding the new custom dynamic library to the current scheduler dynamic library list, and then recompiling to generate a new scheduler base image.
[0107] In addition, when it is identified that there is no running instance being scheduled in the current scheduler, the new scheduler is validated by restarting the scheduler, and a new scheduling strategy is generated and enabled, for example, the definition type of the new scheduling strategy is KubeSchedulerProfile.
[0108] The third type is an extension type, which corresponds to an algorithm that is not involved in the dynamic library and the native default scheduling strategy, and can be obtained through a network service. Accordingly, the extension network service is specified through a custom extension network service.
[0109] Specifically, the current is an extension type, and the parser directly creates a corresponding scheduling strategy configuration file according to the configuration information of the extension type, starts an assembly container to compile a new base image, and when it is identified that there is no running instance being scheduled in the current scheduler, the new scheduler is validated by restarting the scheduler, and a new scheduling strategy is generated and enabled.
[0110] In a specific implementation, type is used to represent the algorithm type, and the algorithm type can be defined in the following three ways: -, DLL, and EXTENDR.
[0111] Correspondingly, - indicates that the algorithm is a pre-prepared custom algorithm that should be obtained in the base image of the custom scheduler. When this value is specified, other fields are optional, that is, the configuration file can be found from the preset algorithm file.
[0112] DLL indicates that the algorithm is provided in the form of a dynamic library, and is loaded by the custom scheduler when it is first used. When this value is specified, the image (image) and path (path) fields must be specified.
[0113] EXTENDR indicates that the algorithm is provided in the form of a schedule extender, and the extender field must be specified.
[0114] When the algorithm type is specified as a dynamic library, the custom scheduler is responsible for copying the dynamic library file from the determined path, and after recompiling the base image, it is added to the existing scheduling algorithm library.
[0115] To achieve the above functions, the custom scheduler defines five new interfaces on the basis of implementing the native scheduling interface:
[0116] (1) Analyze the custom scheduling strategy
[0117] This interface is mainly responsible for parsing the declaration of the custom scheduling strategy in the configuration into a plug-in;
[0118] (2) Create a user configuration file for custom scheduling
[0119] This interface is responsible for generating KubeSchedulerProfile based on the plug-in generated in 1), and judging whether the same user configuration file exists;
[0120] (3) Add custom scheduling algorithm
[0121] According to the stage where the custom scheduling algorithm is located, it is added to the algorithm list;
[0122] (4) Get the current algorithm list
[0123] All algorithm lists of the current five stages can be returned according to the calling request, and the application app can specify the custom algorithm in advance by obtaining the implemented algorithm list through the interface;
[0124] (5) Get the current scheduling user configuration file list
[0125] All algorithm lists of the current five stages can be returned according to the calling request, and the application can specify the custom algorithm in advance by obtaining the implemented user configuration file list through the interface.
[0126] Step S305: constructing a first base image according to the configuration file;
[0127] Step S306: determining a first target node based on the first base image.
[0128] Among them, steps S305-306 are consistent with steps S103-104 in embodiment 1, and will not be repeated in this embodiment.
[0129] In summary, in the information processing method provided in this embodiment, the content of the custom scheduling strategy is parsed to obtain a configuration file, including: parsing the declaration of the custom scheduling strategy to obtain the algorithm type contained in the declaration; and obtaining a configuration file according to an obtaining manner corresponding to the algorithm type. In this scheme, the algorithm type in the custom scheduling strategy declaration is obtained to realize obtaining a configuration file according to an obtaining manner corresponding to the algorithm type, and different algorithm types are realized to obtain configuration files.
[0130] AsFigure 4 Fig. 4 shows a flowchart of an embodiment 4 of the information processing method provided in the present application, which comprises the following steps:
[0131] Step S401: obtaining a running instance to be scheduled;
[0132] Step S402: querying whether the template of the running instance to be scheduled contains a custom scheduling strategy, and parsing the custom scheduling strategy to obtain a configuration file;
[0133] Steps S401-402 are consistent with steps S101-102 in embodiment 1, and will not be described herein.
[0134] Step S403: analyzing the custom scheduling strategy to obtain target algorithm configuration information and an analysis link corresponding to the target algorithm configuration information;
[0135] In this embodiment, the target algorithm corresponds to an algorithm for calculating and processing characteristic values processed by the scheduler.
[0136] Specifically, based on the analysis of the custom scheduling strategy, the analysis link corresponding to the target algorithm configuration information is obtained, and the target algorithm configuration information is applied to the analysis link for processing.
[0137] Specifically, the analysis link includes a pre-selection link and a preferred link.
[0138] In specific implementation, the corresponding custom scheduling strategy can be matched by setting a value pair of parameters, and the enabled and disabled algorithms can be specified in the pre-selection link and the preferred link, and the corresponding weight values can be specified, and the normalization algorithm and weight can also be specified in the preferred link.
[0139] Step S404: generating a target plug-in according to the target configuration algorithm information;
[0140] The target plug-in contains a first channel, so that the parameter adjustment information of the target algorithm is accepted through the first channel in the analysis link.
[0141] Wherein, the configurations in the scheduler cannot be changed at will after it is started, but the parameters of the algorithms in the scheduler can be adjusted based on the first channel.
[0142] Specifically, based on the target configuration algorithm information, a target plug-in is generated, which contains a first channel, so that the parameter adjustment information of the target algorithm is adjusted to the parameters of the algorithms in the corresponding analysis link of the scheduler based on the first channel.
[0143] In specific implementation, the plug-in generally dynamically adjusts the weight or the normalization algorithm.
[0144] As an example, the process of creating a plugin is as follows: parse the scheduling policy, determine whether to adjust the weights when dynamic adjustment is enabled, and if so, create a plugin to dynamically change the weights; if not, create a plugin to dynamically change the normalization algorithm; add the created plugin to the configuration file and start the dynamic table monitoring program so that the scheduler can be restarted based on the configuration file in the future.
[0145] Step S405: Build the first base image according to the configuration file;
[0146] Step S406: Based on the first base image, analyze and determine the first target node.
[0147] Steps S405-406 are the same as steps S103-104 in Example 1, and will not be described again in this example.
[0148] In summary, the information processing method provided in this embodiment further includes: analyzing the custom scheduling strategy to obtain target algorithm configuration information and the analysis step corresponding to the target algorithm configuration information; generating a target plugin based on the target configuration algorithm information, wherein the target plugin includes a first channel so that parameter adjustment information of the target algorithm is received through the first channel in the analysis step.
[0149] like Figure 5 The flowchart shown is a 5th embodiment of an information processing method provided in this application. The method includes the following steps:
[0150] Step S501: Obtain the running instance to be scheduled;
[0151] Step S502: Query the template of the running instance to be scheduled to obtain a custom scheduling policy, and parse the custom scheduling policy to obtain a configuration file;
[0152] Step S503: Analyze the custom scheduling strategy to obtain the target algorithm configuration information and the analysis steps corresponding to the target algorithm configuration information;
[0153] Step S504: Generate the target plugin based on the target configuration algorithm information;
[0154] Step S505: Build the first base image according to the configuration file;
[0155] Step S506: Based on the first base image, analyze and determine the first target node;
[0156] Steps S501-506 are the same as steps S401-406 in Example 4, and will not be described again in this example.
[0157] Step S507: reading parameter adjustment information of the target algorithm through the first channel;
[0158] The parameter adjustment information of the algorithm is a changed value obtained by the dynamic table monitoring program through the API service. The API can be used to obtain information on the operating system. Specifically, during the running of the scheduler, the parameter adjustment information is obtained by interacting with the dynamic table monitoring program through the first channel.
[0159] Specifically, after the scheduler is started based on the first base image, the process of analyzing and determining the target node includes a pre-selection link and an optimization link.
[0160] As shown in Figure 6 The process of analyzing and determining the target node by the scheduler is shown in the figure. The algorithms set for the application include a custom pre-selection scheduling algorithm, a custom optimization algorithm, and a custom normalization algorithm. In the pre-selection link, the custom scheduling algorithm is added. The algorithms used in the pre-selection link include pre-selection scheduling algorithm 1, custom scheduling algorithm, …, pre-selection scheduling algorithm 2. There are three algorithm sets: the full set includes pre-selection scheduling algorithm 1, custom scheduling algorithm, …, pre-selection scheduling algorithm 2; the default set includes pre-selection scheduling algorithm 1, …, pre-selection scheduling algorithm 2; and the custom set includes custom scheduling algorithm. One set is selected for pre-selection. In the optimization link, the custom optimization algorithm is added. The algorithms used in the optimization link include optimization scheduling algorithm, eigenvalue normalization, custom optimization algorithm, and custom normalization algorithm, dynamic normalization algorithm, and weight superposition order are added through the first channel.
[0161] The nodes to be screened include node 1, node 2, and node 3. In the pre-selection link, after the first judgment loop, the algorithm based on the pre-selection link filters out node 3 from the three nodes, leaving nodes 1 and 2. In the optimization link, after the second judgment loop, one of the custom algorithm, the optimization scheduling algorithm, and the eigenvalue normalization is selected for calculation. After the third judgment loop, it is determined whether to check the distribution to determine whether to use the custom normalization algorithm or the dynamic normalization algorithm, and whether to customize the weight to realize the weight superposition order. The score of node 1 is 12, and the score of node 2 is 25. Therefore, node 2 is selected as the target node of the to-be-scheduled running instance, and is scheduled to node 2 for running.
[0162] In this embodiment, the process of the last third judgment loop is mainly described.
[0163] Step S508: processing the first result according to the parameter adjustment information to obtain a second target node.
[0164] The first target node is determined based on the first result, and the second target node is used to run the to-be-scheduled running instance.
[0165] Specifically, the scheduler analyzes to obtain a first result, and determines a first target node based on the first result.
[0166] In this embodiment, the parameter adjustment information is used to process the first result, such as a normalization algorithm, to achieve uniform distribution of feature values involved in the first result as much as possible, and solve the potential problem of best node matching error caused by uneven distribution of features and superposition of multiple feature values.
[0167] For example, in the declaration of the custom scheduling strategy, the following needs to be performed: a normalization algorithm when a priority stage statistical score is specified; a current normalization algorithm is specified by setting a value to specify whether the current normalization algorithm is dynamically changed, when the value is set to true, the scheduler can dynamically change the weight of the current algorithm according to the normal weight update value; according to the algorithm specified value, the same named distribution checking function is matched in the prefabricated algorithm, when the algorithm is not specified, the default distribution checking algorithm is used, and when the algorithm is specified, the normalization algorithm used when the statistical score is changed can be changed multiple times.
[0168] The parameter adjustment information of the target algorithm includes a dynamic weight value or a normalization algorithm, and correspondingly, the process of processing the first result according to the parameter adjustment information to obtain a second target node is as follows:
[0169] Based on the parameter adjustment information of the target algorithm including a dynamic weight value, the first result is weighted processed according to the dynamic weight value to obtain a second result; and a second target node is determined according to the second result.
[0170] Or
[0171] Based on the parameter adjustment information of the target algorithm including a target normalization algorithm, the first result is normalized processed according to the target normalization algorithm to obtain a third result; and a second target node is determined according to the third result.
[0172] It should be noted that after the scheduling calculation of the normal link ends, the current dynamically modified weight value is multiplied or the normalization calculation is re-executed according to a new normalization method, and if the first channel is not assigned, the plug-in is skipped and the calculation of the subsequent link based on the score to determine the first target node is normally executed.
[0173] Specifically, the process of normalizing the first result based on the target normalization algorithm includes: querying whether there is a first algorithm corresponding to the target normalization algorithm; if the first algorithm exists, discarding the first result, processing it based on the first algorithm to obtain a third result, and determining the first target node based on the third result; if the first algorithm does not exist, processing the first result based on the target normalization algorithm to obtain a third result, and the third result is used to determine the second target node.
[0174] Specifically, the first algorithm is an algorithm with the same name as the target normalization algorithm.
[0175] In summary, the information processing method provided in this embodiment further includes: reading parameter adjustment information of the target algorithm through the first channel; processing the first result according to the parameter adjustment information to obtain a second target node, wherein the first target node is determined based on the first result, and the second target node is used to run the scheduled instance. In this solution, the parameter adjustment information of the target algorithm is read through the first channel of the plugin, so as to adjust the applied algorithm during the scheduler operation.
[0176] like Figure 7 The diagram shown is an application scenario illustration of an information processing method provided in this application. The diagram includes the entire parsing strategy and the process of creating a custom scheduling profile.
[0177] S701: Parse the scheduling algorithm type;
[0178] S702: Determines whether a type is specified;
[0179] If no type is specified, execute S703; if a type is specified, execute S711.
[0180] S703: Determine if the specified algorithm name exists;
[0181] If it does not exist, execute S704; if it exists, execute S705.
[0182] S704: Error message;
[0183] S705: Determine if a plugin with the same configuration exists;
[0184] When a specified algorithm name exists, the algorithm name represents its configuration, and the existence of a corresponding plugin is determined based on the algorithm name.
[0185] If it does not exist, execute S706; if it exists, execute S707.
[0186] S706: Create plugins corresponding to the algorithms;
[0187] S707: using the existing plug-in;
[0188] S708: judging whether there is a user configuration file with the same configuration based on the plug-in;
[0189] wherein, based on the created plug-in / the existing plug-in, it is judged whether there is a user configuration file with the same configuration strategy as the plug-in.
[0190] If not, S709 is executed; otherwise, S710 is executed.
[0191] S709: creating a user configuration file corresponding to the plug-in;
[0192] S710: using the existing user configuration file;
[0193] After the user configuration file is determined, the process ends.
[0194] S711: judging whether the type is a dynamic library;
[0195] This part is used to judge whether the specified type is a dynamic library or an extension type.
[0196] wherein, if the type is a dynamic library, S712 is executed; otherwise, S715 is executed.
[0197] S712: judging whether there is a mirror and a path;
[0198] If yes, S713 is executed; otherwise, S714 is executed.
[0199] S713: creating an assembly container, copying a dynamic library file, starting an automatic building process, and creating a new base image;
[0200] wherein, if the type of the scheduling algorithm is a dynamic library, it should also have a mirror and a path, based on which the dynamic library file is copied and a new base image is created.
[0201] S714: error reporting;
[0202] S715: judging whether there is a container;
[0203] If the specified type of the scheduling algorithm is not a dynamic library, it should be an extension type.
[0204] wherein, if the type of the scheduling algorithm is an extension type, it should also have a container.
[0205] If not, S716 is executed; otherwise, S717 is executed.
[0206] S716: error reporting;
[0207] S717: start the extended container;
[0208] S718: determine whether the scheduler is scheduling;
[0209] If yes, return to loop execution S718, if no, execute S719.
[0210] This step is to determine that the scheduler completes scheduling and then execute the next step.
[0211] S719: restart the scheduler.
[0212] After restarting the scheduler, the process of parsing the strategy and creating the custom scheduling strategy profile ends.
[0213] As shown in the application scenario of the information processing method provided by the present application, a schematic diagram of the application of the custom scheduler is shown, which is a control surface (Kubernetes), including: etcd, api service and custom scheduling framework, and the dashed box in the figure is the structural content involved in the present application. Figure 8 The custom content (such as ① declaration of scheduling strategy ② referenced scheduling strategy) can be added to the configuration of the custom scheduling strategy of the etcd through the api service based on kubectl.
[0214] Among them, when the algorithm in the custom content includes an extension type, the extension content is set in the extension service; when the algorithm in the custom content includes a dynamic library mode, the dynamic library has corresponding image content.
[0215] Among them, the custom scheduling framework automatically builds a new base image based on the extension content or the dynamic library content by creating a container to realize the prefabrication of the custom scheduling algorithm. The custom scheduling framework has a default scheduling strategy and a custom strategy, and the creating container will also generate a dynamic weight and a normalization algorithm according to the obtained extension content or dynamic library content, and the dynamic table monitoring program monitors the api and updates the dynamic weight and dynamic normalization of the monitored content through the channel. After the custom scheduling framework is restarted based on the new base image, it also needs to be processed based on the dynamic weight and normalization.
[0216] Corresponding to the above-mentioned embodiment of the information processing method provided by the present application, the present application also provides an embodiment of the device applying the information processing method.
[0217] As shown in the structure diagram of the information processing device embodiment provided by the present application, the device includes the following structures: an obtaining module 901, an analyzing module 902, a constructing module 903 and an analyzing module 904.
[0218] Figure 9
[0219] The obtaining module is configured to obtain a running instance to be scheduled.
[0220] The analysis module is configured to analyze the custom scheduling strategy to obtain configuration files.
[0221] The construction module is configured to construct a first base image according to the configuration files.
[0222] The analysis module is configured to analyze and determine a first target node based on the first base image, the first target node being used to run the running instance to be scheduled.
[0223] Optionally, the method further comprises:
[0224] The starting module is configured to start based on the stored second base image, the second base image comprising pre-configured executable files, and the second base image being updated based on the constructed first base image.
[0225] Optionally, the analysis module comprises:
[0226] The parsing unit is configured to parse the declaration of the custom scheduling strategy to obtain an algorithm type contained in the declaration.
[0227] The obtaining unit is configured to obtain configuration files according to an obtaining manner corresponding to the algorithm type.
[0228] Optionally, the obtaining unit is specifically configured to:
[0229] If the algorithm type is a first type, the configuration files are searched for in preset algorithm files.
[0230] If the algorithm type is a second type, preset dynamic library files are obtained based on a specified storage path and basic information of the target application, and the dynamic library files are taken as the configuration files.
[0231] If the algorithm type is a third type, configuration files are created based on preset extension configuration information.
[0232] Optionally, the method further comprises:
[0233] The plug-in module is configured to analyze the custom scheduling strategy to obtain target algorithm configuration information and an analysis link corresponding to the target algorithm configuration information; generate a target plug-in according to the target configuration algorithm information, the target plug-in comprising a first channel, so that parameter adjustment information of a target algorithm is accepted through the first channel in the analysis link.
[0234] Optionally, further comprising:
[0235] a reading module, configured to read parameter adjustment information of a target algorithm through the first channel;
[0236] a processing module, configured to process the first result according to the parameter adjustment information to obtain a second target node, wherein the first target node is determined based on the first result, and the second target node is used to run the running instance to be scheduled.
[0237] Optionally, the processing module is configured to:
[0238] the parameter adjustment information of the target algorithm comprises a dynamic weight value, and the first result is weighted processed according to the dynamic weight value to obtain a second result;
[0239] the second target node is determined according to the second result.
[0240] Optionally, the processing module is configured to:
[0241] the parameter adjustment information of the target algorithm comprises a target normalization algorithm, and the first result is normalized processed according to the target normalization algorithm to obtain a third result;
[0242] the second target node is determined according to the third result.
[0243] It should be noted that the functions of each structure of the information processing device in the embodiment are explained with reference to the foregoing method embodiments, and will not be repeated here.
[0244] To sum up, the information processing device provided in the embodiment is applied to a scheduler, and first acquires a running instance to be scheduled; based on the fact that the template of the running instance to be scheduled obtained through the query contains a self-defined scheduling strategy, the self-defined scheduling strategy is parsed to obtain a configuration file, and the self-defined scheduling strategy contains a strategy of a target application corresponding to the running instance, a first basic image is constructed according to the configuration file, and a target node is analyzed and determined according to the first basic image, and the target node determined through the analysis is combined with the strategy of the target application, different applications select different strategies, and personalized scheduling processing is realized.
[0245] Corresponding to the information processing method provided in the foregoing embodiment of the application, the application further provides an electronic device and a readable storage medium corresponding to the information processing method.
[0246] The electronic device comprises a memory and a processor.
[0247] The memory stores an information processing program.
[0248] The processor is configured to load and execute the information processing program stored in the memory, so as to implement each step of the information processing method according to any one of the preceding embodiments.
[0249] The information processing method is implemented by the electronic device, and the implementation of the information processing method by the electronic device can refer to the preceding embodiments of the information processing method.
[0250] The readable storage medium has a computer program stored thereon, and the computer program is called and executed by the processor, so as to implement each step of the information processing method according to any one of the preceding embodiments.
[0251] The computer program stored in the readable storage medium is executed to implement the information processing method, and the implementation of the information processing method by the computer program can refer to the preceding embodiments of the information processing method.
[0252] The embodiments are described in a progressive manner in the specification, and each embodiment focuses on the difference from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the apparatus provided by the embodiments, the description is relatively simple because the apparatus corresponds to the method. The relevant parts can be referred to the description of the method.
[0253] The above description of the embodiments enables a person skilled in the art to implement or use the present application. Various modifications of the embodiments will be apparent to a person skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features provided herein.
Claims
1. An information processing method, comprising: obtaining a running instance to be scheduled; inquiring whether a custom scheduling strategy is contained in a template of the running instance to be scheduled, and parsing a declaration of the custom scheduling strategy to obtain an algorithm type contained in the declaration, the custom scheduling strategy containing a strategy of a target application corresponding to the running instance to be scheduled; if the algorithm type is a first type, searching a configuration file in a preset algorithm file; if the algorithm type is a second type, obtaining a preset dynamic library file based on a specified storage path and basic information of the target application, and taking the dynamic library file as the configuration file; if the algorithm type is a third type, creating the configuration file based on preset extension configuration information; constructing a first base image according to the configuration file; based on the first base image, analyzing and determining a first target node, the first target node being used for running the running instance to be scheduled.
2. The method of claim 1, before the obtaining a running instance to be scheduled, further comprising: starting based on a stored second base image, the second base image including a pre-configured executable file, and the second base image being updated based on the constructed first base image.
3. The method of claim 1, after the parsing the custom scheduling strategy to obtain a configuration file, further comprising: analyzing the custom scheduling strategy to obtain target algorithm configuration information and an analysis link corresponding to the target algorithm configuration information; generating a target plug-in according to the target algorithm configuration information, the target plug-in containing a first channel, so that parameter adjustment information of a target algorithm is accepted through the first channel in the analysis link.
4. The method of claim 3, after the analyzing and determining a first target node, further comprising: reading parameter adjustment information of a target algorithm through the first channel; processing a first result according to the parameter adjustment information to obtain a second target node, the first target node being determined based on the first result, and the second target node being used for running the running instance to be scheduled.
5. The method of claim 4, the processing a first result according to the parameter adjustment information comprising: based on the parameter adjustment information of the target algorithm including a dynamic weight value, performing weighted processing on the first result according to the dynamic weight value to obtain a second result; determining a second target node according to the second result.
6. The method of claim 4, the processing a first result according to the parameter adjustment information comprising: based on the parameter adjustment information of the target algorithm including a target normalization algorithm, performing normalization processing on the first result according to the target normalization algorithm to obtain a third result; determining a second target node according to the third result.
7. An information processing apparatus, comprising: an obtaining module configured to obtain a running instance to be scheduled; The parsing module is configured to query a template of the to-be-scheduled running instance to obtain a self-defined scheduling strategy, parse the self-defined scheduling strategy to obtain a configuration file, and determine a policy of a target application corresponding to the to-be-scheduled running instance in the self-defined scheduling strategy. The constructing module is configured to construct a first base image according to the configuration file. The analyzing module is configured to analyze and determine a first target node based on the first base image, and the first target node is configured to run the to-be-scheduled running instance. The parsing module includes a parsing unit configured to parse a declaration of the self-defined scheduling strategy to obtain an algorithm type contained in the declaration. The obtaining unit is configured to search for a configuration file in a preset algorithm file if the algorithm type is a first type, obtain a preset dynamic library file based on a specified storage path and basic information of the target application if the algorithm type is a second type, and use the dynamic library file as the configuration file if the algorithm type is a third type.
8. An electronic device comprising: A memory and a processor; The memory stores an information processing program; The processor is configured to load and execute the information processing program stored in the memory to implement each step of the information processing method according to any one of 1-6.
Citation Information
Patent Citations
Container capacity expansion method and device
CN110958138A
Pod balanced scheduling method and device, main node and storage medium
CN111737003A