Service management method and device, equipment, storage medium and program product

By receiving and detecting container service information in a software architecture environment, and using mapping tables to determine target service information based on the number of calls and task duration, the problem of resource waste and response delay in Python service cluster management is solved, and more efficient service resource utilization and response speed is achieved.

CN119861996APending Publication Date: 2025-04-22MACROWING SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411995384.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

In the current software architecture environment, the clustered management of Python services has problems of resource waste and response delays, which is difficult to meet complex business needs.

Method used

By receiving service information sent by each container, detecting the service status, and determining the target service information of the service call request based on the number of calls and the historical task processing time in the mapping table, improving service resource utilization and reducing response delay.

Benefits of technology

It achieves the effect of improving service resource utilization and reducing response delay, and can allocate service resources more accurately to meet high concurrency needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119861996A_ABST
    Figure CN119861996A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a service management method and device, equipment, a storage medium and a program product. The method comprises the following steps: receiving first service information sent by each container; detecting a service state corresponding to the first service information; wherein the service state comprises a starting state and a non-starting state; if the service state is a starting state, storing second service information corresponding to the starting state into a mapping table; receiving a service calling request sent by a calling party; in the mapping table, target service information corresponding to the service calling request is determined based on the number of calling times at the current moment and historical task processing duration; and returning target service information corresponding to the target service to the calling party. According to the embodiment of the invention, through a mode of determining the target service information corresponding to the service calling request based on the calling frequency of the current moment and the historical task processing duration, the utilization rate of service resources can be improved, and the response delay is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a service management method, device, equipment, storage medium and program product. Background Art

[0002] In the current software architecture environment, there are many problems with the cluster management of Python services. In traditional management methods, service calls often rely on manual configuration, resulting in waste of service resources and response delays, which can no longer meet the growing complex business needs. Summary of the invention

[0003] The present invention provides a service management method, device, equipment, storage medium and program product to improve the utilization rate of service resources and reduce response delay.

[0004] In a first aspect, an embodiment of the present disclosure provides a service management method, comprising: receiving first service information sent by each container; detecting a service status corresponding to the first service information; wherein the service status includes a started status and a non-started status; if the service status is a started status, storing second service information corresponding to the started status in a mapping table; receiving a service call request sent by a caller; in the mapping table, determining a target service information corresponding to the service call request based on the number of calls at the current moment and the historical task processing duration; and returning the target service information corresponding to the target service to the caller.

[0005] In the second aspect, the embodiment of the present disclosure also provides a service management device, including: a first service information receiving module, used to receive first service information sent by each container; a detection module, used to detect the service status corresponding to the first service information; wherein the service status includes a started state and a non-started state; a second service information storage module, used to store the second service information corresponding to the started state into a mapping table if the service status is a started state; a service call request receiving module, used to receive a service call request sent by a caller; a target service information determination module, used to determine the target service information corresponding to the service call request in the mapping table based on the number of calls at the current moment and the historical task processing duration; and return the target service information corresponding to the target service to the caller.

[0006] In the third aspect, an embodiment of the present disclosure further provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the service management method as described in the embodiment of the present disclosure.

[0007] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the service management method as described in the embodiment of the present disclosure.

[0008] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program, which implements the service management method as described in the embodiment of the present disclosure when executed by a processor.

[0009] The technical solution of the disclosed embodiment receives the first service information sent by each container; detects the service status corresponding to the first service information; wherein the service status includes a startup status and a non-startup status; if the service status is a startup status, stores the second service information corresponding to the startup status in a mapping table; receives a service call request sent by a caller; in the mapping table, determines the target service information corresponding to the service call request based on the number of calls at the current moment and the historical task processing duration; and returns the target service information corresponding to the target service to the caller. The disclosed embodiment can improve the utilization rate of service resources and reduce response delays by determining the target service information corresponding to the service call request based on the number of calls at the current moment and the historical task processing duration. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0011] Figure 1 A schematic diagram of a service management method flow provided by an embodiment of the present invention;

[0012] Figure 2 A schematic diagram of the structure of a service management device provided by an embodiment of the present disclosure;

[0013] Figure 3 The present invention is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0014] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0015] It should be understood that the various steps recorded in the method implementation of the present disclosure can be performed in different orders and / or in parallel. In addition, the method implementation may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect. The term "including" and its variations used herein are open inclusions, that is, "including but not limited to". It should be noted that the concepts of "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units. It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that unless otherwise clearly stated in the context, it should be understood as "one or more". It is understandable that the data involved in the present technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of the corresponding laws, regulations and relevant provisions.

