Component scheduling method and apparatus, electronic device, and storage medium
By conducting multiple tests, scheduling scores, and updates on open-source components, components with high security were selected for scheduling. This resolved the security vulnerabilities in open-source components and improved the security and scheduling stability of the software system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- STATE GRID ELECTRONIC COMMERCE TECH CO LTD
- Filing Date
- 2024-11-21
- Publication Date
- 2026-07-10
Smart Images

Figure CN119622711B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of power technology, and in particular to a component scheduling method, system, electronic device, and storage medium. Background Technology
[0002] Open source components, which declare under open source licenses that the software can be used in commercial applications under specified conditions, are distributed and used, thus making them a popular choice in both commercial and non-commercial software projects.
[0003] Some software application systems utilize open-source components to perform corresponding operations. However, some open-source components may contain known or unknown security vulnerabilities, making them difficult to defend against external attacks and thus impacting the security performance of the software application system. Summary of the Invention
[0004] This disclosure provides a component scheduling method, system, electronic device, and storage medium that can solve at least one of the above-mentioned problems.
[0005] This disclosure provides a component scheduling method, including:
[0006] The following first test scheduling operation is performed multiple times for multiple first components to obtain a first score for each first component. The first test scheduling operation includes: determining two first components from the multiple first components, performing test scheduling on the two first components respectively, scoring the two first components based on the execution time of the two first components in their respective test scheduling processes to obtain a second score for each of the two first components, and updating the first score of each of the two first components based on the second score of each of the two first components.
[0007] In response to the current scheduling request for the plurality of first components, a plurality of second components are determined among the plurality of first components based on the first score of each first component;
[0008] Each of the second components is scheduled separately to obtain the scheduling result of each of the second components;
[0009] Based on the scheduling results of each of the second components, the first score of each of the first components is updated, wherein the updated first score of each of the first components is used in response to the next scheduling request for the plurality of first components.
[0010] According to another aspect of this disclosure, a component scheduling apparatus is provided, comprising:
[0011] The test scheduling module is used to perform the following first test scheduling operations multiple times for multiple first components to obtain a first score for each first component. The first test scheduling operation includes: determining two first components from the multiple first components and performing test scheduling on the two first components respectively; scoring the two first components based on the execution time of the two first components in their respective test scheduling processes to obtain a second score for each of the two first components; and updating the first score of each of the two first components based on their respective second scores.
[0012] The scheduling request response module is used to respond to the current scheduling request for the plurality of first components and determine a plurality of second components among the plurality of first components based on the first score of each first component;
[0013] The scheduling processing module is used to perform scheduling processing on each of the second components respectively, and obtain the scheduling result of each of the second components;
[0014] The rating update module is used to update the first rating of each first component based on the scheduling results of each second component, wherein the updated first rating of each first component is used in response to the next scheduling request for the plurality of first components.
[0015] According to another aspect of this disclosure, an electronic device is provided, comprising:
[0016] At least one processor; and
[0017] The memory is communicatively connected to the at least one processor; wherein,
[0018] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform any component scheduling method in the embodiments of this disclosure.
[0019] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause a computer to perform any component scheduling method in the embodiments of this disclosure.
[0020] By employing the technical solution of this disclosure, multiple first test scheduling operations are performed on multiple first components to obtain a first score for each first component. The first test scheduling operation includes: identifying two first components from the multiple first components, performing test scheduling on each of the two first components, scoring each of the two first components based on their execution time during their respective test scheduling processes to obtain a second score for each of the two first components, and updating the first scores of each of the two first components based on their second scores. In this way, the component score can be determined based on the component's test runtime for subsequent formal scheduling. During formal scheduling, in response to the current scheduling request for the multiple first components, multiple second components are identified from the multiple first components based on their first scores; each second component is scheduled to obtain a scheduling result; and the first scores of each first component are updated based on the scheduling results of each second component. The updated first scores of each first component are used to respond to the next scheduling request for the multiple first components. Thus, multiple components are scheduled simultaneously each time a component is scheduled, and even if one component is attacked, other components can still be used for scheduling without affecting the generation of the scheduling result. Furthermore, each time a component is scheduled, its score is updated based on the scheduling result, so that the scheduling effect is better and the security is higher when scheduling components next time. Attached Figure Description
[0021] Figure 1 This is a flowchart of a component scheduling method according to an embodiment of the present disclosure;
[0022] Figure 2 This is a flowchart of a component scheduling method according to another embodiment of this disclosure;
[0023] Figure 3 This is a structural block diagram of a component scheduling device according to an embodiment of the present disclosure;
[0024] Figure 4 This is a block diagram of an electronic device used to implement embodiments of the present disclosure. Detailed Implementation
[0025] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0026] Figure 1 This is a flowchart of a component scheduling method according to an embodiment of the present disclosure.
[0027] like Figure 1 As shown, the component scheduling method may include:
[0028] S110, perform the following first test scheduling operation multiple times for multiple first components to obtain a first score for each first component, wherein the first test scheduling operation includes: determining two first components from multiple first components, and performing test scheduling on these two first components respectively; scoring these two first components based on the execution time of these two first components in their respective test scheduling processes to obtain a second score for each of the two first components; and updating the first score of each of the two first components based on their respective second scores.
[0029] S120, in response to this scheduling request for multiple first components, based on the first score of each first component, determine multiple second components among the multiple first components;
[0030] S130, perform scheduling processing on each second component separately to obtain the scheduling result of each second component;
[0031] S140, based on the scheduling results of each second component, the first score of each first component is updated, wherein the updated first score of each first component is used to respond to the next scheduling request for multiple first components.
[0032] Understandably, step S110 is a pre-testing step, and steps S120 to S140 are the operational steps for formally responding to the scheduling request. Steps S120-S140 can be executed multiple times. Step S110 can be executed only once or multiple times; it is used to initialize the first score of each first component.
[0033] For example, perform 100 or 1000 one-test scheduling operations for 10 or 20 first components.
[0034] For example, the aforementioned multiple first components are components whose functional similarity exceeds a preset threshold.
[0035] For example, these components can be open source components.
[0036] For example, determining two first components from a plurality of first components can be done randomly or according to the order in which the plurality of first components are arranged.
[0037] For example, test scheduling of the first component can be performed by timing from the start of the test to the end of the test to obtain the execution time of the first component during the test scheduling process.
[0038] For example, each time the above test scheduling operation is executed, the first score of any two first components is updated. After executing this multiple times, the first score of each first component can be obtained.
[0039] Understandably, step S110 above is a test scheduling process executed in a component-safe environment.
[0040] Understandably, in step S120 above, determining multiple second components from multiple first components based on the first scores of each first component may include selecting the top three components or the top five components from the multiple first components based on their scores.
[0041] Understandably, step S130 above is a scheduling operation performed in response to this scheduling request. Its specific process can be any operation that any component can perform, and will not be described in detail here.
[0042] For example, given the scheduling results of each of the second components, one of the identical scheduling results can be selected as the target scheduling result for this scheduling request.
[0043] For example, while obtaining the scheduling result, it is also necessary to perform the above step S140 to update the score of each first component in order to respond to the next scheduling request for the above multiple first components.
[0044] For example, updating the first score of each first component can be done by updating all first components or by updating only some first components. For instance, the first score of the second component among the aforementioned multiple first components can be updated, while the first scores of the non-second components among the aforementioned multiple first components can remain unchanged.
[0045] According to the above implementation method, the following first test scheduling operation is performed multiple times on multiple first components to obtain a first score for each first component. The first test scheduling operation includes: determining two first components from the multiple first components, performing test scheduling on each of the two first components, scoring each of the two first components based on their execution time during their respective test scheduling processes to obtain a second score for each of the two first components, and updating the first scores of each of the two first components based on their second scores. In this way, by performing multiple tests on the components and determining the component scores based on the test runtime, the scores are used for subsequent formal scheduling.
[0046] During formal scheduling, in response to scheduling requests for multiple first components, multiple second components are determined from among the first components based on their initial scores. Each second component is then scheduled separately, yielding a scheduling result. Based on these results, the initial scores of each first component are updated. These updated scores are used to respond to the next scheduling request for multiple first components. In this way, multiple components are scheduled simultaneously each time a component is scheduled. Even if one component is attacked, other components can still be used for scheduling, without affecting the scheduling result. Furthermore, each time a component is scheduled, its score is updated based on the scheduling result, ensuring better scheduling performance and higher security in subsequent component scheduling.
[0047] In one implementation, the two first components are scored based on their respective execution durations during the test scheduling process to obtain their current scores. This includes: if the first execution duration of the third component is longer than the second execution duration of the fourth component, the second score of the third component is determined based on the baseline score value, and the second score of the fourth component is determined based on the baseline score value and the ratio of the first execution duration to the second execution duration.
[0048] Understandably, the third and fourth components are either of the two first components mentioned above.
[0049] For example, the baseline score can be preset, such as 20 points or 30 points.
[0050] For example, the baseline score is used as the second score for the third component. Alternatively, the baseline score is multiplied by a preset coefficient to obtain the second score for the third component.
[0051] For example, the second score of the fourth component is obtained by adding the baseline score and the ratio of the first execution time to the second execution time. Alternatively, the second score of the fourth component is obtained by adding the product of the baseline score, the ratio of the first execution time to the second execution time, and a preset coefficient.
[0052] According to the above implementation method, for the two components of execution test scheduling, the score of the component with a longer execution time is adjusted, for example, its score is increased, while the score of the component with a shorter execution time remains unchanged.
[0053] In one implementation, determining the second score of the fourth component based on a benchmark score and the ratio of the first execution time to the second execution time includes: multiplying the ratio of the first execution time to the second execution time by a first coefficient, and adding the multiplication result to the benchmark score to obtain the second score of the fourth component.
[0054] For example, suppose there are ten open-source components with similar functions. Each component is given an initial first score of 20 points. Two components A and B are randomly selected each time for scheduling and execution.
[0055] The execution processes of these two components are denoted as PA and PB, corresponding to execution times TA and TB. Assuming TA > TB, the latest score for A after execution is SA = 20 + 0.2 * TA / TA. The latest score for B is SB = 20 + 0.2 * TA / TB. Thus, the new first scores for these 10 components are obtained.
[0056] By repeating the above operation 1000 times, the first score of each first component after initialization can be obtained.
[0057] According to the above implementation method, the first score of multiple first components can be determined by the test runtime of multiple first components with similar functions, so as to determine the scheduling priority of the components in the subsequent process.
[0058] The adaptive scheduling process of the components will be described below.
[0059] In one implementation, updating the first score of each first component based on the scheduling results of each second component includes: determining a third score for each second component based on the maximum value among the scheduling resource consumption values of multiple second components and the scheduling resource consumption value of each second component; updating the first score of each second component based on the third score of each second component to obtain an updated first score for each second component; and updating the first score of each first component based on the updated first score of each second component to obtain an updated first score for each first component.
[0060] For example, the scheduling resource consumption values may include CPU consumption values, memory consumption values, execution time, and disk I / O consumption values, etc.
[0061] For example, the third score of the second component can be determined based on the ratio of the maximum value to the scheduling resource consumption value of the second component. For instance, the ratio of the maximum value to the scheduling resource consumption value of the second component can be used as the third score of the second component. Alternatively, the ratio can be multiplied by a coefficient to obtain the third score of the second component.
[0062] For example, when there are multiple scheduling resource consumption values, they can be normalized or averaged to obtain a unified scheduling resource consumption value.
[0063] For example, the third score of each second component is used as the updated first score of each second component.
[0064] For example, based on the updated first scores of each of the plurality of first components, the first scores of each of the second components are updated. Meanwhile, the first scores of the non-second components among the plurality of first components remain unchanged.
[0065] According to the above implementation method, the scheduling results of each second component can be used to update the score of each second component, which facilitates the next scheduling.
[0066] In one implementation, a third score for each second component is determined based on the maximum value among the scheduling resource consumption values of multiple second components, and the scheduling resource consumption value of each second component. This includes: determining a first value, a second value, a third value, and a fourth value based on the maximum value among the CPU consumption values, the maximum value among the memory consumption values, the maximum value among the execution time, and the maximum value among the disk I / O consumption values of multiple second components; and determining the third score for the second component based on the ratio between the first value and the CPU consumption value of the second component, the ratio between the second value and the memory consumption value of the second component, the ratio between the third value and the execution time of the second component, and the ratio between the fourth value and the disk I / O consumption value of the second component.
[0067] For example, weights are determined for the four ratios mentioned above, and then the four ratios are summed using each weight to obtain the third score of the second component.
[0068] For example, the sum of the above four ratios is used to obtain the third score of the second component.
[0069] According to the above implementation method, a third score of the second component under the resource consumption situation during the scheduling process can be calculated, so as to update the first score of the first component.
[0070] In one implementation, based on the third score of each second component, the first score of each second component is updated to obtain the updated first score of each second component, including:
[0071] In the case where there are at least two fifth components with the same scheduling result and at least one sixth component with a scheduling result different from any of the fifth components, the first score of each fifth component is added to the third score of each fifth component to obtain the updated first score of the fifth component, and the first score of each sixth component is subtracted from the third score of each second component to obtain the updated first score of the second component.
[0072] In one implementation, it further includes:
[0073] If the scheduling results of multiple second components are the same, the first score of each second component is added to the second score of each second component to obtain the updated first score of each second component.
[0074] If the scheduling results of multiple second components are different, the first score of each second component is subtracted from the second score of each second component to obtain the updated first score of the second component.
[0075] For example, such as Figure 2 As shown, the process of updating the first score of each second component can be as follows:
[0076] The top 3 ranked components are executed, and the results are categorized into three cases.
[0077] Record the CPU consumption, memory consumption, disk I / O consumption, and execution time for each of the three components.
[0078] The first approach is to respond to the request if the results of the three requests are consistent, and to add points to each of the three components to obtain the first score after the three components are updated.
[0079] The second scenario involves intercepting all three requests if they yield inconsistent results. This is then reported to the system for record-keeping, and points are deducted from each of the three components, updating their initial ratings.
[0080] The third approach is to report the results of the two requests to the system for record-keeping, and add points to the two components with consistent results, deduct points from the inconsistent ones, and update the first score of the three components.
[0081] According to the above implementation method, the primary focus in the adaptive scheduling process of this component is on component security. This is because security vulnerabilities between components are inconsistent (that is, a vulnerability present in component A may not be present in component B because the code logic of the two components is different). The resource consumption of the components is also considered. Three components are selected; this "3" is an empirical value, taking into account both performance (selecting more components consumes more resources) and security (preventing the situation where two components simultaneously possess the same vulnerability, although the probability is extremely low).
[0082] The execution process refers to the process from when the application system receives an HTTP request to when it returns an HTTP request. Execution time refers to the time it takes for a third-party component to receive and return data. Identical execution results (scheduling results) mean that when the three third-party components receive the same data, they return completely identical data.
[0083] For example, if the execution results of the three selected components are all the same, then it can be assumed that all three components are secure in this execution, and points should be added according to the formula logic. If the three request results are not completely consistent, then it proves that there is a security vulnerability in the logic of processing the data in one of the components, and points should be deducted according to the formula logic.
[0084] In this way, components with high average security can be selected, and in the next execution, components with higher scores, i.e., higher security, will be prioritized. If the software system is attacked by an unknown vulnerability, there will be situations where the three request results are not completely consistent. In this case, the score of the component with the unknown vulnerability will decrease, and the score of other components without unknown vulnerabilities may become the highest. Subsequent scheduling will then call the more secure component.
[0085] Therefore, when attackers exploit new, unknown vulnerabilities to attack software systems, components that do not have the unknown vulnerability will be prioritized in the scheduling order, thus preventing the system from being attacked.
[0086] Figure 3 This is a structural block diagram of a component scheduling device according to an embodiment of the present disclosure.
[0087] like Figure 3 As shown, the component scheduling device may include:
[0088] The test scheduling module 310 is used to perform the following first test scheduling operations multiple times for multiple first components to obtain a first score for each first component. The first test scheduling operation includes: determining two first components from the multiple first components and performing test scheduling on the two first components respectively; scoring the two first components based on the execution time of the two first components in their respective test scheduling processes to obtain a second score for each of the two first components; and updating the first score of each of the two first components based on their respective second scores.
[0089] The scheduling request response module 320 is used to respond to the current scheduling request for the plurality of first components, and to determine a plurality of second components among the plurality of first components based on the first score of each first component.
[0090] The scheduling processing module 330 is used to perform scheduling processing on each of the second components to obtain the scheduling results of each of the second components;
[0091] The rating update module 340 is used to update the first rating of each first component based on the scheduling results of each second component, wherein the updated first rating of each first component is used in response to the next scheduling request for the plurality of first components.
[0092] In one embodiment, the test scheduling module 310 is specifically used for:
[0093] If the first execution time of the third component is greater than the second execution time of the fourth component in the two first components, the second score of the third component is determined based on the benchmark score value, and the second score of the fourth component is determined based on the benchmark score value and the ratio of the first execution time to the second execution time.
[0094] In one implementation, determining the second score of the fourth component based on the benchmark score value and the ratio of the first execution time to the second execution time includes: multiplying the ratio between the first execution time and the second execution time by a first coefficient, and adding the multiplication result to the benchmark score value to obtain the second score of the fourth component.
[0095] In one embodiment, the scoring update module 340 includes:
[0096] The scoring calculation unit is used to determine the third score of each of the second components based on the maximum value of the scheduling resource consumption values of the plurality of second components and the scheduling resource consumption values of each of the second components.
[0097] The first rating update unit is used to update the first rating of each second component based on the third rating of each second component, so as to obtain the updated first rating of each second component.
[0098] The second rating update unit is used to update the first rating of each first component based on the updated first rating of each second component, so as to obtain the updated first rating of each first component.
[0099] In one embodiment, the scoring calculation unit is specifically used to: determine a first value, a second value, a third value, and a fourth value based on the maximum value among the CPU consumption values, the maximum value among the memory consumption values, the maximum value among the execution time values, and the maximum value among the disk I / O consumption values of the plurality of second components; and determine a third score for the second component based on the ratio between the first value and the CPU consumption value of the second component, the ratio between the second value and the memory consumption value of the second component, the ratio between the third value and the execution time of the second component, and the ratio between the fourth value and the disk I / O consumption value of the second component.
[0100] In one implementation, the first rating update unit is specifically configured to: when there are at least two fifth components with the same scheduling result and at least one sixth component with a scheduling result different from any of the fifth components among the plurality of second components, add the first rating of each fifth component to the third rating of each fifth component to obtain the updated first rating of the fifth component, and subtract the third rating of each second component from the first rating of each sixth component to obtain the updated first rating of the second component.
[0101] In one embodiment, the first score update unit is further configured to: when the scheduling results of the plurality of second components are the same, add the first score of each second component to the second score of each second component to obtain the updated first score of each second component; when the scheduling results of the plurality of second components are different, subtract the second score of each second component from the first score of each second component to obtain the updated first score of the second component.
[0102] The specific functions and examples of each module and submodule of the system in this disclosure embodiment can be found in the relevant descriptions of the corresponding steps in the above method embodiments, and will not be repeated here.
[0103] According to embodiments of this disclosure, the above-described method can be applied to an electronic device and a readable storage medium.
[0104] Figure 4A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0105] like Figure 4 As shown, device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 602 or a computer program loaded from storage unit 608 into random access memory (RAM) 603. RAM 603 may also store various programs and data required for the operation of device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0106] Multiple components in device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of monitors, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0107] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as a component scheduling method. For example, in some embodiments, a component scheduling method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of a component scheduling method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform a component scheduling method by any other suitable means (e.g., by means of firmware).
[0108] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0109] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0110] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0111] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0112] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0113] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0114] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0115] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A component scheduling method, characterized in that, include: The following first test scheduling operation is performed multiple times for multiple first components to obtain a first score for each first component. The first test scheduling operation includes: determining two first components from the multiple first components, performing test scheduling on the two first components respectively, scoring the two first components based on the execution time of the two first components in their respective test scheduling processes to obtain a second score for each of the two first components, and updating the first score of each of the two first components based on the second score of each of the two first components. In response to the current scheduling request for the plurality of first components, a plurality of second components are determined among the plurality of first components based on the first score of each first component; Each of the second components is scheduled separately to obtain the scheduling result of each of the second components; Based on the scheduling results of each of the second components, the first score of each of the first components is updated, wherein the updated first score of each of the first components is used in response to the next scheduling request for the plurality of first components.
2. The method according to claim 1, characterized in that, The scoring of the two first components based on their execution time during their respective test scheduling processes yields their current scores, including: If the first execution time of the third component is greater than the second execution time of the fourth component in the two first components, the second score of the third component is determined based on the benchmark score value, and the second score of the fourth component is determined based on the benchmark score value and the ratio of the first execution time to the second execution time.
3. The method according to claim 2, characterized in that, The determination of the second score of the fourth component based on the benchmark score value and the ratio of the first execution time to the second execution time includes: The ratio between the first execution time and the second execution time is multiplied by the first coefficient, and the result of the multiplication is added to the benchmark score to obtain the second score of the fourth component.
4. The method according to claim 1, characterized in that, The step of updating the first score of each of the first components based on the scheduling results of each of the second components includes: Based on the maximum value among the scheduling resource consumption values of the plurality of second components, and the scheduling resource consumption value of each second component, a third score is determined for each second component. Based on the third score of each of the second components, the first score of each of the second components is updated to obtain the updated first score of each of the second components. Based on the updated first scores of each of the second components, the first scores of each of the first components are updated to obtain the updated first scores of each of the first components.
5. The method according to claim 4, characterized in that, The third score for each second component is determined based on the maximum value among the scheduling resource consumption values of the plurality of second components and the scheduling resource consumption value of each second component, including: The first value, the second value, the third value, and the fourth value are determined based on the maximum value among the central processing unit consumption value, the maximum value among the memory consumption value, the maximum value among the execution time value, and the maximum value among the disk input / output consumption value of the plurality of second components, respectively. The third score of the second component is determined based on the ratio between the first value and the CPU consumption value of the second component, the ratio between the second value and the memory consumption value of the second component, the ratio between the third value and the execution time of the second component, and the ratio between the fourth value and the disk I / O consumption value of the second component.
6. The method according to claim 4, characterized in that, The step of updating the first score of each of the second components based on the third score of each of the second components to obtain the updated first score of each of the second components includes: In the case where there are at least two fifth components with the same scheduling result and at least one sixth component with a scheduling result different from any of the fifth components, the first score of each fifth component is added to the third score of each fifth component to obtain the updated first score of the fifth component, and the third score of each second component is subtracted from the first score of each sixth component to obtain the updated first score of the second component.
7. The method according to claim 6, characterized in that, Also includes: If the scheduling results of the multiple second components are the same, the first score of each second component is added to the second score of each second component to obtain the updated first score of each second component. If the scheduling results of the multiple second components are different, the first score of each second component is subtracted from the second score of each second component to obtain the updated first score of the second component.
8. A component scheduling device, characterized in that, include: The test scheduling module is used to perform the following first test scheduling operations multiple times for multiple first components to obtain a first score for each first component. The first test scheduling operation includes: determining two first components from the multiple first components and performing test scheduling on the two first components respectively; scoring the two first components based on the execution time of the two first components in their respective test scheduling processes to obtain a second score for each of the two first components; and updating the first score of each of the two first components based on their respective second scores. The scheduling request response module is used to respond to the current scheduling request for the plurality of first components and determine a plurality of second components among the plurality of first components based on the first score of each first component; The scheduling processing module is used to perform scheduling processing on each of the second components respectively, and obtain the scheduling result of each of the second components; The rating update module is used to update the first rating of each first component based on the scheduling results of each second component, wherein the updated first rating of each first component is used in response to the next scheduling request for the plurality of first components.
9. An electronic device, comprising: At least one processor; as well as The memory that is communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein, Computer instructions are used to cause a computer to perform the method according to any one of claims 1-7.