Database switching method and system, computer equipment and medium

By intercepting the request data in the production environment and executing it in the simulation environment, the target task data is verified when the Oracle database is switched to MySQL, and the database is switched after ensuring that the first and second execution results are consistent, solving the verification when the Oracle database is switched to MySQL. Risk and stability issues, reducing the risk of database switching and improving the business stability of the production environment.

CN118567788APending Publication Date: 2024-08-30PINGAN YIQIANBAO E COMMERCE CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410729365.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

When the Oracle database is switched to MySQL, there are high risks in the verification process, resulting in low business stability in the production environment and the lack of effective downgrade solutions, resulting in emergency rollback of the system and incorrect business data processing.

Method used

Use the interceptor to intercept request data in the production environment, generate target task data, and execute it in the simulation environment to generate the first execution result and the preconfigured second execution result. When the two are consistent, switch the database to discover and transform potential problems in advance. problems and reduce risks.

Benefits of technology

It effectively reduces the risk of database switching and improves the business stability of the production environment. By verifying the feasibility of database switching in the simulation environment, the systemic risks caused by direct switching are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567788A
    Figure CN118567788A
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a database switching method and system, computer equipment and a medium, the method comprises the following steps: reading pre-stored target task data, the task data being generated by request data intercepted in an actual production environment corresponding to a current database; after the condition is met, a program interface corresponding to the target task data is called and executed in a simulation environment corresponding to the target database to be switched, and an execution result is generated; and switching the current database into the target database according to the execution result. As the program interface corresponding to the target task data generated based on the actual production environment is executed in the simulation environment corresponding to the target database to be switched in advance, the problem existing when the program interface runs in the simulation environment corresponding to the target database to be switched can be determined in advance; the systematic risk caused by direct database switching is avoided, so that the database switching risk is reduced, and the service stability of the production environment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a database switching method, system, computer equipment and medium. Background Art

[0002] Traditional commercial database software (Oracle) is mostly based on a centralized architecture. The database relies on large high-end equipment to provide high processing power and scalability. With the continuous development of business, the amount of data and business volume continues to grow, and the traditional centralized Oracle database architecture has become a bottleneck in terms of scalability. Based on this, it is particularly necessary to switch the Oracle database of the software system to MySQL.

[0003] In the prior art, when the Oracle database is switched to MySQL, many functional interfaces in the software system need to be pre-verified and verified on the production line to meet the application scenarios of MySQL. Since the functional interfaces involve complicated historical businesses, the risks in the verification process are relatively high. If the verification is performed directly in the production environment, if problems occur during the verification process and no downgrade plan is prepared, the system can only be rolled back urgently, and the wrong business data needs to be handled afterwards, which increases the risk of database switching and reduces the business stability of the production environment. Summary of the invention

[0004] Based on this, it is necessary to provide a database switching method, system, computer equipment and medium to address the problems of high database switching risk and low business stability in the production environment.

[0005] A database switching method, the method comprising: receiving a verification request, reading pre-stored target task data, the target task data being generated by intercepting request data in an actual production environment corresponding to a current database by an interceptor; when the target task data meets a preset program interface execution condition, calling and executing a program interface corresponding to the target task data in a simulation environment corresponding to a target database to be switched, generating a first execution result; obtaining a second execution result pre-configured for the target task data; and when the first execution result and the second execution result are consistent, switching the current database to the target database.

[0006] In one of the embodiments, before receiving the verification request, it also includes: when a business request is detected in the production environment, calling an interceptor pre-configured in the actual production environment; intercepting the request data corresponding to the business request through the interceptor; copying the request data, and synchronizing the copied request data to the memory through an asynchronous queue for persistent storage, to obtain the pre-stored target task data.

[0007] In one of the embodiments, the method also includes: parsing and extracting task description text and multiple task parameters present in the target task data; calculating the format qualification corresponding to the target task data based on the multiple task parameters; calculating the execution risk corresponding to the target task data based on a pre-built sensitive word library and the task description text; when the format qualification is greater than or equal to a preset qualification threshold and the execution risk is less than a preset execution risk, determining that the target task data meets the preset program interface execution conditions.

[0008] In one of the embodiments, the format qualification corresponding to the target task data is calculated based on multiple task parameters, including: querying the standard parameter corresponding to each task parameter in a preset standard parameter library based on the label of each task parameter; judging whether each task parameter is consistent with the corresponding standard parameter, and generating a judgment result; determining qualified task parameters based on the judgment result; and determining the ratio between the number of qualified task parameters and the number of multiple task parameters as the format qualification corresponding to the target task data.

