CN117076072A - Container borrowing method and related device - Google Patents

Container borrowing method and related device Download PDF

Info

Publication number
CN117076072A
CN117076072A CN202311044266.1A CN202311044266A CN117076072A CN 117076072 A CN117076072 A CN 117076072A CN 202311044266 A CN202311044266 A CN 202311044266A CN 117076072 A CN117076072 A CN 117076072A
Authority
CN
China
Prior art keywords
pod
borrowing
determining
pods
downstream
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311044266.1A
Other languages
Chinese (zh)
Inventor
朱佳
李科君
吕江昭
刘海锋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202311044266.1A priority Critical patent/CN117076072A/en
Publication of CN117076072A publication Critical patent/CN117076072A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The application discloses a container borrowing method and a related device, which are applied to an upstream cluster in a container borrowing system, wherein the container borrowing system comprises the upstream cluster and N downstream clusters, and N is an integer greater than 1; the method comprises the following steps: determining the number of first pod to be borrowed to obtain m pods, wherein m is a positive integer; sending a first borrowing request to each of the N downstream clusters, where the first borrowing request is used to request the corresponding downstream cluster to determine a second number of pods that can be supported; receiving the supportable second pod numbers returned by each of the N downstream clusters to obtain N second pod numbers; determining the sum of the N second pod numbers to obtain y; and when y is greater than or equal to m, selecting m pod from the y pod, and calling the m pod. The embodiment of the application can improve the borrowing efficiency of the container.

Description

