A service control method, system, storage medium and electronic device
Through the separation of configuration management application module and forwarding application module, the third-party database is used to store service forwarding information, which solves the problem of low service request forwarding efficiency, reduces server pressure, and improves service forwarding efficiency and system flexibility.
Patent Information
- Application Number
- CN202210708277.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-21
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2042-06-21
AI Technical Summary
As the number of services and visits increase, the server pressure increases, resulting in the problem of low request forwarding efficiency.
Through the separation of configuration management application module and forwarding application module, third-party databases are used to store service forwarding information, decoupling of management application module and forwarding application module, development and management are achieved separately, reducing server pressure and improving service forwarding efficiency.
It realizes rapid forwarding processing of service requests, reduces server pressure, simplifies the development of service control system, and improves service forwarding efficiency and flexible management capabilities.
Smart Images

Figure CN115118787B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a service control method, system, storage medium and electronic device. Background Art
[0002] As the number of internal systems in an enterprise increases, each system provides services to the outside world independently, resulting in decentralized and complicated service management. To address the above issues, a centralized service control and management system was created to handle requests for all services.
[0003] In the process of implementing the present invention, it is found that there are at least the following technical problems in the prior art: as the number of services increases, the traffic also increases, the pressure on the server also gradually increases, further leading to the problem of low request forwarding efficiency. Summary of the invention
[0004] The present invention provides a service control method, system, storage medium and electronic device to improve the forwarding efficiency of service requests and reduce the pressure on the server.
[0005] According to one aspect of the present invention, there is provided a service control method, comprising:
[0006] Configuring service forwarding information for each service provider based on the configuration management application module, and synchronizing the service forwarding information of each service provider to a database for storage;
[0007] When receiving a service request, the forwarding application module obtains service forwarding information corresponding to the service request from the database, and forwards the service request based on the obtained service forwarding information.
[0008] Optionally, the service forwarding information includes a forwarding address corresponding to the service provider;
[0009] The method also includes: when the configuration management application module receives a registration request from the requesting end to any service provider, it generates a service identifier corresponding to the registration request, synchronizes the service identifier to a database, and feeds back the service identifier to the requesting end, wherein the service identifier is associated with a forwarding path of the corresponding service provider, and the requesting end generates a service request based on the received service identifier.
[0010] Optionally, the acquiring, based on the forwarding application module, service forwarding information corresponding to the service request from the database includes:
[0011] The service identifier in the service request is parsed based on the forwarding application module, and a corresponding forwarding path is obtained from the database according to the service identifier.
[0012] Optionally, the method further includes: generating an authorization token for a service identifier corresponding to the service provider based on the configuration management application module according to the concurrency of the service provider, and synchronizing the authorization token to the database for storage.
[0013] Optionally, before the forwarding application module acquires the corresponding forwarding path from the database according to the service identifier, the method further includes:
[0014] Based on the forwarding application module sending an authorization request to the database according to the service identifier, upon receiving an authorization token corresponding to the service identifier fed back by the database, a step of acquiring a corresponding forwarding path from the database according to the service identifier is performed.
[0015] Optionally, before the forwarding application module acquires the corresponding forwarding path from the database according to the service identifier, the method further includes:
[0016] Based on the forwarding application module, the forwarding path corresponding to the service identifier is obtained in the local cache. When the obtained forwarding path is empty, the step of obtaining the corresponding forwarding path from the database according to the service identifier is executed; when the obtained forwarding path is not empty, the step of forwarding the service request based on the forwarding path is executed.
[0017] According to another aspect of the present invention, there is provided a service control system, comprising: a configuration management application module, a database and a forwarding application module, wherein;
[0018] A configuration management application module, used to configure service forwarding information for each service provider, and synchronize the service forwarding information of each service provider to the database;
[0019] The database is used to store the service forwarding information of each service provider;
[0020] The forwarding application module, when receiving a service request, obtains service forwarding information corresponding to the service request from the database, and forwards the service request based on the obtained service forwarding information.
[0021] Optionally, the data storage area in the configuration management application module stores the service identifier and forwarding path of each service provider;
[0022] The configuration management application module is also used to generate an authorization token corresponding to each service identifier according to the concurrency of each service provider, wherein the service identifier, forwarding path and corresponding authorization token of the service provider constitute the service forwarding information of the service provider.
[0023] Optionally, when receiving a registration request for any service from the requesting end, the configuration management application module obtains a service identifier corresponding to the registration request and feeds back the service identifier to the requesting end, wherein the requesting end generates a service request based on the received service identifier.
[0024] Optionally, the forwarding application module is used to identify a service identifier in the service request, obtain a corresponding forwarding path from the database according to the service identifier, and forward the service request based on the forwarding path.
[0025] Optionally, before the forwarding application module obtains the corresponding forwarding path from the database according to the service identifier, the forwarding application module is also used to send an authorization request to the database based on the service identifier, and upon receiving the authorization token corresponding to the service identifier fed back by the database, execute the step of obtaining the corresponding forwarding path from the database according to the service identifier.
[0026] Optionally, before obtaining the corresponding forwarding path from the database according to the service identifier, the forwarding application module is also used to obtain the forwarding path corresponding to the service identifier in the local cache; when the obtained forwarding path is empty, the step of obtaining the corresponding forwarding path from the database according to the service identifier is executed; when the obtained forwarding path is not empty, the step of forwarding the service request based on the forwarding path is executed.
[0027] Optionally, the configuration management application module includes a JAVA application module, the database includes a Redis database, and the forwarding application module includes an Nginx application module.
[0028] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0029] at least one processor; and
[0030] a memory communicatively connected to the at least one processor; wherein,
[0031] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the service control method described in any embodiment of the present invention.
[0032] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the service control method described in any embodiment of the present invention when executed.
[0033] The technical solution of the embodiment of the present invention, by setting up a configuration management application module and a forwarding application module, splits the service configuration management and service forwarding, which are executed by different application modules, thereby reducing the pressure on the server. The service forwarding information is stored through a third-party database, which is used for data transmission between the management application module and the forwarding application module, thereby realizing the decoupling of the management application module and the forwarding application module. Accordingly, the management application module, the database and the forwarding application module can be developed and managed separately, thereby reducing the development time and difficulty of the service control system. The service control system realizes flexible management of services and improves the service forwarding efficiency.
[0034] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 It is a flow chart of a service control method provided by an embodiment of the present invention;
[0037] Figure 2 is a structural diagram of a service control system provided by an embodiment of the present invention;
[0038] Figure 3 is a structural diagram of a service control system provided by an embodiment of the present invention;
[0039] Figure 4 It is a schematic diagram of a flow chart of a JAVA application module responding to a registration request provided by an embodiment of the present invention;
[0040] Figure 5 This is a flow chart of a JAVA application module periodically generating authorizations provided by an embodiment of the present invention;
[0041] Figure 6 It is a schematic diagram of a process of forwarding a service request by an Nginx application module provided in an embodiment of the present invention;
[0042] Figure 7 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0044] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0045] Figure 1 It is a flow chart of a service control method provided by an embodiment of the present invention. The service control method is applied to a service control system and is suitable for quickly forwarding received service requests.
[0046] See also Figure 2 , Figure 2 2 is a structural diagram of a service control system provided by an embodiment of the present invention, and the service control system includes a configuration management application module 210, a database 220 and a forwarding application module 230. In this embodiment, the configuration management application module 210, the database 220 and the forwarding application module 230 can be configured in the same server, or can be configured in different servers in a server cluster, for example, the configuration management application module 210, the database 220 and the forwarding application module 230 are respectively configured in different servers, or any two of the configuration management application module 210, the database 220 and the forwarding application module 230 can be configured in the same server, for example. The configuration management application module 210 and the database 220 are configured in the same server, and the forwarding application module 230 is configured in another server; for example, the database 220 and the forwarding application module 230 are configured in the same server, and the configuration management application module 210 is configured in another server. In this embodiment, the integration relationship between the configuration management application module 210, the database 220 and the forwarding application module 230 is not limited.
[0047] The configuration management application module 210 is connected in communication with the database 220, and the database 220 is connected in communication with the forwarding application module 230. In this embodiment, the configuration management application module 210 performs service management, and the forwarding application module 230 performs service forwarding on the received service request. By setting up the management application module 210 and the forwarding application module 230 that are configured independently of each other, the service configuration management and service forwarding are split and executed by different application modules, thereby reducing the pressure on the server. By setting up a database 220 that is independent of the management application module 210 and the forwarding application module 230, which is used to store the service forwarding information generated by the configuration management application module 210, the service forwarding information is obtained from the database 220 during the service forwarding processing of the forwarding application module 230, thereby realizing the decoupling of the management application module 210 and the forwarding application module 230.
[0048] The configuration management application module 210 may be an application module with a service configuration management function, and the implementation language is not limited. In some embodiments, the configuration management application module 210 may be a JAVA application module. The types of the database 220 may include but are not limited to Redis database, Oracle database, SQL Server database, DB2 database, Mysql database, etc. The forwarding application module 230 may be an application module with a forwarding function, and the specific form of the forwarding application module 230 is not limited. In some embodiments, the forwarding application module 230 may be a reverse proxy application module, such as an Nginx application module.
[0049] In one embodiment, the configuration management application module 210 is a JAVA application module, the database 220 is a Redis database, and the forwarding application module 230 is an Nginx application module. Figure 3 , Figure 3 This is an example diagram of a service control system provided by an embodiment of the present invention.
[0050] The service control method provided in this embodiment is executed based on the above service control system. Specifically, the method comprises the following steps:
[0051] S110. Configure service forwarding information for each service provider based on the configuration management application module, and synchronize the service forwarding information configured by each service provider to a database for storage.
[0052] S120: When the forwarding application module receives a service request, it obtains service forwarding information corresponding to the service request from the database, and forwards the service request based on the obtained service forwarding information.
[0053] The request end initiates a request to the target service, that is, the request end generates a service request for the target service, sends the service request to the forwarding application module, and the forwarding application module forwards the service request to the target service to achieve access to the target service. Among them, the request end can be a client such as a computer, PC, mobile phone, tablet computer, etc. The target service is integrated on the server. For example, one server can be integrated with one or more services. The forwarding application module forwards the service request of the request end to the target service.
[0054] The configuration management application module pre-configures service forwarding information for each service provider, wherein the service provider is used to provide service feedback to the requester and can be the request object of the service request of the requester. For example, the requester sends a service request to service A, then service A is a service provider.
[0055] The service forwarding information includes the forwarding path of the service provider, and the data storage area in the configuration management application module stores the forwarding path of each service provider. Among them, the data storage area in the configuration management application module can be a local database of the configuration management application module. The configuration management application module synchronizes the forwarding path of each service provider to the database, and the database stores the forwarding path of each service provider for easy calling by the forwarding application module. Among them, the forwarding path of the service provider can be the URL (uniform resource locator) address of the service provider.
[0056] On the basis of the above implementation, a service identifier of a service provider is generated based on a configuration management application module. The service identifier may be a token identifier, and the token identifier may be generated based on the configuration management application module in response to a request from the requesting end to register with a service provider. Optionally, upon receiving a registration request from the requesting end to any service provider, the configuration management application module generates a service identifier corresponding to the registration request, synchronizes the service identifier to a database, and feeds back the service identifier to the requesting end, wherein the service identifier is associated with a forwarding path of the corresponding service provider, and the requesting end generates a service request based on the received service identifier.
[0057] The requesting end sends a registration request of the service provider to the configuration management application module, and the registration request is used to apply for access rights of the service provider to the configuration management application module. Based on the situation that the configuration management application module receives the registration request of the requesting end to any service provider, it generates a service identifier corresponding to the registration request, and feeds back the service identifier to the requesting end. The service identifier can be generated based on the address information of the service provider. In some embodiments, the configuration management application obtains the address information and registration timestamp of the registered service provider, and generates a service identifier based on the address information and registration timestamp of the service provider. Specifically, the service identifier can be obtained based on the address information and registration timestamp of the service provider based on a preset splicing method, or the address information and registration timestamp of the service provider are added to a specific field of the identification template to generate the service identifier. The service identifier corresponds one-to-one with the registered user information, or the service identifier corresponds one-to-one with the requesting end.
[0058] Based on the configuration management application module, the service identifier is associated with the forwarding path of the requested service provider and stored in a local database, and the forwarding path and the service identifier are synchronized to the database. In the database, there is a corresponding relationship between the forwarding path of the service provider and the service identifier, wherein the forwarding path of the service provider and the service identifier can be a one-to-many corresponding relationship.
[0059] The service identifier and forwarding path of each service provider are stored in the database, so that the forwarding application module can obtain the forwarding path of the service provider from the database based on the service identifier of the service provider, and forward the service request to the service provider.
[0060] The generated service identifier is fed back to the requester based on the configuration management application module. The requester receives the service identifier fed back by the configuration management application module and stores it in the local cache of the requester. The requester can store the service identifiers corresponding to multiple service providers. When detecting the access operation to any service provider, a service request is generated based on the service identifier corresponding to the service provider and the service request is sent to the forwarding application module.
[0061] Based on the above embodiment, the service request received by the forwarding application module includes a service identifier. Accordingly, the service forwarding information corresponding to the service request is obtained from the database based on the forwarding application module, including: parsing the service identifier in the service request based on the forwarding application module, and obtaining a corresponding forwarding path from the database according to the service identifier.
[0062] The forwarding application module receives the service request, parses the service request, and obtains the service identifier contained in the service request, which is the service identifier of the service provider being accessed. If the service identifier is not parsed, an error code is fed back to indicate that the service request is an error request. If the service identifier is parsed, the forwarding application module matches the corresponding forwarding path from the database through the service identifier. Specifically, the forwarding path that matches the service identifier can be obtained from the database through the LUA script.
[0063] On the basis of the above embodiment, before the forwarding application module obtains the forwarding path, the forwarding application module also performs authorization verification through the service identifier in the service request. For example, the service identifier in the service request may be transmitted to a database, and the service identifier in the service request may be matched in the database. If the match is successful, it is determined that the service request has access authorization, and if the match fails, it is determined that the service request does not have access authorization.
[0064] In some embodiments, the service provider has a concurrency limit. Accordingly, for service requests from the requesting end, if the number of service requests exceeds the concurrency of the service provider, the service requests exceeding the concurrency will not have access authorization.
[0065] Correspondingly, the configuration management application module generates an authorization token for the service provider's corresponding service identifier based on the concurrent volume of the service provider, and synchronizes the authorization token to the database for storage. Among them, the service identifier, forwarding path and corresponding authorization token group of the service provider stored in the data volume are associated and stored.
[0066] Before the forwarding application module obtains the corresponding forwarding path from the database according to the service identifier, the method further includes: the forwarding application module sends an authorization request to the database according to the service identifier, and in the case of receiving the authorization token corresponding to the service identifier fed back by the database, performs the step of obtaining the corresponding forwarding path from the database according to the service identifier. In the case of failing to receive the authorization token corresponding to the service identifier fed back by the database, it is determined that the service request does not have access authorization, and an error code is returned to indicate that the access authorization to the service provider is not provided.
[0067] Based on the database receiving the authorization request sent by the database, according to the service identifier in the authorization request, any authorization token in the authorization token corresponding to the service identifier is extracted and fed back to the forwarding application module. In the case of obtaining the authorization token corresponding to the service identifier based on the forwarding application module, the authorization token corresponding to the service identifier is reduced until the number of authorization tokens is zero. It should be noted that the authorization token is time-limited. If the validity period is exceeded, the authorization token has no authorization effect and is automatically discarded. Correspondingly, based on the configuration management application module, the authorization token corresponding to each service identifier is regularly generated according to the validity range of the authorization token, and synchronized to the database.
[0068] When the forwarding application module determines that the service request has access authorization, the forwarding address of the service request is obtained according to the service identifier in the service request. In some embodiments, the forwarding address of the service request can be read from a database; in some embodiments, the forwarding address of the service request can be read from a local cache based on the forwarding application module.
[0069] Optionally, before the forwarding application module obtains the corresponding forwarding path from the database according to the service identifier, it also includes: based on the forwarding application module, obtaining the forwarding path corresponding to the service identifier in the local cache, and when the obtained forwarding path is empty, executing the step of obtaining the corresponding forwarding path from the database according to the service identifier; when the obtained forwarding path is not empty, executing the step of forwarding the service request based on the forwarding path.
[0070] Based on the forwarding application module, the forwarding path read from the database is stored in the local cache, which makes it easy to obtain the forwarding path corresponding to the subsequent service request in the local cache, omitting the interaction process with the database and improving the forwarding efficiency.
[0071] The technical solution of this embodiment, by setting up a configuration management application module and a forwarding application module, splits the service configuration management and service forwarding, which are executed by different application modules, reducing the pressure on the server. The third-party database storage service forwards information for data transmission between the management application module and the forwarding application module, realizing the decoupling of the management application module and the forwarding application module. Accordingly, the management application module, database and forwarding application module can be developed and managed separately, reducing the development time and difficulty of the service control system. The service control system realizes flexible management of services and improves the efficiency of service forwarding.
[0072] Based on the above embodiments, the present invention also provides a preferred example of a service control system. Figure 3The service control system includes a JAVA application module, a Redis database and an Nginx application module, and the JAVA application module, the Redis database and the Nginx application module are respectively arranged on different servers. The JAVA application module configures service forwarding information for each service provider, and synchronizes the service forwarding information configured by each service provider to the Redis database. When the Nginx application module receives a service request, it obtains the service forwarding information corresponding to the service request from the Redis database, and forwards the service request based on the obtained service forwarding information.
[0073] For more information, see Figure 4 , Figure 4 It is a flow chart of the JAVA application module responding to a registration request provided by an embodiment of the present invention. When a user sends a registration request to any service provider through a request end, the JAVA application module generates a token identifier corresponding to the registration request, that is, a service identifier in the above embodiment. The generated token identifier is stored in the local database of the JAVA application module, and the generated token identifier is synchronized to the Redis database, wherein the generated token identifier in the local database of the JAVA application module and the Redis database is associated with the forwarding address of the requested service provider.
[0074] See also Figure 5 , Figure 5 This is a flowchart of a JAVA application module providing an embodiment of the present invention to generate authorization periodically. The JAVA application module reads a local database, obtains a token identifier, and a time validity range and a concurrency corresponding to the token identifier from the local database, generates an authorization token corresponding to the token identifier according to the time validity range and the concurrency corresponding to the token identifier, and synchronizes the authorization token to a Redis database, where the token identifier in the Redis database is associated with the authorization token.
[0075] See also Figure 6 , Figure 6It is a flow chart of the Nginx application module forwarding the service request provided by the embodiment of the present invention. When receiving the service request, the Nginx application module parses the service request and determines whether the request header of the service request includes a token identifier. When the request header does not include a token identifier, an error code is generated to indicate that the service request is an error request. When the request header includes a token identifier, an authorization token is obtained from the Redis database according to the token identifier. When the authorization token cannot be obtained, an error code is generated to indicate that there is no access authorization; when the authorization token is successfully obtained, the forwarded URL address, i.e., the forwarding address, is obtained from the local cache according to the token identifier. When the address obtained in the local cache is not empty, the upstream address is updated to the URL address, and the service request is forwarded to the service provider to be accessed according to the upstream address. When the address obtained in the local cache is empty, the URL address is obtained from the Redis database according to the token identifier, and when the obtained URL address is not empty, the upstream address is updated to the URL address, and the service request is forwarded to the service provider to be accessed according to the upstream address.
[0076] Figure 2 is a schematic diagram of the structure of a service control system provided by an embodiment of the present invention, such as Figure 2 As shown, the device includes: a configuration management application module 210, a database 220 and a forwarding application module 230, wherein;
[0077] Configuration management application module 210, used to configure service forwarding information for each service provider and synchronize the service forwarding information of each service provider to the database;
[0078] Database 220, used to store service forwarding information of each service provider;
[0079] The forwarding application module 230, when receiving a service request, obtains service forwarding information corresponding to the service request from a database, and forwards the service request based on the obtained service forwarding information.
[0080] On the basis of the above embodiment, optionally, the data storage area in the configuration management application module 210 stores the forwarding path of each service provider, and synchronizes the forwarding path to the database 220;
[0081] When the configuration management application module 210 receives a registration request from the requesting end to any service provider, it generates a service identifier corresponding to the registration request, synchronizes the service identifier to the database 220, and feeds the service identifier back to the requesting end, wherein the service identifier is associated with the corresponding forwarding path, and the requesting end generates a service request based on the received service identifier.
[0082] On the basis of the above embodiment, optionally, the configuration management application module 210 is further used to generate an authorization token corresponding to each service identifier according to the concurrency of each service provider.
[0083] On the basis of the above embodiment, optionally, the forwarding application module 230 is used to identify the service identifier in the service request, obtain the corresponding forwarding path from the database 220 according to the service identifier, and forward the service request based on the forwarding path.
[0084] On the basis of the above embodiment, optionally, before the forwarding application module 230 obtains the corresponding forwarding path from the database 220 according to the service identifier, it is also used to send an authorization request to the database 220 based on the service identifier, and when receiving the authorization token corresponding to the service identifier fed back by the database 220, execute the step of obtaining the corresponding forwarding path from the database 220 according to the service identifier.
[0085] On the basis of the above embodiment, optionally, before the forwarding application module 230 obtains the corresponding forwarding path from the database 220 according to the service identifier, it is also used to obtain the forwarding path corresponding to the service identifier in the local cache, and when the obtained forwarding path is empty, execute the step of obtaining the corresponding forwarding path from the database 220 according to the service identifier; when the obtained forwarding path is not empty, execute the step of forwarding the service request based on the forwarding path.
[0086] The technical solution of this embodiment, by setting up a configuration management application module 210 and a forwarding application module 230, splits the service configuration management and service forwarding, which are executed by different application modules, reducing the pressure on the server. The service forwarding information is stored through a third-party database 220, which is used for data transmission between the management application module and the forwarding application module 230, so as to realize the decoupling of the management application module and the forwarding application module 230. Accordingly, the management application module, the database 220 and the forwarding application module 230 can be developed and managed separately, reducing the development time and difficulty of the service control system. The service control system realizes flexible management of services and improves the efficiency of service forwarding.
[0087] Figure 71 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0088] like Figure 7 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0089] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0090] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the service control method.
[0091] In some embodiments, the service control method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the service control method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the service control method in any other appropriate manner (e.g., by means of firmware).
[0092] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0093] The computer program for implementing the service control method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0094] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to execute a service control method, the method comprising:
[0095] Based on the configuration management application module, each service provider is configured with service forwarding information, and the service forwarding information configured by each service provider is synchronized to a database for storage;
[0096] When receiving a service request, the forwarding application module obtains service forwarding information corresponding to the service request from the database, and forwards the service request based on the obtained service forwarding information.
[0097] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0098] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0099] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0100] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0101] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0102] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A service control method, characterized in that: include: Configuring service forwarding information for each service provider based on the configuration management application module, and synchronizing the service forwarding information of each service provider to a database for storage; Based on the forwarding application module, when receiving a service request, the forwarding application module obtains service forwarding information corresponding to the service request from the database, and forwards the service request based on the obtained service forwarding information; The service forwarding information includes a forwarding address corresponding to the service provider; The method further comprises: When receiving a registration request from a requesting end to any service provider, the configuration management application module generates a service identifier corresponding to the registration request, synchronizes the service identifier to a database, and feeds the service identifier back to the requesting end, wherein the service identifier is associated with a forwarding path of the corresponding service provider, and the requesting end generates a service request based on the received service identifier; the service identifier is generated based on the address information and registration timestamp of the service provider; The method further comprises: Based on the configuration management application module, according to the concurrent volume of the service provider, an authorization token corresponding to the service identifier of the service provider is generated, and the authorization token is synchronized to the database for storage; the authorization token has time validity; Before the forwarding application module acquires the corresponding forwarding path from the database according to the service identifier, the method further includes: Based on the forwarding application module sending an authorization request to the database according to the service identifier, upon receiving an authorization token corresponding to the service identifier fed back by the database, executing the step of acquiring a corresponding forwarding path from the database according to the service identifier; In the case where the authorization token corresponding to the service identifier fed back by the database cannot be received, it is determined that the service request does not have access authorization, and an error code is returned.
2. The method according to claim 1, characterized in that The acquiring, based on the forwarding application module, service forwarding information corresponding to the service request from the database includes: The service identifier in the service request is parsed based on the forwarding application module, and a corresponding forwarding path is obtained from the database according to the service identifier.
3. The method according to claim 2, characterized in that Before the forwarding application module acquires the corresponding forwarding path from the database according to the service identifier, the method further includes: Based on the forwarding application module, the forwarding path corresponding to the service identifier is obtained in the local cache. When the obtained forwarding path is empty, the step of obtaining the corresponding forwarding path from the database according to the service identifier is executed; when the obtained forwarding path is not empty, the step of forwarding the service request based on the forwarding path is executed.
4. A service control system, characterized in that: include: Configuration management application module, database and forwarding application module, among which; The configuration management application module is used to configure service forwarding information for each service provider and synchronize the service forwarding information of each service provider to the database; The database is used to store the service forwarding information of each service provider; The forwarding application module, when receiving a service request, obtains service forwarding information corresponding to the service request from the database, and forwards the service request based on the obtained service forwarding information; The data storage area in the configuration management application module stores the forwarding paths of each service provider, and synchronizes the forwarding paths to the database; When receiving a registration request from a requesting end to any service provider, the configuration management application module generates a service identifier corresponding to the registration request, synchronizes the service identifier to a database, and feeds the service identifier back to the requesting end, wherein the service identifier is associated with a corresponding forwarding path, and the requesting end generates a service request based on the received service identifier; the service identifier is generated based on the address information and registration timestamp of the service provider; The configuration management application module is also used to generate authorization tokens corresponding to the service identifiers according to the concurrency of each service provider; the authorization tokens are time-limited; Before the forwarding application module obtains the corresponding forwarding path from the database according to the service identifier, the forwarding application module is further used to send an authorization request to the database based on the service identifier, and execute the step of obtaining the corresponding forwarding path from the database according to the service identifier when receiving the authorization token corresponding to the service identifier fed back by the database; In the case where the authorization token corresponding to the service identifier fed back by the database cannot be received, it is determined that the service request does not have access authorization, and an error code is returned.
5. The system according to claim 4, characterized in that The forwarding application module is used to identify the service identifier in the service request, obtain a corresponding forwarding path from the database according to the service identifier, and forward the service request based on the forwarding path.
6. The system according to claim 5, characterized in that Before obtaining the corresponding forwarding path from the database according to the service identifier, the forwarding application module is also used to obtain the forwarding path corresponding to the service identifier in the local cache, and when the obtained forwarding path is empty, execute the step of obtaining the corresponding forwarding path from the database according to the service identifier; when the obtained forwarding path is not empty, execute the step of forwarding the service request based on the forwarding path.
7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the service control method according to any one of claims 1 to 3.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the service control method according to any one of claims 1 to 3 when executed.