[0009] In one of the embodiments, the execution risk corresponding to the target task data is calculated based on a pre-built sensitive word library and a task description text, including: segmenting the task description text to obtain a segmentation result; obtaining all sensitive words in the pre-built sensitive word library; using all the obtained sensitive words as nodes, and determining semantically similar nodes in each node, and establishing directed edges between semantically similar nodes to obtain a temporary directed node graph; traversing the target nodes consistent with the segmentation result in the temporary directed node graph; simulating the execution result of each target node in a production environment through a virtual machine; determining the risk level of each target node based on the execution result of each target node in the production environment; querying and accumulating the risk score corresponding to the risk level of each target node to obtain the execution risk corresponding to the target task data.

[0010] In one of the embodiments, obtaining a second execution result pre-configured for target task data includes: obtaining a mapping relationship between a task identifier and an execution result pre-generated in a production environment; parsing and obtaining a first task identifier of the target task data; traversing and querying a second task identifier that is identical to the first task identifier in the mapping relationship; and determining the execution result corresponding to the second task identifier as the second execution result pre-configured for the target task data.

[0011] In one of the embodiments, when the first execution result and the second execution result are consistent, the current database is switched to the target database, including: when the first execution result and the second execution result are inconsistent, obtaining a report template; establishing a mapping relationship between the first execution result and the second execution result; calling a data analysis service, and constructing a result analysis description text for each mapping relationship through the result analysis service; filling the mapping relationship and its result analysis description text into the report template to generate a verification report; and sending the verification report to the client for display.

[0012] A database switching system, the system includes: a task data reading module, used to receive a verification request and read pre-stored target task data, the target task data is generated by intercepting request data in an actual production environment corresponding to a current database by an interceptor; a first execution result generating module, used to call and execute a program interface corresponding to the target task data in a simulation environment corresponding to a target database to be switched when the target task data meets a preset program interface execution condition, and generate a first execution result; a second execution result obtaining module, used to obtain a second execution result pre-configured for the target task data; and a database switching module, used to switch the current database to the target database when the first execution result and the second execution result are consistent.

[0013] A computer device includes a memory and a processor. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor executes the steps of the above-mentioned database switching method.

[0014] A medium storing computer-readable instructions, when the computer-readable instructions are executed by one or more processors, enables the one or more processors to execute the steps of the above database switching method.

[0015] The above-mentioned database switching method, system, device and medium, the database switching system first receives a verification request and reads the pre-stored target task data, the target task data is generated by intercepting the request data in the actual production environment corresponding to the current database through the interceptor; then when the target task data meets the preset program interface execution conditions, the program interface corresponding to the target task data is called and executed in the simulation environment corresponding to the target database to be switched, and a first execution result is generated, and then the second execution result pre-configured for the target task data is obtained, and finally when the first execution result and the second execution result are consistent, the current database is switched to the target database. Since the present application executes the program interface corresponding to the target task data generated based on the actual production environment in the simulation environment corresponding to the target database to be switched in advance, it is possible to determine in advance the problems existing when the program interface is running in the simulation environment corresponding to the target database to be switched, and to modify the problems in a timely manner, thereby avoiding the systemic risks brought about by direct database switching, thereby reducing the risk of database switching and improving the business stability of the production environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0017] Figure 1 This is an implementation environment diagram of a database switching method provided in one embodiment of the present application;

[0018] Figure 2 This is a schematic diagram of the internal structure of a computer device in one embodiment of the present application;

[0019] Figure 3 A schematic diagram of a database switching method flow chart provided in one embodiment of the present application;

[0020] Figure 4 A schematic diagram of the data structure of task data provided in one embodiment of the present application;

[0021] Figure 5 A schematic diagram of data persistence storage provided in one embodiment of the present application;

[0022] Figure 6 A schematic block diagram of a database switching process provided in one embodiment of the present application;

[0023] Figure 7 A schematic diagram of another database switching method of the present application;

[0024] Figure 8 It is a system structure diagram of a database switching system provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0026] It can be understood that the terms "first", "second", etc. used in the present application can be used in this article to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from another element.

[0027] Figure 1 FIG. 1 is an implementation environment diagram of a database switching method provided in an embodiment, such as Figure 1 As shown, in this implementation environment, a server 110 and a client 120 are included.