[0016] Figure 1 A flow chart of a service management method provided in an embodiment of the present invention, the embodiment of the present disclosure is applicable to the situation of managing cluster services. The execution subject of the embodiment of the present invention may be a registration center in a server. The server runs on any type of operating system and is deployed using a Docker environment. Multiple containers, that is, multiple Docker containers, can be created using the Docker environment. The registration center is used to manage services. The registration center may be a Docker container. The service management in the embodiment of the present invention may be understood as the management of a second programming language service. The method may be executed by a service management device, which may be implemented in the form of software and / or hardware, and optionally, may be implemented by an electronic device, which may be a mobile terminal, a PC, or a server, etc. Figure 1 As shown, the method includes:

[0017] S110: Receive first service information sent by each container.

[0018] In this embodiment, there is no limit on the number of containers, which may include one or more containers. The container may be a Docker container.

[0019] It should be noted that each container includes a first programming language service and at least one second programming language service; the first programming language service is used to manage the corresponding second programming language service. The first programming language service and the second programming language service are different. Exemplarily, the first programming language service can be understood as a function or program written in the first programming language, such as a java service, and the second programming language service can be a function or program written in the second programming language, a python service. For example, a python service can be used for text recognition. The python services included in each container can be the same or different. The python services in the container can be different or the same. Multiple sets of containers can form a cluster.

[0020] It should be noted that in configuring the Docker container network, you can configure the bridge mode (Bridge) or overlay network mode (Overlay), and combine the virtual extensible LAN (VXLAN) and other technologies to achieve cross-host container communication, ensure the efficiency and stability of the network, so that the containers can be interconnected and access each other, and ensure efficient and reliable communication. Set the hostname that is identified or referenced in the network for each container, and set the container with the hostname "inwise" as the registration center.

[0021] Among them, the first service information may include an Internet Protocol Address (IP) address, a port number, a service name, and a service code, etc. The service code is used to distinguish different second programming language services. The first service information can be understood as the service information that the first programming language service in the container believes that the second programming language service has been started. Specifically, the first programming language service in the container starts the second programming language service, and stores the first service information of the startup status of the second programming language service in the setting database. The first programming language service reads the first service information from the setting database and sends it to the registration center.

[0022] Optionally, receiving first service information sent by each container includes: receiving first service information sent by the first programming language service of each container according to a set period; wherein the first service information is service information read from a setting database by the first programming language service of each container according to the set period; and the setting database is used to store the first service information corresponding to the running second programming language service.

[0023] Exemplarily, the first programming language service of each container starts the second programming language service through a shell command, and stores the first service information of the startup status of the second programming language service in a setting database. The first programming language service of each container reads the first service information corresponding to the running second programming language service from the setting database according to a set period, and sends the first service information to the registration center through a hypertext transfer protocol request (HTTP Request), so that the registration center receives the first service information sent by the first programming language service of each container according to the set period.

[0024] The setting database may be any persistent database, such as a PostgreSQL database. In this embodiment, there is no specific limitation on the setting period, for example, it may be once a minute.

[0025] S120: Detect a service status corresponding to the first service information.

[0026] The service status includes an activated state and an inactivated state.

[0027] In this embodiment, since the service status is dynamic, the second programming language service may stop unexpectedly after being started, or it may remain in a normal startup state. Therefore, the registration center needs to detect the service status of the second programming language service corresponding to the first service information to ensure the accuracy of the service status of the second programming language service.

[0028] Optionally, detecting the service status corresponding to the first service information includes: using a set network tool to detect the connection status of the network address information; the connection status includes a connected state and a disconnected state; if the connection status is a connected state, the service status of the second programming language service corresponding to the first service information is a started state; if the connection status is a disconnected state, the service status of the second programming language service corresponding to the first service information is a disabled state.

[0029] Wherein, the first service information includes network address information. The network address information may include an IP address and a port number. The setting network tool may be any type of network tool, such as a telnet network tool. Exemplarily, the setting network tool may be used to specify an IP address and a port number to check the connection status of the port corresponding to the port number. If the setting network tool can successfully connect to the specified port number, it indicates that the connection status is a connected state. If the setting network tool fails to successfully connect to the specified port number, it indicates that the connection status is a disconnected state. If the connection status is a connected state, the service status of the second programming language service corresponding to the first service information is a startup state, that is, the service status of the second programming language service is normal. If the connection status is a disconnected state, the service status of the second programming language service corresponding to the first service information is a non-started state, that is, the service status of the second programming language service is abnormal, and the abnormal service status can be recorded in an array.

