Network request migration method and apparatus, computer device, and storage medium
By dynamically updating traffic distribution rules and thresholds, network requests are allocated to private and non-private cloud servers based on user identifiers, resolving server crashes caused by network request migration and achieving a stable private cloud migration process.
Patent Information
- Application Number
- CN202310381126.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-11
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2043-04-11
AI Technical Summary
Existing network request migration methods are prone to causing server crashes when migrating all users' network requests to a private cloud environment, making it impossible to guarantee the stable operation of the private cloud.
By allocating network requests to a first private cloud server and a non-private cloud server based on the user's identifier, and dynamically updating the traffic allocation rules and thresholds after the first private cloud server is detected to be stable, network requests are gradually migrated to the private cloud server.
This approach enables the gradual migration of network requests while ensuring the stability of the private cloud server, thus preventing server crashes and ensuring timely responses to network requests.
Smart Images

Figure CN116320018B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, in particular to a network request migration method and device, computer equipment and a storage medium, which can be used in the field of financial technology or other related fields. BACKGROUND
[0002] With the rapid development of Internet business, in view of the data security, each institution begins to gradually migrate the existing business to the private cloud environment, in order to ensure that the network request can be responded in time after the business is migrated to the private cloud environment, the network request migration method appears.
[0003] The current network request migration method adopts the gray pilot method, and pre-migrates a small part of user network requests to the private cloud environment, and after the gray pilot is successful, all user network requests are migrated to the private cloud environment. However, the current network request migration method, when all user network requests are migrated to the private cloud environment, due to the large fluctuation of network request data, it is easy to cause the server of the private cloud to crash and other problems, which needs to be improved. SUMMARY
[0004] Therefore, it is necessary to provide a network request migration method, device, computer equipment and storage medium which can realize the gradual migration of network requests while ensuring the stable operation of the private cloud server.
[0005] In a first aspect, the present application provides a network request migration method, the method comprising:
[0006] According to the user identifier of each application user, the first user and the second user are selected from the application user;
[0007] The network request of the first user is distributed to the first private cloud server for response;
[0008] The network request of the second user is distributed to the non-private cloud server for response; wherein the first private cloud server and the non-private cloud server carry the application data of the target business application;
[0009] When it is detected that the first private cloud server is running stably, the distribution rule and the distribution threshold are updated;
[0010] According to the updated distribution rule and distribution threshold, the user identifier of each application user is updated, and the execution of selecting the first user and the second user from the application user according to the updated application user identifier is returned until the number of the second user is zero.
[0011] In one of the embodiments, the network request of the second user is assigned to the non-private cloud server for response, including:
[0012] According to the user identification of the second user, the network request of the second user is assigned to at least one of the second private cloud server, the second non-private cloud server and the first non-private cloud server for response; wherein the first private cloud server and the first non-private cloud server both carry application data of the target business application in a localized database environment; and the second private cloud server and the second non-private cloud server both carry application data of the target business application in a non-localized database environment.
[0013] In one of the embodiments, before the first user and the second user are selected from the application users according to the user identification of each application user, the method further includes:
[0014] A random number is generated for each application user; and the user identification of each application user is generated according to the comparison result between the user code of each application user and the random number of each application user and the pre-set shunting threshold.
[0015] In one of the embodiments, the user identification of each application user is generated according to the comparison result between the user code of each application user and the random number of each application user and the pre-set shunting threshold, including:
[0016] According to the user code of each application user and the pre-set shunting rule, the first category of each application user is determined; wherein the first category is a localized user or a non-localized user; according to the comparison result between the random number of each application user and the pre-set shunting threshold, the second category of each application user is determined; wherein the second category is a private cloud user or a non-private cloud user; and according to the first category and the second category of each application user, the user identification of each application user is determined.
[0017] In one of the embodiments, the user identification of each application user is determined according to the first category and the second category of each application user, including:
[0018] For each application user, if the first category of the application user is a domestic user and the second category of the application user is a private cloud user, generating a user identifier of the application user according to a server identifier of the first private cloud server; if the first category of the application user is a domestic user and the second category of the application user is a non-private cloud user, generating the user identifier of the application user according to a server identifier of the first non-private cloud server; if the first category of the application user is a non-domestic user and the second category of the application user is a private cloud user, generating the user identifier of the application user according to a server identifier of the second private cloud server; and if the first category of the application user is a non-domestic user and the second category of the application user is a non-private cloud user, generating the user identifier of the application user according to a server identifier of the second non-private cloud server.
[0019] In one of the embodiments, selecting the first user and the second user from the application users according to the user identifiers of the application users comprises:
[0020] For each application user, if the user identifier of the application user is generated based on the server identifier of the first private cloud server, the application user is the first user; otherwise, the application user is the second user.
[0021] In one of the embodiments, updating the shunting rule and the shunting threshold when it is detected that the first private cloud server is running stably comprises:
[0022] When it is identified that the first private cloud server is running stably according to the detection result of the data traffic in the first private cloud server, sending an update prompt to the operation and maintenance party to instruct the operation and maintenance party to update the shunting rule and the shunting threshold.
[0023] In a second aspect, the application further provides a network request migration device, the device comprising:
[0024] A user selection module is configured to select the first user and the second user from the application users according to the user identifiers of the application users.
[0025] A first user distribution module is configured to distribute the network request of the first user to the first private cloud server for response.
[0026] A second user distribution module is configured to distribute the network request of the second user to the non-private cloud server for response; wherein the first private cloud server and the non-private cloud server both carry application data of the target service application.
[0027] A rule updating module is configured to update the shunting rule and the shunting threshold when it is detected that the first private cloud server is running stably.
[0028] The identification updating module is configured to update the user identifications of the application users according to the updated shunting rule and the shunting threshold, and return to execute the step of selecting the first users and the second users from the application users according to the updated user identifications of the application users, until the number of the second users is zero.
[0029] In a third aspect, the present application provides a computer device. The computer device comprises a memory and a processor. The memory stores a computer program. The processor implements the following steps when executing the computer program:
[0030] selecting the first users and the second users from the application users according to the user identifications of the application users;
[0031] allocating the network request of the first user to the first private cloud server for response;
[0032] allocating the network request of the second user to the non-private cloud server for response; wherein the first private cloud server and the non-private cloud server both carry application data of the target business application;
[0033] updating the shunting rule and the shunting threshold when detecting that the first private cloud server is running stably;
[0034] updating the user identifications of the application users according to the updated shunting rule and the shunting threshold, and returning to execute the step of selecting the first users and the second users from the application users according to the updated user identifications of the application users, until the number of the second users is zero.
[0035] In a fourth aspect, the present application provides a computer readable storage medium. The computer readable storage medium stores a computer program. The computer program is executed by a processor to implement the following steps:
[0036] selecting the first users and the second users from the application users according to the user identifications of the application users;
[0037] allocating the network request of the first user to the first private cloud server for response;
[0038] allocating the network request of the second user to the non-private cloud server for response; wherein the first private cloud server and the non-private cloud server both carry application data of the target business application;
[0039] updating the shunting rule and the shunting threshold when detecting that the first private cloud server is running stably;
[0040] According to the updated shunting rule and the shunting threshold, the user identifier of each application user is updated, and the step of selecting the first user and the second user from each application user according to the updated user identifier of each application user is executed until the number of the second user is zero.
[0041] In a fifth aspect, the present application further provides a computer program product. The computer program product comprises a computer program which, when executed by a processor, implements the following steps:
[0042] According to the user identifier of each application user, the first user and the second user are selected from each application user;
[0043] The network request of the first user is allocated to the first private cloud server for response;
[0044] The network request of the second user is allocated to the non-private cloud server for response; wherein the first private cloud server and the non-private cloud server both carry application data of the target business application;
[0045] In the case where it is detected that the first private cloud server runs stably, the shunting rule and the shunting threshold are updated;
[0046] According to the updated shunting rule and the shunting threshold, the user identifier of each application user is updated, and the step of selecting the first user and the second user from each application user according to the updated user identifier of each application user is executed until the number of the second user is zero.
[0047] The network request migration method, device, computer device and storage medium described above, by allocating the network request of each application user to the first private cloud server and the non-private cloud server based on the user identifier of each application user, and by dynamically updating the user identifier of each application user through the introduced shunting rule and the shunting threshold, can make the network request of all application users of the target business application gradually migrate to the first private cloud server. Compared with the related art, after a small part of the network request is migrated to the private cloud server, the remaining majority of the network request is directly migrated to the private cloud server, which ensures the stable operation of the private cloud service. BRIEF DESCRIPTION OF DRAWINGS
[0048] Figure 1A A flowchart of the network request migration method in one embodiment;
[0049] Figure 1B A schematic diagram of network request allocation in one embodiment;
[0050] Figure 2 A schematic diagram of network request allocation in another embodiment;
[0051] Figure 3A flowchart of a process of generating a user identifier in an embodiment;
[0052] Figure 4 A flowchart of a process of determining a user identifier in an embodiment;
[0053] Figure 5 A flowchart of a process of a network request migration method in another embodiment;
[0054] Figure 6 A structural block diagram of a network request migration apparatus in an embodiment;
[0055] Figure 7 A structural block diagram of a network request migration apparatus in another embodiment;
[0056] Figure 8 An internal structural diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0057] In order to make the purposes, technical solutions and advantages of the present application clearer, further detailed description will be made to the present application in combination with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0058] With the rapid development of Internet business, in view of the data security, each institution begins to gradually migrate the existing business to the private cloud environment, in order to ensure the user experience, that is, to ensure that the network request of the user can be responded in time after the business is migrated to the private cloud environment, the network request migration method appears.
[0059] The current network request migration method adopts the gray pilot method, and pre-migrates the network requests of a small part of gray users to the private cloud environment, and after the network request response of the gray users is successful, the network requests of all users are migrated to the private cloud environment. However, the current network request migration method, when migrating the network requests of all users to the private cloud environment, due to the large fluctuation of the network request data, is easy to cause the server of the private cloud to crash and other problems.
[0060] Based on this, in an embodiment, as shown in Figure 1A A network request migration method is provided, which can be applied to a management server, and further, taking a distribution platform applied on the management server as an example, the method includes the following steps:
[0061] S101, selecting a first user and a second user from each application user according to the user identifier of each application user.
[0062] In this embodiment, each application user is a user of the target business application; optionally, each application user has a user identifier, which can be used to select the server, etc., to execute the application user's network requests; furthermore, in this embodiment, the user identifier of each application user can be dynamically changed, for example, the user identifier of each application user is different in different network request migration stages. The so-called first user and second user are two types of users classified according to the user identifiers of each application user.
[0063] Optionally, when migrating network requests, it is necessary to obtain the user identifier of each application user. For any application user, it is possible to check whether the application user's network request contains a user identifier. If the application user's network request contains a user identifier, the application user can be directly identified as the first user or the second user based on the application user's user identifier.
[0064] If the application user does not have a user identifier, a user identifier can be configured for the application user. For example, the application user's encoded information can be input into a trained identifier determination model. The identifier determination model can directly determine the application user's user identifier based on the input application user's encoded information and the parameters of the identifier determination model itself. Subsequently, based on the application user's user identifier, the application user can be determined as the first user or the second user.
[0065] S102, determine if the number of the second user is zero; if not, execute S103; if yes, execute S107.
[0066] S103, the network request from the first user is assigned to the first private cloud server for response.
[0067] In this context, a network request refers to a request to access or process relevant data of the target business application. The first private cloud server is a server configured in a private cloud environment. Furthermore, in this embodiment, the first private cloud server carries the application data of the target business application.
[0068] Optionally, users of each application can send network requests to the management server through tools embedded on their terminals that can operate the target business applications. These tools can be apps, visual interfaces, or mini-programs, etc.
[0069] Furthermore, after selecting the first user and the second user from among the application users, the network request of the first user can be allocated to the first private cloud server; the first private cloud server responds to the network request of the first user based on the application data of the target business application it carries.
[0070] S104 distributes the network request from the second user to a non-private cloud server for response.
[0071] The non-private cloud server is a server configured in a non-private cloud environment, and further, the non-private cloud server in this embodiment carries application data of the target service application.
[0072] Optionally, the network request of the second user can be allocated to the non-private cloud server, and the non-private cloud server can respond to the network request of the second user based on the application data of the target service application carried by the non-private cloud server.
[0073] It can be understood that, in order to ensure the user experience of the application user, when the target service application is migrated from the non-private cloud environment to the private cloud environment, the original target service application in the non-private cloud environment and the target service application in the private cloud environment can work at the same time, avoiding the phenomenon that the network request response of part of the application user is not timely due to the change of the service environment.
[0074] For example, referring to Figure 1B The first private cloud server A1 and the non-private cloud server A2 are configured at the same time, the first private cloud server A1 and the non-private cloud server A2 both carry application data of the application A, access the network request of each application user, determine B1 as the first user according to the user identifier A1 of the user B1 in the application A, and then the management server allocates the network request of the user B1 to the first private cloud server A1 for response based on the load balancing technology (SLB); or, determine B2 as the second user according to the user identifier A2 of the user B2 in the application A, and then the management server allocates the network request of the user B2 to the non-private cloud server A2 for response based on the load balancing technology.
[0075] S105, updating the shunting rule and the shunting threshold value when it is detected that the first private cloud server runs stably.
[0076] The shunting rule and the shunting threshold value are pre-set and can be dynamically adjusted according to the data flow and other factors of the first private cloud server, and are a constraint condition for determining the user identifier.
[0077] Optionally, a monitoring detection thread can be configured for the first private cloud server, which can automatically update the pre-set shunting rule and shunting threshold value when it is detected that the first private cloud server runs stably.
[0078] Alternatively, the data traffic in the first private cloud server can be detected, and it is determined that the first private cloud server is running stably when the data traffic in the first private cloud server is detected to be stable. That is, when it is identified that the first private cloud server is running stably according to the detection result of the data traffic in the first private cloud server, an update prompt is sent to the operation and maintenance party to instruct the operation and maintenance party to update the shunting rule and the shunting threshold. Optionally, the operation and maintenance party updates the shunting rule and the shunting threshold according to the size of the data traffic in the first private cloud server and the current shunting rule and shunting threshold after receiving the update prompt. The update prompt can include information such as the current shunting rule and shunting threshold.
[0079] It can be understood that in the embodiment, in order to gradually migrate the network requests of the application users from the non-private cloud server to the first private cloud server, when the shunting rule and the shunting threshold are updated, it should be ensured that the number of the first users is increased and the number of the second users is reduced when the user identifier is determined based on the updated shunting rule and shunting threshold.
[0080] For example, based on the preset shunting rule D1 and shunting threshold E1, the number of the user identifier A1 is determined to be 100, and the number of the user identifier A2 is determined to be 1000. Therefore, the number of the first users is currently 100, and the number of the second users is 1000; after the shunting rule D1 and the shunting threshold E1 are updated, the updated shunting rule D2 and the shunting threshold E2 are obtained, and based on the updated shunting rule D2 and the shunting threshold E2, the number of the user identifier A1 is determined to be 200, and the number of the user identifier A2 is determined to be 900. Therefore, the number of the first users is currently 200, and the number of the second users is 900, that is, the number of the second users is gradually reduced.
[0081] S106, update the user identifier of each application user according to the updated shunting rule and shunting threshold, and return to execute S101.
[0082] Specifically, since the shunting rule and the shunting threshold can be used to determine the user identifier, after the shunting rule and the shunting threshold change, the user identifier of each application user also changes accordingly, so the user identifier of each application user can be updated according to the updated shunting rule and shunting threshold.
[0083] Further, as the user identifier of each application user changes, the server to which the network request of each application user is allocated also changes, that is, the first user and the second user are reselected from the application users, and then the network request of the first user is allocated to the first private cloud server for response, and the network request of the second user is allocated to the non-private cloud server for response. It can be understood that, in order to ensure the stable operation of the first private cloud server during the network request migration process, the above operation needs to be repeated multiple times, gradually increasing the number of first users until the number of second users is zero.
[0084] S107, the network request migration is completed.
[0085] In the above network request migration method, the network request of each application user is allocated to the first private cloud server and the non-private cloud server based on the user identifier of each application user, and the user identifier of each application user is dynamically updated by introducing the shunting rule and the shunting threshold, so that the network request of all application users of the target business application is gradually migrated to the first private cloud server. Compared with the related art in which a small part of network requests are migrated to the private cloud server, and then the remaining majority of network requests are migrated to the private cloud server, the stable operation of the private cloud server is ensured.
[0086] In order to ensure that the first private cloud server can operate stably when the network request is gradually migrated to the first private cloud server, on the basis of the above embodiment, a second user allocation method is provided, according to the user identifier of the second user, the network request of the second user is allocated to at least one of the second private cloud server, the second non-private cloud server and the first non-private cloud server for response.
[0087] Among them, referring to Figure 2 , the first private cloud server and the first non-private cloud server both carry application data of the target business application in a domestic database environment; the second private cloud server and the second non-private cloud server both carry application data of the target business application in a non-domestic database environment.
[0088] With the requirement of full domestication of infrastructure, each institution gradually introduces a domestic database, that is, the network request on the non-domestic database is gradually migrated to the domestic database. Among them, the domestic database refers to the database software provided by domestic manufacturers, such as OceanBase, GoldenDB, GaussDB, etc.; the non-domestic database refers to the database software provided by foreign manufacturers, such as DB2, Oracle, etc.
[0089] Specifically, after the second user is determined, the network request of the second user can be distributed to the corresponding server for response based on the user identifier of the second user, which can be the second private cloud server, the second non-private cloud server or the first non-private cloud server.
[0090] It can be understood that, since the first private cloud server and the first non-private cloud server both bear application data of the target business application in a localized database environment, and the second private cloud server and the second non-private cloud server both bear application data of the target business application in a non-localized database environment, when the network request of the second user is migrated to the first private cloud server, the network request on the non-localized database is also migrated to the localized database.
[0091] In the embodiment, the second private cloud server, the second non-private cloud server and the first non-private cloud server are introduced, and the network request of the second user is distributed to the second private cloud server, the second non-private cloud server and the first non-private cloud server respectively, so as to ensure the stable operation of each server; the localized database and the non-localized database are introduced, so as to achieve the target of migrating the network request on the non-localized database to the localized database.
[0092] In order to accurately control the distribution of the network request of each application user, on the basis of the above-mentioned embodiments, in the present embodiment, an optional way of determining the user identifier is provided, as shown in Figure 3 The specific steps include the following steps:
[0093] S301, a random number is generated for each application user.
[0094] Optionally, when the user identifier of each application user is determined, a random number can be generated for each application user. For example, a random number is generated for each application user from 1-100.
[0095] S302, the user identifier of each application user is generated according to the comparison result between the user code of each application user and the pre-set distribution threshold and the random number of each application user.
[0096] The user code is the identity information of each application user, which is unique, i.e. the user codes of each application user are different.
[0097] Optionally, the user code of each application user and the random number of each application user can be input into the trained identifier determination model at the same time, and the identifier determination model can directly output the user identifier of each application user based on the input user code of each application user and the random number of each application user.
[0098] Alternatively, for each application user, the user code of the application user can be compared with a preset private cloud migration list to determine whether the application user needs to be migrated to a private cloud server, wherein the private cloud migration list records user codes of users that need to be migrated to the private cloud server; further, the random number of the application user is compared with a preset shunting threshold; then, the user identifier of the application user is generated according to whether the application user needs to be migrated to the private cloud server and the comparison result of the random number of the application user and the preset shunting threshold.
[0099] In the embodiment, the operation of assigning a random number to each application user is introduced, and by comparing the random number of each application user with a preset shunting threshold, the user identifier of each application user can be accurately determined, and the shunting of network requests of each application user can be accurately controlled, thereby ensuring the stability of the server in the network request migration process.
[0100] In order to more accurately control the shunting of network requests of each application user, on the basis of the above-mentioned embodiments, in the present embodiment, another optional way of determining the user identifier is provided, as shown in Figure 4 The specific steps include the following steps:
[0101] S401, determining the first category of each application user according to the user code of each application user and a preset shunting rule.
[0102] The first category is a localized user or a non-localized user.
[0103] Optionally, a first category determination model can be trained based on the preset shunting rule, and then the user code of each application user is input into the first category determination model in sequence, so as to determine the first category of each application user.
[0104] For example, the user code of the application user H is "202436", the user code of the application user I is "202460", and the preset shunting rule is that the application user whose last digit of the user code is "0" or "1" is a localized user, and the rest of the application users are non-localized users. Therefore, the application user H is a non-localized user, and the application user I is a localized user.
[0105] S402, determining the second category of each application user according to the comparison result between the random number of each application user and a preset shunting threshold.
[0106] The second category is a private cloud user or a non-private cloud user.
[0107] Optionally, the second-class determination model can be trained based on the preset shunt threshold, and then the random numbers of the application users are sequentially input into the second-class determination model, so as to determine the second classes of the application users.
[0108] For example, the random number of the application user H is 7, the random number of the application user I is 15, the preset shunt threshold is 10, the application user with the random number greater than the shunt threshold is a non-private cloud user, and the application user with the random number less than the shunt threshold is a private cloud user. Therefore, the application user H is a private cloud user, and the application user I is a non-private cloud user.
[0109] S403, determining the user identities of the application users according to the first classes and the second classes of the application users.
[0110] Optionally, for each application user, the user identity of the application user can be determined according to whether the application user is a domestic user or a non-domestic user, and whether the application user is a private cloud user or a non-private cloud user.
[0111] Specifically, for each application user, if the first class of the application user is a domestic user and the second class of the application user is a private cloud user, the user identity of the application user is generated according to the server identity of the first private cloud server. For example, the server identity A1 of the first private cloud server can be taken as the user identity A1 of the application user.
[0112] Alternatively, if the first class of the application user is a domestic user and the second class of the application user is a non-private cloud user, the user identity of the application user is generated according to the server identity of the first non-private cloud server.
[0113] Alternatively, if the first class of the application user is a non-domestic user and the second class of the application user is a private cloud user, the user identity of the application user is generated according to the server identity of the second private cloud server.
[0114] Alternatively, if the first class of the application user is a non-domestic user and the second class of the application user is a non-private cloud user, the user identity of the application user is generated according to the server identity of the second non-private cloud server.
[0115] In the embodiment, the first class and the second class are introduced, so that the user identities of the application users can be more accurately determined, and the shunting of the network requests of the application users can be more accurately controlled.
[0116] Further, on the basis of the above-mentioned embodiment, the first user and the second user can be selected from the application users, for each application user, if the user identifier of the application user is generated based on the server identifier of the first private cloud server, the application user is the first user; otherwise, the application user is the second user.
[0117] Figure 5 For another embodiment of the flowchart of the network request migration method, on the basis of the above-mentioned embodiment, the present embodiment provides an optional example of the network request migration method. In combination with Figure 5 , the specific implementation process is as follows:
[0118] S501, a random number is generated for each application user.
[0119] S502, according to the user code of each application user and the pre-set shunting rule, the first category of each application user is determined.
[0120] Among them, the first category is a domestic user or a non-domestic user.
[0121] S503, according to the comparison result between the random number of each application user and the pre-set shunting threshold, the second category of each application user is determined.
[0122] Among them, the second category is a private cloud user or a non-private cloud user.
[0123] S504, according to the first category and the second category of each application user, the user identifier of each application user is determined.
[0124] Specifically, for each application user, if the first category of the application user is a domestic user, and the second category of the application user is a private cloud user, the user identifier of the application user is generated according to the server identifier of the first private cloud server; if the first category of the application user is a domestic user, and the second category of the application user is a non-private cloud user, the user identifier of the application user is generated according to the server identifier of the first non-private cloud server; if the first category of the application user is a non-domestic user, and the second category of the application user is a private cloud user, the user identifier of the application user is generated according to the server identifier of the second private cloud server; if the first category of the application user is a non-domestic user, and the second category of the application user is a non-private cloud user, the user identifier of the application user is generated according to the server identifier of the second non-private cloud server.
[0125] S505, according to the user identifier of each application user, the first user and the second user are selected from the application users.
[0126] Specifically, for each application user, if the user identifier of the application user is generated based on the server identifier of the first private cloud server, the application user is regarded as a first user; otherwise, the application user is regarded as a second user.
[0127] S506, determining whether the number of second users is zero; if not, performing S507; if yes, S511.
[0128] S507, distributing the network request of the first user to the first private cloud server for response.
[0129] S508, distributing the network request of the second user to the non-private cloud server for response.
[0130] Among them, the first private cloud server and the non-private cloud server both carry the application data of the target business application.
[0131] Specifically, according to the user identifier of the second user, the network request of the second user is distributed to at least one of the second private cloud server, the second non-private cloud server and the first non-private cloud server for response; wherein the first private cloud server and the first non-private cloud server both carry the application data of the target business application in a localized database environment; the second private cloud server and the second non-private cloud server both carry the application data of the target business application in a non-localized database environment.
[0132] S509, updating the distribution rule and the distribution threshold under the condition that the first private cloud server is detected to be stable.
[0133] S510, updating the user identifier of each application user according to the updated distribution rule and distribution threshold, and returning to perform S505.
[0134] S511, network request migration is completed.
[0135] The specific process of S501-S511 can refer to the description of the above method embodiment, which has similar implementation principles and technical effects, and will not be repeated here.
[0136] It should be understood that although each step in the flowchart involved in each embodiment as described above is shown in sequence according to the direction of the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless explicitly stated herein, there is no strict order limitation for the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowchart involved in each embodiment as described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or steps or stages in other steps.
[0137] Based on the same inventive concept, the embodiments of the present application also provide a network request migration device for implementing the network request migration method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more network request migration device embodiments provided below can refer to the limitations of the network request migration method described above, which will not be repeated here.
[0138] In one embodiment, as shown in Figure 6 A network request migration device 1 is provided, comprising a user selection module 10, a first user allocation module 20, a second user allocation module 30, a rule updating module 40 and an identity updating module 50, wherein:
[0139] The user selection module 10 is configured to select a first user and a second user from each application user according to the user identity of each application user;
[0140] The first user allocation module 20 is configured to allocate the network request of the first user to a first private cloud server for response;
[0141] The second user allocation module 30 is configured to allocate the network request of the second user to a non-private cloud server for response; wherein the first private cloud server and the non-private cloud server each carries application data of a target service application;
[0142] The rule updating module 40 is configured to update the shunting rule and the shunting threshold when it is detected that the first private cloud server is running stably;
[0143] The identity updating module 50 is configured to update the user identity of each application user according to the updated shunting rule and the shunting threshold, and return to execute the selection of the first user and the second user from each application user according to the updated user identity of each application user until the number of the second user is zero.
[0144] In one embodiment, the second user distribution module 30 is specifically configured to:
[0145] According to the user identification of the second user, distribute the network request of the second user to at least one of the second private cloud server, the second non-private cloud server and the first non-private cloud server for response; wherein the first private cloud server and the first non-private cloud server both carry application data of the target business application in a localized database environment; and the second private cloud server and the second non-private cloud server both carry application data of the target business application in a non-localized database environment.
[0146] In one embodiment, the network request migration device 1 further comprises an identification determination module 60, as shown in Figure 7 The identification determination module 60 comprises:
[0147] A random number generation unit 61 for generating a random number for each application user respectively;
[0148] An identification determination unit 62 for generating the user identification of each application user according to the user code of each application user and the comparison result between the random number of each application user and the pre-set shunting threshold.
[0149] In one embodiment, the identification determination unit 62 comprises:
[0150] A first determination sub-unit for determining the first category of each application user according to the user code of each application user and the pre-set shunting rule; wherein the first category is a localized user or a non-localized user;
[0151] A second determination sub-unit for determining the second category of each application user according to the comparison result between the random number of each application user and the pre-set shunting threshold; wherein the second category is a private cloud user or a non-private cloud user;
[0152] An identification determination sub-unit for determining the user identification of each application user according to the first category and the second category of each application user.
[0153] In one embodiment, the identification determination sub-unit is specifically configured to:
[0154] For each application user, if the first category of the application user is a domestication user and the second category of the application user is a private cloud user, a user identifier of the application user is generated according to a server identifier of the first private cloud server; if the first category of the application user is a domestication user and the second category of the application user is a non-private cloud user, the user identifier of the application user is generated according to a server identifier of the first non-private cloud server; if the first category of the application user is a non-domestication user and the second category of the application user is a private cloud user, the user identifier of the application user is generated according to a server identifier of the second private cloud server; and if the first category of the application user is a non-domestication user and the second category of the application user is a non-private cloud user, the user identifier of the application user is generated according to a server identifier of the second non-private cloud server.
[0155] In one embodiment, the user selection module 10 is specifically configured to:
[0156] For each application user, if the user identifier of the application user is generated based on the server identifier of the first private cloud server, the application user is regarded as a first user; otherwise, the application user is regarded as a second user.
[0157] In one embodiment, the rule updating module 40 is specifically configured to:
[0158] In a case where it is identified that the first private cloud server is stable in operation according to a detection result of data traffic in the first private cloud server, an update prompt is sent to an operation and maintenance party to instruct the operation and maintenance party to update the shunting rule and the shunting threshold.
[0159] The various modules in the network request migration apparatus described above can be all or partially implemented by software, hardware, and combinations thereof. The various modules described above can be embedded in or independent of a processor in a computer device in a hardware form, or stored in a memory in a computer device in a software form, so as to be called and executed by a processor to perform operations corresponding to the various modules.
[0160] In one embodiment, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in Figure 8As shown in the figure. The computer device includes a processor, a memory, an input / output interface (I / O for short) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capability. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as shunting rules and shunting thresholds. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through network connection. The computer program is executed by the processor to implement a network request migration method.
[0161] Those skilled in the art can understand that, Figure 8 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0162] In one embodiment, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the following steps:
[0163] According to the user identifier of each application user, the first user and the second user are selected from the application users;
[0164] The network request of the first user is distributed to the first private cloud server for response;
[0165] The network request of the second user is distributed to the non-private cloud server for response; wherein the first private cloud server and the non-private cloud server carry application data of the target business application;
[0166] In the case where it is detected that the first private cloud server runs stably, the shunting rule and the shunting threshold are updated;
[0167] According to the updated shunting rule and shunting threshold, the user identifier of each application user is updated, and the execution of selecting the first user and the second user from the application users according to the updated application user identifier is returned until the number of the second user is zero.
[0168] In one embodiment, the processor implements the following steps when executing the logic in the computer program that assigns the network request of the second user to the non-private cloud server for response:
[0169] According to the user identification of the second user, the network request of the second user is assigned to at least one of the second private cloud server, the second non-private cloud server and the first non-private cloud server for response; wherein the first private cloud server and the first non-private cloud server both carry application data of the target business application in a localized database environment; and the second private cloud server and the second non-private cloud server both carry application data of the target business application in a non-localized database environment.
[0170] In one embodiment, the processor implements the following steps when executing the logic in the computer program that selects the first user and the second user from the application users according to the user identification of each application user:
[0171] A random number is generated for each application user; and the user identification of each application user is generated according to the comparison result between the user code of each application user and the random number of each application user and the pre-set shunting threshold.
[0172] In one embodiment, the processor implements the following steps when executing the logic in the computer program that generates the user identification of each application user according to the comparison result between the user code of each application user and the random number of each application user and the pre-set shunting threshold:
[0173] According to the user code of each application user and the pre-set shunting rule, the first category of each application user is determined; wherein the first category is a localized user or a non-localized user; according to the comparison result between the random number of each application user and the pre-set shunting threshold, the second category of each application user is determined; wherein the second category is a private cloud user or a non-private cloud user; and according to the first category and the second category of each application user, the user identification of each application user is determined.
[0174] In one embodiment, the processor implements the following steps when executing the logic in the computer program that determines the user identification of each application user according to the first category and the second category of each application user:
[0175] For each application user, if the first category of the application user is a localization user and the second category of the application user is a private cloud user, a user identifier of the application user is generated according to a server identifier of the first private cloud server; if the first category of the application user is a localization user and the second category of the application user is a non-private cloud user, the user identifier of the application user is generated according to a server identifier of the first non-private cloud server; if the first category of the application user is a non-localization user and the second category of the application user is a private cloud user, the user identifier of the application user is generated according to a server identifier of the second private cloud server; if the first category of the application user is a non-localization user and the second category of the application user is a non-private cloud user, the user identifier of the application user is generated according to a server identifier of the second non-private cloud server.
[0176] In one embodiment, when the processor executes the logic in the computer program for selecting a first user and a second user from the application users according to the user identifiers of the application users, the following steps are implemented:
[0177] For each application user, if the user identifier of the application user is generated based on the server identifier of the first private cloud server, the application user is taken as the first user; otherwise, the application user is taken as the second user.
[0178] In one embodiment, when the processor executes the logic in the computer program for updating the shunting rule and the shunting threshold under the condition that the first private cloud server is detected to be running stably, the following steps are implemented:
[0179] Under the condition that the first private cloud server is identified to be running stably according to the detection result of the data traffic in the first private cloud server, an update prompt is sent to the operation and maintenance party to instruct the operation and maintenance party to update the shunting rule and the shunting threshold.
[0180] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0181] selecting a first user and a second user from the application users according to the user identifiers of the application users;
[0182] allocating a network request of the first user to the first private cloud server for response;
[0183] allocating a network request of the second user to a non-private cloud server for response; wherein the first private cloud server and the non-private cloud server both carry application data of a target business application;
[0184] updating the shunting rule and the shunting threshold under the condition that the first private cloud server is detected to be running stably.
[0185] According to the updated shunting rule and the shunting threshold, the user identifier of each application user is updated, and the execution of selecting the first user and the second user from each application user according to the updated user identifier of each application user until the number of the second user is zero is returned.
[0186] In one embodiment, when the code logic in the computer program that assigns the network request of the second user to the non-private cloud server for response is executed by the processor, the following steps are specifically implemented:
[0187] According to the user identifier of the second user, the network request of the second user is assigned to at least one of the second private cloud server, the second non-private cloud server and the first non-private cloud server for response; wherein the first private cloud server and the first non-private cloud server both carry application data of the target business application in a localized database environment; the second private cloud server and the second non-private cloud server both carry application data of the target business application in a non-localized database environment.
[0188] In one embodiment, when the code logic in the computer program that selects the first user and the second user from each application user according to the user identifier of each application user is executed by the processor, the following steps are specifically implemented:
[0189] A random number is generated for each application user; according to the user code of each application user and the comparison result between the random number of each application user and the pre-set shunting threshold, the user identifier of each application user is generated.
[0190] In one embodiment, when the code logic in the computer program that generates the user identifier of each application user according to the user code of each application user and the comparison result between the random number of each application user and the pre-set shunting threshold is executed by the processor, the following steps are specifically implemented:
[0191] According to the user code of each application user and the pre-set shunting rule, the first category of each application user is determined; wherein the first category is a localized user or a non-localized user; according to the comparison result between the random number of each application user and the pre-set shunting threshold, the second category of each application user is determined; wherein the second category is a private cloud user or a non-private cloud user; according to the first category and the second category of each application user, the user identifier of each application user is determined.
[0192] In one embodiment, when the code logic in the computer program that determines the user identifier of each application user according to the first category and the second category of each application user is executed by the processor, the following steps are specifically implemented:
[0193] For each application user, if the first category of the application user is a domestic user and the second category of the application user is a private cloud user, a user identifier of the application user is generated according to a server identifier of the first private cloud server; if the first category of the application user is a domestic user and the second category of the application user is a non-private cloud user, the user identifier of the application user is generated according to a server identifier of the first non-private cloud server; if the first category of the application user is a non-domestic user and the second category of the application user is a private cloud user, the user identifier of the application user is generated according to a server identifier of the second private cloud server; and if the first category of the application user is a non-domestic user and the second category of the application user is a non-private cloud user, the user identifier of the application user is generated according to a server identifier of the second non-private cloud server.
[0194] In one embodiment, the code logic in the computer program for selecting the first user and the second user from the application users according to the user identifiers of the application users is implemented by the processor as follows when the code logic is executed by the processor:
[0195] For each application user, if the user identifier of the application user is generated based on the server identifier of the first private cloud server, the application user is regarded as the first user; otherwise, the application user is regarded as the second user.
[0196] In one embodiment, the code logic in the computer program for updating the shunting rule and the shunting threshold when it is detected that the first private cloud server is running stably is implemented by the processor as follows when the code logic is executed by the processor:
[0197] When it is detected that the first private cloud server is running stably according to the detection result of the data flow in the first private cloud server, an update prompt is sent to the operation and maintenance party to instruct the operation and maintenance party to update the shunting rule and the shunting threshold.
[0198] In one embodiment, a computer program product is provided, which includes a computer program, and the computer program is executed by the processor to implement the following steps:
[0199] Selecting the first user and the second user from the application users according to the user identifiers of the application users;
[0200] Assigning the network request of the first user to the first private cloud server for response;
[0201] Assigning the network request of the second user to the non-private cloud server for response; wherein the application data of the target service application is carried in the first private cloud server and the non-private cloud server;
[0202] In a case where it is detected that the first private cloud server is stable, update the shunting rule and the shunting threshold value;
[0203] According to the updated shunting rule and the shunting threshold value, update the user identifier of each application user, and return to execute the operation of selecting a first user and a second user from each application user according to the updated user identifier of each application user, until the number of the second users is zero.
[0204] In one embodiment, when the computer program is executed by the processor to perform the operation of distributing the network request of the second user to the non-private cloud server for response, the following steps are specifically implemented:
[0205] According to the user identifier of the second user, distribute the network request of the second user to at least one of the second private cloud server, the second non-private cloud server and the first non-private cloud server for response; wherein the first private cloud server and the first non-private cloud server both carry application data of the target business application in a localized database environment; the second private cloud server and the second non-private cloud server both carry application data of the target business application in a non-localized database environment.
[0206] In one embodiment, when the computer program is executed by the processor to perform the operation of selecting a first user and a second user from each application user according to the user identifier of each application user, the following steps are specifically implemented:
[0207] Generate a random number for each application user; and generate the user identifier of each application user according to the user code of each application user and the comparison result between the random number of each application user and the pre-set shunting threshold value.
[0208] In one embodiment, when the computer program is executed by the processor to perform the operation of generating the user identifier of each application user according to the user code of each application user and the comparison result between the random number of each application user and the pre-set shunting threshold value, the following steps are specifically implemented:
[0209] Determine the first category of each application user according to the user code of each application user and the pre-set shunting rule; wherein the first category is a localized user or a non-localized user; determine the second category of each application user according to the comparison result between the random number of each application user and the pre-set shunting threshold value; wherein the second category is a private cloud user or a non-private cloud user; and determine the user identifier of each application user according to the first category and the second category of each application user.
[0210] In one embodiment, when the computer program is executed by the processor to perform the operation of determining the user identifier of each application user according to the first category and the second category of each application user, the following steps are specifically implemented:
[0211] For each application user, if the first category of the application user is a domestication user and the second category of the application user is a private cloud user, a user identifier of the application user is generated according to a server identifier of the first private cloud server; if the first category of the application user is a domestication user and the second category of the application user is a non-private cloud user, the user identifier of the application user is generated according to a server identifier of the first non-private cloud server; if the first category of the application user is a non-domestication user and the second category of the application user is a private cloud user, the user identifier of the application user is generated according to a server identifier of the second private cloud server; and if the first category of the application user is a non-domestication user and the second category of the application user is a non-private cloud user, the user identifier of the application user is generated according to a server identifier of the second non-private cloud server.
[0212] In one embodiment, when the computer program is executed by the processor to select the first user and the second user from the application users according to the user identifiers of the application users, the following steps are specifically implemented:
[0213] For each application user, if the user identifier of the application user is generated based on the server identifier of the first private cloud server, the application user is regarded as the first user; otherwise, the application user is regarded as the second user.
[0214] In one embodiment, when the computer program is executed by the processor to update the shunting rule and the shunting threshold under the condition that it is detected that the first private cloud server is running stably, the following steps are specifically implemented:
[0215] Under the condition that it is identified that the first private cloud server is running stably according to the detection result of the data flow in the first private cloud server, an update prompt is sent to the operation and maintenance party to instruct the operation and maintenance party to update the shunting rule and the shunting threshold.
[0216] It should be noted that the data (including but not limited to the shunting rule and the shunting threshold) involved in the present application are all data fully authorized by all parties, and the collection, use and processing of the relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0217] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0218] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.
[0219] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A network request migration method, characterized in that, The method includes: Generate a random number for each application user; Based on the user code of each application user and the comparison result between the random number of each application user and the pre-set traffic diversion threshold, a user identifier for each application user is generated; wherein, the user code is the identity information of each application user; Based on the user identifiers of each application user, a first user and a second user are selected from each application user; wherein, if the user identifier of the application user is generated based on the server identifier of the first private cloud server, then the application user is selected as the first user; otherwise, the application user is selected as the second user. The network request from the first user is assigned to the first private cloud server for response; The network request from the second user is assigned to a non-private cloud server for response; wherein, both the first private cloud server and the non-private cloud server carry the application data of the target business application; Once the first private cloud server is detected to be running stably, update the traffic splitting rules and traffic splitting thresholds. Based on the updated traffic splitting rules and thresholds, update the user identifiers of each application user, and return to the execution stage to select the first user and the second user from each application user based on the updated user identifiers, until the number of the second user is zero.
2. The method according to claim 1, characterized in that, The step of allocating the network request of the second user to a non-private cloud server for response includes: Based on the user identifier of the second user, the network request of the second user is assigned to at least one of the second private cloud server, the second non-private cloud server and the first non-private cloud server for response; The first private cloud server and the first non-private cloud server both use a domestically produced database environment to carry the application data of the target business application; the second private cloud server and the second non-private cloud server both use a non-domestic database environment to carry the application data of the target business application.
3. The method according to claim 2, characterized in that, The step of generating user identifiers for each application user based on their user codes and the comparison results between their random numbers and pre-set traffic splitting thresholds includes: Based on the user codes of each application user and the pre-set traffic distribution rules, the first category of each application user is determined; wherein, the first category is either domestic users or non-domestic users; Based on the comparison between the random number of each application user and the pre-set traffic diversion threshold, a second category is determined for each application user; wherein, the second category is either a private cloud user or a non-private cloud user. The user identifier for each application user is determined based on the first and second categories of each application user.
4. The method according to claim 3, characterized in that, The process of determining the user identifier of each application user based on the first and second categories includes: For each application user, if the first category of the application user is a domestic user and the second category of the application user is a private cloud user, then the user identifier of the application user is generated based on the server identifier of the first private cloud server. If the first category of the application user is a domestic user and the second category of the application user is a non-private cloud user, then the user identifier of the application user is generated based on the server identifier of the first non-private cloud server. If the first category of the application user is a non-domestic user and the second category of the application user is a private cloud user, then the user identifier of the application user is generated based on the server identifier of the second private cloud server. If the first category of the application user is a non-domestic user and the second category of the application user is a non-private cloud user, then the user identifier of the application user is generated based on the server identifier of the second non-private cloud server.
5. The method according to claim 1, characterized in that, The step of updating the traffic splitting rules and thresholds when the first private cloud server is detected to be operating stably includes: Based on the data traffic detection results in the first private cloud server, if the first private cloud server is found to be operating stably, an update prompt is sent to the operation and maintenance party to instruct the operation and maintenance party to update the traffic splitting rules and traffic splitting thresholds.
6. A network request migration device, characterized in that, The device includes: The random number generation unit is used to generate a random number for each application user. The identifier determination unit is used to generate a user identifier for each application user based on the user code of each application user and the comparison result between the random number of each application user and the preset diversion threshold; wherein, the user code is the identity information of each application user; The user selection module is used to select a first user and a second user from each application user based on the user identifier of each application user; wherein, if the user identifier of the application user is generated based on the server identifier of the first private cloud server, then the application user is selected as the first user; otherwise, the application user is selected as the second user. The first user allocation module is used to allocate the network requests of the first user to the first private cloud server for response; The second user allocation module is used to allocate the network requests of the second user to a non-private cloud server for response; wherein, both the first private cloud server and the non-private cloud server carry the application data of the target business application; The rule update module is used to update the traffic splitting rules and traffic splitting thresholds when the first private cloud server is detected to be running stably. The identifier update module is used to update the user identifier of each application user according to the updated traffic splitting rules and traffic splitting thresholds, and return to the execution to select the first user and the second user from each application user according to the updated application user user identifiers, until the number of the second user is zero.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Shunting information configuration method and device, electronic equipment and storage medium
CN112714011A