[0028] The server 110 may be a server, which may be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, such as a server device that performs the database switching step. The server 110 receives a verification request and reads pre-stored target task data, which is generated by intercepting request data in an actual production environment corresponding to the current database by an interceptor; when the target task data meets the preset program interface execution conditions, the server 110 calls and executes the program interface corresponding to the target task data in the simulation environment corresponding to the target database to be switched, and generates a first execution result; the server 110 obtains a second execution result pre-configured for the target task data from the client 120; when the first execution result and the second execution result are consistent, the server 110 switches the current database to the target database.

[0029] It should be noted that the client 120 can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The server 110 and the client 120 can be connected via Bluetooth, USB (Universal Serial Bus) or other communication connection methods, and the present invention does not limit this.

[0030] Figure 2 FIG. 1 is a schematic diagram of the internal structure of a computer device in one embodiment. Figure 2As shown, the computer device includes a processor, a medium, a memory and a network interface connected via a system bus. Among them, the medium of the computer device stores an operating system, a database and computer-readable instructions, and the database may store a control information sequence. When the computer-readable instructions are executed by the processor, the processor can implement a database switching method. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor can execute a database switching method. The network interface of the computer device is used to connect and communicate with a terminal. Those skilled in the art can understand that Figure 2 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components. The medium is a readable storage medium.

[0031] The following will be combined with the attached Figure 3-7 , the database switching method provided in the embodiment of the present application is introduced in detail. The method can be implemented by a computer program and can be run on a database switching system based on the von Neumann system. The computer program can be integrated into an application or run as an independent tool application.

[0032] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0033] The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, large database switching technology, operation / interaction systems, mechatronics, etc. Artificial intelligence software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0034] See also Figure 3 , which is a flowchart of a database switching method provided in an embodiment of the present application.

[0035] like Figure 3 As shown, the method of the embodiment of the present application may include the following steps:

[0036] S101, receiving a verification request and reading pre-stored target task data, where the target task data is generated by intercepting request data in an actual production environment corresponding to the current database by an interceptor;

[0037] The verification request is sent by the developer through the client. The data structure of any pre-stored target task data is as follows: Figure 4 The pre-stored target task data may be read from a database in the memory.

[0038] In an embodiment of the present application, when generating pre-stored target task data, first, when a business request is detected in the production environment, the interceptor pre-configured in the actual production environment is called, and then the request data corresponding to the business request is intercepted by the interceptor, and finally the request data is copied, and the copied request data is synchronized to the memory through an asynchronous queue for persistent storage, thereby obtaining the pre-stored target task data. By intercepting the request data in the actual production environment by the interceptor to generate a large amount of task data for storage, historical request data that can represent the actual production environment can be obtained, and verification based on the historical request data can maximize the authenticity of the data, thereby improving the reliability of verification.

[0039] For example Figure 5 As shown in the figure, a traffic proxy, namely an interceptor, is introduced into the actual production environment corresponding to the current database. At this time, when the request traffic of the B / C end user calls the system platform through HTTP, the background intercepts the online request data through the customized interceptor, filters the intercepted requests, and then synchronizes the request data for persistent storage.

[0040] In a possible implementation, when receiving a verification request from a backend administrator, the server first reads pre-stored target task data from a memory, where the pre-stored target task data is any task data in the memory.

[0041] S102, when the target task data meets the preset program interface execution condition, calling and executing the program interface corresponding to the target task data in the simulation environment corresponding to the target database to be switched, and generating a first execution result;

[0042] In the embodiment of the present application, when judging whether the target task data meets the preset program interface execution conditions, the task description text and multiple task parameters in the target task data are first parsed and extracted, and then the format qualification corresponding to the target task data is calculated according to the multiple task parameters. Secondly, the execution risk corresponding to the target task data is calculated according to the pre-built sensitive word library and the task description text. Finally, when the format qualification is greater than or equal to the preset qualification threshold and the execution risk is less than the preset execution risk, it is determined that the target task data meets the preset program interface execution conditions. By calculating the format qualification and execution risk of the target task data, it can be quickly determined whether the target task data meets the requirements.

[0043] Specifically, when calculating the format qualification corresponding to the target task data based on multiple task parameters, first, the standard parameter corresponding to each task parameter is queried in the preset standard parameter library according to the label of each task parameter, and then it is determined whether each task parameter is consistent with the corresponding standard parameter to generate a judgment result. Secondly, qualified task parameters are determined based on the judgment result. Finally, the ratio between the number of qualified task parameters and the number of multiple task parameters is determined as the format qualification corresponding to the target task data.

