Instruction library migration method, device, computer device and storage medium
By obtaining the type of data operation request and migrating data according to the status of the control switch of the configuration center, the cumbersome problem of the instruction library migration process is solved, and an efficient migration process is achieved.
Patent Information
- Application Number
- CN202111328977.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-10
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2041-11-10
AI Technical Summary
In the prior art, the instruction library migration process is cumbersome and takes a long time, resulting in low migration efficiency.
By responsive to data operation requests, obtain the operation type, and migrate the data operation request from the instruction library to the corresponding centralized library according to the control switch status in the configuration center, avoiding issuing change scripts and restarting the server.
Simplifies the instruction library migration process, improves migration efficiency, saves time, and reduces the impact on business processing.
Smart Images

Figure CN114020724B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a method and apparatus for migrating an instruction library, a computer device, a storage medium, and a computer program product. Background Art
[0002] In the field of computer technology, corresponding data operations can be performed by accessing an instruction library, such as data query operations, data deletion operations, etc.
[0003] In related technologies, when migrating an instruction library, generally, technical parameters are stored in a table, and then the channel process is controlled by issuing a change script; however, the process of issuing a change script is relatively cumbersome and time-consuming, resulting in low efficiency of instruction library migration. Summary of the Invention
[0004] Based on this, in view of the above technical problems, it is necessary to provide an instruction library migration method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve the efficiency of instruction library migration.
[0005] In a first aspect, this application provides an instruction library migration method. The method includes:
[0006] Respond to a data operation request for the instruction library, and obtain the operation type of the data operation request;
[0007] Determine a corresponding control switch according to the operation type;
[0008] Migrate the data operation request from the instruction library to a corresponding centralized library according to the status of the control switch in the configuration center.
[0009] In one embodiment, the determining a corresponding control switch according to the operation type includes:
[0010] When the operation type is a data query operation, determine the gray-to-positive switch, the emergency switch, the dual-write switch, and the query switch as the control switches corresponding to the data query operation;
[0011] When the operation type is a data change operation, determine the emergency switch and the dual-write switch as the control switches corresponding to the data change operation.
[0012] In one embodiment, when the operation type is a data query operation, the migrating the data operation request from the instruction library to a corresponding centralized library according to the status of the control switch in the configuration center includes:
[0013] When the gray-to-normal switch in the configuration center is in the off state, migrate the data operation request from the instruction library to the first centralized library;
[0014] When the gray-to-normal switch in the configuration center is in the on state, migrate the data operation request from the instruction library to the corresponding centralized library according to the states of the emergency switch, the dual-write switch, and the query switch in the configuration center.
[0015] In one embodiment, the migrating the data operation request from the instruction library to the corresponding centralized library according to the states of the emergency switch, the dual-write switch, and the query switch in the configuration center includes:
[0016] When the emergency switch in the configuration center is in the on state, or when the emergency switch in the configuration center is in the off state and both the dual-write switch and the query switch are in the on state, migrate the data operation request from the instruction library to the first centralized library;
[0017] When both the emergency switch and the dual-write switch in the configuration center are in the off state, or when the emergency switch in the configuration center is in the off state, the dual-write switch is in the on state, and the query switch is in the off state, migrate the data operation request from the instruction library to the second centralized library.
[0018] In one embodiment, when the operation type is a data change operation, the migrating the data operation request from the instruction library to the corresponding centralized library according to the state of the control switch in the configuration center includes:
[0019] When the emergency switch in the configuration center is in the on state, migrate the data operation request from the instruction library to the first centralized library;
[0020] When the emergency switch in the configuration center is in the off state, migrate the data operation request from the instruction library to the corresponding centralized library according to the state of the dual-write switch in the configuration center.
[0021] In one embodiment, the migrating the data operation request from the instruction library to the corresponding centralized library according to the state of the dual-write switch in the configuration center includes:
[0022] When the dual-write switch in the configuration center is in the on state, migrate the data operation request from the instruction library to the first centralized library and the second centralized library;
[0023] When the dual-write switch in the configuration center is in the off state, migrate the data operation request from the instruction library to the second centralized library.
[0024] In a second aspect, the present application also provides an instruction library device. The device includes:
[0025] A type acquisition module, configured to acquire the operation type of the data operation request in response to a data operation request for the instruction library;
[0026] A switch determination module, configured to determine a corresponding control switch according to the operation type;
[0027] A request migration module, configured to migrate the data operation request from the instruction library to a corresponding centralized library according to the status of the control switch in the configuration center.
[0028] In a third aspect, the present application also provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0029] Acquire the operation type of the data operation request in response to a data operation request for the instruction library;
[0030] Determine a corresponding control switch according to the operation type;
[0031] Migrate the data operation request from the instruction library to a corresponding centralized library according to the status of the control switch in the configuration center.
[0032] In a fourth aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0033] Acquire the operation type of the data operation request in response to a data operation request for the instruction library;
[0034] Determine a corresponding control switch according to the operation type;
[0035] Migrate the data operation request from the instruction library to a corresponding centralized library according to the status of the control switch in the configuration center.
[0036] In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0037] Acquire the operation type of the data operation request in response to a data operation request for the instruction library;
[0038] Determine a corresponding control switch according to the operation type;
[0039] Migrate the data operation request from the instruction library to the corresponding centralized library according to the status of the control switch described in the configuration center.
[0040] The above-mentioned instruction library method, device, computer equipment, storage medium and computer program product obtain the operation type of the data operation request by responding to the data operation request for the instruction library; then determine the corresponding control switch according to the operation type; finally, migrate the data operation request from the instruction library to the corresponding centralized library according to the status of the control switch in the configuration center. In this way, only by relying on the status of the control switch in the configuration center, the data operation request can be migrated from the instruction library to the corresponding centralized library, without the need to publish a change script or restart the server, thus simplifying the instruction library migration process, saving time, and further improving the instruction library migration efficiency. Description of the Drawings
[0041] Figure 1 It is a schematic flowchart of the instruction library migration method in one embodiment;
[0042] Figure 2 It is a schematic flowchart of the steps for determining the corresponding control switch in one embodiment;
[0043] Figure 3 It is a schematic flowchart of the instruction library migration method in another embodiment;
[0044] Figure 4 It is a schematic flowchart of the instruction library migration method in yet another embodiment;
[0045] Figure 5 It is a structural block diagram of the instruction library migration device in one embodiment;
[0046] Figure 6 It is an internal structure diagram of a computer device in one embodiment. Detailed Embodiments
[0047] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to 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.
[0048] It should be noted that the instruction library migration method and device provided in the present application can be used in the financial field for operating e-banking services, or can also be used in any field other than the financial field, such as the computer technology field; the application fields of the instruction library migration method and device provided in the present application are not limited.
[0049] In one embodiment, as Figure 1As shown in the figure, a method for migrating an instruction library is provided. In this embodiment, the method is exemplified by being applied to a server. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0050] Step S101, in response to a data operation request for the instruction library, obtain the operation type of the data operation request.
[0051] Among them, the instruction library refers to a single-point database for different nodes to access. The data operation request refers to an operation request for the data in the instruction library, including but not limited to a data query request, a data deletion request, a data addition request, and a data modification request.
[0052] Among them, the operation type refers to the type corresponding to the data operation request, including but not limited to a data query operation and a data change operation; the data change operation includes but not limited to a data deletion operation, a data addition operation, and a data modification operation.
[0053] Specifically, the server, in response to a data operation request for the instruction library, obtains an instruction through the operation type to obtain the operation type of the data operation request. Among them, the operation type acquisition instruction is an instruction for obtaining the operation type of a data operation request.
[0054] Step S102, determine the corresponding control switch according to the operation type.
[0055] Among them, the control switch refers to a gray-to-normal switch, an emergency switch, a dual-write switch, and a query switch, and the control switches corresponding to different operation types are different. For example, the control switches corresponding to a data query operation are a gray-to-normal switch, an emergency switch, a dual-write switch, and a query switch; the control switches corresponding to a data change operation are an emergency switch and a dual-write switch. It should be noted that each control switch has two states, namely an on state and an off state.
[0056] Specifically, the server queries the corresponding relationship between the operation type and the control switch according to the operation type of the data operation request to obtain the control switch corresponding to the operation type.
[0057] Step S103, migrate the data operation request from the instruction library to the corresponding centralized library according to the state of the control switch in the configuration center.
[0058] Among them, the states of different control switches are pre-configured in the configuration center. The configuration center is a parameter configuration framework that takes effect in real time, which can be an Apollo configuration center or other configuration centers. It should be noted that the states of the control switches in the configuration center take effect in real time and do not require restarting the server.
[0059] Among them, the centralized repository refers to a database that can implement the function of operating data according to data operation requests; in an actual scenario, one type of centralized repository refers to the original centralized repository, and the other type of centralized repository refers to the centralized repository abstracted from the services provided by the e-banking application; the e-banking application is a distributed application framework.
[0060] Specifically, the server queries the configuration center to obtain the status of the control switch; according to the status of the control switch, it determines the corresponding centralized repository, and migrates the data operation request from the instruction library to this centralized repository, and processes the data operation request through this centralized repository, such as deleting corresponding data or adding corresponding data according to the data operation request.
[0061] In the above instruction library migration method, by responding to the data operation request for the instruction library, the operation type of the data operation request is obtained; then, according to the operation type, the corresponding control switch is determined; finally, according to the status of the control switch in the configuration center, the data operation request is migrated from the instruction library to the corresponding centralized repository; in this way, only according to the status of the control switch in the configuration center, the data operation request can be migrated from the instruction library to the corresponding centralized repository, without publishing a change script or restarting the server, thus simplifying the instruction library migration process, saving time, and further improving the instruction library migration efficiency.
[0062] In one embodiment, as Figure 2 shown, the above step S102, determining the corresponding control switch according to the operation type, specifically includes the following steps:
[0063] Step S201, when the operation type is a data query operation, then determine the gray-to-normal switch, the emergency switch, the dual-write switch, and the query switch as the control switches corresponding to the data query operation.
[0064] Step S202, when the operation type is a data change operation, then determine the emergency switch and the dual-write switch as the control switches corresponding to the data change operation.
[0065] Among them, the gray-to-normal switch is defaulted to the off state. At this time, for data query operations, only gray-scale customers can access the services provided by the e-banking application, and non-gray-scale customers continue to query the centralized repository; if the gray-to-normal switch is in the on state, then when all customers perform data query operations, they need to judge how to call the services provided by the centralized repository and the e-banking application according to the switch states of the emergency switch, the dual-write switch, and the query switch.
[0066] Among them, if the emergency switch is in the on state, the centralized repository is queried for all operations processed by the channel, and the services provided by the e-banking application are not invoked. If the emergency switch is in the off state, for data addition operations, data deletion operations, or data modification operations, it is necessary to determine the state of the dual-write switch to decide whether to invoke the services provided by the e-banking application or the services provided by both the centralized repository and the e-banking application; for data query operations, it is necessary to determine how to invoke the services provided by the centralized repository and the e-banking application based on the states of the dual-write switch and the query switch.
[0067] Among them, if the dual-write switch is in the on state, for data addition operations, data deletion operations, or data modification operations, the services provided by both the centralized repository and the e-banking application need to be invoked to maintain data consistency; for data query operations, it is necessary to determine how to operate based on the state of the query switch; if the dual-write switch is in the off state, for data addition operations, data deletion operations, or data modification operations, only the services provided by the e-banking application are invoked; for data query operations, only the services provided by the e-banking application are also invoked.
[0068] Among them, if the query switch is in the on state, the centralized repository is queried; if the query switch is in the off state, the services provided by the e-banking application are queried.
[0069] Specifically, the server queries the corresponding relationship between the operation type and the control switch according to the operation type of the data operation request; in this corresponding relationship, the control switches corresponding to the data query operation are the gray-to-normal switch, the emergency switch, the dual-write switch, and the query switch, and the control switches corresponding to the data change operation are the emergency switch and the dual-write switch; then, when the operation type is a data query operation, the gray-to-normal switch, the emergency switch, the dual-write switch, and the query switch are determined as the control switches corresponding to the data query operation; when the operation type is a data change operation, the emergency switch and the dual-write switch are determined as the control switches corresponding to the data change operation.
[0070] For example, when the operation type is a data deletion operation, the server determines the emergency switch and the dual-write switch as the control switches corresponding to the data change operation.
[0071] In this embodiment, by querying the corresponding relationship between the operation type and the control switch according to the operation type of the data operation request and determining the corresponding control switch, it is beneficial to subsequently migrate the data operation request from the instruction library to the corresponding centralized repository according to the state of the control switch in the configuration center, achieving the purpose of migrating the data operation request from the instruction library to the corresponding centralized repository according to the state of the control switch.
[0072] In one embodiment, when the operation type is a data query operation, step S103 above, according to the status of the control switch in the configuration center, migrates the data operation request from the instruction library to the corresponding centralized library, specifically including: when the gray-to-normal switch in the configuration center is in the off state, migrating the data operation request from the instruction library to the first centralized library; when the gray-to-normal switch in the configuration center is in the on state, according to the status of the emergency switch, the dual-write switch, and the query switch in the configuration center, migrating the data operation request from the instruction library to the corresponding centralized library.
[0073] Among them, the first centralized library refers to the original centralized library.
[0074] Specifically, when the operation type is a data query operation, the server queries the configuration center to obtain the status of the gray-to-normal switch; when the gray-to-normal switch is in the off state, it determines that the corresponding centralized library is the first centralized library, and migrates the data operation request from the instruction library to the first centralized library, and the first centralized library performs corresponding data query operations according to the data operation request. When the gray-to-normal switch is in the on state, the server queries the configuration center to obtain the status of the emergency switch, the dual-write switch, and the query switch, and determines the corresponding centralized library according to the status of the emergency switch, the dual-write switch, and the query switch, and migrates the data operation request from the instruction library to the corresponding centralized library, and the centralized library performs corresponding data query operations according to the data operation request.
[0075] In this embodiment, for data query operations, according to the status of different control switches, the data operation request can be migrated from the instruction library to the corresponding centralized library without publishing a change script or restarting the server, thus simplifying the instruction library migration process, saving time, and further improving the instruction library migration efficiency; at the same time, migrating the data operation request from the instruction library to the corresponding centralized library solves the pressure and risk of the single point of the instruction library.
[0076] In one embodiment, according to the status of the emergency switch, the dual-write switch, and the query switch in the configuration center, migrating the data operation request from the instruction library to the corresponding centralized library, specifically including: when the emergency switch in the configuration center is in the on state, or when the emergency switch in the configuration center is in the off state and both the dual-write switch and the query switch are in the on state, migrating the data operation request from the instruction library to the first centralized library; when both the emergency switch and the dual-write switch in the configuration center are in the off state, or when the emergency switch in the configuration center is in the off state, the dual-write switch is in the on state, and the query switch is in the off state, migrating the data operation request from the instruction library to the second centralized library.
[0077] Among them, the second centralized library refers to the centralized library abstracted from the services provided by the electronic banking application.
[0078] Specifically, the server queries the configuration center to obtain the statuses of the emergency switch, the dual-write switch, and the query switch. When the emergency switch is in the on state, it determines the corresponding centralized repository as the first centralized repository, migrates the data operation request from the instruction repository to the first centralized repository, and performs corresponding data query operations according to the data operation request through the first centralized repository. When the emergency switch is in the off state, the dual-write switch is in the on state, and the query switch is in the on state, it determines the corresponding centralized repository as the first centralized repository, migrates the data operation request from the instruction repository to the first centralized repository, and performs corresponding data query operations according to the data operation request through the first centralized repository. When the emergency switch is in the off state and the dual-write switch is in the off state, it determines the corresponding centralized repository as the second centralized repository, migrates the data operation request from the instruction repository to the second centralized repository, and performs corresponding data query operations according to the data operation request through the second centralized repository. When the emergency switch is in the off state, the dual-write switch is in the on state, and the query switch is in the off state, it determines the corresponding centralized repository as the second centralized repository, migrates the data operation request from the instruction repository to the second centralized repository, and performs corresponding data query operations according to the data operation request through the second centralized repository.
[0079] In this embodiment, according to the statuses of the emergency switch, the dual-write switch, and the query switch in the configuration center, the data operation request is migrated from the instruction repository to the corresponding centralized repository without publishing a change script or restarting the server, ensuring the stable operation of the business during the implementation of the instruction repository migration and reducing the impact on business processing during the instruction repository migration. At the same time, it overcomes the problem that setting a single dual-write switch can only ensure data consistency in the database under normal circumstances, cannot ensure that it does not affect normal customers in abnormal situations, and cannot flexibly switch queries in real time.
[0080] In one embodiment, when the operation type is a data change operation, according to the status of the control switch in the configuration center, migrating the data operation request from the instruction repository to the corresponding centralized repository specifically includes: when the emergency switch in the configuration center is in the on state, migrating the data operation request from the instruction repository to the first centralized repository; when the emergency switch in the configuration center is in the off state, according to the status of the dual-write switch in the configuration center, migrating the data operation request from the instruction repository to the corresponding centralized repository.
[0081] Specifically, when the operation type is a data change operation, the server queries the configuration center to obtain the status of the emergency switch. When the emergency switch is in the on state, the corresponding centralized repository is determined as the first centralized repository, and the data operation request is migrated from the instruction library to the first centralized repository. The first centralized repository performs corresponding data change operations according to the data operation request, such as data deletion operations, data addition operations, etc. When the emergency switch is in the off state, the server queries the configuration center to obtain the status of the dual-write switch. According to the status of the dual-write switch, the corresponding centralized repository is determined, and the data operation request is migrated from the instruction library to the corresponding centralized repository. The centralized repository performs corresponding data change operations according to the data operation request, such as data deletion operations, data addition operations, etc.
[0082] In this embodiment, for data change operations, according to the status of the emergency switch and the dual-write switch, the data operation request is migrated from the instruction library to the corresponding centralized repository, without the need to publish a change script or restart the server, thus simplifying the instruction library migration process, saving time, and improving the instruction library migration efficiency.
[0083] In one embodiment, according to the status of the dual-write switch in the configuration center, migrating the data operation request from the instruction library to the corresponding centralized repository specifically includes: when the dual-write switch in the configuration center is in the on state, migrating the data operation request from the instruction library to the first centralized repository and the second centralized repository; when the dual-write switch in the configuration center is in the off state, migrating the data operation request from the instruction library to the second centralized repository.
[0084] Specifically, for data change operations, when the emergency switch is in the off state, when the dual-write switch is in the on state, the corresponding centralized repositories are determined as the first centralized repository and the second centralized repository, and the data operation request is migrated from the instruction library to the first centralized repository and the second centralized repository. The first centralized repository and the second centralized repository perform corresponding data change operations according to the data operation request, such as data deletion operations, data addition operations, etc. When the dual-write switch is in the off state, the corresponding centralized repository is determined as the second centralized repository, and the data operation request is migrated from the instruction library to the second centralized repository. The second centralized repository performs corresponding data change operations according to the data operation request, such as data deletion operations, data addition operations, etc.
[0085] In this embodiment, for data change operations, when the emergency switch is in the off state, according to the status of the dual-write switch, the data operation request is migrated from the instruction library to the corresponding centralized repository, without the need to publish a change script or restart the server, ensuring the stability of the business during the implementation of the instruction library migration and reducing the impact on business processing during the instruction library migration process.
[0086] In one embodiment, as Figure 3As shown, another method for migrating the instruction library is provided. Taking the application of this method to a server as an example, it includes the following steps:
[0087] Step S301: In response to a data operation request for the instruction library, obtain the operation type of the data operation request.
[0088] Among them, step S301 has two branches, namely step S302 and step S306.
[0089] Step S302: When the operation type is a data query operation, determine the gray-to-positive switch, emergency switch, dual-write switch, and query switch as the control switches corresponding to the data query operation.
[0090] Among them, step S302 has three branches, namely step S303, step S304, and step S305.
[0091] Step S303: When the gray-to-positive switch in the configuration center is in the off state, migrate the data operation request from the instruction library to the first centralized library.
[0092] Step S304: When the gray-to-positive switch in the configuration center is in the on state and the emergency switch is in the on state, or when the gray-to-positive switch in the configuration center is in the on state, the emergency switch is in the off state, and both the dual-write switch and the query switch are in the on state, migrate the data operation request from the instruction library to the first centralized library.
[0093] Step S305: When the gray-to-positive switch in the configuration center is in the on state and both the emergency switch and the dual-write switch are in the off state, or when the gray-to-positive switch in the configuration center is in the on state, the emergency switch is in the off state, the dual-write switch is in the on state, and the query switch is in the off state, migrate the data operation request from the instruction library to the second centralized library.
[0094] Step S306: When the operation type is a data change operation, determine the emergency switch and the dual-write switch as the control switches corresponding to the data change operation.
[0095] Among them, step S306 has three branches, namely step S307, step S308, and step S309.
[0096] Step S307: When the emergency switch in the configuration center is in the on state, migrate the data operation request from the instruction library to the first centralized library.
[0097] Step S308: When the emergency switch in the configuration center is in the off state and the dual-write switch is in the on state, migrate the data operation request from the instruction library to the first centralized library and the second centralized library.
[0098] Step S309: When the emergency switch in the configuration center is in the off state and the dual-write switch is in the off state, migrate the data operation request from the instruction library to the second centralized library.
[0099] In the above instruction library migration method, by responding to the data operation request for the instruction library, obtain the operation type of the data operation request; then determine the corresponding control switch according to the operation type; finally, according to the status of the control switch in the configuration center, migrate the data operation request from the instruction library to the corresponding centralized library. In this way, only according to the status of the control switch in the configuration center, the data operation request can be migrated from the instruction library to the corresponding centralized library, without releasing a change script or restarting the server, thus simplifying the instruction library migration process, saving time, and improving the instruction library migration efficiency.
[0100] In one embodiment, to more clearly illustrate the instruction library migration method provided by the embodiments of the present application, the following uses a specific embodiment to specifically describe the instruction library migration method. In one embodiment, as Figure 4 shown, the present application also provides an instruction library migration method. By configuring four parameters in the real-time effective configuration center, namely the gray-to-positive switch A, the emergency switch B, the dual-write switch C, and the query switch D, these four parameters are in real-time effective and do not require restarting the server. By different combinations of the four switches, the impact on business processing during the instruction library migration process can be reduced. The specific content includes the following:
[0101] When going into production on the normal production date on the channel side, the switch settings are as follows: the gray-to-positive switch is 0 (not yet positive), the emergency switch is 0 (closed), the dual-write switch is 1 (dual-write open), and the query switch is 0 to query the electronic banking application service. After going into production and before gray-to-positive, if the gray-scale verification is problem-free, then when gray-to-positive, turn on the gray-to-positive switch, indicating successful positive conversion. When all customers query, the judgment logic of switches A, B, and C is followed, and a version is run in a trial. If there are no problems, then in the next version, turn off the dual-write switch and fully switch to the electronic banking application side. If after going into production and before gray-to-positive, the gray-scale verification has problems, if the query has problems, then switch the query switch to query the centralized library, and the gray-to-positive switch is not positively converted; if there are problems with the add, delete, and modify services of the electronic banking application, then the emergency switch needs to be turned on and fully switched to only operate the centralized library.
[0102] For example, referring to Figure 4 , for the query operation, determine whether to query the electronic banking service or the original process centralized library according to the status of the gray-to-positive switch A, the emergency switch B, the dual-write switch C, and the query switch D. For the add, delete, and modify operations, determine whether to operate the electronic banking service and the centralized library, or only operate the electronic banking service, or only operate the centralized library according to the status of the emergency switch B and the dual-write switch C.
[0103] The above instruction library migration method ensures the stability of business during the instruction library migration implementation process, and if there is a problem, the switch can be switched urgently, reducing the impact on business processing and normal customers during the migration process.
[0104] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages 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 to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0105] Based on the same inventive concept, embodiments of the present application also provide an instruction library migration device for implementing the instruction library migration method involved above. The implementation solution provided by this device is similar to the implementation solution described in the above method. Therefore, the specific limitations of one or more instruction library migration device embodiments provided below can be found in the above-mentioned limitations of the instruction library migration method and will not be repeated here.
[0106] In one embodiment, Figure 5 As shown, an instruction library migration device is provided, including: a type acquisition module 510, a switch determination module 520 and a request migration module 530, wherein:
[0107] The type acquisition module 510 is configured to acquire the operation type of the data operation request in response to the data operation request to the instruction library.
[0108] The switch determination module 520 is configured to determine a corresponding control switch according to the operation type.
[0109] The request migration module 530 is used to migrate data operation requests from the instruction library to the corresponding centralized library according to the status of the control switch in the configuration center.
[0110] In one embodiment, the switch determination module 520 is also used to determine the gray-out switch, emergency switch, double-write switch and query switch as control switches corresponding to the data query operation when the operation type is a data query operation; and to determine the emergency switch and double-write switch as control switches corresponding to the data change operation when the operation type is a data change operation.
[0111] In one embodiment, when the operation type is a data query operation, the request migration module 530 is further configured to migrate the data operation request from the instruction library to the first centralized library when the gray-to-normal switch in the configuration center is in the off state; when the gray-to-normal switch in the configuration center is in the on state, migrate the data operation request from the instruction library to the corresponding centralized library according to the states of the emergency switch, the dual-write switch, and the query switch in the configuration center.
[0112] In one embodiment, the request migration module 530 is further configured to migrate the data operation request from the instruction library to the first centralized library when the emergency switch in the configuration center is in the on state, or when the emergency switch in the configuration center is in the off state and both the dual-write switch and the query switch are in the on state; when both the emergency switch and the dual-write switch in the configuration center are in the off state, or when the emergency switch in the configuration center is in the off state, the dual-write switch is in the on state, and the query switch is in the off state, migrate the data operation request from the instruction library to the second centralized library.
[0113] In one embodiment, when the operation type is a data change operation, the request migration module 530 is further configured to migrate the data operation request from the instruction library to the first centralized library when the emergency switch in the configuration center is in the on state; when the emergency switch in the configuration center is in the off state, migrate the data operation request from the instruction library to the corresponding centralized library according to the state of the dual-write switch in the configuration center.
[0114] In one embodiment, the request migration module 530 is further configured to migrate the data operation request from the instruction library to the first centralized library and the second centralized library when the dual-write switch in the configuration center is in the on state; when the dual-write switch in the configuration center is in the off state, migrate the data operation request from the instruction library to the second centralized library. Each module in the above instruction library migration device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the computer device in hardware form or be independent of it, or be stored in the memory in the computer device in software form, so that the processor can call and execute the operations corresponding to the above respective modules.
[0115] In one embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 6As shown. The computer device includes a processor, a memory, and a network interface connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. 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 the status of control switches. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements an instruction library migration method.
[0116] Those skilled in the art can understand that Figure 6 the structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0117] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented:
[0118] In response to a data operation request for the instruction library, obtain the operation type of the data operation request;
[0119] According to the operation type, determine the corresponding control switch;
[0120] According to the status of the control switch in the configuration center, migrate the data operation request from the instruction library to the corresponding centralized library.
[0121] In one embodiment, when the processor executes the computer program, the following steps are also implemented: when the operation type is a data query operation, then determine the gray-to-positive switch, the emergency switch, the dual-write switch, and the query switch as the control switches corresponding to the data query operation; when the operation type is a data change operation, then determine the emergency switch and the dual-write switch as the control switches corresponding to the data change operation.
[0122] In one embodiment, when the processor executes the computer program, the following steps are also implemented: when the gray-to-positive switch in the configuration center is in the off state, migrate the data operation request from the instruction library to the first centralized library; when the gray-to-positive switch in the configuration center is in the on state, according to the status of the emergency switch, the dual-write switch, and the query switch in the configuration center, migrate the data operation request from the instruction library to the corresponding centralized library.
[0123] In one embodiment, when the processor executes the computer program, the following steps are further implemented: when the emergency switch in the configuration center is in the on state, or when the emergency switch in the configuration center is in the off state, and both the dual-write switch and the query switch are in the on state, migrate the data operation request from the instruction library to the first centralized library; when both the emergency switch and the dual-write switch in the configuration center are in the off state, or when the emergency switch in the configuration center is in the off state, the dual-write switch is in the on state, and the query switch is in the off state, migrate the data operation request from the instruction library to the second centralized library.
[0124] In one embodiment, when the processor executes the computer program, the following steps are further implemented: when the emergency switch in the configuration center is in the on state, migrate the data operation request from the instruction library to the first centralized library; when the emergency switch in the configuration center is in the off state, migrate the data operation request from the instruction library to the corresponding centralized library according to the state of the dual-write switch in the configuration center.
[0125] In one embodiment, when the processor executes the computer program, the following steps are further implemented: when the dual-write switch in the configuration center is in the on state, migrate the data operation request from the instruction library to the first centralized library and the second centralized library; when the dual-write switch in the configuration center is in the off state, migrate the data operation request from the instruction library to the second centralized library.
[0126] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0127] In response to a data operation request for the instruction library, obtain the operation type of the data operation request;
[0128] Determine the corresponding control switch according to the operation type;
[0129] Migrate the data operation request from the instruction library to the corresponding centralized library according to the state of the control switch in the configuration center.
[0130] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: when the operation type is a data query operation, determine the gray-to-normal switch, the emergency switch, the dual-write switch, and the query switch as the control switches corresponding to the data query operation; when the operation type is a data change operation, determine the emergency switch and the dual-write switch as the control switches corresponding to the data change operation.
[0131] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: when the gray-to-normal switch in the configuration center is in the off state, migrate the data operation request from the instruction library to the first centralized library; when the gray-to-normal switch in the configuration center is in the on state, migrate the data operation request from the instruction library to the corresponding centralized library according to the states of the emergency switch, the dual-write switch, and the query switch in the configuration center.
[0132] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: when the emergency switch in the configuration center is in the on state, or when the emergency switch in the configuration center is in the off state, and both the dual-write switch and the query switch are in the on state, migrate the data operation request from the instruction library to the first centralized library; when both the emergency switch and the dual-write switch in the configuration center are in the off state, or when the emergency switch in the configuration center is in the off state, the dual-write switch is in the on state, and the query switch is in the off state, migrate the data operation request from the instruction library to the second centralized library.
[0133] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: when the emergency switch in the configuration center is in the on state, migrate the data operation request from the instruction library to the first centralized library; when the emergency switch in the configuration center is in the off state, migrate the data operation request from the instruction library to the corresponding centralized library according to the state of the dual-write switch in the configuration center.
[0134] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: when the dual-write switch in the configuration center is in the on state, migrate the data operation request from the instruction library to the first centralized library and the second centralized library; when the dual-write switch in the configuration center is in the off state, migrate the data operation request from the instruction library to the second centralized library.
[0135] In one embodiment, a computer program product is provided, including a computer program, which when executed by a processor, implements the following steps:
[0136] In response to a data operation request for the instruction library, obtain the operation type of the data operation request;
[0137] Determine the corresponding control switch according to the operation type;
[0138] Migrate the data operation request from the instruction library to the corresponding centralized library according to the state of the control switch in the configuration center.
[0139] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: when the operation type is a data query operation, then determine the gray-to-positive switch, the emergency switch, the dual-write switch, and the query switch as the control switches corresponding to the data query operation; when the operation type is a data change operation, then determine the emergency switch and the dual-write switch as the control switches corresponding to the data change operation.
[0140] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: when the gray-to-normal switch in the configuration center is in the off state, migrate the data operation request from the instruction library to the first centralized library; when the gray-to-normal switch in the configuration center is in the on state, migrate the data operation request from the instruction library to the corresponding centralized library according to the states of the emergency switch, the dual-write switch, and the query switch in the configuration center.
[0141] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: when the emergency switch in the configuration center is in the on state, or when the emergency switch in the configuration center is in the off state and both the dual-write switch and the query switch are in the on state, migrate the data operation request from the instruction library to the first centralized library; when both the emergency switch and the dual-write switch in the configuration center are in the off state, or when the emergency switch in the configuration center is in the off state, the dual-write switch is in the on state, and the query switch is in the off state, migrate the data operation request from the instruction library to the second centralized library.
[0142] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: when the emergency switch in the configuration center is in the on state, migrate the data operation request from the instruction library to the first centralized library; when the emergency switch in the configuration center is in the off state, migrate the data operation request from the instruction library to the corresponding centralized library according to the state of the dual-write switch in the configuration center.
[0143] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: when the dual-write switch in the configuration center is in the on state, migrate the data operation request from the instruction library to the first centralized library and the second centralized library; when the dual-write switch in the configuration center is in the off state, migrate the data operation request from the instruction library to the second centralized library.
[0144] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties.
[0145] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.
[0146] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0147] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. An instruction library migration method, characterized in that, The method includes: In response to a data operation request for the instruction library, obtaining the operation type of the data operation request; Determining a corresponding control switch according to the operation type; According to the status of the control switch in the configuration center, migrating the data operation request from the instruction library to the corresponding centralized library; wherein, the instruction library is a single-point database for different nodes to access; the configuration center is a parameter configuration framework that takes effect in real time; the centralized library is a database that realizes the function of operating data according to the data operation request; Among them, the determining a corresponding control switch according to the operation type includes: When the operation type is a data query operation, the gray-to-positive switch, the emergency switch, the dual-write switch, and the query switch are determined as the control switches corresponding to the data query operation; When the operation type is a data change operation, the emergency switch and the dual-write switch are determined as the control switches corresponding to the data change operation.
2. The method according to claim 1, characterized in that, When the operation type is a data query operation, the migrating the data operation request from the instruction library to the corresponding centralized library according to the status of the control switch in the configuration center includes: When the gray-to-positive switch in the configuration center is in the off state, migrating the data operation request from the instruction library to the first centralized library; When the gray-to-positive switch in the configuration center is in the on state, migrating the data operation request from the instruction library to the corresponding centralized library according to the status of the emergency switch, the dual-write switch, and the query switch in the configuration center.
3. The method according to claim 2, wherein The migrating the data operation request from the instruction library to the corresponding centralized library according to the status of the emergency switch, the dual-write switch, and the query switch in the configuration center includes: When the emergency switch in the configuration center is in the on state, or when the emergency switch in the configuration center is in the off state, and both the dual-write switch and the query switch are in the on state, migrating the data operation request from the instruction library to the first centralized library; When both the emergency switch and the dual-write switch in the configuration center are in the off state, or when the emergency switch in the configuration center is in the off state, the dual-write switch is in the on state, and the query switch is in the off state, migrating the data operation request from the instruction library to the second centralized library.
4. The method according to claim 1, characterized in that, When the operation type is a data change operation, the migrating the data operation request from the instruction library to the corresponding centralized library according to the status of the control switch in the configuration center includes: When the emergency switch in the configuration center is in the on state, migrating the data operation request from the instruction library to the first centralized library; When the emergency switch in the configuration center is in the off state, migrating the data operation request from the instruction library to the corresponding centralized library according to the status of the dual-write switch in the configuration center.
5. The method according to claim 4, characterized in that, The migrating the data operation request from the instruction library to the corresponding centralized library according to the status of the dual-write switch in the configuration center includes: When the dual-write switch in the configuration center is in the on state, migrate the data operation request from the instruction library to the first centralized library and the second centralized library; When the dual-write switch in the configuration center is in the off state, migrate the data operation request from the instruction library to the second centralized library.
6. An instruction library migration device, characterized in that, The device includes: A type acquisition module, configured to acquire the operation type of the data operation request in response to a data operation request for the instruction library; A switch determination module, configured to determine a corresponding control switch according to the operation type; A request migration module, configured to migrate the data operation request from the instruction library to a corresponding centralized library according to the state of the control switch in the configuration center; wherein, the instruction library is a single-point database for different nodes to access; the configuration center is a parameter configuration framework that takes effect in real time; the centralized library is a database that implements the function of operating data according to the data operation request; The switch determination module is further configured to, when the operation type is a data query operation, determine the gray-to-positive switch, the emergency switch, the dual-write switch, and the query switch as the control switches corresponding to the data query operation; when the operation type is a data change operation, determine the emergency switch and the dual-write switch as the control switches corresponding to the data change operation.
7. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 5 are implemented.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Database migration method and device, electronic equipment and storage medium
CN110874354A
Data migration method and device, electronic equipment and computer storage medium
CN112860670A