[0030] S130: If the service status is a startup status, store the second service information corresponding to the startup status into a mapping table.

[0031] The second service information is different from the first service information. The second service information may include the first service information. The second service information may include the IP address, port number, service name, service code, cumulative number of calls, historical task processing time, number of calls at the current moment, etc. Compared with the first service information, the second service information is more detailed.

[0032] The mapping table can be understood as a key-value mapping table (map), which is a data structure used to store a set of key-value pairs. The mapping table consists of a service code and corresponding second service information; the key value can be the service code of the second programming language service. The value can be the second service information.

[0033] Optionally, after detecting the service status corresponding to the first service information, it also includes: when the service status is in an unstarted state, restarting the second programming language service corresponding to the first service information until the service status changes to a started state, stopping the restart, and storing the second service information corresponding to the started state in a mapping table.

[0034] Exemplarily, when the service status is not started, the second programming language service corresponding to the first service information can be restarted through a shell command until the service status changes to the started status, the restart is stopped, and the second service information corresponding to the started status is stored in the mapping table.

[0035] In this embodiment, when the service status is not started, it is restarted continuously until the service status is changed to the started status. At the same time, since the first service information is sent by the first programming language service according to the set period, the service status of the first service information can be detected according to the set period, thereby achieving rapid service recovery when the second programming language service stops unexpectedly, that is, when the service status is not started, thereby reducing the downtime.

[0036] In this embodiment, since the first service information is read from the setting database by the first programming language service according to the set period, the service status of the first service information can be detected according to the set period, that is, interacting with the setting database according to the set period, and when the service status is not started, the service status is changed to the started state by continuous restart, thereby ensuring the availability of the second programming language service.

[0037] S140: Receive a service call request sent by the caller.

[0038] The caller may be a business party such as a client or a server that needs to call the second programming language service. The service call request includes the service code. In this embodiment, when the second programming language service needs to be called, the caller may send a service call request carrying the service code to the registration center via an HTTP request. The registration center receives the service call request sent by the caller.

[0039] S150. In the mapping table, determine the target service information corresponding to the service call request based on the number of calls at the current moment and the historical task processing duration; and return the target service information corresponding to the target service to the caller.

[0040] Specifically, through a service call request, one or more corresponding second service information can be found in the mapping table. In the case of multiple second service information, the most suitable second service information can be determined from the multiple second service information according to the number of calls at the current moment and the historical task processing time as the target service information, and the target service information corresponding to the target service can be returned to the caller to achieve the effect of accurately allocating service resources.

[0041] Optionally, in the mapping table, the target service corresponding to the service call request is determined based on the number of calls at the current moment and the historical task processing time, including: in the mapping table, based on the service code in the service call request, the corresponding second service information is obtained as candidate service information; if there are multiple candidate service information, the number of calls corresponding to each candidate service information at the current moment is obtained; the historical task processing time corresponding to each candidate service information is obtained; wherein the historical task processing time is the average time for the second programming language service corresponding to the candidate service information to process a single task; the workload of each candidate service information is determined based on the number of calls and the historical task processing time corresponding to each candidate service information; and the candidate service information with the smallest workload is used as the target service information.

[0042] Specifically, based on the service code in the service call request, the corresponding second service information is obtained from the mapping table as the candidate service information; if there are multiple candidate service information, that is, the service codes of multiple candidate service information are the same (the unique identifiers (IDs) of multiple candidate service information are different and the port numbers are different, but the IPs may be the same), then the number of calls to the second programming language service corresponding to each candidate service information at the current moment is obtained. The historical task processing time of the second programming language service corresponding to each candidate service information is obtained; wherein the historical task processing time is the average time for the second programming language service corresponding to the corresponding candidate service information to process a single task; the workload of each candidate service information is determined based on the number of calls corresponding to each candidate service information and the corresponding historical task processing time. After obtaining the workload of each candidate service information, the candidate service information with the smallest workload is used as the target service information.

[0043] Exemplarily, for a second programming language service corresponding to a piece of candidate service information, if at the current moment there are 10 callers simultaneously calling the second programming language service, then the number of calls to the second programming language service is 10.

[0044] Optionally, the workload of each candidate service information is determined based on the number of calls corresponding to each candidate service information and the historical task processing time, including: for each candidate service information, taking the product of the corresponding number of calls and the corresponding historical task processing time as the workload of the corresponding candidate service information.