[0044] Specifically, when calculating the execution risk corresponding to the target task data based on the pre-built sensitive word library and the task description text, firstly, the task description text is segmented to obtain the segmentation result, and then all the sensitive words in the pre-built sensitive word library are obtained, and then all the obtained sensitive words are used as nodes, and semantically similar nodes are determined in each node, and directed edges are established between semantically similar nodes to obtain a temporary directed node graph, and then the target nodes consistent with the segmentation result are traversed in the temporary directed node graph, and then the execution result of each target node in the production environment is simulated by a virtual machine, and finally the risk level of each target node is determined according to the execution result of each target node in the production environment, and the risk score corresponding to the risk level of each target node is queried and accumulated to obtain the execution risk corresponding to the target task data.

[0045] In a possible implementation, when the target task data meets the preset program interface execution conditions, the program interface corresponding to the target task data is called and executed in the simulation environment corresponding to the target database to be switched to generate a first execution result. Alternatively, if the requirements are not met, the verification can be directly suspended, and the target task data that does not meet the requirements can be pushed to the client for further modification by R&D engineers to improve processing efficiency.

[0046] S103, obtaining a second execution result pre-configured for the target task data;

[0047] The second execution result is a result obtained by executing the corresponding program interface of the target task data in the actual production environment.

[0048] In an embodiment of the present application, when obtaining a second execution result pre-configured for target task data, first obtain the mapping relationship between the task identifier and the execution result pre-generated in the production environment, then parse and obtain the first task identifier of the target task data, and then traverse and query the second task identifier that is the same as the first task identifier in the mapping relationship, and finally determine the execution result corresponding to the second task identifier as the second execution result pre-configured for the target task data.

[0049] S104: When the first execution result and the second execution result are consistent, the current database is switched to the target database.

[0050] In a possible implementation, when the first execution result and the second execution result are consistent, the current database is switched to the target database.

[0051] In another possible implementation, when the first execution result is inconsistent with the second execution result, the report template is first obtained, and then a mapping relationship between the first execution result and the second execution result is established. Next, the data analysis service is called, and a result analysis description text is constructed for each mapping relationship through the result analysis service. Finally, the mapping relationship and its result analysis description text are filled into the report template, a verification report is generated, and the verification report is sent to the client for display.

[0052] For example Figure 6 As shown, Figure 6 This is a process schematic diagram of a database switching process provided by the present application. First, the user sends a verification request on the background administrator page, and then the server reads each target task data in the memory, and then determines whether the format qualification of the target task data is greater than or equal to the preset qualification threshold. If not, the verification is terminated. If so, continue to determine whether the execution risk of the target task data is less than the preset execution risk. If not, the verification is terminated. If so, call and execute the program interface corresponding to the target task data in the simulation environment corresponding to the target database to be switched, generate a first execution result, and then obtain the second execution result pre-configured for the target task data, and then determine whether the first execution result and the second execution result are consistent. If so, switch the current database to the target database. If not, generate a verification report and send it to the client for display.

[0053] For example, when the current system is running business, data is still read and written to the Oracle database. At the same time, the traffic will be intercepted and persisted through the interceptor, and then the traffic will be replayed in the MySQL scenario to verify the business operation of the MySQL scenario. After sufficient verification, the production environment system will switch to MySQL, which can greatly reduce the risk of switching.

[0054] In an embodiment of the present application, the database switching system first receives a verification request and reads pre-stored target task data, where the target task data is generated by intercepting request data in the actual production environment corresponding to the current database by an interceptor; then when the target task data meets the preset program interface execution conditions, the program interface corresponding to the target task data is called and executed in the simulation environment corresponding to the target database to be switched, generating a first execution result, and then obtaining a second execution result pre-configured for the target task data, and finally when the first execution result and the second execution result are consistent, the current database is switched to the target database. Since the present application executes the program interface corresponding to the target task data generated based on the actual production environment in the simulation environment corresponding to the target database to be switched in advance, it is possible to determine in advance the problems existing when the program interface is running in the simulation environment corresponding to the target database to be switched, and to modify the problems in a timely manner, thereby avoiding the systemic risks brought about by direct database switching, thereby reducing the risk of database switching and improving the business stability of the production environment.

[0055] See also Figure 7 , which is a flowchart of a database switching method provided in an embodiment of the present application.

[0056] like Figure 7 As shown, the method of the embodiment of the present application may include the following steps:

[0057] S201, when a business request is detected in the production environment, calling an interceptor pre-configured in the actual production environment;

