Service deployment method and apparatus, storage medium, and electronic device
By automating the cleanup of invalid machine code and authorization information in distributed clusters, the problem of low service deployment efficiency caused by residual machine code during distributed cluster fault recovery is solved, simplifying the deployment process and improving efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG HUACHUANG VISION TECH CO LTD
- Filing Date
- 2023-08-08
- Publication Date
- 2026-04-28
AI Technical Summary
During the recovery process of a distributed cluster, residual machine code leads to low service deployment efficiency. Existing technologies require manual identification and processing, which is complex and prone to errors, thus affecting system recovery efficiency.
By obtaining the target service of the target distributed cluster, calling the cleanup program to delete invalid machine codes, and providing services after verification, the network address list is obtained by using node tags to automatically clean up invalid machine codes and authorization information.
It automates the cleanup of invalid machine code and authorization information, simplifies the deployment and maintenance of distributed clusters after changes, and improves service deployment efficiency.
Smart Images

Figure CN116896549B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and more specifically, to a service deployment method, apparatus, storage medium, and electronic device. Background Technology
[0002] With the increasing popularity of cloud-native technologies, a software licensing mechanism is needed to protect application software copyright during containerized deployment of services. For multi-node distributed clusters, to improve overall system high availability, multiple critical nodes are often selected for software license verification checks. This ensures that if one node fails, the license of another node can still be verified, allowing the entire system to continue operating. However, during project deployment, it has been found that node failure recovery or cluster reorganization often results in residual historical machine code in the system, making it impossible to determine which machine code is valid and which can be deleted.
[0003] Traditionally, developers need to manually identify and verify all machine codes one by one, delete invalid machine codes and authorization information, and then apply for new authorization information for valid machine codes to restore system operation. If the associated information for each machine code is not saved, all machine codes and authorization information must be cleared, the service redeployed, and authorization re-issued.
[0004] Since hardware machine codes are often generated by hashing information from various hardware components such as hard drives and motherboards, a single machine code string cannot precisely pinpoint a specific physical server node. Therefore, manual processing requires storing more relevant information in a database for accurate determination. This process is highly complex and error-prone, making it difficult to recover from failures in critical cluster nodes and significantly reducing the applicability and efficiency of software-licensed high-availability solutions.
[0005] There is currently no effective solution to the problem that machine code residues generated during the fault recovery process of distributed clusters in related technologies lead to low service deployment efficiency. Summary of the Invention
[0006] This invention provides a service deployment method, apparatus, storage medium, and electronic device to at least address the problem in related technologies where machine code residues are generated during the fault recovery process of distributed clusters, resulting in low service deployment efficiency.
[0007] According to an embodiment of the present invention, a method for deploying a service is provided, comprising: obtaining a target service to be deployed on a target distributed cluster, wherein the target distributed cluster includes a target node, the target node being used to receive requests associated with the target service; invoking a cleanup program on the target node to delete invalid machine codes, wherein the target service has pre-authorized a first group of machine codes, the cleanup program being used to identify machine codes in the first group of machine codes that are different from the target machine code as the invalid machine codes, the target machine code being the machine code corresponding to the target node; and, if the invalid machine codes have been cleaned up, verifying the authorization of the target machine codes, and, if the verification is successful, starting to provide the target service on the target node.
[0008] According to another embodiment of the present invention, a service deployment apparatus is provided, comprising:
[0009] The acquisition module is used to acquire the target service to be deployed in the target distributed cluster, wherein the target distributed cluster includes a target node, and the target node is used to receive requests associated with the target service;
[0010] The deletion module is used to call a cleanup program on the target node to delete invalid machine codes. The target service has pre-authorized a first group of machine codes. The cleanup program is used to identify machine codes in the first group of machine codes that are different from the target machine code as invalid machine codes. The target machine code is the machine code corresponding to the target node.
[0011] The verification module is used to verify the authorization of the target machine code when the invalid machine code has been cleaned up, and to start providing the target service on the target node if the verification is successful.
[0012] Optionally, the device is configured to call a cleanup program on the target node to delete invalid machine codes in the following manner: obtaining the first group of machine codes corresponding to the first group of nodes, wherein the first group of nodes are nodes pre-configured in the target distributed cluster that are allowed to provide the target service; traversing the first group of machine codes and adding machine codes in the first group of machine codes that are different from the target machine code to a deletion list; and deleting the invalid machine code and the database record corresponding to the invalid machine code according to the deletion list.
[0013] Optionally, the device is configured to obtain the first group of machine codes corresponding to the first group of nodes by: obtaining a first group of network addresses, wherein the first group of network addresses includes the host network addresses associated with each node in the first group of nodes; and determining the first group of machine codes based on the first group of network addresses.
[0014] Optionally, the device is configured to traverse the first group of machine codes in the following manner, adding machine codes in the first group of machine codes that are different from the target machine code to a list to be deleted: calling a target interface to obtain a second group of network addresses corresponding to a second group of nodes, wherein the target interface is an interface in the target distributed cluster used to obtain cluster node information, and the second group of nodes are nodes in the target distributed cluster currently marked as allowed to provide the target service; traversing the first group of machine codes to determine whether each network address in the first group of network addresses belongs to the second group of network addresses; comparing the first machine code corresponding to the first network address with the target machine code, and if the first machine code is different from the target machine code... The first machine code is added to the list to be deleted, wherein the first network address represents a network address in the first group of network addresses that does not belong to the second group of network addresses, and the first group of machine codes includes the first machine code; the second machine code corresponding to the second network address is compared with the target machine code, and if the second network address is the same as the target network address and the second machine code is different from the target machine code, the second machine code is added to the list to be deleted, wherein the second network address represents a network address in the first group of network addresses that belongs to the second group of network addresses, the target network address is the host network address associated with the target node, and the first group of machine codes includes the second machine code.
[0015] Optionally, the apparatus is further configured to: before calling the target interface to obtain the second group of nodes and the second group of network addresses corresponding to the second group of nodes, select and mark N nodes in the target distributed cluster, where N is a positive integer; when the number of replicas of the target service is set to N, authorize the target service for each of the N nodes according to the machine code corresponding to the node, configure the license information of the target service corresponding to the machine code, and determine the N nodes as the second group of nodes.
[0016] Optionally, the device is configured to delete the invalid machine code and the database record corresponding to the invalid machine code according to the list to be deleted in the following manner: In the target database, a first data structure, a second data structure, and a third data structure corresponding to the invalid machine code are determined according to the list to be deleted, wherein the first data structure records a one-to-one correspondence between the machine code and the network address, the second data structure records a one-to-one correspondence between the machine code and the host hardware information, and the third data structure records a one-to-one correspondence between the machine code and the license information of the target service; and the database records associated with the first data structure, the second data structure, and the third data structure are deleted in the target database.
[0017] Optionally, the device is configured to verify the authorization of the target machine code in the event that the invalid machine code has been cleaned up, and, if the verification is successful, to begin providing the target service on the target node: acquiring the target machine code, the target network address, and the target host hardware information, wherein the target machine code, the target network address, and the target host hardware information all correspond to the target node, the target host hardware information represents the hardware information of the host associated with the target node, and the target network address represents the network address of the host associated with the target node; querying the target machine code in the target database to determine the existence status of the target machine code; and instructing the target database packet in the existence status. If the target machine code is included, the first data structure and the second data structure corresponding to the target machine code are updated based on the target network address and the target host hardware information; if the existence status indicates that the target database does not include the target machine code, the first data structure, the second data structure, and the third data structure corresponding to the target machine code are added based on the target network address and the target host hardware information, wherein the third data structure is set to empty to indicate that the target node is not pre-configured as a node that is allowed to provide the target service; the third data structure corresponding to the target machine code is read for verification, and if the verification is successful, the target service is started to be provided on the target node.
[0018] According to yet another embodiment of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored therein, wherein the computer program is configured to perform the steps in any of the above method embodiments when it is run.
[0019] According to yet another embodiment of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0020] This invention provides a method for obtaining a target service to be deployed on a target distributed cluster. The target distributed cluster includes target nodes that receive requests associated with the target service. A cleanup program is invoked on the target node to delete invalid machine codes. The target service pre-authorizes a first set of machine codes. The cleanup program identifies machine codes in the first set that differ from the target machine code as invalid machine codes. The target machine code corresponds to the target node. After invalid machine codes have been cleaned up, the authorization of the target machine code is verified. If the verification is successful, the target service is provided on the target node. By obtaining a list of network addresses of cluster nodes based on node tags and comparing it with network addresses and machine codes recorded in a database, the cleanup of invalid machine codes and invalid authorization information is automated. This simplifies the deployment and maintenance of the distributed cluster after changes, and solves the problem of low service deployment efficiency caused by residual machine codes during fault recovery in related technologies. This achieves the technical effect of improving service deployment efficiency and simplifying the service deployment process. Attached Figure Description
[0021] Figure 1 This is a hardware structure block diagram of a mobile terminal for a service deployment method according to an embodiment of the present invention.
[0022] Figure 2 This is a flowchart of a service deployment method according to an embodiment of the present invention;
[0023] Figure 3 This is a schematic diagram illustrating a specific example of a service deployment method according to an embodiment of the present invention;
[0024] Figure 4 This is a schematic diagram of the execution flow of a service deployment method according to an embodiment of the present invention;
[0025] Figure 5 This is a schematic diagram of the execution flow of another service deployment method according to an embodiment of the present invention;
[0026] Figure 6 This is a schematic diagram illustrating the execution flow of another service deployment method according to an embodiment of the present invention;
[0027] Figure 7 This is a structural block diagram of a service deployment apparatus according to an embodiment of the present invention. Detailed Implementation
[0028] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings and examples.
[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0030] The methods and embodiments provided in this application can be executed on a mobile terminal, a computer terminal, or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a service deployment method according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0031] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the service deployment method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0032] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0033] This embodiment provides a method for deploying a service. Figure 2 This is a flowchart of a service deployment method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0034] S202, Obtain the target service to be deployed in the target distributed cluster, wherein the target distributed cluster includes target nodes, and the target nodes are used to receive requests associated with the target service;
[0035] Optionally, in this embodiment, the target distributed cluster may include, but is not limited to, various distributed clusters implemented by deploying containers for managing containerized applications on multiple hosts in a cloud platform.
[0036] For example, this may include, but is not limited to, Kubernetes. The goal of Kubernetes is to make deploying containerized applications simple and efficient. Kubernetes provides a mechanism for application deployment, planning, updating, and maintenance.
[0037] Kubernetes achieves this by deploying containers, each isolated from the others, with its own file system. Processes within containers do not interfere with each other, and computing resources are differentiated. Compared to virtual machines, containers can be deployed quickly. Because containers are decoupled from the underlying infrastructure and machine file system, they can be migrated between different clouds and different operating system versions.
[0038] Containers consume fewer resources and deploy quickly. Each application can be packaged into a container image, and the one-to-one relationship between each application and container gives containers a significant advantage. Using containers, container images can be created for applications during the build or release phase. Because each application does not need to be combined with other application stacks or depend on the production environment infrastructure, this provides a consistent environment from development to testing and production. Similarly, containers are lighter and more "transparent" than virtual machines, making them easier to monitor and manage.
[0039] It's important to note that cloud technology refers to a hosting technology that unifies hardware, software, and network resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. It's a collective term for network technologies, information technologies, integration technologies, management platform technologies, and application technologies based on the cloud computing business model. These technologies can form resource pools, allowing for on-demand use and flexibility. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will require robust system support, which can only be achieved through cloud computing.
[0040] Cloud computing refers to the delivery and usage model of IT infrastructure, meaning obtaining necessary resources in an on-demand and easily scalable manner through a network. In a broader sense, cloud computing also refers to the delivery and usage model of services, meaning obtaining necessary services in an on-demand and easily scalable manner through a network. These services can be IT and software related, internet-related, or other services. Cloud computing is a product of the convergence of traditional computer and network technologies such as grid computing, distributed computing, parallel computing, utility computing, network storage technologies, virtualization, and load balancing. Driven by the development of the internet, real-time data streams, the diversification of connected devices, and the demands of search services, social networks, mobile commerce, and open collaboration, cloud computing has developed rapidly. Unlike previous parallel and distributed computing, the emergence of cloud computing will fundamentally revolutionize the entire internet model and enterprise management model.
[0041] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of storage devices of various types (storage devices are also called storage nodes) in the network to work together through application software or application interfaces to provide data storage and business access functions to the outside world.
[0042] A database, simply put, can be viewed as an electronic filing cabinet—a place to store electronic files, where users can perform operations such as adding, querying, updating, and deleting data. A "database" is a collection of data stored together in a certain way, capable of being shared by multiple users, with minimal redundancy, and independent of application programs.
[0043] A Database Management System (DBMS) is a computer software system designed to manage databases, generally possessing basic functions such as storage, retrieval, security, and backup. DBMSs can be classified according to the database model they support, such as relational or XML (Extensible Markup Language); or according to the type of computer they support, such as server clusters or mobile devices; or according to the query language used, such as SQL (Structured Query Language) or XQuery; or according to performance priorities, such as maximum scale or maximum operating speed; or other classification methods. Regardless of the classification method used, some DBMSs can cross categories, for example, simultaneously supporting multiple query languages.
[0044] In one exemplary embodiment, the deployment method of the above-described service can be applied to, but is not limited to, the field of cloud gaming, also known as gaming on demand, which is an online gaming technology based on cloud computing technology. Cloud gaming technology enables thin clients with relatively limited graphics processing and data processing capabilities to run high-quality games. In a cloud gaming scenario, the game does not run on the player's gaming terminal but on a cloud server. The cloud server renders the game scene as a video and audio stream, which is then transmitted to the player's gaming terminal via the network. The player's gaming terminal does not need to have powerful graphics processing and data processing capabilities; it only needs basic streaming media playback capabilities and the ability to obtain player input commands and send them to the cloud server.
[0045] In one exemplary embodiment, the deployment method of the above services can be applied to, but is not limited to, the field of cloud education. Cloud Computing Education (CCEDU) refers to an education platform service based on a cloud computing business model. On the cloud platform, all educational institutions, training institutions, enrollment service agencies, publicity agencies, industry associations, management agencies, industry media, legal structures, etc., are centrally integrated into a resource pool. These resources can be displayed and interacted with each other, communicate on demand, and reach agreements, thereby reducing education costs and improving efficiency.
[0046] In one exemplary embodiment, the deployment method of the above-described service can be applied to, but is not limited to, the field of cloud conferencing, which is an efficient, convenient, and low-cost form of meeting based on cloud computing technology. Users only need to perform simple and easy-to-use operations through an internet interface to quickly and efficiently share voice, data files, and videos with teams and clients around the world. The complex technologies such as data transmission and processing during the meeting are handled by the cloud conferencing service provider.
[0047] Currently, domestic cloud conferencing mainly focuses on services based on the SaaS (Software as a Service) model, including telephone, internet, and video services. Video conferencing based on cloud computing is called cloud conferencing.
[0048] In the era of cloud conferencing, the transmission, processing, and storage of data are all handled by the computer resources of the video conferencing vendors. Users no longer need to purchase expensive hardware or install cumbersome software. They can simply open a browser, log in to the corresponding interface, and conduct efficient remote meetings.
[0049] Cloud conferencing systems support dynamic multi-server cluster deployment and provide multiple high-performance servers, significantly improving meeting stability, security, and availability. In recent years, video conferencing has gained popularity due to its ability to greatly improve communication efficiency, continuously reduce communication costs, and upgrade internal management, and is widely used in various fields such as transportation, logistics, telecommunications, education, and enterprises. Undoubtedly, with the application of cloud computing, video conferencing will be even more attractive in terms of convenience, speed, and ease of use, inevitably triggering a new surge in video conferencing applications.
[0050] In one exemplary embodiment, the deployment method of the above-described service can be applied to fields including but not limited to cloud social networking. Cloud social networking is a virtual social application model that integrates the Internet of Things, cloud computing, and mobile Internet to establish a well-known "resource sharing relationship graph" and then conduct online social networking. The main feature of cloud social networking is that it unifies and evaluates a large amount of social resources to form an effective resource pool and provides services to users on demand. The more users participate in sharing, the greater the utilization value that can be created.
[0051] For example, take cloud conferencing as an example. Figure 3 This is a schematic diagram illustrating a specific example of a service deployment method according to an embodiment of the present invention, such as... Figure 3 As shown, a video conferencing system includes an MCU (Multipoint Control Unit, i.e., a video conferencing server) and various participating devices such as software and hardware terminals, and recording servers. Terminals capture images and audio, encode them, and send them to the MCU. The MCU then, according to the meeting requirements, merges or does not merge the images sent from multiple terminals, and mixes or does not mix the audio before sending it to each participating terminal, thus enabling audio and video communication among multiple participants. With the increasing popularity of cloud-native technologies, video conferencing system server software can also be containerized using container orchestration infrastructure software such as Kubernetes, thereby gaining benefits such as containerized isolation of the runtime environment, limited use of system resources, and ease of system operation and maintenance.
[0052] It should be noted that the aforementioned target service is... Figure 3 Any one or more registration services shown, such as registration service 1, registration service 2, etc.
[0053] Optionally, in this embodiment, the target node is a node pre-set by the target distributed cluster for the application associated with the target service. This node can accept the registration request of the terminal through load balancing using technologies such as ingress.
[0054] S204, On the target node, the cleanup program is called to delete the invalid machine code. The target service has pre-authorized the first group of machine codes. The cleanup program is used to identify the machine codes in the first group of machine codes that are different from the target machine code as invalid machine codes. The target machine code is the machine code corresponding to the target node.
[0055] Optionally, in this embodiment, the cleanup procedure may include, but is not limited to, a cleanup procedure added to the startup script of the target service. By adding a machine code cleanup procedure call to the startup script of the target service, when the target service starts deployment, the cleanup procedure can be called to complete the cleanup of invalid machine codes. When the cleanup is completed, the cleanup procedure exits and the target service continues to start.
[0056] It should be noted that the target database connected to the target distributed cluster stores a first group of pre-authorized nodes. The machine code corresponding to this first group of nodes is the aforementioned first group of machine codes. By comparing whether the aforementioned first group of machine codes includes the target machine code corresponding to the target node, the invalid machine code in the aforementioned first group of machine codes can be determined.
[0057] Among them, the aforementioned invalid machine codes represent historical machine codes remaining in the target distributed cluster after node failure recovery or cluster reorganization. The nodes corresponding to these machine codes can no longer be used as nodes for software license verification checks, and therefore need to be cleaned up.
[0058] It should be noted that the number of target nodes mentioned above is preset by the system and can be one or more.
[0059] S206: If the invalid machine code has been cleaned up, verify the authorization of the target machine code, and if the verification is successful, start providing the target service on the target node.
[0060] Optionally, in this embodiment, the clearing of the aforementioned invalid machine code can be understood as the first group of machine codes being compared with the target machine code, and the invalid machine code being deleted based on the comparison results.
[0061] It should be noted that the above-mentioned authorization verification of the target machine code can be understood as the need to complete the above verification before using the target service, so that the target node can receive request messages from the outside regarding the target service.
[0062] This embodiment allows for the acquisition of a target service to be deployed on a target distributed cluster. The target distributed cluster includes target nodes, which receive requests associated with the target service. A cleanup program is invoked on the target node to delete invalid machine codes. The target service pre-authorizes a first group of machine codes. The cleanup program identifies machine codes in the first group that differ from the target machine code as invalid machine codes. The target machine code corresponds to the target node. After invalid machine codes have been cleaned up, the authorization of the target machine code is verified. If the verification is successful, the target service is provided on the target node. By obtaining a list of network addresses of cluster nodes based on node tags and comparing it with the network addresses and machine codes recorded in the database, automated cleanup of invalid machine codes and invalid authorization information is achieved. This simplifies the deployment and maintenance of the distributed cluster after changes, and solves the problem of low service deployment efficiency caused by residual machine codes during fault recovery in related technologies. This achieves the technical effect of improving service deployment efficiency and simplifying the service deployment process.
[0063] As an optional approach, a cleanup program is invoked on the target node to delete invalid machine codes, including: obtaining the first group of machine codes corresponding to the first group of nodes, wherein the first group of nodes are nodes in the target distributed cluster that are pre-configured to provide the target service; traversing the first group of machine codes and adding machine codes in the first group that are different from the target machine code to the list to be deleted; and deleting invalid machine codes and the database records corresponding to the invalid machine codes according to the list to be deleted.
[0064] Optionally, in this embodiment, the first group of nodes refers to nodes that are pre-set to provide the target service before node failure recovery or cluster reorganization.
[0065] It should be noted that the above-mentioned traversal of the first group of machine codes can be understood as comparing the target machine code with each machine code in the first group of machine codes in turn, and adding the machine codes that do not match the comparison results to the above-mentioned list to be deleted.
[0066] Optionally, in this embodiment, the database record corresponding to the failed machine code may include, but is not limited to, the following:
[0067] Hashset, key: code2ip, field: hw_code (hash machine code), value: POD_HOST_IP (internal IP address of the node's host machine);
[0068] Hashset, key: code2hw, field: hw_code (hash machine code), value: hw_code2 (original machine code, containing the original hardware serial number information, used for manual location and investigation of invalid machine codes);
[0069] The Hashset, with key: code2license, field: hw_code (hash machine code), and value: licensestring (license software license string), contains authorization information such as validity period, license content, and signature.
[0070] As an optional approach, obtaining the first set of machine codes corresponding to the first set of nodes includes: obtaining the first set of network addresses, wherein the first set of network addresses includes the host network addresses associated with each node in the first set of nodes; and determining the first set of machine codes based on the first set of network addresses.
[0071] Optionally, in this embodiment, the aforementioned host network address can be understood as the IP address of the physical machine deployed on each node in the intranet. One physical machine allows multiple nodes to be deployed. In other words, the physical machine addresses of multiple nodes may be the same or different.
[0072] As an optional approach, the first group of machine codes is traversed, and machine codes in the first group that differ from the target machine code are added to the list to be deleted. This includes: calling the target interface to obtain the second group of network addresses corresponding to the second group of nodes, where the target interface is the interface used to obtain cluster node information in the target distributed cluster, and the second group of nodes are the nodes in the target distributed cluster currently marked as allowed to provide the target service; traversing the first group of machine codes to determine whether each network address in the first group of network addresses belongs to the second group of network addresses; comparing the first machine code corresponding to the first network address with the target machine code, and adding machine codes that differ from the target machine code. In the following case, the first machine code is added to the list to be deleted, where the first network address refers to the network address in the first group of network addresses that does not belong to the second group of network addresses, and the first group of machine codes includes the first machine code; the second machine code corresponding to the second network address is compared with the target machine code. If the second network address is the same as the target network address and the second machine code is different from the target machine code, the second machine code is added to the list to be deleted, where the second network address refers to the network address in the first group of network addresses that belongs to the second group of network addresses, the target network address is the host network address associated with the target node, and the first group of machine codes includes the second machine code.
[0073] Optionally, in this embodiment, the aforementioned second group of nodes represents nodes marked by the target distributed cluster as permitted to provide the target service after node failure recovery or cluster reorganization.
[0074] In an exemplary embodiment, the first group of machine codes is traversed in the following manner to determine whether each network address in the first group of network addresses belongs to the second group of network addresses; the first machine code corresponding to the first network address is compared with the target machine code:
[0075] S1, call the interface to obtain its own hash machine code, which is x;
[0076] S2, obtains the internal network IP of its own node's host machine, which is HIP;
[0077] S3 calls the Kubernetes API client to obtain the list of nodes in the cluster that are tagged with li=true and the corresponding list of host machine internal network IPs, which is lips;
[0078] S4, access the database and retrieve the code2ip list;
[0079] S5, iterate through the code2ip list, hash the machine code as y, and assign the corresponding IP as yip:
[0080] Traverse the list of lips, including the following steps:
[0081] S5-1, if yip is not in the lips list, then determine whether machine code y is equal to x. If they are not equal, add the corresponding machine code y to the list to be deleted.
[0082] S5-2, if yip is in the lips list, its own IP (i.e., hip) is equal to yip and its machine code y is not equal to its machine code x, then add y to the list to be deleted;
[0083] S6, end the traversal;
[0084] S7, traverse the list to be deleted, and execute hdel to delete the records in code2ip, code2hw, and code2license;
[0085] S8, machine code cleanup complete.
[0086] As an optional approach, before calling the target interface to obtain the second group of nodes and the second group of network addresses corresponding to the second group of nodes, the above method further includes: selecting and marking N nodes in the target distributed cluster, where N is a positive integer; when the number of replicas of the target service is set to N, authorizing the target service for each of the N nodes according to the machine code corresponding to the node, configuring the license information of the target service corresponding to the machine code, and determining the N nodes as the second group of nodes.
[0087] Optionally, in this embodiment, the license information of the target service may include, but is not limited to, the validity period, the start time of the validity period, the end time of the validity period, signature information, and other authorized content.
[0088] In an exemplary embodiment, N nodes can be selected and marked in the target distributed cluster as follows: with the number of replicas of the target service set to N, the target service is authorized for each of the N nodes according to the machine code corresponding to the node, and the license information of the target service corresponding to the machine code is configured, thus determining the N nodes as the second group of nodes:
[0089] S1, Select N suitable nodes in the distributed cluster and label them li=true;
[0090] S2, the scheduling strategy for the registered service is: nodes must contain the label li=true;
[0091] S3 sets the number of replicas of the registration service to N and uses technologies such as ingress for load balancing to accept registration requests from terminals.
[0092] S4 sets up the service readiness probe and service liveness probe for the registered service, which detect the listening port of the registered service; example: httpGet, path: / , port:8191. This ensures that the registered service does not provide services externally if it fails the license check.
[0093] S5, set the database, where the database service can be a key-value database (such as Redis) or a relational database (such as MySQL), without restriction;
[0094] S6 sets appropriate intra-cluster access permissions for containers that register services, including ServiceAccount, ClusterRole, and ClusterRoleBinding information, so that they can obtain cluster node information.
[0095] S7 licenses the software for each registered service copy according to the machine code of the corresponding node and configures the corresponding license string.
[0096] As an optional approach, deleting invalid machine codes and their corresponding database records based on a list to be deleted includes: determining, in the target database, a first data structure, a second data structure, and a third data structure corresponding to the invalid machine codes, respectively, based on the list to be deleted. The first data structure records a one-to-one correspondence between the machine code and the network address; the second data structure records a one-to-one correspondence between the machine code and the host hardware information; and the third data structure records a one-to-one correspondence between the machine code and the target service's license information. Then, deleting the database records associated with the first, second, and third data structures in the target database.
[0097] For example, the first data structure mentioned above may be, but is not limited to: Hashset, key: code2ip, field: hw_code (hash machine code), value: POD_HOST_IP (internal IP address of the node host machine);
[0098] The second data structure mentioned above may be, but is not limited to, Hashset, key: code2hw, field: hw_code (hash machine code), value: hw_code2 (original machine code, containing the original hardware serial number information, used for manual location and investigation of invalid machine codes);
[0099] The third data structure mentioned above can be, but is not limited to, a Hashset, key: code2license, field: hw_code (hash machine code), and value: license string (license software license string), which contains authorization information such as validity period, authorization content, signature, etc.
[0100] As an optional approach, after invalid machine codes have been cleared, the authorization of the target machine code is verified. If the verification is successful, the target service is provided on the target node. This includes: obtaining the target machine code, target network address, and target host hardware information, where the target machine code, target network address, and target host hardware information all correspond to the target node. The target host hardware information represents the hardware information of the host associated with the target node, and the target network address represents the network address of the host associated with the target node; querying the target machine code in the target database to determine its existence status; if the existence status indicates that the target database includes the target machine code, updating the first and second data structures corresponding to the target machine code based on the target network address and target host hardware information; if the existence status indicates that the target database does not include the target machine code, adding the first, second, and third data structures corresponding to the target machine code based on the target network address and target host hardware information, where the third data structure is set to empty to indicate that the target node is not pre-configured as a node allowed to provide the target service; reading the third data structure corresponding to the target machine code for verification, and if the verification is successful, providing the target service on the target node.
[0101] Optionally, in this embodiment, the above-mentioned verification of the authorization of the target machine code may include, but is not limited to, the following:
[0102] S1, obtain the machine code x (corresponding to the aforementioned target machine code) of its own node (corresponding to the aforementioned target machine code), the node host IP is mip, and the original machine code hw2 of the node;
[0103] S2, read the record in the database where the value of the code2ip field is machine code x, where:
[0104] a) If machine code x already exists in the database, then use mip and hw2 to update the code2ip and code2hw records;
[0105] b) If machine code x does not exist in the database, then use x, mip, and hw2 to write new records code2ip, code2hw, and code2license; if the license in the code2license record is empty, it means that no license has been set.
[0106] S3, Initiate the license validity check loop:
[0107] a) The registration service reads the code2license record and obtains the license corresponding to its own machine code x;
[0108] b) Verify the validity of the license, including whether the digital signature is valid and whether the time validity is valid;
[0109] c) If invalid, wait for several seconds and then jump to a (Why wait for several seconds? To retry);
[0110] d) If valid, exit the loop.
[0111] S4 opens the registration service listening port 8191 and begins providing services to the outside world.
[0112] Obviously, the embodiments described above are only some embodiments of the present invention, and not all embodiments.
[0113] The present invention will be described in detail below with reference to specific embodiments:
[0114] A video conferencing system includes an MCU (Multipoint Control Unit, i.e., a video conferencing server) and various participating devices such as software and hardware terminals, recording servers, etc. Terminals capture images and audio, encode them, and send them to the MCU. The MCU then merges or does not merge the images sent from multiple terminals, and mixes or does not mix the audio before sending them to each participating terminal, thus enabling audio and video communication among multiple participants. With the increasing popularity of cloud-native technologies, video conferencing system server software can also be containerized using container orchestration infrastructure software such as Kubernetes, thereby gaining benefits such as containerized isolation of the runtime environment, limited use of system resources, and ease of system maintenance. To protect application software copyright, a software licensing mechanism is necessary for video conferencing software. Since video conferencing systems are often multi-node distributed clusters, to improve overall system high availability, multiple key nodes are often selected to perform software license verification checks, i.e., license validity checks, to ensure that if one node fails, the license of another node can still be verified, allowing the entire system to continue operating. However, during project deployment, it was found that node failure recovery or cluster reorganization often results in residual historical machine code in the system, making it impossible to determine which machine code is valid and which can be deleted. This poses a challenge to Kubernetes cluster software licensing deployment and failure recovery. This application aims to provide a Kubernetes-based cluster application software licensing implementation method to solve the machine code residual problem encountered during failure recovery in multi-node high-availability deployment of Kubernetes cluster software licenses, thereby simplifying the application deployment process and accelerating the system failure recovery process.
[0115] Figure 4 This is a schematic diagram illustrating the execution flow of a service deployment method according to an embodiment of the present invention, such as... Figure 4 As shown, the Kubernetes cluster configuration process includes, but is not limited to, the following:
[0116] S402, Select N suitable nodes in the distributed cluster and label them li=true;
[0117] S404, The scheduling policy for the registration service is: nodes must contain the tag li=true;
[0118] S406 sets the number of replicas of the registration service to N and uses load balancing techniques such as ingress to accept registration requests from terminals.
[0119] S408 sets the service readiness probe (readinessProbe) and service liveness probe (livenessProbe) for the registered service, and checks the listening port of the registered service; example: httpGet, path: / , port:8191. This ensures that the registered service does not provide services externally if it fails the license check.
[0120] S410, Configure the database, where the database service can be a key-value database (such as Redis) or a relational database (such as MySQL), without limitation;
[0121] S412 sets appropriate intra-cluster access permissions for containers that register services, including ServiceAccount, ClusterRole, and ClusterRoleBinding information, so that they can obtain cluster node information.
[0122] S414, for each copy of the registered service, software licenses are granted based on the machine code of the corresponding node, and the corresponding license string is configured.
[0123] Taking the Redis database storage structure as an example, the Redis data structure is defined as follows:
[0124] Hashset, key: code2ip, field: hw_code (hash machine code), value: POD_HOST_IP (internal IP address of the node's host machine);
[0125] Hashset, key: code2hw, field: hw_code (hash machine code), value: hw_code2 (original machine code, containing the original hardware serial number information, used for manual location and investigation of invalid machine codes);
[0126] The Hashset, with key: code2license, field: hw_code (hash machine code), and value: licensestring (license software license string), contains authorization information such as validity period, license content, and signature.
[0127] The meeting control service logic includes, but is not limited to, the following: reading all code2license records from the database service; providing machine code and license query interfaces; and providing an interface for setting licenses by machine code.
[0128] Figure 5 This is a schematic diagram illustrating the execution flow of another service deployment method according to an embodiment of the present invention, such as... Figure 5 As shown, the registration service logic includes, but is not limited to, the following:
[0129] S502, the machine code cleanup program sc is added to the registration service startup script. After the cleanup is complete, sc exits and the registration service continues to start.
[0130] S504, the registration service obtains the machine code x of its own node, the node host IP is mip, and the original machine code hw2 of the node;
[0131] S506, the registration service reads the record in the database where the value of the code2ip field is machine code x. If machine code x already exists in the database, the code2ip and code2hw records are updated using mip and hw2. If machine code x does not exist in the database, the code2ip, code2hw, and code2license records are newly written using x, mip, and hw2. If the license field in the code2license record is empty, it means that no license has been set.
[0132] S508, Initiate the license validity check loop:
[0133] S508-1, the registration service reads the code2license record and obtains the license corresponding to its own machine code x;
[0134] S508-2 verifies the legality of the license, including whether the digital signature is valid and whether the time validity is valid.
[0135] If S508-3 is invalid, wait for several seconds and then jump to S508-1;
[0136] S508-4, if valid, exit the loop;
[0137] S510 opens the registration service listening port 8191 and begins providing services to the outside world.
[0138] Figure 6 This is a schematic diagram illustrating the execution flow of another service deployment method according to an embodiment of the present invention, such as... Figure 6 As shown, the machine code cleanup program (sc) logic includes, but is not limited to, the following:
[0139] S602, calls the interface to obtain its own hash machine code, which is x;
[0140] S604 retrieves the internal network IP of its own node's host machine, which is HIP;
[0141] S606 calls the Kubernetes API client to obtain the list of nodes in the cluster that are tagged with li=true and the corresponding list of host machine internal network IPs, which is lips;
[0142] S608, access the database and retrieve the code2ip list;
[0143] S610, iterate through the code2ip list, hash the machine code as y, and assign the corresponding IP as yip:
[0144] S610-1, Traverse the list of lips, including the following steps:
[0145] S610-1-1, if yip is not in the lips list, then determine whether machine code y is equal to x. If they are not equal, add the corresponding machine code y to the list to be deleted.
[0146] S610-1-2, if yip is in the lips list, its own IP (i.e., hip) is equal to yip and its machine code y is not equal to its machine code x, then add y to the list to be deleted;
[0147] S612, end the traversal;
[0148] S614, traverse the list to be deleted, and execute hdel to delete the records in code2ip, code2hw, and code2license;
[0149] S616, Machine code cleanup complete.
[0150] This embodiment utilizes a machine code cleanup program to obtain a list of cluster node IPs based on node tags, and then compares this list with the IPs and machine codes recorded in the database using a comparison algorithm. This achieves automated cleanup of invalid machine codes and license-related information, simplifying deployment and maintenance after cluster changes. In various scenarios such as register service node reduction, register service node migration, register service node anomaly recovery, register service node anomaly replacement, and multiple Kubernetes cluster reorganization, simply by adjusting the `li=true` tag and redeploying the register service workload, invalid machine codes and license-related information can be automatically cleaned up. This simplifies cluster deployment complexity, simplifies daily cluster maintenance, and accelerates cluster fault recovery and reorganization. Furthermore, it supports high-availability load-balanced deployment of any number of replicas of the register service, such as 1, 2, or 3. Additionally, it supports anomaly recovery scenarios where the host IP remains unchanged but the machine code changes when a register service node is replaced.
[0151] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.
[0152] This embodiment also provides a service deployment apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0153] Figure 7 This is a structural block diagram of a service deployment apparatus according to an embodiment of the present invention, such as... Figure 7 As shown, the device includes:
[0154] The acquisition module 702 is used to acquire the target service to be deployed in the target distributed cluster, wherein the target distributed cluster includes a target node, and the target node is used to receive requests associated with the target service;
[0155] The deletion module 704 is used to call a cleanup program on the target node to delete invalid machine codes. The target service has pre-authorized a first group of machine codes. The cleanup program is used to identify machine codes in the first group of machine codes that are different from the target machine code as invalid machine codes. The target machine code is the machine code corresponding to the target node.
[0156] The verification module 706 is used to verify the authorization of the target machine code when the invalid machine code has been cleaned up, and to start providing the target service on the target node if the verification is successful.
[0157] As an optional solution, the device is used to call a cleanup program on the target node to delete invalid machine codes in the following manner: obtaining the first group of machine codes corresponding to the first group of nodes, wherein the first group of nodes are nodes pre-configured in the target distributed cluster that are allowed to provide the target service; traversing the first group of machine codes and adding machine codes in the first group of machine codes that are different from the target machine code to a list to be deleted; deleting the invalid machine code and the database record corresponding to the invalid machine code according to the list to be deleted.
[0158] As an optional solution, the device is used to obtain the first group of machine codes corresponding to the first group of nodes in the following manner: obtaining a first group of network addresses, wherein the first group of network addresses includes the host network addresses associated with each node in the first group of nodes; and determining the first group of machine codes based on the first group of network addresses.
[0159] As an optional solution, the device is used to traverse the first group of machine codes in the following manner, adding machine codes in the first group of machine codes that are different from the target machine code to a list to be deleted: calling a target interface to obtain a second group of network addresses corresponding to a second group of nodes, wherein the target interface is an interface in the target distributed cluster used to obtain cluster node information, and the second group of nodes are nodes in the target distributed cluster currently marked as allowed to provide the target service; traversing the first group of machine codes to determine whether each network address in the first group of network addresses belongs to the second group of network addresses; comparing the first machine code corresponding to the first network address with the target machine code, and adding machine codes that are different from the target machine code. In this case, the first machine code is added to the list to be deleted, wherein the first network address represents a network address in the first group of network addresses that does not belong to the second group of network addresses, and the first group of machine codes includes the first machine code; the second machine code corresponding to the second network address is compared with the target machine code, and if the second network address is the same as the target network address and the second machine code is different from the target machine code, the second machine code is added to the list to be deleted, wherein the second network address represents a network address in the first group of network addresses that belongs to the second group of network addresses, the target network address is the host network address associated with the target node, and the first group of machine codes includes the second machine code.
[0160] As an optional solution, the apparatus is further configured to: before calling the target interface to obtain the second group of nodes and the second group of network addresses corresponding to the second group of nodes, select and mark N nodes in the target distributed cluster, where N is a positive integer; when the number of replicas of the target service is set to N, authorize the target service for each of the N nodes according to the machine code corresponding to the node, configure the license information of the target service corresponding to the machine code, and determine the N nodes as the second group of nodes.
[0161] As an optional solution, the device is used to delete the invalid machine code and the database record corresponding to the invalid machine code according to the list to be deleted in the following manner: In the target database, a first data structure, a second data structure, and a third data structure corresponding to the invalid machine code are determined according to the list to be deleted, wherein the first data structure records a one-to-one correspondence between the machine code and the network address, the second data structure records a one-to-one correspondence between the machine code and the host hardware information, and the third data structure records a one-to-one correspondence between the machine code and the license information of the target service; and the database records associated with the first data structure, the second data structure, and the third data structure are deleted from the target database.
[0162] As an optional solution, the device is used to verify the authorization of the target machine code after the invalid machine code has been cleared, and to start providing the target service on the target node if the verification is successful: acquiring the target machine code, the target network address, and the target host hardware information, wherein the target machine code, the target network address, and the target host hardware information all correspond to the target node, the target host hardware information represents the hardware information of the host associated with the target node, and the target network address represents the network address of the host associated with the target node; querying the target machine code in the target database to determine the existence status of the target machine code; and indicating the target service on the target node if the existence status is successful. If the database includes the target machine code, update the first data structure and the second data structure corresponding to the target machine code based on the target network address and the target host hardware information; if the existence status indicates that the target database does not include the target machine code, add the first data structure, the second data structure, and the third data structure corresponding to the target machine code based on the target network address and the target host hardware information, wherein the third data structure is set to empty to indicate that the target node is not pre-configured as a node that is allowed to provide the target service; read the third data structure corresponding to the target machine code for verification, and if the verification is successful, start providing the target service on the target node.
[0163] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0164] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
[0165] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0166] Embodiments of the present invention also provide an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0167] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0168] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.
[0169] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0170] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for deploying a service, characterized in that, include: Obtain the target service to be deployed on the target distributed cluster, wherein the target distributed cluster includes a target node, and the target node is used to receive requests associated with the target service; On the target node, a cleanup program is invoked to delete invalid machine codes. The target service has pre-authorized a first group of machine codes. The cleanup program is used to identify machine codes in the first group that are different from the target machine code as invalid machine codes. The target machine code is the machine code corresponding to the target node. If the invalid machine code has been cleaned up, the authorization of the target machine code is verified, and if the verification is successful, the target service is started to be provided on the target node.
2. The method according to claim 1, characterized in that, The step of calling the cleanup program on the target node to delete invalid machine codes includes: Obtain the first group of machine codes corresponding to the first group of nodes, wherein the first group of nodes are nodes pre-configured in the target distributed cluster that are allowed to provide the target service; Iterate through the first group of machine codes and add the machine codes in the first group that are different from the target machine code to the list to be deleted. Delete the invalid machine code and the database record corresponding to the invalid machine code according to the list to be deleted.
3. The method according to claim 2, characterized in that, The step of obtaining the first group of machine codes corresponding to the first group of nodes includes: Obtain the first set of network addresses, wherein the first set of network addresses includes the host network addresses associated with each node in the first set of nodes; The first set of machine codes is determined based on the first set of network addresses.
4. The method according to claim 3, characterized in that, The step of traversing the first group of machine codes and adding machine codes in the first group that are different from the target machine code to the list to be deleted includes: Call the target interface to obtain the second group of network addresses corresponding to the second group of nodes, wherein the target interface is the interface in the target distributed cluster used to obtain cluster node information, and the second group of nodes are the nodes in the target distributed cluster that are currently marked as allowed to provide the target service; Traverse the first group of machine codes to determine whether each network address in the first group of network addresses belongs to the second group of network addresses; The first machine code corresponding to the first network address is compared with the target machine code. If the first machine code is different from the target machine code, the first machine code is added to the list to be deleted. The first network address refers to the network address in the first group of network addresses that does not belong to the second group of network addresses. The first group of machine codes includes the first machine code. The second machine code corresponding to the second network address is compared with the target machine code. If the second network address is the same as the target network address and the second machine code is different from the target machine code, the second machine code is added to the list to be deleted. The second network address refers to the network address belonging to the second group of network addresses in the first group of network addresses. The target network address is the host network address associated with the target node. The first group of machine codes includes the second machine code.
5. The method according to claim 4, characterized in that, Before calling the target interface to obtain the second group of nodes and the second group of network addresses corresponding to the second group of nodes, the method further includes: Select and label N nodes in the target distributed cluster, where N is a positive integer; When the number of replicas of the target service is set to N, the target service is authorized for each of the N nodes according to the machine code corresponding to the node, and the license information of the target service corresponding to the machine code is configured, and the N nodes are determined as the second group of nodes.
6. The method according to claim 2, characterized in that, The step of deleting the invalid machine code and the database record corresponding to the invalid machine code according to the list to be deleted includes: In the target database, a first data structure, a second data structure, and a third data structure corresponding to the invalid machine code are determined according to the list to be deleted. The first data structure records a one-to-one corresponding machine code and network address, the second data structure records a one-to-one corresponding machine code and host hardware information, and the third data structure records a one-to-one corresponding machine code and the license information of the target service. Delete the database records associated with the first data structure, the second data structure, and the third data structure in the target database.
7. The method according to claim 6, characterized in that, The step of verifying the authorization of the target machine code after the invalid machine code has been cleaned up, and starting to provide the target service on the target node if the verification is successful, includes: The target machine code, target network address, and target host hardware information are obtained, wherein the target machine code, target network address, and target host hardware information are all corresponding to the target node, the target host hardware information represents the hardware information of the host associated with the target node, and the target network address represents the network address of the host associated with the target node. The target machine code is queried in the target database to determine its existence status. If the existence status indicates that the target database includes the target machine code, the first data structure and the second data structure corresponding to the target machine code are updated based on the target network address and the target host hardware information. If the existence status indicates that the target database does not include the target machine code, the first data structure, the second data structure, and the third data structure corresponding to the target machine code are added based on the target network address and the target host hardware information. The third data structure is set to empty to indicate that the target node is not pre-configured as a node that is allowed to provide the target service. The third data structure corresponding to the target machine code is read for verification, and if the verification is successful, the target service is started to be provided on the target node.
8. A service deployment apparatus, characterized in that, include: The acquisition module is used to acquire the target service to be deployed in the target distributed cluster, wherein the target distributed cluster includes a target node, and the target node is used to receive requests associated with the target service; The deletion module is used to call a cleanup program on the target node to delete invalid machine codes. The target service has pre-authorized a first group of machine codes. The cleanup program is used to identify machine codes in the first group of machine codes that are different from the target machine code as invalid machine codes. The target machine code is the machine code corresponding to the target node. The verification module is used to verify the authorization of the target machine code when the invalid machine code has been cleaned up, and to start providing the target service on the target node if the verification is successful.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in any one of claims 1 to 7.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Distributed server system authorization control method and device
CN107579994A
Code scanning rule processing method and device, storage medium and electronic equipment
CN115543838A