[0045] Exemplarily, the workload of each candidate service information is determined in the following manner: the product of the number of calls corresponding to the current moment and the corresponding historical task processing duration is used as the workload of the corresponding candidate service information.

[0046] In this embodiment, by returning the target service information corresponding to the minimum product value of the number of calls corresponding to the current moment and the corresponding historical task processing time to the caller, the processing capacity and current load capacity of the second programming language service are taken into consideration to achieve more accurate service resource allocation, which can greatly improve the service resource utilization and meet high concurrency requirements. Since the number of calls is the latest moment, that is, the target service information is dynamic, it can be dynamically adjusted according to the real-time load, which can avoid the waste of service resources and reduce response delays.

[0047] For example, in a certain business system, multiple Docker containers are deployed to run Python services. After the system is started, the Java service in each container starts and manages the Python service according to the set rules, and sends the first service information to the registration center. Communication between containers is achieved through the configured Docker container network, such as the bridge network mode. The registration center monitors the service status of the Python service corresponding to the first service information, and returns the target service information according to the load balancing algorithm (based on the number of calls at the current time and the historical task processing time) when there is a call request, to ensure service call and operation.

[0048] The technical solution of the disclosed embodiment receives the first service information sent by each container; detects the service status corresponding to the first service information; wherein the service status includes a startup status and a non-startup status; if the service status is a startup status, stores the second service information corresponding to the startup status in a mapping table; receives a service call request sent by a caller; in the mapping table, determines the target service information corresponding to the service call request based on the number of calls at the current moment and the historical task processing duration; and returns the target service information corresponding to the target service to the caller. The disclosed embodiment can improve the utilization rate of service resources and reduce response delays by determining the target service information corresponding to the service call request based on the number of calls at the current moment and the historical task processing duration.

[0049] Figure 2 A schematic diagram of the structure of a service management device provided by an embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the device includes: a first service information receiving module 210, a detection module 220, a second service information storage module 230, a service call request receiving module 240 and a target service information determining module 250;

[0050] A first service information receiving module 210, configured to receive first service information sent by each container;

[0051] The detection module 220 is used to detect the service status corresponding to the first service information; wherein the service status includes an activated state and an inactivated state;

[0052] The second service information storage module 230 is used to store the second service information corresponding to the startup state into the mapping table if the service state is the startup state;

[0053] The service call request receiving module 240 is used to receive the service call request sent by the caller;

[0054] The target service information determination module 250 is used to determine the target service information corresponding to the service call request in the mapping table based on the current call times and the historical task processing duration; and return the target service information corresponding to the target service to the caller.

[0055] The technical solution of the disclosed embodiment receives the first service information sent by each container; detects the service status corresponding to the first service information; wherein the service status includes a startup status and a non-startup status; if the service status is a startup status, stores the second service information corresponding to the startup status in a mapping table; receives a service call request sent by a caller; in the mapping table, determines the target service information corresponding to the service call request based on the number of calls at the current moment and the historical task processing duration; and returns the target service information corresponding to the target service to the caller. The disclosed embodiment can improve the utilization rate of service resources and reduce response delays by determining the target service information corresponding to the service call request based on the number of calls at the current moment and the historical task processing duration.

[0056] The container includes a first programming language service and at least one second programming language service; the first programming language service is used to manage the corresponding second programming language service.

[0057] Optionally, the first service information receiving module is specifically used to: receive first service information sent by the first programming language service of each container according to a set period; wherein the first service information is service information read from a setting database by the first programming language service of each container according to the set period; and the setting database is used to store the first service information corresponding to the running second programming language service.

[0058] Wherein, the first service information includes network address information.

[0059] Optionally, the detection module is specifically used to: use a set network tool to detect the connection status of the network address information; the connection status includes a connected state and a disconnected state; if the connection status is a connected state, the service status of the second programming language service corresponding to the first service information is a started state; if the connection status is a disconnected state, the service status of the second programming language service corresponding to the first service information is a disabled state.

[0060] Optionally, the above-mentioned device also includes a restart module, which is specifically used to: when the service status is an unstarted state, restart the second programming language service corresponding to the first service information until the service status changes to a started state, stop restarting, and store the second service information corresponding to the started state into a mapping table.

[0061] The mapping table is composed of a service code and corresponding second service information; the service code is used to distinguish different second programming language services; and the service call request includes the service code.