[0058] S202, intercepting request data corresponding to the business request through an interceptor;

[0059] S203, copying the request data, and synchronizing the copied request data to the memory through an asynchronous queue for persistent storage, to obtain pre-stored target task data;

[0060] S204, receiving a verification request, reading pre-stored target task data, where the target task data is generated by intercepting request data in an actual production environment corresponding to the current database by an interceptor;

[0061] S205, parsing and extracting the task description text and multiple task parameters in the target task data;

[0062] S206, calculating the format qualification corresponding to the target task data according to the multiple task parameters;

[0063] S207, calculating the execution risk corresponding to the target task data according to the pre-built sensitive word library and the task description text;

[0064] S208, when the format qualification is greater than or equal to the preset qualification threshold and the execution risk is less than the preset execution risk, determining that the target task data meets the preset program interface execution condition;

[0065] S209, obtaining a second execution result pre-configured for the target task data;

[0066] S210: When the first execution result and the second execution result are consistent, the current database is switched to the target database.

[0067] In an embodiment of the present application, the database switching system first receives a verification request and reads pre-stored target task data, where the target task data is generated by intercepting request data in the actual production environment corresponding to the current database through an interceptor; then when the target task data meets the preset program interface execution conditions, the program interface corresponding to the target task data is called and executed in the simulation environment corresponding to the target database to be switched, generating a first execution result, and then obtaining a second execution result pre-configured for the target task data, and finally when the first execution result and the second execution result are consistent, the current database is switched to the target database. Since the present application executes the program interface corresponding to the target task data generated based on the actual production environment in the simulation environment corresponding to the target database to be switched in advance, the traffic in the real environment can be replayed in the simulation environment, and the problems can be modified in time, avoiding the systemic risks brought about by direct database switching, thereby reducing the risk of database switching and improving the business stability of the production environment.

[0068] The following is a system embodiment of the present invention, which can be used to implement the method embodiment of the present invention. For details not disclosed in the system embodiment of the present invention, please refer to the method embodiment of the present invention.

[0069] See also Figure 8 , which shows a schematic diagram of the structure of a database switching system provided by an exemplary embodiment of the present invention. The database switching system can be implemented as all or part of a device through software, hardware, or a combination of both. The system 1 includes a task data reading module 10, a first execution result generating module 20, a second execution result obtaining module 30, and a database switching module 40.

[0070] The task data reading module 10 is used to receive the verification request and read the pre-stored target task data, where the target task data is generated by intercepting the request data in the actual production environment corresponding to the current database by the interceptor;

[0071] The first execution result generating module 20 is used to call and execute the program interface corresponding to the target task data in the simulation environment corresponding to the target database to be switched to generate a first execution result when the target task data meets the preset program interface execution condition;

[0072] A second execution result acquisition module 30, used to acquire a second execution result pre-configured for the target task data;

[0073] The database switching module 40 is used to switch the current database to the target database when the first execution result and the second execution result are consistent.

[0074] It should be noted that the database switching system provided in the above embodiment only uses the division of the above functional modules as an example when executing the database switching method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the database switching system provided in the above embodiment and the database switching method embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.

[0075] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0076] In an embodiment of the present application, the database switching system first receives a verification request and reads pre-stored target task data, where the target task data is generated by intercepting request data in the actual production environment corresponding to the current database through an interceptor; then when the target task data meets the preset program interface execution conditions, the program interface corresponding to the target task data is called and executed in the simulation environment corresponding to the target database to be switched, generating a first execution result, and then obtaining a second execution result pre-configured for the target task data, and finally when the first execution result and the second execution result are consistent, the current database is switched to the target database. Since the present application executes the program interface corresponding to the target task data generated based on the actual production environment in the simulation environment corresponding to the target database to be switched in advance, the traffic in the real environment can be replayed in the simulation environment, and the problems can be modified in time, avoiding the systemic risks brought about by direct database switching, thereby reducing the risk of database switching and improving the business stability of the production environment.

[0077] In one embodiment, a computer device is provided, the device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0078] Receive a verification request and read pre-stored target task data, where the target task data is generated by intercepting request data in an actual production environment corresponding to the current database by an interceptor;

[0079] When the target task data meets the preset program interface execution condition, calling and executing the program interface corresponding to the target task data in the simulation environment corresponding to the target database to be switched, and generating a first execution result;

[0080] Obtaining a second execution result preconfigured for the target task data;

[0081] When the first execution result and the second execution result are consistent, the current database is switched to the target database.

