Search

CN-122019053-A - Information processing method, electronic device, storage medium, and computer program product

CN122019053ACN 122019053 ACN122019053 ACN 122019053ACN-122019053-A

Abstract

The application provides an information processing method, electronic equipment, a storage medium and a computer program product, wherein the method comprises the steps of monitoring the number of producers, determining that the consumers need to be expanded or contracted when the number of the producers changes, deploying the consumers in a container arrangement type frame, and expanding or contracting the consumers by utilizing the number of the producers and first information, wherein the first information represents the proportional relation between the number of the producers and the number of the consumers. The scheme provided by the application has better universality, can respond to service fluctuation more quickly, and realizes timely capacity expansion and contraction of consumers.

Inventors

  • CHEN DEHE

Assignees

  • 中移(苏州)软件技术有限公司
  • 中国移动通信集团有限公司

Dates

Publication Date
20260512
Application Date
20260127

Claims (10)

  1. 1. An information processing method, characterized in that the method comprises: monitoring the number of producers deployed in a container orchestration class framework; when the number of the producers is determined to change, determining that the consumers need to be expanded or contracted, wherein the consumers are deployed in the container arrangement type framework; and expanding or shrinking the capacity of the consumer by using the number of producers and first information, wherein the first information represents the proportional relation between the number of producers and the number of consumers.
  2. 2. The method according to claim 1, wherein the method further comprises: acquiring second information, wherein the second information represents the CPU service condition of each consumer; the expanding the consumer using the number of producers and the first information includes: and expanding the capacity of the consumer by using the number of producers, the first information and the second information.
  3. 3. The method of claim 2, wherein expanding the consumer using the number of producers, first information, and second information comprises: Determining the average utilization rate of CPU occupied by the consumers on each node in the container arrangement type framework by utilizing the second information, and generating new consumer quantity by utilizing the producer quantity and the first information; and expanding the capacity of the consumers by utilizing the average utilization rate of the CPU occupied by the consumers on each node and the number of new consumers.
  4. 4. The method according to claim 1, wherein the method further comprises: And acquiring and storing the updated first information.
  5. 5. A method according to claim 3, wherein expanding the consumers using the average CPU usage and the new number of consumers occupied by the consumers at each node comprises: Under the condition that the number of new consumers is smaller than or equal to a first threshold value and the average utilization rate of the CPU occupied by the consumers on each node is smaller than or equal to a second threshold value, expanding the capacity of the consumers based on the number of the new consumers; Or alternatively And under the condition that the number of the new consumers is larger than a first threshold value and the average utilization rate of the CPU occupied by the consumers on each node is smaller than or equal to a second threshold value, expanding the capacity of the consumers based on the first threshold value.
  6. 6. The method of claim 5, wherein the method further comprises: and acquiring and storing the updated first threshold value and/or the updated second threshold value.
  7. 7. The method of any of claims 1 to 6, wherein the container orchestration class framework comprises a K8S framework, the listening to a producer number, comprising: the producer number is obtained by calling an application programming interface API in the K8S framework.
  8. 8. An electronic device comprising a processor and a memory for storing a computer program capable of running on the processor, Wherein the processor is adapted to perform the steps of the method of any of claims 1 to 7 when the computer program is run.
  9. 9. A storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the method according to any of claims 1 to 7.
  10. 10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 7.

Description

Information processing method, electronic device, storage medium, and computer program product Technical Field The present application relates to the field of big data processing technology, and in particular, to an information processing method, an electronic device, a storage medium, and a computer program product. Background With the rapid development of cloud computing technology, a containerization technology (such as Docker) and a container orchestration framework (such as Kubernetes, abbreviated as K8S) have become mainstream deployment modes of a micro-service architecture. In an actual business scenario, there is typically a "producer-consumer" model, where the producer is responsible for producing data or tasks and the consumer is responsible for processing the data or tasks. In practical use, service peaks or valleys are unavoidable, which requires expansion or contraction of the volume of the producer and consumer. In the related art, some schemes of capacity expansion and capacity shrinkage are proposed. However, these schemes are less versatile to implement and there is significant hysteresis in consumer expansion and contraction. Disclosure of Invention The embodiment of the application provides an information processing method, electronic equipment, a storage medium and a computer program product, which have better universality and can respond to business fluctuation more quickly so as to realize timely capacity expansion and contraction of consumers. The technical scheme of the embodiment of the application is realized as follows: the embodiment of the application provides an information processing method, which comprises the following steps: monitoring the number of producers deployed in a container orchestration class framework; when the number of the producers is determined to change, determining that the consumers need to be expanded or contracted, wherein the consumers are deployed in the container arrangement type framework; and expanding or shrinking the capacity of the consumer by using the number of producers and first information, wherein the first information represents the proportional relation between the number of producers and the number of consumers. The embodiment of the application also provides an electronic device comprising a processor and a memory for storing a computer program capable of running on the processor, The processor is used for executing the steps of any one of the information processing methods when running the computer program. The embodiment of the application also provides a storage medium, on which a computer program is stored, which when being executed by a processor, implements the steps of any one of the above information processing methods. The embodiment of the application also provides a computer program product, comprising a computer program which, when being executed by a processor, realizes the steps of any one of the information processing methods. The embodiment of the application has the following beneficial effects: The information processing method, the electronic equipment, the storage medium and the computer program product provided by the embodiment of the application monitor the number of producers, determine that the consumers need to be expanded or contracted when the number of the producers changes, arrange the consumers in the container arrangement type frame, and utilize the number of the producers and first information to expand or contract the consumers, wherein the first information represents the proportional relation between the number of the producers and the number of the consumers. In the scheme, the producers and the consumers are both deployed in the container arrangement type framework, so that no matter what type of message queue (namely the message queue middleware) is used, unified interfaces related to the quantity of the producers and the capacity expansion or contraction of the consumers can be used in the container arrangement type framework to monitor the quantity of the producers and expand or contract the consumers, the method has good universality, and the quantity of the producers is monitored, the capacity expansion or contraction of the consumers is carried out by combining with the supply and demand proportion, when the quantity of the producers is changed, the corresponding change of the quantity of the consumers can be determined simply and timely based on the quantity of the producers and the first information, so that the capacity expansion speed of the consumers is faster, the capacity expansion of the consumers can be carried out in advance before the production speed of the producers is too fast, the capacity expansion of the consumers can be started after the occurrence of message backlog is avoided, and the consumers can be contracted in time when the quantity of the producers is reduced, and the waste of calculation resources can be avoided. Drawings FIG. 1 is a schematic diagram of a related a