[0062] Optionally, the target service information determination module is specifically used to: in the mapping table, obtain the corresponding second service information based on the service code in the service call request as candidate service information; if there are multiple candidate service information, obtain the number of calls corresponding to each candidate service information at the current moment; obtain the historical task processing time corresponding to each candidate service information; wherein the historical task processing time is the average time for the second programming language service corresponding to the candidate service information to process a single task; determine the workload of each candidate service information based on the number of calls corresponding to each candidate service information and the historical task processing time; and use the candidate service information with the smallest workload as the target service information.

[0063] Optionally, the target service information determination module is specifically used to: for each candidate service information, use the product of the corresponding number of calls and the corresponding historical task processing time as the workload of the corresponding candidate service information.

[0064] The service management device provided in the embodiments of the present disclosure can execute the service management method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0065] Figure 3 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0066] like Figure 3As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0067] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0068] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as method service management.

[0069] In some embodiments, the method service management may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method service management described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the method service management in any other appropriate manner (e.g., by means of firmware).

[0070] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0071] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0072] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0073] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0074] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0075] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0076] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the service management method provided in any embodiment of the present application.

[0077] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0078] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A service management method, characterized in that: include: receiving first service information sent by each container; Detecting a service state corresponding to the first service information; wherein the service state includes an activated state and an inactivated state; If the service state is a startup state, storing the second service information corresponding to the startup state into a mapping table; Receive the service call request sent by the caller; In the mapping table, the target service information corresponding to the service call request is determined based on the number of calls at the current moment and the historical task processing duration; and the target service information corresponding to the target service is returned to the caller.

2. The method according to claim 1, characterized in that in, The container includes a first programming language service and at least one second programming language service; the first programming language service is used to manage the corresponding second programming language service; receiving first service information sent by each container, including: Receive first service information sent by the first programming language service of each container according to a set period; wherein the first service information is service information read from a setting database by the first programming language service of each container according to the set period; the setting database is used to store the first service information corresponding to the running second programming language service.

3. The method according to claim 2, characterized in that in, The first service information includes network address information; detecting a service state corresponding to the first service information includes: Using a network setting tool to detect the connection status of the network address information; the connection status includes a connected state and a disconnected state; If the connection state is a connected state, the service state of the second programming language service corresponding to the first service information is a started state; If the connection status is a disconnected state, the service status of the second programming language service corresponding to the first service information is an inactive state.

4. The method according to claim 2, characterized in that: After detecting the service state corresponding to the first service information, the method further includes: When the service state is in an inactive state, restart the second programming language service corresponding to the first service information until the service state changes to an active state, stop restarting, and store the second service information corresponding to the active state into a mapping table.

5. The method according to claim 2, characterized in that: in, The mapping table is composed of a service code and corresponding second service information; the service code is used to distinguish different second programming language services; wherein the service call request includes the service code; in the mapping table, the target service corresponding to the service call request is determined based on the number of calls at the current moment and the historical task processing time, including: In the mapping table, obtaining corresponding second service information based on the service code in the service call request as candidate service information; If there are multiple candidate service information, then obtain the call count corresponding to each candidate service information at the current moment; Obtaining the historical task processing time corresponding to each candidate service information; wherein the historical task processing time is the average time for the second programming language service corresponding to the candidate service information to process a single task; Determine the workload of each candidate service information based on the number of calls corresponding to each candidate service information and the historical task processing time; The candidate service information with the minimum workload is used as the target service information.

6. The method according to claim 5, characterized in that Determining the workload of each candidate service information based on the number of calls corresponding to each candidate service information and the historical task processing duration includes: For each candidate service information, the product of the corresponding number of calls and the corresponding historical task processing time is taken as the workload of the corresponding candidate service information.

7. A service management device, characterized in that: include: A first service information receiving module, used to receive first service information sent by each container; A detection module, used to detect a service state corresponding to the first service information; wherein the service state includes an activated state and an inactivated state; A second service information storage module, configured to store the second service information corresponding to the startup state into a mapping table if the service state is a startup state; A service call request receiving module, used to receive a service call request sent by a caller; The target service information determination module is used to determine the target service information corresponding to the service call request in the mapping table based on the number of calls at the current moment and the historical task processing duration; and return the target service information corresponding to the target service to the caller.

8. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the service management method as described in any one of claims 1-6.

9. A storage medium comprising computer executable instructions, wherein the computer executable instructions are used to perform the service management method according to any one of claims 1 to 6 when executed by a computer processor.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the service management method according to any one of claims 1 to 6.