Routing resource allocation method and device, electronic device and storage medium
By using mapping relationships to filter the target engine service address in cloud computing, the problems of low resource utilization and high management complexity among tenants are solved, resource sharing and logical isolation are realized, cost reduction and stability are improved.
Patent Information
- Application Number
- CN202310086206.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-18
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2043-01-18
AI Technical Summary
In the cloud computing service model, the prior art has problems such as low resource utilization among tenants, high cost, high management complexity and mutual influence between tenants.
By receiving access requests from the user, the mapping relationship is used to determine the target configuration encoding and partition identification information, the target engine service address is selected, and the target engine process business logic information to return the execution results, realizing physical isolation and logical isolation, and reducing the impact between tenants.
It realizes resource sharing, reduces the average cost of tenants, reduces management complexity, and improves the stability of the operating environment and the efficiency of business logic information processing.
Smart Images

Figure CN116132314B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud technology, and in particular to a routing resource allocation method and device, an electronic device, and a storage medium. Background Art
[0002] Currently, sharing and isolation coexist in cloud computing service models. Users directly access, operate, and manage business objects, data, or resources isolated within the corresponding tenant through self-service. Related technologies primarily utilize full-stack isolation models and resource pool models to process each tenant's business objects, data, and resources. The full-stack isolation model provides tenants with a set of isolated and independently deployed instances. Allocating a set of isolated and independently deployed instances to each tenant results in low resource utilization, high costs, and long release cycles. The resource pool model uniformly deploys and manages service content under the current service model, sharing service content and instances between tenants. Logical isolation of tenants' business and data is achieved through data fields and namespaces. However, the management of data fields and namespaces is complex, and the shared service content and instances between tenants easily interfere with each other. Summary of the Invention
[0003] In response to the above technical problems, the main purpose of the embodiments of the present application is to propose a routing resource allocation method and device, electronic device and storage medium, aiming to reduce the average cost of tenants, reduce management complexity, and eliminate mutual influence between tenants.
[0004] To achieve the above objectives, a first aspect of an embodiment of the present application provides a method for allocating routing resources, the method comprising:
[0005] Receive an access request sent by a user; wherein the access request includes: tenant number information and business logic information;
[0006] Determine the target configuration encoding information according to the tenant number information and a preset first mapping relationship; wherein the first mapping relationship is a mapping relationship between the tenant number information and the configuration encoding information configured by the candidate engine;
[0007] Determine the target partition identification information according to the target configuration coding information and a preset second mapping relationship; wherein the second mapping relationship is a mapping relationship between the configuration coding information and the partition identification information of the candidate partition;
[0008] Filtering a target engine service address from preset candidate engine service address information according to the target configuration coding information and the target partition identification information;
[0009] Sending the business logic information to the target engine service according to the target engine service address, so that the target engine service selects a target engine from candidate engines, and processes the business logic information through the target engine to return an execution result;
[0010] The execution result is sent to the user terminal.
[0011] According to some embodiments of the present invention, determining target configuration encoding information according to the tenant number information and a preset first mapping relationship includes:
[0012] Performing an engine configuration search in the first mapping relationship according to the tenant number information to obtain candidate configuration encoding information of at least one candidate engine configuration;
[0013] Acquire configuration status information of the candidate engine configuration according to the candidate configuration encoding information;
[0014] Filtering a target engine configuration from the candidate engine configurations according to the configuration state information; wherein the target engine configuration is used to record the occupied resource value of the user terminal;
[0015] The candidate configuration encoding information of the target engine configuration is used as the target configuration encoding information.
[0016] The step of filtering out a target engine configuration from the candidate engine configurations according to the configuration state information includes:
[0017] Storing the candidate configuration encoding information of the candidate engine configuration into a preset candidate list;
[0018] Determining whether the configuration status information of the candidate engine configuration is in a pending allocation state;
[0019] If the configuration status information is in a pending allocation state, setting the candidate engine configuration as the target engine configuration;
[0020] If the configuration status information is not in the to-be-allocated state, the candidate configuration coding information is removed from the candidate list.
[0021] According to some embodiments of the present invention, after sending the business logic information to the engine service according to the target engine service address, the method further includes:
[0022] Obtain the occupied resource value of the target engine service processing the business logic information of each of the user terminals;
[0023] Comparing the occupied resource value with a preset occupation threshold;
[0024] If the occupied resource value is greater than a preset occupation threshold, the business logic information of the user terminal is migrated to a preset candidate engine service.
[0025] According to some embodiments of the present invention, migrating the business logic information of the user terminal to a preset candidate engine service includes:
[0026] Obtaining access user status information of each candidate engine service;
[0027] Filtering a selected engine service from the candidate engine services according to the access user status information;
[0028] Setting the configuration status information of the target engine configuration to be in migration;
[0029] Migrating a target engine of the target engine service to the selected engine service;
[0030] Migrating the business logic information to the selected engine service.
[0031] According to some embodiments of the present invention, before receiving the access request sent by the user terminal, the method further includes periodically detecting a fault status of the target partition, specifically including:
[0032] Sending a fault detection signal to the target engine service of the target partition according to a preset time interval, and monitoring a fault feedback signal returned by the target engine service; wherein the target partition is the partition corresponding to the target partition identification information;
[0033] If the fault feedback signal is not received within a preset time period, the business logic information of the target engine service is migrated to a preset backup engine service.
[0034] According to some embodiments of the present invention, before receiving the access request sent by the user terminal, the method further includes: performing a version upgrade in units of partitions, specifically including:
[0035] receiving a version update request for the target partition; wherein the version update request includes target version information;
[0036] Switching the source version of the target engine service of the target partition to the target version corresponding to the target version information according to the target version information;
[0037] Obtaining log information of a process in which the target engine service switches from the source version to the target version;
[0038] Performing an abnormality analysis on the log information to obtain an abnormality analysis result;
[0039] If the abnormality analysis result is characterized as abnormal, rolling back the target engine service from the target version to the source version;
[0040] If the abnormality analysis result indicates that there is no abnormality, the version information of the target engine service is set as the target version information.
[0041] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a routing resource allocation device, the device comprising:
[0042] A request receiving module, configured to receive an access request sent by a user terminal; wherein the access request includes: tenant number information and business logic information;
[0043] A coding information acquisition module, configured to determine target configuration coding information based on the tenant number information and a preset first mapping relationship; wherein the first mapping relationship is a mapping relationship between the tenant number information and the configuration coding information configured by the candidate engine;
[0044] an identification information acquisition module, configured to determine target partition identification information based on the target configuration coding information and a preset second mapping relationship; wherein the second mapping relationship is a mapping relationship between the configuration coding information and the partition identification information of the candidate partition;
[0045] An address screening module, configured to screen a target engine service address from preset candidate engine service address information according to the target configuration coding information and the target partition identification information;
[0046] An address sending module is configured to send the business logic information to a target engine service according to the target engine service address, so that the target engine service selects a target engine from candidate engines, and processes the business logic information through the target engine to return an execution result;
[0047] The result sending module sends the execution result to the user terminal.
[0048] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the method described in the first aspect when executing the computer program.
[0049] To achieve the above-mentioned purpose, the fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method described in the first aspect.
[0050] The present application proposes a routing resource allocation method and apparatus, an electronic device, and a storage medium. The method receives an access request from a user terminal, wherein the access request includes tenant number information and business logic information. First, based on the tenant number information and a preset first mapping relationship, target configuration code information corresponding to the tenant number information is determined. The first mapping relationship is a mapping relationship between the tenant number information and configuration code information of a candidate engine configuration. Then, based on the target configuration code information and a preset second mapping relationship, target partition identification information, i.e., the partition where the tenant is located, is determined. The second mapping relationship is a mapping relationship between the configuration code information and partition identification information of the candidate partition. Then, based on the target configuration code information and the target partition identification information, a target engine service address is filtered from preset candidate engine service address information, thereby completing the allocation of the target engine service. Finally, business logic information is sent to a target engine service based on the target engine service address, so that the target engine service filters the target engine from the candidate engines. The target engine processes the business logic information to return an execution result, which is then sent to the user terminal. Therefore, this application achieves physical isolation through the allocation of engine configurations and logical isolation through the allocation of engines. The engine runs within the engine service, achieving resource sharing and reducing costs. The above-mentioned physical isolation and logical isolation reduce the impact between multiple tenants, and executes tenant business logic in partitions, increasing the stability of the operating environment and thus improving the efficiency of business logic information processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 This is a flow chart of the routing resource allocation method provided by an embodiment of the present application;
[0052] Figure 2 yes Figure 1 Flowchart of step S102 in FIG.
[0053] Figure 3 yes Figure 2 Flowchart of step S203 in FIG.
[0054] Figure 4 is a flowchart of a routing resource allocation method provided by another embodiment of the present application;
[0055] Figure 5 yes Figure 4 Flowchart of step S403 in FIG.
[0056] Figure 6 is a flowchart of a routing resource allocation method provided by another embodiment of the present application;
[0057] Figure 7 is a flowchart of a routing resource allocation method provided by another embodiment of the present application;
[0058] Figure 8 This is a device structure diagram of a routing resource allocation device provided by an embodiment of the present application;
[0059] Figure 9 This is a schematic diagram of the hardware structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0061] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.
[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0063] Currently, sharing and isolation coexist in cloud computing service models. Users directly access, operate, and manage business objects, data, or resources isolated within the corresponding tenant through self-service. Related technologies primarily utilize full-stack isolation models and resource pool models to process each tenant's business objects, data, and resources. The full-stack isolation model provides tenants with a set of isolated and independently deployed instances. Allocating a set of isolated and independently deployed instances to each tenant results in low resource utilization, high costs, and long release cycles. The resource pool model uniformly deploys and manages service content under the current service model, sharing service content and instances between tenants. Logical isolation of tenants' business and data is achieved through data fields and namespaces. However, the management of data fields and namespaces is complex, and the shared service content and instances between tenants easily interfere with each other.
[0064] Based on this, embodiments of the present application provide a routing resource allocation method and apparatus, electronic device, and storage medium, designed to reduce tenants' average costs, reduce management complexity, and eliminate mutual impact between tenants. The routing resource allocation method and apparatus, electronic device, and storage medium provided in embodiments of the present application are specifically illustrated by the following embodiments. First, the routing resource allocation method in embodiments of the present application is described.
[0065] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to achieve optimal results.
[0066] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0067] The routing resource allocation method provided in the embodiment of the present application relates to the field of cloud technology. The routing resource allocation method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, or can be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the routing resource allocation method, etc., but is not limited to the above forms.
[0068] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0069] Reference Figure 1 According to the routing resource allocation method provided in the first aspect of the embodiment of the present application, Figure 1 The method may include but is not limited to steps S101 to S106.
[0070] Step S101: receiving an access request sent by a user, wherein the access request includes: tenant number information and business logic information;
[0071] Step S102: determining target configuration encoding information based on the tenant number information and a preset first mapping relationship, wherein the first mapping relationship is a mapping relationship between the tenant number information and the configuration encoding information configured by the candidate engine;
[0072] Step S103: determining target partition identification information according to the target configuration coding information and a preset second mapping relationship, wherein the second mapping relationship is a mapping relationship between the configuration coding information and the partition identification information of the candidate partition;
[0073] Step S104, filtering out a target engine service address from preset candidate engine service address information according to the target configuration code information and the target partition identification information;
[0074] Step S105: sending the business logic information to the target engine service according to the target engine service address, so that the target engine service selects the target engine from the candidate engines, and processes the business logic information through the target engine to return the execution result;
[0075] Step S106: Send the execution result to the user terminal.
[0076] Steps S101 to S106 shown in the embodiment of the present application receive an access request sent by a user terminal, wherein the access request includes: tenant number information and business logic information. First, based on the tenant number information and a preset first mapping relationship, the target configuration coding information corresponding to the tenant number information is determined, wherein the first mapping relationship is the mapping relationship between the tenant number information and the configuration coding information of the candidate engine configuration. Then, based on the target configuration coding information and a preset second mapping relationship, the target partition identification information is determined, i.e., the partition where the tenant is located. The second mapping relationship is the mapping relationship between the configuration coding information and the partition identification information of the candidate partition. Then, based on the target configuration coding information and the target partition identification information, the target engine service address is filtered from the preset candidate engine service address information, thereby completing the allocation of the target engine service. Finally, the business logic information is sent to the target engine service based on the target engine service address, so that the target engine service filters the target engine from the candidate engines, and the target engine processes the business logic information to return the execution result, and the execution result is sent to the user terminal. Therefore, this application achieves physical isolation through the allocation of engine configurations and logical isolation through the allocation of engines. The engine runs within the engine service, achieving resource sharing and reducing costs. The above-mentioned physical isolation and logical isolation reduce the impact between multiple tenants, and the tenant business logic is executed in partitions, which increases the stability of the operating environment. Even if problems occur, the impact range will be concentrated in a single partition.
[0077] See also Figure 2 In some embodiments, step S102 may include but is not limited to steps S201 to S204:
[0078] Step S201: Search for an engine configuration in the first mapping relationship according to the tenant number information to obtain candidate configuration encoding information of at least one candidate engine configuration;
[0079] Step S202: obtaining configuration status information of the candidate engine configuration according to the candidate configuration encoding information;
[0080] Step S203: Filtering a target engine configuration from the candidate engine configurations according to the configuration status information, wherein the target engine configuration is used to record the resource usage value of the user terminal;
[0081] Step S204: Using the candidate configuration encoding information of the target engine configuration as the target configuration encoding information.
[0082] In step S201 of some embodiments, an engine configuration search is performed in the first mapping relationship based on the tenant number information, and the candidate engine configurations that match the tenant number information in the first mapping relationship are screened out and stored in a candidate engine configuration table, and the candidate configuration coding information corresponding to all candidate engine configurations is recorded for use in engine configuration screening in subsequent steps.
[0083] In step S202 of some embodiments, the candidate configuration encoding information includes configuration status information and engine configuration data for the candidate engine configuration. Configuration status information includes the following states: pending allocation, registering, allocating, running, deferred loading, archived, migrating, and disabled. Only engine configurations in the pending allocation state are available for user registration and allocation; all other states are unallocatable. Therefore, by obtaining the configuration status information in the candidate configuration encoding information, engine configurations can be further screened using the configuration status information.
[0084] In step S203 of some embodiments, a target engine configuration is filtered out from the candidate engine configurations based on the configuration status information, where the target engine configuration is used to record the occupied resource value of the user terminal. When the occupied resource value exceeds a preset threshold, it means that the tenant occupies too many partition resources, and the tenant will be enterprise migrated to ensure the normal operation of the tenant. If the occupied resource value recorded by the target engine configuration does not exceed the preset threshold, it means that the target engine configuration is in a pending allocation state, which meets the screening requirements.
[0085] In step S204 of some embodiments, the candidate engine configuration information of the target engine configuration obtained through screening is used as the target configuration coding information to ensure a one-to-one correspondence between the tenant number and the engine configuration coding information.
[0086] In steps S201 to S204 shown in this embodiment, the engine configuration is searched and filtered in the first mapping relationship according to the tenant number information, and the target engine configuration is filtered out from the candidate engine configurations using the configuration status information to obtain a target engine configuration with sufficient resource space and in a state to be allocated, while ensuring a one-to-one correspondence between the tenant number and the engine configuration information.
[0087] See also Figure 3 In some embodiments, step S203 may include but is not limited to steps S301 to S304:
[0088] Step S301, storing candidate configuration encoding information configured by the candidate engine into a preset candidate list;
[0089] Step S302: determine whether the configuration status information of the candidate engine configuration is in a pending allocation state;
[0090] Step S303: If the configuration status information is in the pending allocation state, the candidate engine configuration is set as the target engine configuration;
[0091] Step S304: If the configuration state information is not in the to-be-allocated state, the candidate configuration code information is removed from the candidate list.
[0092] In step S301 of some embodiments, candidate configuration encoding information of the candidate engine configuration is stored in a preset candidate list, so as to facilitate retrieval of the candidate configuration encoding information to screen out the target engine configuration.
[0093] In step S302 of some embodiments, the target engine configuration is screened by keyword matching. When the configuration status information of the candidate engine configuration is in an unallocatable state, the returned result is in an unallocatable state. When the configuration status information of the candidate engine configuration is in a to-be-allocated state, the returned result is in a to-be-allocated state, so as to ensure that the candidate engine configuration to be allocated is accurately screened out.
[0094] In step S303 of some embodiments, if the configuration status information is characterized as a pending allocation state, indicating that the candidate engine configuration can be used for tenant registration allocation, the candidate engine configuration is set as the target engine configuration to ensure that the target engine configuration in the pending allocation state is obtained.
[0095] In step S304 of some embodiments, if the configuration status information is characterized as not being in the allocation state, it means that the candidate engine configuration is not available for registration allocation, and the candidate configuration encoding information of this candidate engine configuration is deleted from the candidate list, and the candidate engine configurations that do not meet the requirements are screened and eliminated in turn.
[0096] In steps S301 to S304 of this embodiment, the candidate configuration coding information is stored in a preset candidate list, and the configuration status of the candidate engine configuration is determined by keyword matching, thereby screening out the target engine configuration that corresponds one-to-one to the tenant number and is in a state to be allocated.
[0097] See also Figure 4 After step S105, the routing resource allocation method may further include but is not limited to steps S401 to S403:
[0098] Step S401, obtaining the resource value occupied by the target engine service processing the business logic information of each user terminal;
[0099] Step S402: comparing the occupied resource value with a preset occupation threshold;
[0100] Step S403: If the occupied resource value is greater than a preset occupation threshold, the business logic information of the user terminal is migrated to a preset candidate engine service.
[0101] In step S401 of some embodiments, all program data in the target engine service are traversed and the business logic information of each user terminal is extracted. The amount of engine service resources occupied by the business logic information of each user terminal is determined to obtain the occupied resource value of the business logic information, which is used to determine whether to subsequently migrate the enterprise.
[0102] In step S402 of some embodiments, the preset occupancy threshold is used to monitor whether the space in the partition is sufficient. By comparing whether the occupied resource value exceeds the preset occupancy threshold, it can be determined whether the partition needs to be migrated.
[0103] In step S403 of some embodiments, if the occupied resource value is greater than the preset occupancy threshold, it means that the resource space of the partition is insufficient and enterprise migration is required to ensure that the tenant can operate normally. In the extreme case, a single partition has only one tenant, where the extreme case refers to when the tenant occupied space is completely close to the total space of a single partition.
[0104] In steps S401 to S403 shown in this embodiment, the resource occupation value of the business logic information of each user terminal processed by the target engine service is obtained, that is, the resource occupation status of each tenant in the partition is obtained, and then the occupied resource value is compared with the preset occupation threshold to determine whether the current partition resources are sufficient. When the partition resources are insufficient, the tenants are migrated through enterprise migration to improve the space resource utilization of each partition and ensure that the tenant space resources are sufficient, thereby improving the efficiency of business logic information processing.
[0105] See also Figure 5 In some embodiments, migrating the user's business logic information to the preset candidate engine service in step S403 may include but is not limited to steps S501 to S502:
[0106] Step S501, obtaining access user status information of each candidate engine service;
[0107] Step S502: Filtering a selected engine service from candidate engine services based on access user status information;
[0108] Step S503, setting the configuration status information of the target engine configuration to be in migration;
[0109] Step S504, migrating the target engine of the target engine service to the selected engine service;
[0110] Step S505: Migrate the business logic information to the selected engine service.
[0111] In step S501 of some embodiments, the access user status information of each candidate engine service is obtained for use in adjusting the status information in subsequent steps.
[0112] In step S502 of some embodiments, the engine services in the pending allocation state in each partition are judged and screened from the candidate engine services according to the access user status information as the selected engine services, ensuring that only the partitions with user status information in the pending allocation state can be used as the selected engine services.
[0113] In step S503 of some embodiments, the configuration status information of the target engine configuration is set to be migrating, so as to ensure that the target engine configuration is locked during the migration process and will not be called by other service programs, thereby causing migration failure.
[0114] In step S504 of some embodiments, the database service corresponding to the target engine service is the source database service, and the target engine of the target engine service is migrated to the selected engine service. This step is divided into two steps. The first step is to uninstall the engine corresponding to the target engine configuration in the target engine service, and the second step is to migrate the copied data in the target engine from the source database service to the selected database service to ensure that the tenant's information is completely migrated to the selected partition.
[0115] In step S505 of some embodiments, the business logic information in the target engine service is also migrated to the selected engine service for execution to ensure that the services provided to the tenants will not be affected by the enterprise migration. After the migration is completed, the configuration status information of the selected engine configuration is set to running to ensure that the tenant's service requests can still operate normally.
[0116] In steps S501 to S505 shown in this embodiment, the user end is the tenant, which obtains the access user status information of each candidate engine service, selects the selected engine service from the candidate engine services based on the access user status information, and sets the status information of the target engine configuration to migrating to ensure the normal progress of the migration. Finally, the enterprise migration is completed by migrating the target engine of the target engine service to the selected engine service, and at the same time, the business logic information is migrated to the selected engine service to ensure that the tenant's service requests can still operate normally.
[0117] See also Figure 6 Before receiving the access request sent by the user terminal, the routing allocation method further includes: regularly detecting the fault status of the target partition, specifically including but not limited to steps S601 to S602:
[0118] Step S601: sending a fault detection signal to a target engine service of a target partition according to a preset time interval, and monitoring a fault feedback signal returned by the target engine service, wherein the target partition is the partition corresponding to the target partition identification information;
[0119] Step S602: If no fault feedback signal is received within a preset time period, the business logic information of the target engine service is migrated to a preset backup engine service.
[0120] In step S601 of some embodiments, a fault detection signal is sent to the target engine service of the target partition according to a preset time interval, and the fault feedback signal returned by the target engine service is monitored to ensure regular detection of whether a fault occurs in the partition. The fault feedback signal is a ping signal, and the ping signal is used to determine whether the engine service program is operating normally. If the engine service program receives the ping signal in normal operation, it will return a normal operation signal. If no signal is returned, it means that there is a fault problem in the partition, and the fault problem is solved through subsequent steps.
[0121] In step S602 of some embodiments, if no fault feedback signal is received within a preset time period, an engine service with user status information in a standby state is searched in the engine service as a target engine service, and the tenant number information in the fault partition is loaded in the target engine service, and the business logic information in the tenant number information is run, so as to timely perform fault detection and maintenance work on the tenant's service.
[0122] See also Figure 7 Before receiving the access request sent by the user terminal, the routing allocation method further includes: performing version upgrade in units of partitions, specifically including but not limited to steps S701 to S702:
[0123] Step S701: receiving a version update request for a target partition, wherein the version update request includes target version information;
[0124] Step S702: Switch the source version of the target engine service of the target partition to the target version corresponding to the target version information according to the target version information;
[0125] Step S703: Obtain log information of the process of switching the target engine service from the source version to the target version;
[0126] Step S704: perform an anomaly analysis on the log information to obtain an anomaly analysis result;
[0127] Step S705: If the abnormality analysis result indicates an abnormality, the target engine service is rolled back from the target version to the source version.
[0128] Step S706: If the abnormality analysis result indicates that there is no abnormality, the version information of the target engine service is set as the target version information.
[0129] In step S701 of some embodiments, by receiving a version update request of a target partition, the target version information in the version update request is obtained, thereby ensuring that the version upgrade is performed in units of partitions.
[0130] In step S702 of some embodiments, the source version of the target engine service of the target partition is switched to the target version corresponding to the target version information according to the target version information, and a version update mark is recorded in the update log to mark that the partition has completed the update.
[0131] In step S703 of some embodiments, the process of switching the target engine service from the source version to the target version is recorded in the log information, and this part of information is obtained to understand whether the update process is normal and without abnormalities.
[0132] In step S704 of some embodiments, an abnormality analysis is performed on the log information to obtain an abnormality analysis result, and whether an abnormality occurs in the update process is determined by determining whether the log information appears.
[0133] In step S705 of some embodiments, if the exception analysis result is characterized as an exception, it means that a problem affecting the user is found in the target version during the update process. Therefore, the target engine service is rolled back from the target version to the source version to ensure that the user is not affected by this update, and the target engine service is updated again after the rollback.
[0134] In step S706 of some embodiments, if the abnormality analysis result indicates no abnormality, all partitions are switched to the target version, fully online, and the version information of the target engine service is set to the target version information, thereby marking the end of the update.
[0135] In steps S701 to S706 shown in this embodiment, by upgrading the version in units of partitions, management costs are reduced, and the stability of the tenant upgrade process is significantly improved through abnormal analysis of log information during the upgrade process and rollback operations after abnormalities occur. Even if problems occur, the impact range will be concentrated in a single partition.
[0136] See also Figure 8 The present application also provides a routing resource allocation device that can implement the above-mentioned routing resource allocation method. The device includes:
[0137] The request receiving module S801 is configured to receive an access request sent by a user terminal, wherein the access request includes tenant number information and business logic information;
[0138] The coding information acquisition module S802 is configured to determine target configuration coding information based on the tenant number information and a preset first mapping relationship; wherein the first mapping relationship is a mapping relationship between the tenant number information and the configuration coding information configured by the candidate engine;
[0139] The identification information acquisition module S803 is configured to determine the target partition identification information according to the target configuration coding information and a preset second mapping relationship; wherein the second mapping relationship is a mapping relationship between the configuration coding information and the partition identification information of the candidate partition;
[0140] An address screening module S804 is configured to screen a target engine service address from preset candidate engine service address information according to the target configuration code information and the target partition identification information;
[0141] The address sending module S805 is used to send the business logic information to the target engine service according to the target engine service address, so that the target engine service can filter out the target engine from the candidate engines and process the business logic information through the target engine to return the execution result;
[0142] The result sending module S806 sends the execution result to the user end.
[0143] The specific implementation of the routing resource allocation device is basically the same as the specific embodiment of the routing resource allocation method described above, and will not be repeated here.
[0144] The present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned routing resource allocation method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, an in-vehicle computer, or the like.
[0145] See also Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:
[0146] The processor 901 can be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0147] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called by the processor 901 to execute the routing resource allocation method of the embodiment of the present application;
[0148] Input / output interface 903, used to implement information input and output;
[0149] Communication interface 904, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);
[0150] Bus 905 , which transmits information between various components of the device (e.g., processor 901 , memory 902 , input / output interface 903 , and communication interface 904 );
[0151] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0152] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned routing resource allocation method is implemented.
[0153] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0154] The routing resource allocation method and device, electronic device and storage medium provided in the embodiment of the present application receive tenant number information and business logic information sent by the user end, then determine the target configuration coding information based on the tenant number information and the preset first mapping relationship, and then determine the target partition identification information based on the target configuration coding information and the preset second mapping relationship, and then filter out the target engine service address from the preset candidate engine service address information based on the target configuration coding information and the target partition identification information, and finally send the business logic information to the target engine service based on the target engine service address, so that the target engine service filters out the target engine from the candidate engines, and processes the business logic information through the target engine to return the execution result, and sends the execution result to the user end. Therefore, the present application achieves physical isolation through the allocation of engine configuration and logical isolation through the allocation of engines, wherein the engine runs within the engine service, achieving resource sharing and reducing costs. The above-mentioned physical isolation and logical isolation reduce the impact between multiple tenants, and execute the tenant business logic in units of partitions, which increases the stability of the operating environment. Even if a problem occurs, the impact range will be concentrated in a single partition, further reducing the impact between multiple tenants.
[0155] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0156] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0157] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0158] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0159] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application 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 clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0160] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0161] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0162] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0163] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0164] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0165] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.
Claims
1. A routing resource allocation method, characterized in that: The method comprises: Receive an access request sent by a user; wherein the access request includes: tenant number information and business logic information; Perform an engine configuration search in a first mapping relationship according to the tenant number information to obtain candidate configuration encoding information of at least one candidate engine configuration; wherein the first mapping relationship is a mapping relationship between the tenant number information and the configuration encoding information of the candidate engine configuration; Acquire configuration status information of the candidate engine configuration according to the candidate configuration encoding information; Filtering a target engine configuration from the candidate engine configurations according to the configuration state information; wherein the target engine configuration is used to record the occupied resource value of the user terminal; Using the candidate configuration encoding information of the target engine configuration as target configuration encoding information; Determine the target partition identification information according to the target configuration coding information and a preset second mapping relationship; wherein the second mapping relationship is a mapping relationship between the configuration coding information and the partition identification information of the candidate partition; Filtering a target engine service address from preset candidate engine service address information according to the target configuration coding information and the target partition identification information; Sending the business logic information to the target engine service according to the target engine service address, so that the target engine service selects a target engine from candidate engines, and processes the business logic information through the target engine to return an execution result; The execution result is sent to the user terminal.
2. The method according to claim 1, characterized in that The step of filtering out a target engine configuration from the candidate engine configurations according to the configuration state information includes: Storing the candidate configuration encoding information of the candidate engine configuration into a preset candidate list; Determining whether the configuration status information of the candidate engine configuration is in a pending allocation state; If the configuration status information is in a pending allocation state, setting the candidate engine configuration as the target engine configuration; If the configuration status information is not in the to-be-allocated state, the candidate configuration coding information is removed from the candidate list.
3. The method according to claim 1, characterized in that After sending the business logic information to the target engine service according to the target engine service address, the method further includes: Obtain the occupied resource value of the target engine service processing the business logic information of each of the user terminals; Comparing the occupied resource value with a preset occupation threshold; If the occupied resource value is greater than a preset occupation threshold, the business logic information of the user terminal is migrated to a preset candidate engine service.
4. The method according to claim 3, characterized in that Migrating the business logic information of the user terminal to a preset candidate engine service includes: Obtaining access user status information of each candidate engine service; Filtering a selected engine service from the candidate engine services according to the access user status information; Setting the configuration status information of the target engine configuration to be in migration; Migrating a target engine of the target engine service to the selected engine service; Migrating the business logic information to the selected engine service.
5. The method according to claim 1, wherein Before receiving the access request sent by the user terminal, the method further includes periodically detecting a fault status of the target partition, specifically including: Sending a fault detection signal to the target engine service of the target partition according to a preset time interval, and monitoring a fault feedback signal returned by the target engine service; wherein the target partition is the partition corresponding to the target partition identification information; If the fault feedback signal is not received within a preset time period, the business logic information of the target engine service is migrated to a preset backup engine service.
6. The method according to claim 1, characterized in that Before receiving the access request sent by the user terminal, the method further includes: performing version upgrade in units of partitions, specifically including: receiving a version update request for the target partition; wherein the version update request includes target version information; Switching the source version of the target engine service of the target partition to the target version corresponding to the target version information according to the target version information; Obtaining log information of a process in which the target engine service switches from the source version to the target version; Performing an abnormality analysis on the log information to obtain an abnormality analysis result; If the abnormality analysis result is characterized as abnormal, rolling back the target engine service from the target version to the source version; If the abnormality analysis result indicates that there is no abnormality, the version information of the target engine service is set as the target version information.
7. A routing resource allocation device, characterized in that: The device comprises: A request receiving module, configured to receive an access request sent by a user terminal; wherein the access request includes: tenant number information and business logic information; A coding information acquisition module is configured to perform an engine configuration search in a first mapping relationship based on the tenant number information to obtain candidate configuration coding information of at least one candidate engine configuration; wherein the first mapping relationship is a mapping relationship between the tenant number information and the configuration coding information of the candidate engine configuration; obtain configuration status information of the candidate engine configuration based on the candidate configuration coding information; filter a target engine configuration from the candidate engine configurations based on the configuration status information; wherein the target engine configuration is used to record the occupied resource value of the user terminal; and use the candidate configuration coding information of the target engine configuration as the target configuration coding information; an identification information acquisition module, configured to determine target partition identification information based on the target configuration coding information and a preset second mapping relationship; wherein the second mapping relationship is a mapping relationship between the configuration coding information and the partition identification information of the candidate partition; An address screening module, configured to screen a target engine service address from preset candidate engine service address information according to the target configuration coding information and the target partition identification information; An address sending module is configured to send the business logic information to a target engine service according to the target engine service address, so that the target engine service selects a target engine from candidate engines, and processes the business logic information through the target engine to return an execution result; The result sending module sends the execution result to the user terminal.
8. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the routing resource allocation method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the routing resource allocation method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Gateway dynamic routing method and device, computer equipment and storage medium
CN111092816A