[0082] In one embodiment, before the processor receives the verification request, it further performs the following operations:

[0083] When a business request is detected in the production environment, an interceptor pre-configured in the actual production environment is called;

[0084] Intercepting request data corresponding to the business request by the interceptor;

[0085] The request data is copied, and the copied request data is synchronized to the memory through an asynchronous queue for persistent storage, so as to obtain the pre-stored target task data.

[0086] In one embodiment, the processor further performs the following operations:

[0087] Parsing and extracting the task description text and multiple task parameters present in the target task data;

[0088] Calculating the format qualification corresponding to the target task data according to the multiple task parameters;

[0089] Calculate the execution risk corresponding to the target task data according to the pre-built sensitive word library and the task description text;

[0090] When the format qualification is greater than or equal to a preset qualification threshold and the execution risk is less than a preset execution risk, it is determined that the target task data meets the preset program interface execution conditions.

[0091] In one embodiment, when the processor calculates the format qualification corresponding to the target task data according to the multiple task parameters, the following operations are specifically performed:

[0092] According to the label of each task parameter, query the standard parameter corresponding to each task parameter in the preset standard parameter library;

[0093] Determine whether each task parameter is consistent with the corresponding standard parameter and generate a determination result;

[0094] Determine qualified task parameters according to the judgment result;

[0095] A ratio between the number of the qualified task parameters and the number of the plurality of task parameters is determined as a format qualification corresponding to the target task data.

[0096] In one embodiment, when the processor calculates the execution risk corresponding to the target task data according to the pre-built sensitive word library and the task description text, the processor specifically performs the following operations:

[0097] Performing word segmentation on the task description text to obtain a word segmentation result;

[0098] Get all sensitive words in the pre-built sensitive word library;

[0099] All the acquired sensitive words are used as nodes, and semantically similar nodes are determined among the nodes, and directed edges are established between the semantically similar nodes to obtain a temporary directed node graph;

[0100] Traversing the target node consistent with the word segmentation result in the temporary directed node graph;

[0101] Simulating the execution result of each target node in the production environment through a virtual machine;

[0102] Determine the risk level of each target node according to the execution result of each target node in the production environment;

[0103] The risk score corresponding to the risk level of each target node is queried and accumulated to obtain the execution risk degree corresponding to the target task data.

[0104] In one embodiment, when the processor executes to obtain the second execution result preconfigured for the target task data, the following operations are specifically performed:

[0105] Acquire a mapping relationship between a task identifier and an execution result pre-generated in the production environment;

[0106] Parsing and obtaining a first task identifier of the target task data;

[0107] Traverse and search the mapping relationship for a second task identifier that is identical to the first task identifier;

[0108] The execution result corresponding to the second task identifier is determined as a second execution result preconfigured for the target task data.

[0109] In one embodiment, when the first execution result and the second execution result are consistent, the processor switches the current database to the target database by specifically performing the following operations:

[0110] When the first execution result is inconsistent with the second execution result, obtaining a report template;

[0111] Establishing a mapping relationship between the first execution result and the second execution result;

[0112] Calling a data analysis service, and constructing a result analysis description text for each mapping relationship through the result analysis service;

[0113] Fill the mapping relationship and the result analysis description text into the report template to generate a verification report;

[0114] The verification report is sent to the client for display.

[0115] In an embodiment of the present application, the database switching system first receives a verification request and reads pre-stored target task data, wherein the target task data is generated by intercepting request data in the actual production environment corresponding to the current database by an interceptor; then, when the target task data meets the preset program interface execution conditions, the program interface corresponding to the target task data is called and executed in the simulation environment corresponding to the target database to be switched, and a first execution result is generated. Then, a second execution result pre-configured for the target task data is obtained, and finally, when the first execution result and the second execution result are consistent, the current database is switched to the target database. Since the present application executes the program interface corresponding to the target task data generated based on the actual production environment in the simulation environment corresponding to the target database to be switched in advance, the traffic in the real environment can be replayed in the simulation environment, and the problems can be modified in time, thereby avoiding the systemic risks brought about by direct database switching, thereby reducing the risk of database switching and improving the business stability of the production environment.

[0116] In one embodiment, a medium storing computer-readable instructions is provided. When the computer-readable instructions are executed by one or more processors, the one or more processors perform the following steps:

[0117] Receive a verification request and read pre-stored target task data, where the target task data is generated by intercepting request data in an actual production environment corresponding to the current database by an interceptor;