Container borrowing method and related device
Technical Field
The present application relates to the field of electronic technology or communication technology, and in particular, to a container borrowing method and a related device.
Background
Along with the wide popularization and application of electronic devices (such as mobile phones, tablet computers and the like), the electronic devices can support more and more applications, have more and more functions, and develop towards diversification and individuation, so that the electronic devices become indispensable electronic articles in the life of users. Electronic devices are also becoming more popular in terms of cloud applications, and cloud computing services provided by the cloud applications greatly improve performance of the electronic devices.
In practical application, a containerized cloud platform based on kubernetes clusters gradually becomes a main stream, but the capacity of a single cluster is limited, so that a multi-cluster combined scheme appears, and at present, the container borrowing efficiency is low, so that the problem of how to improve the container borrowing efficiency is to be solved.
Disclosure of Invention
The embodiment of the application provides a container borrowing method and a related device, which can improve the container borrowing efficiency.
In a first aspect, an embodiment of the present application provides a container borrowing method, which is applied to an upstream cluster in a container borrowing system, where the container borrowing system includes the upstream cluster and N downstream clusters, where N is an integer greater than 1; the method comprises the following steps:
determining the number of first pod to be borrowed to obtain m pods, wherein m is a positive integer;
sending a first borrowing request to each of the N downstream clusters, where the first borrowing request is used to request the corresponding downstream cluster to determine a second number of pods that can be supported;
receiving the supportable second pod numbers returned by each of the N downstream clusters to obtain N second pod numbers; determining the sum of the N second pod numbers to obtain y;
And when y is greater than or equal to m, selecting m pod from the y pod, and calling the m pod.
In a second aspect, an embodiment of the present application provides a container borrowing apparatus, which is applied to an upstream cluster in a container borrowing system, where the container borrowing system includes the upstream cluster and N downstream clusters, where N is an integer greater than 1; the device comprises: a determining unit, a transmitting unit, a receiving unit and a selecting unit, wherein,
the determining unit is used for determining the first pod number to be borrowed to obtain m pods, wherein m is a positive integer;
the sending unit is configured to send a first borrowing request to each of the N downstream clusters, where the first borrowing request is used to request the corresponding downstream cluster to determine a second pod number that can be supported;
the receiving unit is configured to receive the supportable second pod numbers returned by each of the N downstream clusters, to obtain N second pod numbers; determining the sum of the N second pod numbers to obtain y;
the selecting unit is configured to select m pod from the y pods and call the m pods when the y is greater than or equal to m.
In a third aspect, an embodiment of the present application provides an electronic device including a processor, a memory for storing one or more programs and configured to be executed by the processor, the programs including instructions for performing part or all of the steps as described by the first party.
In a fourth aspect, embodiments of the present application provide a non-volatile computer-readable storage medium, where the non-volatile computer-readable storage medium stores a computer program for electronic data exchange, where the computer program causes a computer to perform some or all of the steps described in the first aspect of the embodiments of the present application.
In a fifth aspect, embodiments of the present application provide a computer program product, wherein the computer program product comprises a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in the first aspect of the embodiments of the present application. The computer program product may be a software installation package.
The embodiment of the application has the following beneficial effects:
it can be seen that, the container borrowing method and the related device described in the embodiments of the present application are applied to an upstream cluster in a container borrowing system, where the container borrowing system includes an upstream cluster and N downstream clusters, N is an integer greater than 1, a first pod number to be borrowed is determined, m pods are obtained, m is a positive integer, a first borrowing request is sent to each of the N downstream clusters, the first borrowing request is used to request the corresponding downstream cluster to determine a supportable second pod number, and the supportable second pod number returned by each of the N downstream clusters is received, so as to obtain N second pod numbers; and determining the sum of the N second pod numbers to obtain y, selecting m pods from the y pods when y is greater than or equal to m, calling the m pods, and adopting bidirectional negotiation and micro-scheduling to realize container borrowing, namely, the bidirectional negotiation is that an upstream cluster is responsible for filling more scheduling requirements in borrowing description, a downstream can decide to be not accepted according to own characteristics, the micro-scheduling means that the problem that the resource condition cannot be sensed in fine granularity is perfectly avoided through a pre-scheduling technology, and the downstream does not need to do any active reporting, so that the scheduling success rate is increased, and the container borrowing efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 2 is a schematic software structure of an electronic device according to an embodiment of the present application;
FIG. 3A is a schematic diagram of a container borrowing system according to an embodiment of the present application;
FIG. 3B is a schematic diagram of a container borrowing system according to an embodiment of the present application;
FIG. 3C is a flow chart of a container borrowing method according to an embodiment of the present application;
FIG. 3D is a flow chart of another method for borrowing containers according to an embodiment of the present application;
FIG. 3E is a flow chart of another method for borrowing containers according to an embodiment of the application;
FIG. 3F is a flow chart of another method for borrowing containers according to an embodiment of the application;
FIG. 4 is a flow chart of another method for borrowing containers according to an embodiment of the application;
fig. 5 is a schematic structural diagram of another electronic device according to an embodiment of the present application;
fig. 6 is a functional block diagram of a container borrowing device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
For a better understanding of aspects of embodiments of the present application, related terms and concepts that may be related to embodiments of the present application are described below.
The terms first, second and the like in the description and in the claims and in the above-described figures are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
In a specific implementation, in an embodiment of the present application, the electronic devices in the upstream cluster may include various devices with computing functions, for example, a handheld device (smart phone, tablet computer, etc.), a smart car, a vehicle-mounted device (navigator, auxiliary reversing system, automobile recorder, automobile refrigerator, etc.), a wearable device (smart bracelet, wireless headset, smart watch, smart glasses, etc.), a computing device or other processing device connected to a wireless modem, and various types of User Equipment (UE), a Mobile Station (MS), a virtual reality/augmented reality device, a terminal device (terminal device), a tag device, etc., where the electronic device may also be a base Station, a server.
The electronic device may further include an intelligent home device, where the intelligent home device may be at least one of: the intelligent sound box, the intelligent camera, the intelligent electric cooker, the intelligent wheelchair, the intelligent massage chair, the intelligent furniture, the intelligent dish washer, the intelligent television, the intelligent refrigerator, the intelligent electric fan, the intelligent warmer, the intelligent clothes hanger, the intelligent lamp, the intelligent router, the intelligent switch board, the intelligent humidifier, the intelligent air conditioner, the intelligent door, the intelligent window, the intelligent cooking bench, the intelligent disinfection cabinet, the intelligent toilet, the sweeping robot and the like are not limited herein.
The first part, the software and hardware operation environment of the technical scheme disclosed by the application is introduced as follows.
As shown, fig. 1 shows a schematic structural diagram of an electronic device 100. Electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a compass 190, a motor 191, an indicator 192, a camera 193, a display 194, a subscriber identity module (subscriber identification module, SIM) card interface 195, and the like.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor AP, a modem processor, a graphics processor GPU, an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor NPU, etc. Wherein the different processing units may be separate components or may be integrated in one or more processors. In some embodiments, the electronic device 100 may also include one or more processors 110. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution. In other embodiments, memory may also be provided in the processor 110 for storing instructions and data. Illustratively, the memory in the processor 110 may be a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it may be called directly from memory. This avoids repeated accesses and reduces the latency of the processor 110, thereby improving the efficiency of the electronic device 100 in processing data or executing instructions. The processor may also include an image processor, which may be an image preprocessor (preprocess image signal processor, pre-ISP), which may be understood as a simplified ISP, which may also perform some image processing operations, e.g. may obtain image statistics.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include inter-integrated circuit (inter-integrated circuit, I2C) interfaces, inter-integrated circuit audio (inter-integrated circuit sound, I2S) interfaces, pulse code modulation (pulse code modulation, PCM) interfaces, universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interfaces, mobile industry processor interfaces (mobile industry processor interface, MIPI), general-purpose input/output (GPIO) interfaces, SIM card interfaces, and/or USB interfaces, among others. The USB interface 130 is an interface conforming to the USB standard, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and a peripheral device. The USB interface 130 may also be used to connect headphones through which audio is played.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also employ different interfacing manners in the above embodiments, or a combination of multiple interfacing manners.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle times, battery health (leakage, impedance), and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G/6G, etc. applied on the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (FLED), a mini light-emitting diode (mini light-emitting diode), microLed, micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device 100 may include 1 or more display screens 194.
The electronic device 100 may implement a photographing function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, so that the electrical signal is converted into an image visible to naked eyes. ISP can also perform algorithm optimization on noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature, etc. of the photographed scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, electronic device 100 may include 1 or more cameras 193.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store one or more computer programs, including instructions. The processor 110 may cause the electronic device 100 to execute the method of displaying page elements provided in some embodiments of the present application, as well as various applications, data processing, and the like, by executing the above-described instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. The storage program area can store an operating system; the storage program area may also store one or more applications (such as gallery, contacts, etc.), etc. The storage data area may store data created during use of the electronic device 100 (e.g., photos, contacts, etc.), and so on. In addition, the internal memory 121 may include high-speed random access memory, and may also include nonvolatile memory, such as one or more disk storage units, flash memory units, universal flash memory (universal flash storage, UFS), and the like. In some embodiments, processor 110 may cause electronic device 100 to perform the methods of displaying page elements provided in embodiments of the present application, as well as other applications and data processing, by executing instructions stored in internal memory 121, and/or instructions stored in a memory provided in processor 110. The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
The pressure sensor 180A is used for sensing a pressure signal, and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A is of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a capacitive pressure sensor comprising at least two parallel plates with conductive material. The capacitance between the electrodes changes when a force is applied to the pressure sensor 180A. The electronic device 100 determines the strength of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the electronic apparatus 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 may also calculate the location of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations that act on the same touch location, but at different touch operation strengths, may correspond to different operation instructions. For example: and executing an instruction for checking the short message when the touch operation with the touch operation intensity smaller than the first pressure threshold acts on the short message application icon. And executing an instruction for newly creating the short message when the touch operation with the touch operation intensity being greater than or equal to the first pressure threshold acts on the short message application icon.
The gyro sensor 180B may be used to determine a motion gesture of the electronic device 100. In some embodiments, the angular velocity of electronic device 100 about three axes (i.e., X, Y and Z axis) may be determined by gyro sensor 180B. The gyro sensor 180B may be used for photographing anti-shake. For example, when the shutter is pressed, the gyro sensor 180B detects the shake angle of the electronic device 100, calculates the distance to be compensated by the lens module according to the angle, and makes the lens counteract the shake of the electronic device 100 through the reverse motion, so as to realize anti-shake. The gyro sensor 180B may also be used for navigating, somatosensory game scenes.
The acceleration sensor 180E may detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity may be detected when the electronic device 100 is stationary. The electronic equipment gesture recognition method can also be used for recognizing the gesture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
The ambient light sensor 180L is used to sense ambient light level. The electronic device 100 may adaptively adjust the brightness of the display 194 based on the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust white balance when taking a photograph. Ambient light sensor 180L may also cooperate with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent false touches.
The fingerprint sensor 180H is used to collect a fingerprint. The electronic device 100 may utilize the collected fingerprint feature to unlock the fingerprint, access the application lock, photograph the fingerprint, answer the incoming call, etc.
The temperature sensor 180J is for detecting temperature. In some embodiments, the electronic device 100 performs a temperature processing strategy using the temperature detected by the temperature sensor 180J. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 performs a reduction in the performance of a processor located in the vicinity of temperature sensor 180J in order to reduce power consumption to implement thermal protection. In other embodiments, when the temperature is below another threshold, the electronic device 100 heats the battery 142 to avoid the low temperature causing the electronic device 100 to be abnormally shut down. In other embodiments, when the temperature is below a further threshold, the electronic device 100 performs boosting of the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperatures.
The touch sensor 180K, also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194.
By way of example, fig. 2 shows a block diagram of the software architecture of the electronic device 100. The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system libraries, and a kernel layer, respectively. The application layer may include a series of application packages.
As shown in fig. 2, the application layer may include applications for cameras, gallery, calendar, phone calls, maps, navigation, WLAN, bluetooth, music, video, short messages, etc.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in FIG. 2, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is used to provide the communication functions of the electronic device 100. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
Android run time includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media library (media library), three-dimensional graphics processing library (e.g., openGL ES), 2D graphics engine (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio video encoding formats, such as: MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
In a second aspect, a method for borrowing containers and a related apparatus according to embodiments of the present application are described below.
The containerized cloud platform based on kubernetes clusters gradually becomes the main stream, but the capacity of a single cluster is limited, so that a multi-cluster combined scheme appears, and two main modes exist: cluster federation and virtual nodes.
In the embodiment of the application, the virtual node refers to that the real node is added into the kubernetes cluster caused by other services or platform pseudo, so that the cluster has expansibility. The true nodes refer to the true nodes in the Kubernetes cluster. The Kubernetes cluster can be called k8s for short, and is an open-source Linux container automation operation and maintenance platform.
As shown in fig. 3A, cluster federation (kubernetes federation): that is, a plurality of clusters are connected together, and generally, an upper layer cluster is required to be used as a manager; the upstream cluster includes a plurality of nodes and each downstream cluster also includes a plurality of nodes.
As shown in fig. 3B, virtual node (tensil kube): more clusters are pseudo-created into one virtual node and added into the original cluster, namely, an upstream cluster can comprise the virtual node and at least one real node, and a downstream cluster comprises a plurality of real nodes.
In particular implementations, one problem that multi-clusters face is that containers need to be scheduled across clusters. And the cluster federation and virtual node concrete implementation only make a layer of scheduling from the macroscopic level. Such as: randomly selecting a downstream cluster; and, for example: selecting a subordinate cluster nearby according to the geographic position; however, the container arrives at the downstream cluster and cannot guarantee successful dispatch, as shown in fig. 3C, assuming that node 1 has 3 cores and node 2 has 5 cores in a cluster, this will fail dispatch because, for example, the container needs an 8-core CPU, which knows that the cluster has 8 cores in its entirety, but may be scattered over 2 nodes. The most essential reason is that the method relies on the downstream cluster to actively report the own resource state, but does not have a good method for sensing the fine-grained node resource. Once a scheduling failure occurs, a secondary rescheduling may be caused.
In addition, the cluster federation and virtual nodes require that upstream and downstream (upstream may be better, especially downstream) are brand new clusters, so that scheduling allocation is performed on the cluster level by the cluster federation and virtual nodes; conversely, the entry is not very friendly to the stock state.
In order to solve the defects of the related art, the embodiment of the application provides a container borrowing method, which is applied to an upstream cluster in a container borrowing system, wherein the container borrowing system comprises the upstream cluster and N downstream clusters, and N is an integer greater than 1; the method comprises the following steps:
determining the number of first pod to be borrowed to obtain m pods, wherein m is a positive integer;
sending a first borrowing request to each of the N downstream clusters, where the first borrowing request is used to request the corresponding downstream cluster to determine a second number of pods that can be supported;
receiving the supportable second pod numbers returned by each of the N downstream clusters to obtain N second pod numbers; determining the sum of the N second pod numbers to obtain y;
and when y is greater than or equal to m, selecting m pod from the y pod, and calling the m pod.
It can be seen that, the container borrowing method described in the embodiment of the present application is applied to an upstream cluster in a container borrowing system, where the container borrowing system includes an upstream cluster and N downstream clusters, N is an integer greater than 1, a first pod number to be borrowed is determined, m is obtained, m is a positive integer, a first borrowing request is sent to each of the N downstream clusters, the first borrowing request is used to request the corresponding downstream cluster to determine a supportable second pod number, and the supportable second pod number returned by each of the N downstream clusters is received, so as to obtain N second pod numbers; and determining the sum of the N second pod numbers to obtain y, selecting m pods from the y pods when y is greater than or equal to m, calling the m pods, and adopting bidirectional negotiation and micro-scheduling to realize container borrowing, namely, the bidirectional negotiation is that an upstream cluster is responsible for filling more scheduling requirements in borrowing description, a downstream can decide to be not accepted according to own characteristics, the micro-scheduling means that the problem that the resource condition cannot be sensed in fine granularity is perfectly avoided through a pre-scheduling technology, and the downstream does not need to do any active reporting, so that the scheduling success rate is increased, and the container borrowing efficiency is improved.
Further, in order to solve the drawbacks in the related art, referring to fig. 3D, fig. 3D is a flow chart of a container borrowing method according to an embodiment of the present application, which is applied to an upstream cluster in a container borrowing system, where the container borrowing system includes the upstream cluster and N downstream clusters, and N is an integer greater than 1; as shown, the container borrowing method may include the steps of:
301. and determining the first pod number to be borrowed to obtain m pods, wherein m is a positive integer.
In the embodiment of the application, borrowing refers to scheduling pod to another cluster, which is called borrowing. The first pod number to be borrowed can be preset or default, and in specific implementation, the first pod number to be borrowed can be determined to obtain m pods, namely m pods to be borrowed, where m is a positive integer.
In a specific implementation, the first pod number of the designated pod type to be borrowed can be determined to obtain m pods, and the designated pod type can be preset or default of the system.
In a specific implementation, the number of first pod of the designated function to be borrowed can be determined to obtain m pods, and the designated function can be preset or default in the system.
In the embodiment of the application, pod is the minimum unit of creation or deployment of Kubernetes. One pod encloses one or more containers. A container is a lightweight virtualization technology that packages applications and their dependent items together for execution in different computer environments.
Wherein, the upstream cluster may include a plurality of nodes, and the downstream cluster may also include a plurality of nodes. For example, a Kubernetes cluster is a collection of many nodes.
In some possible examples, the determining the first pod number to borrow in step 301 may include the following steps:
11. determining target task parameters of a target task;
12. determining the number of reference pod corresponding to the target task parameter;
13. determining a target network parameter;
14. determining a target optimization parameter corresponding to the target network parameter;
15. and optimizing the reference pod number according to the target optimization parameter to obtain the first pod number.
In the embodiment of the application, the target task can be a system task or a task set by a user. The target task parameters may include at least one of: the task type, task priority, task importance level, task difficulty coefficient, etc., are not limited herein.
Wherein the target network parameters may include at least one of: network bandwidth, network rate, network delay, network size, etc., are not limited herein.
In the embodiment of the application, the target task parameters of the target task are determined, the mapping relation between the preset task parameters and the pod number can be stored in advance, and the reference pod number corresponding to the target task parameters is determined based on the mapping relation.
Further, a target network parameter may be obtained, a mapping relationship between a preset network parameter and an optimization parameter is stored in advance, a target optimization parameter corresponding to the target network parameter is determined based on the mapping relationship, and the reference pod number is optimized according to the target optimization parameter to obtain a first pod number, which is specifically as follows:
first pod number= (1+ target optimization parameter) reference pod number
In this way, on one hand, the number of pod corresponding to the task parameter can be obtained, on the other hand, the corresponding optimization parameter can be determined based on the network parameter, and the number of pod corresponding to the task parameter is optimized based on the optimization parameter, so that the number of pod suitable for the task and the network environment can be obtained, and the number of pod required by meeting the task and the network environment can be completed at one time, namely, the container borrowing efficiency can be improved.
In some possible examples, the method may further comprise the steps of:
s1, sending a test borrowing request to each of the N downstream clusters, wherein the test borrowing request is used for requesting the corresponding downstream cluster to determine the number of the pod which can be supported;
s2, receiving the supportable pod number returned by each downstream cluster in the N downstream clusters to obtain N reference pod numbers; and determining the sum of the N reference pod numbers to obtain b, wherein b is greater than or equal to m.
In the embodiment of the application, a test borrowing request can be sent to each of N downstream clusters, the test borrowing request is used for requesting the corresponding downstream cluster to determine the supportable pod number, and then the supportable pod number returned by each of the N downstream clusters is received to obtain N reference pod numbers; and determining the sum of the N reference pod numbers to obtain b, wherein b is greater than or equal to m, namely the borrowing number which can be supported by the container borrowing system can be tested in advance, and further, the pod number which can be born by the container borrowing system can be obtained on the basis of the pod number which can be supported by the current environment.
302. And sending a first borrowing request to each of the N downstream clusters, wherein the first borrowing request is used for requesting the corresponding downstream cluster to determine the second pod number capable of being supported.
In the embodiment of the application, the upstream cluster can send the first borrowing request to each downstream cluster in the N downstream clusters, and the first borrowing request is used for requesting the corresponding downstream cluster to determine the supportable second pod number, so that the supportable pod number statistics can be realized.
303. Receiving the supportable second pod numbers returned by each of the N downstream clusters to obtain N second pod numbers; and determining the sum of the N second pod numbers to obtain y.
In the embodiment of the application, the number of supportable second pod returned by each downstream cluster in the N downstream clusters can be received to obtain the number of N second pod, and the sum of the number of N second pod is determined to obtain y.
304. And when y is greater than or equal to m, selecting m pod from the y pod, and calling the m pod.
In the embodiment of the application, when y is greater than or equal to m, selecting m pod from y pods, and calling the m pod.
In some possible examples, the step 304, selecting m pod from the y pods, and calling the m pod may include the following steps:
41. determining the borrowing grade corresponding to each pod in the N second pods, and obtaining y borrowing grades;
42. and determining m borrowing levels in front of the borrowing levels from the y borrowing levels, and calling the pod corresponding to the m borrowing levels.
In the embodiment of the application, the borrowing grade corresponding to each pod in the N second pods can be determined, y borrowing grades are obtained, then m borrowing grades in front of the borrowing grade are determined from the y borrowing grades, and the pods corresponding to the m borrowing grades are called, so that the supportable pods with high borrowing grades can be preferentially selected, and the improvement of the container borrowing efficiency is facilitated.
In some possible examples, the step 41 of determining the borrowing level corresponding to each of the N second pod numbers to obtain y borrowing levels may include the following steps:
411. determining channel parameters of a communication link between the upstream cluster and each of the N downstream clusters to obtain N channel parameters;
412. and determining the y borrowing levels according to the N channel parameters.
In the embodiment of the present application, the channel parameters may include at least one of the following: channel quality assessment value, channel bandwidth, channel network rate, etc., are not limited herein.
In a specific implementation, channel parameters of a communication link between an upstream cluster and each downstream cluster in N downstream clusters can be determined to obtain N channel parameters, a mapping relation between preset channel parameters and borrowing levels can be stored in advance, the borrowing level corresponding to each channel parameter is determined to obtain the borrowing level corresponding to each channel, and y borrowing levels can be obtained.
In some possible examples, the method may further comprise the steps of:
b1, when y is smaller than m, selecting y pod from y pod, and calling the y pod;
b2, determining the number of the third pod to be borrowed, and obtaining m-y pods;
b3, sending a second borrowing request to each of the N downstream clusters, wherein the second borrowing request is used for requesting the corresponding downstream cluster to determine the fourth pod number which can be supported;
b4, receiving the supportable fourth pod number returned by each downstream cluster in the N downstream clusters, and obtaining N fourth pod numbers; determining the sum of the number of the N fourth pod to obtain w;
and B5, when w is greater than or equal to m-y, selecting m-y pod from w pod, and calling the m-y pod.
In the embodiment of the application, when y is smaller than m, y pod is selected from y pods, y pods are called, namely when y is smaller than m, y pods can be borrowed at most once, the number of remaining third pods needing borrowing can be determined, m-y pods are obtained, a second borrowing request is sent to each of N downstream clusters, the second borrowing request is used for requesting the corresponding downstream cluster to determine the number of supportable fourth pod, the number of supportable fourth pod returned by each of N downstream clusters is received, N fourth pod numbers are obtained, the sum of N fourth pod numbers is determined, w is obtained, when w is larger than or equal to m-y, m-y pod is selected from w pod, and m-y pod is called, namely when y is smaller than m, the fact that all the pods needing to be called cannot be called once is indicated, the borrowing operation can be completed again, and the remaining container can be borrowed again, and the borrowing operation can be completed.
In the embodiment of the application, a BorrowDescribe CRD, which can be called as a borrowing description, is designed in the borrowing process, and is called BD for short. Custom resource definition (custom resource define, CRD), is one way for Kubernetes to let the developer go to custom resources in order to improve scalability. In this description, several pieces of content are mainly contained: podReference: a pod reference indicating to which pod he corresponds that needs to be borrowed; borrowPolicy: a borrowing policy, such as in which time period to perform borrowing; clusteraffinity: cluster affinity, which represents which clusters are selected by upstream subjective intent; acceptCycle: when a certain pod borrowing is supported downstream, an upstream decision needs to be waited, but the upstream decision cannot wait without limitation, a wait strategy can be set, and the simplest is to set a wait time. I.e. the cluster implements a pre-scheduling technique, i.e. the pod is run in a simulation of the scheduling procedure, but not actually implemented.
In the embodiment of the application, novirtual indicates not to borrow, pendingVirtual indicates to borrow from other clusters when the original cluster scheduling is not out, mustVirtual is not in the original cluster scheduling, and is directly borrowed from other clusters.
By way of illustration, as shown in fig. 3E, wherein an upstream cluster and 3 downstream clusters may form a container borrowing system. In particular, when a pod is marked as requiring borrowing (pending virtual/MustVirtual), a corresponding borrowing description is created for the pod, which can be understood as issuing a task, equivalent to asking the downstream cluster: "who can schedule this pod". Therefore, after the downstream cluster senses the borrowing description, the downstream cluster automatically judges whether the demand can be met and informs the upstream cluster.
Specifically, the upstream cluster may send "i want to schedule this pod (specific pod)" to each downstream cluster, and then each downstream cluster may feed back a response result, for example, "i can support", and when there are multiple supported downstream clusters, then a required number of specific pods may be selected, that is, "i.e." i have selected "to the selected downstream cluster.
Further, as shown in fig. 3F, the steps are as follows: the pod is created in an upstream cluster, and metadata of the pod is slightly modified according to the borrowing level of the pod, which belongs to technical details and is not developed as a focus of the document; looking at the borrowed level of pod, there are two cases discussed in expansion (NoVirtual indicates not borrowed, not said here): pendingVirtual: firstly, when an upstream cluster is in a pending state, indicating that the upstream cluster is not scheduled, and when the pending continues for a specified time, creating a Borrowed Description (BD); mustVirtual: directly creating a BD for the pod; the BD is perceived by the downstream cluster, and the specific perception mode is a mechanism of a watch-list CRD in kubernetes; the downstream cluster determines whether the borrowing is suitable or not according to the porosity policy and Clusteraffinity by combining the self characteristics, then further performs pre-scheduling, and if the borrowing is continuously satisfied, updates BD state representation to be satisfied; and the upstream clusters select the optimal ones from all the satisfied downstream clusters to be distributed, so that the whole borrowing process is completed.
In the embodiment of the application, the success rate of one-time scheduling can be effectively increased, and because the cost price ratio of scheduling failure is larger, the pod needs to be deleted at the downstream and then rescheduled at the upstream; the method can be used for seamlessly accessing the stock platform and has high practicability.
In the specific implementation, if the scheduling behavior in other schemes is regarded as one-way assignment and macro scheduling, the one-way assignment is that the upstream clusters select, and the downstream can only passively accept and then schedule; macroscopic scheduling is because the cluster can only judge whether the sum of the downstream resources is enough or not, but whether the implementation to a specific node can meet the scheduling is uncertain; in the embodiment of the application, a complete cross-cluster borrowing scheme is realized by realizing a borrowing CRD and pre-scheduling technology. It can be considered as a kind of bi-directional negotiation, micro-scheduling: bidirectional negotiation is because the upstream cluster is responsible for filling more scheduling requirements in the borrowing description, and the downstream can decide to be not accepted according to the self characteristics; the micro scheduling is to perfectly avoid the problem that the resource condition cannot be perceived in fine granularity through the pre-scheduling technology, and does not need to actively report downstream, so that the scheduling success rate is increased.
It can be seen that, the container borrowing method described in the embodiment of the present application is applied to an upstream cluster in a container borrowing system, where the container borrowing system includes an upstream cluster and N downstream clusters, N is an integer greater than 1, a first pod number to be borrowed is determined, m is obtained, m is a positive integer, a first borrowing request is sent to each of the N downstream clusters, the first borrowing request is used to request the corresponding downstream cluster to determine a supportable second pod number, and the supportable second pod number returned by each of the N downstream clusters is received, so as to obtain N second pod numbers; and determining the sum of the N second pod numbers to obtain y, selecting m pods from the y pods when y is greater than or equal to m, calling the m pods, and adopting bidirectional negotiation and micro-scheduling to realize container borrowing, namely, the bidirectional negotiation is that an upstream cluster is responsible for filling more scheduling requirements in borrowing description, a downstream can decide to be not accepted according to own characteristics, the micro-scheduling means that the problem that the resource condition cannot be sensed in fine granularity is perfectly avoided through a pre-scheduling technology, and the downstream does not need to do any active reporting, so that the scheduling success rate is increased, and the container borrowing efficiency is improved.
In accordance with the foregoing, referring to fig. 4, fig. 4 is a flow chart of another container borrowing method according to an embodiment of the present application, as shown in the drawing, the method is applied to an upstream cluster in a container borrowing system, where the container borrowing system includes the upstream cluster and N downstream clusters, and N is an integer greater than 1; the container borrowing method comprises the following steps:
401. and determining the first pod number to be borrowed to obtain m pods, wherein m is a positive integer.
402. And sending a first borrowing request to each of the N downstream clusters, wherein the first borrowing request is used for requesting the corresponding downstream cluster to determine the second pod number capable of being supported.
403. Receiving the supportable second pod numbers returned by each of the N downstream clusters to obtain N second pod numbers; and determining the sum of the N second pod numbers to obtain y.
404. And when y is greater than or equal to m, selecting m pod from the y pod, and calling the m pod.
405. And when y is smaller than m, selecting y pod from y pods, and calling the y pod.
406. And determining the number of the third pod needing borrowing, and obtaining m-y pods.
407. And sending a second borrowing request to each of the N downstream clusters, wherein the second borrowing request is used for requesting the corresponding downstream cluster to determine a fourth number of the supported pod.
408. Receiving the fourth number of supportable pod returned by each of the N downstream clusters to obtain N fourth number of pods; and determining the sum of the number of the N fourth pod to obtain w.
409. And when w is greater than or equal to m-y, selecting m-y pod from w pods, and calling the m-y pod.
The specific description of the steps 401 to 409 may refer to the relevant steps of the container borrowing method as shown in fig. 3D, which is not described herein.
It can be seen that the container borrowing method described in the embodiment of the present application is applied to an upstream cluster in a container borrowing system, where the container borrowing system includes an upstream cluster and N downstream clusters, where N is an integer greater than 1; determining a first pod number to be borrowed, obtaining m pods, wherein m is a positive integer, sending a first borrowing request to each of N downstream clusters, wherein the first borrowing request is used for requesting the corresponding downstream cluster to determine a second pod number capable of being supported, and receiving the second pod number capable of being supported returned by each of the N downstream clusters to obtain N second pod numbers; determining the sum of N second pod numbers to obtain y, selecting m pods from the y pods when y is greater than or equal to m, calling the m pods, selecting y pods from the y pods when y is less than m, calling the y pods, determining the rest third pod numbers needing to be borrowed to obtain m-y pods, sending a second borrowing request to each of N downstream clusters, wherein the second borrowing request is used for requesting the corresponding downstream cluster to determine the fourth pod number capable of being supported, receiving the fourth pod number capable of being supported returned by each of the N downstream clusters, and obtaining N fourth pod numbers; and determining the sum of the number of the N fourth pod to obtain w, selecting m-y pods from the w pods when the w is greater than or equal to m-y, and calling the m-y pods.
In accordance with the foregoing embodiments, referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application, where the electronic device includes a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor and applied to an upstream cluster in a container borrowing system, and the container borrowing system includes the upstream cluster and N downstream clusters, where N is an integer greater than 1; in an embodiment of the present application, the program includes instructions for performing the steps of:
determining the number of first pod to be borrowed to obtain m pods, wherein m is a positive integer;
sending a first borrowing request to each of the N downstream clusters, where the first borrowing request is used to request the corresponding downstream cluster to determine a second number of pods that can be supported;
receiving the supportable second pod numbers returned by each of the N downstream clusters to obtain N second pod numbers; determining the sum of the N second pod numbers to obtain y;
and when y is greater than or equal to m, selecting m pod from the y pod, and calling the m pod.
In some possible examples, in the selecting m pod from the y pods and invoking the m pod, the program includes instructions for:
determining the borrowing grade corresponding to each pod in the N second pods, and obtaining y borrowing grades;
and determining m borrowing levels in front of the borrowing levels from the y borrowing levels, and calling the pod corresponding to the m borrowing levels.
Further, in some possible examples, in determining the borrowing level corresponding to each of the N second pod numbers, obtaining y borrowing levels, the program includes instructions for:
determining channel parameters of a communication link between the upstream cluster and each of the N downstream clusters to obtain N channel parameters;
and determining the y borrowing levels according to the N channel parameters.
In some possible examples, in terms of the determining the first number of pods to borrow, the program includes instructions for:
determining target task parameters of a target task;
determining the number of reference pod corresponding to the target task parameter;
Determining a target network parameter;
determining a target optimization parameter corresponding to the target network parameter;
and optimizing the reference pod number according to the target optimization parameter to obtain the first pod number.
In some possible examples, the above-described program further comprises instructions for performing the steps of:
sending a test borrowing request to each of the N downstream clusters, where the test borrowing request is used to request the corresponding downstream cluster to determine the number of pod that can be supported;
receiving the supportable pod number returned by each of the N downstream clusters to obtain N reference pod numbers; and determining the sum of the N reference pod numbers to obtain b, wherein b is greater than or equal to m.
In some possible examples, the above-described program further comprises instructions for performing the steps of:
when y is smaller than m, selecting y pod from y pods, and calling the y pod;
determining the number of the third pod to be borrowed, and obtaining m-y pods;
sending a second borrowing request to each of the N downstream clusters, where the second borrowing request is used to request the corresponding downstream cluster to determine a fourth number of pods that can be supported;
Receiving the fourth number of supportable pod returned by each of the N downstream clusters to obtain N fourth number of pods; determining the sum of the number of the N fourth pod to obtain w;
and when w is greater than or equal to m-y, selecting m-y pod from w pods, and calling the m-y pod.
It can be seen that, the electronic device described in the embodiment of the present application is applied to an upstream cluster in a container borrowing system, where the container borrowing system includes an upstream cluster and N downstream clusters, N is an integer greater than 1, a first pod number to be borrowed is determined, m pods are obtained, m is a positive integer, a first borrowing request is sent to each of the N downstream clusters, the first borrowing request is used to request the corresponding downstream cluster to determine a supportable second pod number, and the supportable second pod number returned by each of the N downstream clusters is received, so as to obtain N second pod numbers; and determining the sum of the N second pod numbers to obtain y, selecting m pods from the y pods when y is greater than or equal to m, calling the m pods, and adopting bidirectional negotiation and micro-scheduling to realize container borrowing, namely, the bidirectional negotiation is that an upstream cluster is responsible for filling more scheduling requirements in borrowing description, a downstream can decide to be not accepted according to own characteristics, the micro-scheduling means that the problem that the resource condition cannot be sensed in fine granularity is perfectly avoided through a pre-scheduling technology, and the downstream does not need to do any active reporting, so that the scheduling success rate is increased, and the container borrowing efficiency is improved.
The foregoing description of the embodiments of the present application has been presented primarily in terms of a method-side implementation. It will be appreciated that the electronic device, in order to achieve the above-described functions, includes corresponding hardware structures and/or software modules that perform the respective functions. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the application can divide the functional units of the electronic device according to the method example, for example, each functional unit can be divided corresponding to each function, and two or more functions can be integrated in one processing unit. The integrated units may be implemented in hardware or in software functional units. It should be noted that, in the embodiment of the present application, the division of the units is schematic, which is merely a logic function division, and other division manners may be implemented in actual practice.
Referring to fig. 6, fig. 6 is a block diagram illustrating functional units of a container borrowing apparatus 600 according to an embodiment of the present application. The container borrowing device 600 is applied to an upstream cluster in a container borrowing system, wherein the container borrowing system comprises the upstream cluster and N downstream clusters, and N is an integer greater than 1; the apparatus 600 includes: a determining unit 601, a transmitting unit 602, a receiving unit 603 and a selecting unit 604, wherein,
the determining unit 601 is configured to determine a first pod number to be borrowed, to obtain m pods, where m is a positive integer;
the sending unit 602 is configured to send a first borrowing request to each of the N downstream clusters, where the first borrowing request is used to request the corresponding downstream cluster to determine a second number of pods that can be supported;
the receiving unit 603 is configured to receive the supportable second pod numbers returned by each of the N downstream clusters, to obtain N second pod numbers; determining the sum of the N second pod numbers to obtain y;
the selecting unit 604 is configured to select m pod from the y pods and call the m pods when the y is greater than or equal to m.
In some possible examples, in the selecting m pod from the y pods and calling the m pods, the selecting unit 604 is specifically configured to:
Determining the borrowing grade corresponding to each pod in the N second pods, and obtaining y borrowing grades;
and determining m borrowing levels in front of the borrowing levels from the y borrowing levels, and calling the pod corresponding to the m borrowing levels.
In some possible examples, in determining the borrowing level corresponding to each of the N second pod numbers, the selecting unit 604 is specifically configured to:
determining channel parameters of a communication link between the upstream cluster and each of the N downstream clusters to obtain N channel parameters;
and determining the y borrowing levels according to the N channel parameters.
In some possible examples, in terms of the determining the first pod number to borrow, the determining unit 601 is specifically configured to:
determining target task parameters of a target task;
determining the number of reference pod corresponding to the target task parameter;
determining a target network parameter;
determining a target optimization parameter corresponding to the target network parameter;
and optimizing the reference pod number according to the target optimization parameter to obtain the first pod number.
In some possible examples, the apparatus 600 is further specifically configured to:
Sending a test borrowing request to each of the N downstream clusters, where the test borrowing request is used to request the corresponding downstream cluster to determine the number of pod that can be supported;
receiving the supportable pod number returned by each of the N downstream clusters to obtain N reference pod numbers; and determining the sum of the N reference pod numbers to obtain b, wherein b is greater than or equal to m.
In some possible examples, the apparatus 600 is further specifically configured to:
when y is smaller than m, selecting y pod from y pods, and calling the y pod;
determining the number of the third pod to be borrowed, and obtaining m-y pods;
sending a second borrowing request to each of the N downstream clusters, where the second borrowing request is used to request the corresponding downstream cluster to determine a fourth number of pods that can be supported;
receiving the fourth number of supportable pod returned by each of the N downstream clusters to obtain N fourth number of pods; determining the sum of the number of the N fourth pod to obtain w;
and when w is greater than or equal to m-y, selecting m-y pod from w pods, and calling the m-y pod.
It can be seen that, the electronic device described in the embodiment of the present application is applied to an upstream cluster in a container borrowing system, where the container borrowing system includes an upstream cluster and N downstream clusters, N is an integer greater than 1, a first pod number to be borrowed is determined, m pods are obtained, m is a positive integer, a first borrowing request is sent to each of the N downstream clusters, the first borrowing request is used to request the corresponding downstream cluster to determine a supportable second pod number, and the supportable second pod number returned by each of the N downstream clusters is received, so as to obtain N second pod numbers; and determining the sum of the N second pod numbers to obtain y, selecting m pods from the y pods when y is greater than or equal to m, calling the m pods, and adopting bidirectional negotiation and micro-scheduling to realize container borrowing, namely, the bidirectional negotiation is that an upstream cluster is responsible for filling more scheduling requirements in borrowing description, a downstream can decide to be not accepted according to own characteristics, the micro-scheduling means that the problem that the resource condition cannot be sensed in fine granularity is perfectly avoided through a pre-scheduling technology, and the downstream does not need to do any active reporting, so that the scheduling success rate is increased, and the container borrowing efficiency is improved.
It should be noted that the electronic device described in the embodiments of the present application is presented in the form of functional units. The term "unit" as used herein should be understood in the broadest possible sense, and the objects used to implement the functions described by the various "units" may be, for example, an integrated circuit ASIC, a single circuit, a processor (shared, dedicated, or group) and memory that execute one or more software or firmware programs, a combinational logic circuit, and/or other suitable components that provide the described functionality.
The determining unit 601, the transmitting unit 602, the receiving unit 603, and the selecting unit 604 may be processors, which may be artificial intelligence chips, NPU, CPU, GPU, PMIC, and the like, which are not limited herein. The functions or steps of any of the above methods can be implemented based on the above unit modules.
The present embodiment also provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program for electronic data exchange, wherein the above computer program causes a computer to execute the embodiments of the present application for implementing any of the methods of the embodiments described above.
The present embodiment also provides a computer program product which, when run on a computer, causes the computer to perform the above-described relevant steps to implement any of the methods of the above-described embodiments.
In addition, embodiments of the present application also provide a container borrowing apparatus, which may be embodied as a chip, component or module, which may include a processor and a memory coupled to each other; the memory is configured to store computer-executable instructions that, when the device is operated, are executable by the processor to cause the chip to perform any one of the method embodiments described above.
The electronic device, the non-volatile computer storage medium, the computer program product, or the chip provided in this embodiment are used to execute the corresponding method provided above, so that the beneficial effects thereof can be referred to the beneficial effects in the corresponding method provided above, and will not be described herein.
It will be appreciated by those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional modules is illustrated, and in practical application, the above-described functional allocation may be performed by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to perform all or part of the functions described above.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts shown as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (10)

1. The container borrowing method is characterized by being applied to an upstream cluster in a container borrowing system, wherein the container borrowing system comprises the upstream cluster and N downstream clusters, and N is an integer greater than 1; the method comprises the following steps:
determining the number of first pod to be borrowed to obtain m pods, wherein m is a positive integer;
sending a first borrowing request to each of the N downstream clusters, where the first borrowing request is used to request the corresponding downstream cluster to determine a second number of pods that can be supported;
receiving the supportable second pod numbers returned by each of the N downstream clusters to obtain N second pod numbers; determining the sum of the N second pod numbers to obtain y;
and when y is greater than or equal to m, selecting m pod from the y pod, and calling the m pod.
2. The method of claim 1, wherein the selecting m pod from the y pods and invoking the m pod comprises:
determining the borrowing grade corresponding to each pod in the N second pods, and obtaining y borrowing grades;
and determining m borrowing levels in front of the borrowing levels from the y borrowing levels, and calling the pod corresponding to the m borrowing levels.
3. The method of claim 2, wherein determining the borrowing level corresponding to each of the N second pod numbers to obtain y borrowing levels comprises:
determining channel parameters of a communication link between the upstream cluster and each of the N downstream clusters to obtain N channel parameters;
and determining the y borrowing levels according to the N channel parameters.
4. The method of claim 1 or 2, wherein the determining the first number of pod to borrow comprises:
determining target task parameters of a target task;
determining the number of reference pod corresponding to the target task parameter;
determining a target network parameter;
determining a target optimization parameter corresponding to the target network parameter;
and optimizing the reference pod number according to the target optimization parameter to obtain the first pod number.
5. The method according to claim 1 or 2, characterized in that the method further comprises:
sending a test borrowing request to each of the N downstream clusters, where the test borrowing request is used to request the corresponding downstream cluster to determine the number of pod that can be supported;
Receiving the supportable pod number returned by each of the N downstream clusters to obtain N reference pod numbers; and determining the sum of the N reference pod numbers to obtain b, wherein b is greater than or equal to m.
6. The method according to claim 1 or 2, characterized in that the method further comprises:
when y is smaller than m, selecting y pod from y pods, and calling the y pod;
determining the number of the third pod to be borrowed, and obtaining m-y pods;
sending a second borrowing request to each of the N downstream clusters, where the second borrowing request is used to request the corresponding downstream cluster to determine a fourth number of pods that can be supported;
receiving the fourth number of supportable pod returned by each of the N downstream clusters to obtain N fourth number of pods; determining the sum of the number of the N fourth pod to obtain w;
and when w is greater than or equal to m-y, selecting m-y pod from w pods, and calling the m-y pod.
7. The container borrowing device is characterized by being applied to an upstream cluster in a container borrowing system, wherein the container borrowing system comprises the upstream cluster and N downstream clusters, and N is an integer greater than 1; the device comprises: a determining unit, a transmitting unit, a receiving unit and a selecting unit, wherein,
The determining unit is used for determining the first pod number to be borrowed to obtain m pods, wherein m is a positive integer;
the sending unit is configured to send a first borrowing request to each of the N downstream clusters, where the first borrowing request is used to request the corresponding downstream cluster to determine a second pod number that can be supported;
the receiving unit is configured to receive the supportable second pod numbers returned by each of the N downstream clusters, to obtain N second pod numbers; determining the sum of the N second pod numbers to obtain y;
the selecting unit is configured to select m pod from the y pods and call the m pods when the y is greater than or equal to m.
8. The apparatus of claim 7, wherein in selecting m pod from the y pods and invoking the m pod, the selecting unit is specifically configured to:
determining the borrowing grade corresponding to each pod in the N second pods, and obtaining y borrowing grades;
and determining m borrowing levels in front of the borrowing levels from the y borrowing levels, and calling the pod corresponding to the m borrowing levels.
9. An electronic device comprising a processor, a memory for storing one or more programs and configured for execution by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-6.
10. A non-transitory computer readable storage medium storing a computer program for electronic data exchange, wherein the computer program causes a computer to perform the method of any of claims 1-6.
CN202311044266.1A 2023-08-17 2023-08-17 Container borrowing method and related device Pending CN117076072A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311044266.1A CN117076072A (en) 2023-08-17 2023-08-17 Container borrowing method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311044266.1A CN117076072A (en) 2023-08-17 2023-08-17 Container borrowing method and related device

Publications (1)

Publication Number Publication Date
CN117076072A true CN117076072A (en) 2023-11-17

Family

ID=88705542

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311044266.1A Pending CN117076072A (en) 2023-08-17 2023-08-17 Container borrowing method and related device

Country Status (1)

Country Link
CN (1) CN117076072A (en)

Similar Documents

Publication Publication Date Title
CN109814766B (en) Application display method and electronic equipment
WO2021213164A1 (en) Application interface interaction method, electronic device, and computer readable storage medium
CN111553846B (en) Super-resolution processing method and device
CN111555825B (en) Radio frequency resource allocation method and device
CN111882642B (en) Texture filling method and device for three-dimensional model
CN114546511A (en) Plug-in management method, system and device
CN115333941B (en) Method for acquiring application running condition and related equipment
CN114915996A (en) Communication exception handling method and related device
WO2022135157A1 (en) Page display method and apparatus, and electronic device and readable storage medium
CN111836226B (en) Data transmission control method, device and storage medium
CN114465852A (en) Signal processing method and related device
CN117076072A (en) Container borrowing method and related device
CN115083400A (en) Voice assistant awakening method and device
CN114336998A (en) Charging control method, charging control device and storage medium
CN114596819B (en) Brightness adjusting method and related device
CN114125738B (en) Data transmission control method and related device
CN115175164B (en) Communication control method and related device
CN113542315B (en) Communication framework, business event processing method and device
CN114630153B (en) Parameter transmission method and device for application processor and storage medium
WO2024109198A1 (en) Window adjustment method and related apparatus
WO2022222780A1 (en) Audio output method, media file recording method, and electronic device
CN116896748A (en) Self-adaptive regulating method and related device for authentication route
CN117917629A (en) Service operation method and related product
CN115079981A (en) Equipment control method and related device
CN117579606A (en) OTA updating method and related device

Legal Events

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