Light service management method and device
By adopting a light service management method in computer systems, the problems of difficulty in function expansion and high maintenance costs in traditional monolithic architecture management methods are solved, rapid deployment and flexible management are achieved, and the overall performance and user experience of the system are improved.
Patent Information
- Application Number
- CN202510015935.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-04-25
AI Technical Summary
The traditional single-unit architecture management method of computer systems has problems such as high coupling, difficulty in function expansion, and high code maintenance costs, which are difficult to meet the needs of rapid iteration and flexible expansion.
Adopt a light service management method to achieve rapid deployment and management of light services by obtaining light service deployment packages from the cloud, decompressing and configuring and routing updates. The method includes responding to light service deployment instructions, updating the database and routing tables, and querying and returning the corresponding light service based on the identification information.
It improves the deployment efficiency of computer systems, reduces the time cost of business going online, enhances the flexibility and scalability of the system, and ensures the accuracy and reliability of service calls.
Smart Images

Figure CN119892822A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer system management, and in particular to a light service management method and device. Background Art
[0002] With the rapid development of information technology and the increasing complexity of business needs in various industries, the architecture of computer systems has undergone continuous evolution.
[0003] The traditional monolithic architecture management method of computer systems integrates all functions into a huge application. With the continuous expansion of business functions and the gradual expansion of system scale, the monolithic architecture has exposed many problems. For example, high coupling leads to difficulty in function expansion and high code maintenance costs. Every time the requirements change or the function is upgraded, the entire application often needs to be recompiled and deployed, which greatly limits the flexibility and maintainability of the system.
[0004] It can be seen that how to optimize the management method of computer systems has become a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention
[0005] The present application provides a light service management method and device to solve the technical problem of how to optimize the management of a computer system.
[0006] In order to solve the above technical problems, the embodiment of the present application provides a light service management method, including:
[0007] In response to the light service deployment instruction, obtain the light service deployment package from the cloud, and save the light service deployment package to a local directory;
[0008] Decompressing the light service deployment package to obtain the first light service and its corresponding configuration information, calling information and first identification information;
[0009] updating a database according to the configuration information, and updating a routing table according to the call information and the first identification information to complete the deployment of the first light service;
[0010] In response to the light service calling instruction, the routing table is queried according to the second identification information corresponding to the light service calling instruction, and the second light service corresponding to the second identification information is returned.
[0011] As one preferred solution, the first identification information includes an ID and a version number;
[0012] Before updating the database according to the configuration information, the method further includes:
[0013] Compare the ID and the version number with those in the routing table;
[0014] If the ID and version number combination identical to the first identification information is not detected in the routing table, it is determined that there is no version conflict, and the update operation of the database according to the configuration information continues;
[0015] If a combination of an ID identical to the first identification information but a different version number is detected in the routing table, a version compatibility check mechanism is triggered.
[0016] As one of the preferred solutions, after triggering the version compatibility check mechanism, it also includes:
[0017] Acquire the light service to be updated in the routing table that is identical to the first identification information ID;
[0018] The version number of the to-be-updated light service to be updated is compared with the version number of the first identification information. If the version number of the first identification information is greater than the to-be-updated version number, the update operation of the database according to the configuration information is continued.
[0019] As one of the preferred solutions, the routing table includes identification information and call information corresponding to multiple light services;
[0020] The updating of the routing table according to the first identification information includes:
[0021] The first identification information is used as a key and the calling information is used as a value and stored in the routing table.
[0022] As one preferred solution, before returning the second light service corresponding to the second identification information, the method further includes:
[0023] The real-time status information of the second light service is obtained, and if the second light service is in an enabled state, the second light service corresponding to the second identification information is returned.
[0024] Another embodiment of the present application provides a light service management device, characterized by comprising:
[0025] An acquisition module, used to respond to the light service deployment instruction, obtain the light service deployment package from the cloud, and save the light service deployment package to a local directory;
[0026] A decompression module, used to decompress the light service deployment package to obtain the first light service and its corresponding configuration information, call information and first identification information;
[0027] A deployment module, used to update the database according to the configuration information, and update the routing table according to the call information and the first identification information to complete the deployment of the first light service;
[0028] The calling module is used to query the routing table according to the second identification information corresponding to the light service calling instruction when responding to the light service calling instruction, and return the second light service corresponding to the second identification information.
[0029] As one preferred solution, the first identification information includes an ID and a version number;
[0030] The decompression module is further used for:
[0031] Compare the ID and the version number with those in the routing table;
[0032] If the ID and version number combination identical to the first identification information is not detected in the routing table, it is determined that there is no version conflict, and the update operation of the database according to the configuration information continues;
[0033] If a combination of an ID identical to the first identification information but a different version number is detected in the routing table, a version compatibility check mechanism is triggered.
[0034] As one preferred solution, the decompression module is further used for:
[0035] Acquire the light service to be updated in the routing table that is identical to the first identification information ID;
[0036] The version number of the to-be-updated light service to be updated is compared with the version number of the first identification information. If the version number of the first identification information is greater than the to-be-updated version number, the update operation of the database according to the configuration information is continued.
[0037] As one of the preferred solutions, the routing table includes identification information and call information corresponding to multiple light services;
[0038] The decompression module is specifically used for:
[0039] The first identification information is used as a key and the calling information is used as a value and stored in the routing table.
[0040] As one preferred solution, the decompression module is further used for:
[0041] The real-time status information of the second light service is obtained, and if the second light service is in an enabled state, the second light service corresponding to the second identification information is returned.
[0042] Compared with the prior art, the beneficial effects of the embodiments of the present application are at least one of the following:
[0043] 1) This application can quickly integrate new light services into the computer system by downloading the light service deployment package from the cloud to the local, decompressing it, and performing corresponding configuration and routing updates. Compared with the traditional complex deployment method, it greatly improves the deployment efficiency and reduces the time cost of business launch.
[0044] 2) The management method of this application enables the computer system to easily add, update and delete light services, and timely adjust the functions of the computer system according to changes in business needs. Different light services can be independently developed, deployed and upgraded, isolated from each other, and will not have too much impact on other services, thereby enhancing the overall flexibility and scalability of the computer system, and being able to better adapt to changing business scenarios and user needs.
[0045] 3) In the calling stage, the application returns the corresponding light service based on the unique identifier query routing table, ensuring the accuracy and reliability of service calling. No matter how many light services exist in the computer system, the target service can be found accurately, avoiding call confusion caused by service names or other factors, and improving the stability of the computer system and user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 It is a flowchart of a light service management method in one embodiment of the present application;
[0047] Figure 2 is a schematic diagram of the structure of a computer system in one embodiment of the present application;
[0048] Figure 3 It is a structural diagram of a light service management device in one embodiment of the present application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. The purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0050] In the description of this application, the terms "first", "second", "third", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", "third", etc. may explicitly or implicitly include one or more of the feature. In the description of this application, unless otherwise specified, "plurality" means two or more.
[0051] In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two elements. The terms "vertical", "horizontal", "left", "right", "upper", "lower" and similar expressions used in this article are only for illustrative purposes, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on this application. The term "and / or" used in this article includes any and all combinations of one or more related listed items. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0052] In the description of this application, it should be noted that, unless otherwise defined, all technical and scientific terms used in this application have the same meaning as those commonly understood by those skilled in the art. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood by specific circumstances.
[0053] It should be noted in advance that existing computer systems generally adopt two main architectural designs: monolithic architecture and microservice architecture.
[0054] Monolithic architecture design is a traditional computer system model, where all functions are concentrated in a large application. This approach faces many challenges when expanding functions and iterative upgrades, such as high coupling, difficult deployment and maintenance, etc. As the scale of the system continues to increase, the disadvantages of the monolithic architecture become more and more prominent, making it difficult to meet the needs of rapid iteration and flexible expansion.
[0055] The microservice architecture divides the application into a series of loosely coupled services, each responsible for a specific function. This design can improve the maintainability of the system, but it also brings new challenges such as service governance and configuration management. The dependencies between microservices are complex, and deployment and upgrading become more difficult. Each microservice also requires an independent operating environment, network overhead, and other management overhead.
[0056] In general, the existing computer system architecture, whether it is a monolithic architecture or a microservice architecture, has certain limitations and is difficult to meet the needs. The "service" in this application refers to lightweight services (i.e., light services). Such services have simple functions and single logic, and the services do not call each other. There are many such services (hundreds). If microservices are used, the computer resources consumed are several times that of stand-alone applications, and the maintenance cost will also surge after going online. However, the code management cost, development cost, and demand change cost of the stand-alone architecture are high. Once the demand changes, the entire project needs to be recompiled, packaged, and deployed, which does not meet the requirements of flexibility and maintainability.
[0057] Therefore, this application proposes a light service architecture, where "light service" refers to the lightweight implementation of business functions (a complex service can be decomposed into multiple light services at the application layer, and this complexity is handled externally). Light services have the following characteristics:
[0058] Lightweight business: Light services focus on providing a single business function, emphasize simplicity and efficiency in design, and do not involve complex interactions between services.
[0059] Stateless execution: The design of light services is similar to serverless functions. Each service executes independently, completes internal processing after being called, and returns the result. They do not need to maintain state or interact with other services.
[0060] Rapid development: Since light services only handle a single function, development efficiency is improved. Light services only perform necessary data queries and processing. After processing, the results are packaged and returned to the caller.
[0061] For example, the "frequent vehicle passing function" in a computer system can be developed as a light service. The light service only needs to implement an interface. After receiving the request, it queries the big data service in the background to obtain relevant vehicle passing data. After completing the data processing, the light service encapsulates the result into a response and returns it to the caller. The whole process does not involve the interaction of other services, making the function call simple and efficient.
[0062] In summary, an embodiment of the present application provides a light service management method. For details, see Figure 1 , Figure 1 The flowchart of the light service management method in one embodiment of the present application is shown, which includes steps S1-S4:
[0063] S1: In response to the light service deployment instruction, obtain the light service deployment package from the cloud, and save the light service deployment package to the local directory;
[0064] The light service deployment instruction is the starting signal that triggers the entire deployment process, usually issued by the system administrator or a specific deployment tool. It clearly instructs the computer system to obtain and deploy the specified light service. This instruction may contain relevant identification information of the light service, such as the name and version number of the light service, so as to accurately find the corresponding deployment package from the cloud.
[0065] Before obtaining a deployment package from the cloud, identity authentication and authorization operations are usually required to ensure that only users or systems with legal permissions can access and download the deployment package. In one embodiment of the present application, authentication methods such as username and password, access key, token, etc. can be used to prove the legitimacy of the cloud service provider, thereby obtaining permission to access and download the deployment package.
[0066] In one embodiment of the present application, different methods can be selected to download the deployment package from the cloud according to the specific environment and requirements, including using command line tools such as curl, wget, etc. to download by specifying the URL address of the deployment package; or using a dedicated cloud service client tool. During the download process, the download progress needs to be monitored and managed to ensure the integrity and stability of the download. Specifically, a download progress bar can be displayed to let the user know the status of the download; at the same time, it is also necessary to handle abnormal situations such as network interruptions and download failures, and ensure that the deployment package can be successfully downloaded to the local through mechanisms such as automatic retry and breakpoint resumption.
[0067] Use the corresponding file operation command or function to save the light service deployment package downloaded from the cloud to the selected local directory. During the saving process, it is necessary to ensure the integrity of the file to avoid file damage or loss. In one embodiment of the present application, the integrity of the file can be verified by calculating the checksum of the deployment package and comparing it with the checksum stored in the cloud.
[0068] S2: decompress the light service deployment package to obtain the first light service and its corresponding configuration information, call information and first identification information;
[0069] It is understandable that after obtaining the light service deployment package and saving it to a local directory, it needs to be decompressed. The decompression process is similar to opening a compressed file, and the files and folders in the deployment package are released to the specified directory through a specific decompression tool or command. This process will obtain the first light service and the corresponding configuration information, call information and first identification information.
[0070] The first identification information includes an ID and a version number, which is the unique identity of the light service in the system. The ID is used to accurately identify a specific light service in the entire system, while the version number indicates the specific version of the light service. Through the combination of the ID and the version number, a specific version of the light service in the system can be clearly located, which facilitates version management, updates, compatibility checks, and other operations.
[0071] The first identification information is closely related to the light service and its configuration information and call information. During the operation and management of the system, the first identification information can be used to quickly find the corresponding light service and its related configuration and call methods, ensuring that the system can accurately call and manage light services of different versions, and realize flexible deployment and upgrade of light services.
[0072] Preferably, in one embodiment of the present application, the first identification information includes an ID and a version number;
[0073] Before updating the database according to the configuration information, it also includes:
[0074] Compare the ID and version number with those in the routing table;
[0075] If the ID and version number combination identical to the first identification information is not detected in the routing table, it is determined that there is no version conflict, and the update operation of the database according to the configuration information continues;
[0076] If a combination of an ID identical to the first identification information but a different version number is detected in the routing table, a version compatibility check mechanism is triggered.
[0077] Before updating the database according to the configuration information, the ID and version number in the first identification information need to be compared with the routing table. The routing table is a key data structure used in the computer system to store routing information of light services, which records the key information such as the identification information, call address, port, etc. of the light service, so that when a call request is received, the request can be accurately forwarded to the corresponding light service.
[0078] Specifically, by comparing, it can be determined whether the light service to be deployed has a version conflict with the light service already in the routing table. If the ID and version number combination identical to the first identification information is not detected in the routing table, it means that the light service is brand new, or is a brand new upgrade of the existing light service, there is no version conflict, and the update operation of the database according to the configuration information can continue.
[0079] Furthermore, if a combination of the same ID as the first identification information but a different version number is detected in the routing table, it means that there may be a version conflict, and the version compatibility check mechanism needs to be triggered. The purpose of the version compatibility check mechanism is to ensure that the newly deployed light service version is compatible with other components or services already in the system, avoiding system failures or anomalies due to version incompatibility.
[0080] In one embodiment of the present application, version compatibility check involves multiple aspects, such as interface compatibility, data format compatibility, dependent library compatibility, etc. It is necessary to check whether the interface of the new light service version is compatible with the calling method of other services, whether the data format can be correctly parsed and processed by other components, and whether the dependent library files conflict with other library files in the system.
[0081] Preferably, in one embodiment of the present application, after triggering the version compatibility check mechanism, it also includes:
[0082] Obtain the light service to be updated that is identical to the first identification information ID in the routing table;
[0083] The version number of the light service to be updated is compared with the version number of the first identification information. If the version number of the first identification information is greater than the version number to be updated, the update operation of the database according to the configuration information is continued.
[0084] Specifically, after the version compatibility check mechanism is triggered, it is necessary to obtain the light service to be updated in the routing table that has the same ID as the first identification information, and compare its version number to be updated with the version number of the first identification information. This step is to further determine the relationship between the new light service version and the existing version, so as to determine whether the update operation can be performed.
[0085] If the version number of the first identification information is greater than the version number to be updated, it means that the new light service version is an upgrade of the existing version and has a higher version number. Generally, it can be considered that the new light service version has better functions and performance or fixes some problems of the existing version. Therefore, the database can be updated according to the configuration information to complete the upgrade deployment of the light service.
[0086] S3: updating the database according to the configuration information, and updating the routing table according to the calling information and the first identification information, so as to complete the deployment of the first light service;
[0087] In one embodiment of the present application, the configuration information in the obtained light service deployment package is parsed in detail. This configuration information may include database connection strings, data table structure definitions, data initialization scripts, and parameters for interacting with other system components. By parsing this information, it is clear which specific update operations need to be performed on the database, such as creating a new data table, modifying the structure of an existing table, inserting initial data, etc.
[0088] Furthermore, a connection to the database is established through a corresponding database driver according to the database connection parameters provided in the configuration information, such as database address, port, user name, password, etc. The stability and reliability of the connection are ensured so that the subsequent update operation can be smoothly performed.
[0089] According to the specific update tasks parsed, write and execute the corresponding SQL statements or use the specific interfaces provided by the database management tool to update the database. When performing update operations, you need to pay attention to the processing of transactions to ensure the consistency and integrity of the data. If the update operation involves multiple data tables or multiple related operation steps, you can encapsulate them in a transaction, either all of which are successfully executed or all are rolled back to avoid data inconsistency.
[0090] After completing the database update, verify and test the updated data to ensure that the accuracy and completeness of the data meet expectations. You can execute some query statements to check whether the new data table is created correctly, whether the data is inserted correctly, and whether the association with other related data tables is established correctly. At the same time, you can also perform some functional tests to ensure that the light service functions based on the new database structure and data can run normally.
[0091] Preferably, in one embodiment of the present application, the routing table includes identification information and call information corresponding to a plurality of light services;
[0092] Updating the routing table according to the first identification information includes:
[0093] The first identification information is used as a key and the call information is used as a value and stored in the routing table.
[0094] Among them, the routing table plays a key role in the entire light service management system. It contains identification information and call information corresponding to multiple light services. Among them, the identification information is used to uniquely identify each light service, and the call information records how to access and call the light service, such as the call address, port number, protocol type, etc. of the light service. Through this key-value pair method, the routing table can effectively associate the identification of the light service with its specific call method, so that when the system receives an external request, it can quickly and accurately find the corresponding light service and call it.
[0095] In one embodiment of the present application, key content related to routing is extracted from the call information and the first identification information, such as the call address, port number, protocol type, and ID and version number of the light service. This information will be used to accurately record the routing entry of the light service in the routing table, so that the corresponding light service can be quickly located when a call request is received.
[0096] Furthermore, the routing table is searched to see whether a light service routing entry corresponding to the first identification information already exists. If not, a new routing entry needs to be created; if it exists, the existing entry needs to be updated according to the new call information and the first identification information. Ensure that the information in the routing table is consistent with the actual deployment of the light service to avoid routing errors that lead to call failures.
[0097] According to the extracted key information and the search or creation results, the routing table is updated accordingly. The ID and version number of the light service are used as unique identifiers, associated with the corresponding call address, port number, protocol type and other information and stored in the routing table. During the update process, attention should be paid to concurrent access control of the routing table to avoid data inconsistency or routing conflicts caused by multiple update operations at the same time.
[0098] After completing the routing table update, a consistency check is required to ensure that all entries in the routing table conform to the expected format and logical relationship. Check the integrity of each routing entry to avoid missing key information or information mismatch. At the same time, you can also check whether there are conflicts in the routing rules in the routing table, such as whether there are multiple different light services using the same call address and port number. If a conflict is found, it needs to be adjusted and corrected in time.
[0099] S4: In response to the light service calling instruction, query the routing table according to the second identification information corresponding to the light service calling instruction, and return the second light service corresponding to the second identification information.
[0100] It is understandable that when the computer system receives the light service call instruction, it parses the instruction and extracts the second identification information contained therein. The second identification information is a key identifier used to uniquely identify the requested light service, similar to the ID card number of a specific service, which can accurately locate the target service among many light services.
[0101] Furthermore, the extracted second identification information is used as a key to search in the routing table. This search process is similar to searching for the corresponding definition through a specific entry in a dictionary. Through efficient search algorithms and data structures, the routing table entry matching the second identification information can be quickly located.
[0102] If there is an entry in the routing table that completely matches the second identification information, it means that the routing information of the corresponding light service has been found, and the call information of the light service can be obtained; if no matching entry is found, it may mean that the requested light service does not exist or the routing table information is incomplete, and the system may return a corresponding error prompt message.
[0103] After obtaining the call information corresponding to the second identification information, the computer system will call and return the corresponding second light service based on this information. The call information contains key details such as the specific location and access method of the light service, such as the server address, port number and call protocol of the light service. The system will establish a connection with the corresponding light service according to the instructions in the call information and forward the request to the light service. After receiving the request, the light service performs corresponding processing and returns the processing result to the computer system, and then the computer system passes the result to the client that initiated the call instruction.
[0104] Preferably, in one embodiment of the present application, before returning the second light service corresponding to the second identification information, the method further includes:
[0105] The real-time status information of the second light service is obtained, and if the second light service is in an enabled state, the second light service corresponding to the second identification information is returned.
[0106] It is understandable that before returning the second light service corresponding to the second identification information, it is necessary to obtain the real-time status information of the light service. This can be achieved by interacting with the runtime environment of the light service, for example, by calling the status query interface provided by the light service, or querying the relevant data structure or log file in the system for monitoring the status of the light service. The real-time status information obtained may include the running status of the light service (such as running, stopped, paused, etc.), resource usage (such as CPU usage, memory usage, etc.), the most recent error information, etc.
[0107] Based on the real-time status information obtained, determine whether the second light service is in an enabled state. Only when the light service is in an enabled state can it normally receive and process the call request and return the corresponding result. If the light service is in an inactive state, such as stopped or paused, it is necessary to decide whether to directly return an error message to the caller, or try to automatically start the light service or take other corresponding processing measures based on the specific business logic and requirements.
[0108] Another embodiment of the present application provides a computer system to implement the above service management method. For details, see Figure 2 , Figure 2 The structure diagram of a computer system in one embodiment of the present application is shown, which includes:
[0109] The computer system proposed in the embodiment of the present application adopts Vue application as the presentation layer, which is responsible for interacting with users and displaying various interfaces and information of the system. Vue is a popular front-end framework that can build a responsive user interface and provide users with a good operating experience. By interacting with the interface of the business layer, data is obtained and displayed, realizing the information interaction function between users and the system.
[0110] Business layer: A light service management platform is built on the business layer, based on SpringBoot application development. SpringBoot is a framework for creating independent, production-level Spring applications, which simplifies the configuration process and provides functions such as automatic configuration, allowing developers to focus more on the implementation of business logic. In this business layer, actual business functions are independently developed in the form of light services, such as the vehicle daytime and nighttime analysis function. Each light service is a relatively independent functional unit that can be deployed independently, but is usually uploaded and deployed on the interface as an independent part of the management system for unified management.
[0111] Data layer: The computer system proposed in the embodiment of the present application uses MySQL database as the data layer to store various data in the system, including relevant information of light services, business data, etc. MySQL is a widely used relational database management system with advantages such as high stability, good performance, and ease of use. It can meet the system's needs for data storage and management, provide data support for the business layer, and ensure persistent storage and efficient query of system data.
[0112] The business layer includes light service management module, routing registration and forwarding module, configuration management module, and log management and statistical analysis module.
[0113] As the core functional module of the system, the light service management module is responsible for comprehensive management of light services. Each light service is a separate functional module in the system, developed based on the Java language and packaged as a war package. This self-contained deployment package contains all the usage information related to the service, such as the functional description of the service, calling method, input and output structure, etc. The light service management module provides operations for adding, deleting, modifying and checking light services, as well as the function of disabling / enabling light services. Administrators can easily and quickly search and manage all light services in a unified manner through the interface, realizing centralized and visual management of light services.
[0114] Furthermore, the light service management module is responsible for the life cycle management of light services, including important functions such as dynamic loading, unloading, and hot upgrades. When the administrator uploads a light service through the management interface, the manager in the module will deploy it to the running environment and register it to the routing module for external calls. During the operation process, the management module will also monitor the running status of the light service in real time. Once an abnormality is found in the light service, it will automatically restart or isolate the abnormal light service when necessary to ensure the overall robustness and stability of the system and ensure the continuous normal operation of the system.
[0115] For each light service, the light service management module defines a unified call entry class com.gosun.AlgorithmMain and equips it with a proprietary Java class loader. In this way, dynamic loading of light services can be achieved, and the loading results can be saved in the routing table for external calls. This dynamic loading mechanism enables the system to manage the deployment and update of light services more flexibly. It can add and replace light services without restarting the entire system, which improves the maintainability and scalability of the system.
[0116] With the help of the version number mechanism, the light service management module supports multiple versions of the same application. When uploading a light service with a larger version number, the old version can be overwritten to achieve hot upgrade. Before the update is successful, the system will continue to use the previous latest version for external calls to ensure the availability of the system during the upgrade process, avoid system interruptions or service unavailability due to upgrade operations, and achieve seamless upgrades and continuous and stable operation of the system.
[0117] The routing registration and forwarding module is a key component for achieving efficient interaction between external requests and internal light services. When a user initiates a request to call a specific light service, the routing module will search the routing table for the corresponding light service registration information based on the request identifier, i.e., the light service ID, and then accurately hand over the request to the corresponding light service for processing, and return the processed result to the caller. This routing table-based request distribution mechanism ensures that requests can be quickly and accurately routed to the first light service, improving the system's response speed and processing efficiency.
[0118] Furthermore, the routing registration and forwarding module maintains metadata information of all light services, such as name, version, disabled status, etc., and persists this information in the database, while maintaining a corresponding routing table in memory. In this way, centralized management and efficient maintenance of light service metadata are achieved, which facilitates the system to monitor and manage the status of light services in real time, and provides strong support for accurate distribution of requests and dynamic management of light services.
[0119] It should be noted that, firstly, the routing registration and forwarding module centrally manages the registration information of all light services, so that the system can flexibly dynamically register and update light services. Administrators can easily modify and adjust the relevant information of all light services in one place, which is convenient for subsequent maintenance and upgrade work, and improves the management efficiency and flexibility of the system.
[0120] Secondly, the routing registration and forwarding module effectively decouples external requests from specific light service implementations. External callers do not need to understand the specific implementation details and deployment of light services, and can initiate requests simply through the light service ID. This design reduces the degree of coupling between the various parts of the system, improves the maintainability and scalability of the system, and ensures that changes or replacements of light services will not affect external calls, facilitating functional expansion and upgrades of the system.
[0121] Thirdly, the routing registration and forwarding module can quickly locate the corresponding light service according to the request identifier with the help of the routing mapping table maintained in the memory, ensuring that the request can be forwarded and processed in the shortest possible time. Especially in high-concurrency scenarios, this efficient request processing mechanism can significantly improve the overall performance of the system, ensure the rapid response of the system, and meet the concurrent request needs of a large number of users.
[0122] Fourthly, the routing registration and forwarding module manages the metadata of light services in the routing table, so that the system can monitor the usage status of light services in real time. When frequent abnormalities are detected in the service, the service can be disabled in time to avoid further expansion of the problem, ensure the stability and reliability of the system, and also facilitate the operation and maintenance personnel to troubleshoot and handle the system.
[0123] The configuration management module is responsible for unified management of various configuration information of the system, such as database connection address, database type, etc. Configuration information supports dynamic updates, and a full configuration table is also saved in memory. When the configuration changes, the configuration module will actively call the corresponding interface of the light service that registered the configuration, and synchronize the changed configuration to the light service, so as to achieve real-time configuration adjustment without restarting the entire system. This dynamic configuration management mechanism improves the flexibility and maintainability of the system, allowing the system to quickly adapt to different operating environments and changes in business needs, reducing system downtime caused by configuration changes, and improving system availability and operation and maintenance efficiency.
[0124] The log management module is responsible for the unified storage and management of the call logs of the entire system. After the caller calls the light service, the module will record the call duration, operation time and other information of the request in detail. These log information provides basic data for subsequent audits and interface performance analysis. By analyzing the logs, we can understand the system's operating status, user behavior, and the use of each functional module, which helps to discover potential problems and performance bottlenecks.
[0125] The statistical analysis module conducts in-depth analysis of the logs collected by the log management module to assist operation and maintenance personnel in quickly locating and solving problems. By analyzing the statistics and analysis of a large amount of log data, we can dig out information such as the operating rules of the system, the frequency and distribution of abnormal situations, and provide strong support for system optimization and troubleshooting. For example, based on the log analysis, we can find out which light services have a high call frequency and which time periods have a large system load, so as to carry out targeted performance optimization and resource adjustments.
[0126] Through the collaborative work of the above core modules, the technical solution of this application achieves high flexibility and maintainability of the computer system. The light service management system of the business layer can deploy multiple at the same time to share traffic, thereby meeting the requirements of scalability and reliability. This architectural design enables the system to better respond to changing business needs and high-concurrency user requests, improves the overall performance and stability of the system, reduces the maintenance cost and development difficulty of the system, and provides strong technical support for the information construction and business development of enterprises.
[0127] Another embodiment of the present application provides a light service management device, such as Figure 3 As shown, Figure 3 A schematic diagram of the structure of a light service management device provided in an embodiment of the present application is shown, including:
[0128] The acquisition module 11 is used to obtain the light service deployment package from the cloud in response to the light service deployment instruction, and save the light service deployment package to a local directory;
[0129] A decompression module 12 is used to decompress the light service deployment package to obtain the first light service and its corresponding configuration information, call information and first identification information;
[0130] A deployment module 13, used to update the database according to the configuration information, and update the routing table according to the call information and the first identification information to complete the deployment of the first light service;
[0131] The calling module 14 is used to query the routing table according to the second identification information corresponding to the light service calling instruction when responding to the light service calling instruction, and return the second light service corresponding to the second identification information.
[0132] Preferably, in one embodiment of the present application, the first identification information includes an ID and a version number;
[0133] Decompression module, also used for:
[0134] Compare the ID and version number with those in the routing table;
[0135] If the ID and version number combination identical to the first identification information is not detected in the routing table, it is determined that there is no version conflict, and the update operation of the database according to the configuration information continues;
[0136] If a combination of an ID identical to the first identification information but a different version number is detected in the routing table, a version compatibility check mechanism is triggered.
[0137] Preferably, in one embodiment of the present application, the decompression module is further used for:
[0138] Obtain the light service to be updated that is identical to the first identification information ID in the routing table;
[0139] The version number of the light service to be updated is compared with the version number of the first identification information. If the version number of the first identification information is greater than the version number to be updated, the update operation of the database according to the configuration information is continued.
[0140] Preferably, in one embodiment of the present application, the routing table includes identification information and call information corresponding to a plurality of light services;
[0141] Decompression module, specifically used for:
[0142] The first identification information is used as a key and the call information is used as a value and stored in the routing table.
[0143] Preferably, in one embodiment of the present application, the decompression module is further used for:
[0144] The real-time status information of the second light service is obtained, and if the second light service is in an enabled state, the second light service corresponding to the second identification information is returned.
[0145] Compared with the prior art, the beneficial effects of the embodiments of the present application are at least one of the following:
[0146] 1) This application can quickly integrate new light services into the computer system by downloading the light service deployment package from the cloud to the local, decompressing it, and performing corresponding configuration and routing updates. Compared with the traditional complex deployment method, it greatly improves the deployment efficiency and reduces the time cost of business launch.
[0147] 2) The management method of this application enables the computer system to easily add, update and delete light services, and timely adjust the functions of the computer system according to changes in business needs. Different light services can be independently developed, deployed and upgraded, isolated from each other, and will not have too much impact on other services, thereby enhancing the overall flexibility and scalability of the computer system, and being able to better adapt to changing business scenarios and user needs.
[0148] 3) In the calling stage, the application returns the corresponding light service based on the unique identifier query routing table, ensuring the accuracy and reliability of service calling. No matter how many light services exist in the computer system, the target service can be found accurately, avoiding call confusion caused by service names or other factors, and improving the stability of the computer system and user experience.
[0149] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A light service management method, characterized in that: include: In response to the light service deployment instruction, obtain the light service deployment package from the cloud, and save the light service deployment package to a local directory; Decompressing the light service deployment package to obtain the first light service and its corresponding configuration information, calling information and first identification information; updating a database according to the configuration information, and updating a routing table according to the call information and the first identification information to complete the deployment of the first light service; In response to the light service calling instruction, the routing table is queried according to the second identification information corresponding to the light service calling instruction, and the second light service corresponding to the second identification information is returned.
2. The light service management method according to claim 1, characterized in that: The first identification information includes an ID and a version number; Before updating the database according to the configuration information, the method further includes: Compare the ID and the version number with those in the routing table; If the ID and version number combination identical to the first identification information is not detected in the routing table, it is determined that there is no version conflict, and the update operation of the database according to the configuration information continues; If a combination of an ID identical to the first identification information but a different version number is detected in the routing table, a version compatibility check mechanism is triggered.
3. The light service management method according to claim 2, characterized in that: After the version compatibility check mechanism is triggered, it also includes: Acquire the light service to be updated in the routing table that is identical to the first identification information ID; The version number of the to-be-updated light service to be updated is compared with the version number of the first identification information. If the version number of the first identification information is greater than the to-be-updated version number, the update operation of the database according to the configuration information is continued.
4. The light service management method according to claim 1, characterized in that: The routing table includes identification information and call information corresponding to multiple light services; The updating of the routing table according to the first identification information includes: The first identification information is used as a key and the calling information is used as a value and stored in the routing table.
5. The light service management method according to claim 1, characterized in that: Before returning the second light service corresponding to the second identification information, the method further includes: The real-time status information of the second light service is obtained, and if the second light service is in an enabled state, the second light service corresponding to the second identification information is returned.
6. A light service management device, characterized in that: include: An acquisition module, used to respond to the light service deployment instruction, obtain the light service deployment package from the cloud, and save the light service deployment package to a local directory; A decompression module, used to decompress the light service deployment package to obtain the first light service and its corresponding configuration information, call information and first identification information; A deployment module, used to update the database according to the configuration information, and update the routing table according to the call information and the first identification information to complete the deployment of the first light service; The calling module is used to query the routing table according to the second identification information corresponding to the light service calling instruction when responding to the light service calling instruction, and return the second light service corresponding to the second identification information.
7. The light service management device according to claim 6, characterized in that: The first identification information includes an ID and a version number; The decompression module is further used for: Compare the ID and the version number with those in the routing table; If the ID and version number combination identical to the first identification information is not detected in the routing table, it is determined that there is no version conflict, and the update operation of the database according to the configuration information continues; If a combination of an ID identical to the first identification information but a different version number is detected in the routing table, a version compatibility check mechanism is triggered.
8. The light service management device according to claim 7, characterized in that: The decompression module is further used for: Acquire the light service to be updated in the routing table that is identical to the first identification information ID; The version number of the to-be-updated light service to be updated is compared with the version number of the first identification information. If the version number of the first identification information is greater than the to-be-updated version number, the update operation of the database according to the configuration information is continued.
9. The light service management device according to claim 6, characterized in that: The routing table includes identification information and call information corresponding to multiple light services; The decompression module is specifically used for: The first identification information is used as a key and the calling information is used as a value and stored in the routing table.
10. The light service management device according to claim 6, characterized in that: The decompression module is further used for: The real-time status information of the second light service is obtained, and if the second light service is in an enabled state, the second light service corresponding to the second identification information is returned.