[0118] When the target task data meets the preset program interface execution condition, calling and executing the program interface corresponding to the target task data in the simulation environment corresponding to the target database to be switched, and generating a first execution result;

[0119] Obtaining a second execution result preconfigured for the target task data;

[0120] When the first execution result and the second execution result are consistent, the current database is switched to the target database.

[0121] In one embodiment, before the processor receives the verification request, it further performs the following operations:

[0122] When a business request is detected in the production environment, an interceptor pre-configured in the actual production environment is called;

[0123] Intercepting request data corresponding to the business request by the interceptor;

[0124] The request data is copied, and the copied request data is synchronized to the memory through an asynchronous queue for persistent storage, so as to obtain the pre-stored target task data.

[0125] In one embodiment, the processor further performs the following operations:

[0126] Parsing and extracting the task description text and multiple task parameters present in the target task data;

[0127] Calculating the format qualification corresponding to the target task data according to the multiple task parameters;

[0128] Calculate the execution risk corresponding to the target task data according to the pre-built sensitive word library and the task description text;

[0129] When the format qualification is greater than or equal to a preset qualification threshold and the execution risk is less than a preset execution risk, it is determined that the target task data meets the preset program interface execution conditions.

[0130] In one embodiment, when the processor calculates the format qualification corresponding to the target task data according to the multiple task parameters, the following operations are specifically performed:

[0131] According to the label of each task parameter, query the standard parameter corresponding to each task parameter in the preset standard parameter library;

[0132] Determine whether each task parameter is consistent with the corresponding standard parameter and generate a determination result;

[0133] Determine qualified task parameters according to the judgment result;

[0134] A ratio between the number of the qualified task parameters and the number of the plurality of task parameters is determined as a format qualification corresponding to the target task data.

[0135] In one embodiment, when the processor calculates the execution risk corresponding to the target task data according to the pre-built sensitive word library and the task description text, the processor specifically performs the following operations:

[0136] Performing word segmentation on the task description text to obtain a word segmentation result;

[0137] Get all sensitive words in the pre-built sensitive word library;

[0138] All the acquired sensitive words are used as nodes, and semantically similar nodes are determined among the nodes, and directed edges are established between the semantically similar nodes to obtain a temporary directed node graph;

[0139] Traversing the target node consistent with the word segmentation result in the temporary directed node graph;

[0140] Simulating the execution result of each target node in the production environment through a virtual machine;

[0141] Determine the risk level of each target node according to the execution result of each target node in the production environment;

[0142] The risk score corresponding to the risk level of each target node is queried and accumulated to obtain the execution risk degree corresponding to the target task data.

[0143] In one embodiment, when the processor executes to obtain the second execution result preconfigured for the target task data, the following operations are specifically performed:

[0144] Acquire a mapping relationship between a task identifier and an execution result pre-generated in the production environment;

[0145] Parsing and obtaining a first task identifier of the target task data;

[0146] Traverse and search the mapping relationship for a second task identifier that is identical to the first task identifier;

[0147] The execution result corresponding to the second task identifier is determined as a second execution result preconfigured for the target task data.

[0148] In one embodiment, when the first execution result and the second execution result are consistent, the processor switches the current database to the target database by specifically performing the following operations:

[0149] When the first execution result is inconsistent with the second execution result, obtaining a report template;

[0150] Establishing a mapping relationship between the first execution result and the second execution result;

[0151] Calling a data analysis service, and constructing a result analysis description text for each mapping relationship through the result analysis service;

[0152] Fill the mapping relationship and the result analysis description text into the report template to generate a verification report;

[0153] The verification report is sent to the client for display.

[0154] In an embodiment of the present application, the database switching system first receives a verification request and reads pre-stored target task data, wherein the target task data is generated by intercepting request data in the actual production environment corresponding to the current database by an interceptor; then, when the target task data meets the preset program interface execution conditions, the program interface corresponding to the target task data is called and executed in the simulation environment corresponding to the target database to be switched, and a first execution result is generated. Then, a second execution result pre-configured for the target task data is obtained, and finally, when the first execution result and the second execution result are consistent, the current database is switched to the target database. Since the present application executes the program interface corresponding to the target task data generated based on the actual production environment in the simulation environment corresponding to the target database to be switched in advance, the traffic in the real environment can be replayed in the simulation environment, and the problems can be modified in time, thereby avoiding the systemic risks brought about by direct database switching, thereby reducing the risk of database switching and improving the business stability of the production environment.

[0155] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The above-mentioned medium can be a non-volatile medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0156] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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, they should be considered to be within the scope of this specification.

[0157] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the attached claims.

Claims

1. A database switching method, It is characterized in that The method comprises: Receive a verification request and read pre-stored target task data, where the target task data is generated by intercepting request data in an actual production environment corresponding to the current database by an interceptor; When the target task data meets the preset program interface execution condition, calling and executing the program interface corresponding to the target task data in the simulation environment corresponding to the target database to be switched, and generating a first execution result; Obtaining a second execution result preconfigured for the target task data; When the first execution result and the second execution result are consistent, the current database is switched to the target database.

2. The method according to claim 1, It is characterized in that Before receiving the verification request, the method further includes: When a business request is detected in the production environment, an interceptor pre-configured in the actual production environment is called; Intercepting request data corresponding to the business request by the interceptor; The request data is copied, and the copied request data is synchronized to the memory through an asynchronous queue for persistent storage, so as to obtain the pre-stored target task data.

3. The method according to claim 1, It is characterized in that The method further comprises: Parsing and extracting the task description text and multiple task parameters present in the target task data; Calculating the format qualification corresponding to the target task data according to the multiple task parameters; Calculate the execution risk corresponding to the target task data according to the pre-built sensitive word library and the task description text; When the format qualification is greater than or equal to a preset qualification threshold and the execution risk is less than a preset execution risk, it is determined that the target task data meets the preset program interface execution conditions.

4. The method according to claim 3, It is characterized in that The calculating the format qualification corresponding to the target task data according to the multiple task parameters includes: According to the label of each task parameter, query the standard parameter corresponding to each task parameter in the preset standard parameter library; Determine whether each task parameter is consistent with the corresponding standard parameter and generate a determination result; Determine qualified task parameters according to the judgment result; A ratio between the number of the qualified task parameters and the number of the plurality of task parameters is determined as a format qualification corresponding to the target task data.

5. The method according to claim 3, It is characterized in that The step of calculating the execution risk corresponding to the target task data according to the pre-built sensitive word library and the task description text includes: Performing word segmentation on the task description text to obtain a word segmentation result; Get all sensitive words in the pre-built sensitive word library; All the acquired sensitive words are used as nodes, and semantically similar nodes are determined among the nodes, and directed edges are established between the semantically similar nodes to obtain a temporary directed node graph; Traversing the target node consistent with the word segmentation result in the temporary directed node graph; Simulating the execution result of each target node in the production environment through a virtual machine; Determine the risk level of each target node according to the execution result of each target node in the production environment; The risk score corresponding to the risk level of each target node is queried and accumulated to obtain the execution risk degree corresponding to the target task data.

6. The method according to claim 1, It is characterized in that The obtaining of a second execution result preconfigured for the target task data includes: Acquire a mapping relationship between a task identifier and an execution result pre-generated in the production environment; Parsing and obtaining a first task identifier of the target task data; Traverse and search the mapping relationship for a second task identifier that is identical to the first task identifier; The execution result corresponding to the second task identifier is determined as a second execution result preconfigured for the target task data.

7. The method according to claim 1, It is characterized in that When the first execution result and the second execution result are consistent, switching the current database to the target database includes: When the first execution result is inconsistent with the second execution result, obtaining a report template; Establishing a mapping relationship between the first execution result and the second execution result; Calling a data analysis service, and constructing a result analysis description text for each mapping relationship through the result analysis service; Fill the mapping relationship and the result analysis description text into the report template to generate a verification report; The verification report is sent to the client for display.

8. A database switching system, It is characterized in that The system comprises: A task data reading module is used to receive a verification request and read pre-stored target task data, wherein the target task data is generated by intercepting request data in an actual production environment corresponding to the current database by an interceptor; A first execution result generating module is used to call and execute the program interface corresponding to the target task data in the simulation environment corresponding to the target database to be switched to generate a first execution result when the target task data meets the preset program interface execution condition; A second execution result acquisition module, used to acquire a second execution result pre-configured for the target task data; A database switching module is used to switch the current database to the target database when the first execution result and the second execution result are consistent.

9. A computer device, It is characterized in that The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the database switching method according to any one of claims 1 to 7.

10. A medium storing computer-readable instructions, It is characterized in that When the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the database switching step according to any one of claims 1 to 7.

Citation Information

Cited By

  • Asynchronous call control method and related device

    CN119883526A

  • An asynchronous invocation control method and related apparatus

    CN119883526B