System switching method and device
By applying adapters and filtering services using filtering rules to process external request flows, efficient testing and smooth switching of the new system are achieved, solving the problems of complex handovers and high testing costs between the old and new systems, and ensuring the authenticity of test data and the security of system switching.
Patent Information
- Application Number
- CN202210302100.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-03-24
AI Technical Summary
The existing system could not meet the needs after business logic adjustments and technological upgrades. The handover between the new system and the original system was complex and time-consuming, resulting in high testing and maintenance costs. In addition, the new system had the risk of code defects, making it difficult to conduct effective testing without affecting the production environment.
Adopt adapter applications and filtering services to filter and process external request flows through filtering rules, generate test request flows and asynchronously distribute them to the new system for testing. At the same time, after the new system is officially launched, smooth switching is achieved through the adapter to avoid system coupling and resource waste.
Without affecting the production environment, the authenticity and credibility of test data can be improved, the handover cycle between the old and new systems can be shortened, the testing and maintenance costs can be reduced, and the security and reliability of system switching can be ensured.
Smart Images

Figure CN114546883B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communication technology, and in particular to a system switching method and device. Background Art
[0002] After a period of use, due to technological advancements and adjustments to business logic, the original system may no longer meet current requirements or the cost of upgrading may be prohibitive. Therefore, a completely new system is needed to redefine the business logic and introduce new technologies to ensure the system can meet current and future requirements.
[0003] After the new system went live, it needed to integrate with the upstream systems. However, the integration process was cumbersome, complex, and time-consuming, ultimately leading to a low willingness on the part of the upstream systems to change and delaying the transition between the new and old systems. Furthermore, the long coexistence period between the new and old systems meant that when new requirements were developed, developers and testers had to spend twice as much time maintaining two applications simultaneously, consuming excessive machine resources. Summary of the Invention
[0004] In view of this, the present application provides a system switching method and apparatus for testing and switching a system.
[0005] Specifically, this application is implemented through the following technical solutions:
[0006] According to a first aspect of the present application, a testing method is proposed, comprising:
[0007] Obtain external request flows from external applications and forward them to the original system;
[0008] Filtering and processing the external request flow according to the filtering rules to generate a test request flow;
[0009] The test request flow is distributed to the system to be tested, and operation status information corresponding to the test request flow processed by the system to be tested is obtained.
[0010] According to a second aspect of the present application, a system switching method is proposed, the method comprising:
[0011] Obtain external request flows from external applications and forward them to the original system;
[0012] Filtering the external requests according to the filtering rules to obtain a filtered external request flow that meets the filtering rules;
[0013] The filtered external request flow is switched to the new system for processing.
[0014] According to a third aspect of the present application, a testing device is provided, comprising:
[0015] A first acquisition unit is configured to acquire an external request flow from an external application and forward it to the original system;
[0016] a processing unit configured to filter and process the external request flow according to the filtering rule to generate a test request flow;
[0017] The testing unit is configured to distribute the test request flow to the system to be tested, and obtain the operation status information corresponding to the test request flow processed by the system to be tested.
[0018] According to a fourth aspect of the present application, a system switching device is provided, comprising:
[0019] A second acquisition unit is configured to acquire an external request flow from an external application and forward it to the original system;
[0020] a screening unit configured to screen the external request according to the filtering rule to obtain a filtered external request flow that meets the filtering rule;
[0021] The switching unit is configured to switch the filtered external request flow to the new system for processing.
[0022] According to a fifth aspect of the present application, an electronic device is provided, including:
[0023] processor;
[0024] a memory for storing processor-executable instructions;
[0025] The processor implements the methods described in the embodiments of the first and second aspects above by running the executable instructions.
[0026] According to a sixth aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in the embodiments of the first and second aspects above are implemented.
[0027] It can be seen from the technical solution provided by the above application that when the new application is tested before it is officially launched, the application generates processed and filtered test data that flows into the new system without affecting the data flowing into the original system. However, the processing results returned by the new system will not be returned to the external application, but will be used to test the operation of the new system. The application tests the new system in the above manner, which can ensure that the data for testing is derived from the real data flowing into the original system, and simulates the authenticity of the test data to a great extent, thereby ensuring the credibility of the test results. It avoids the situation where the test data and the online data are different, resulting in the inability to simulate the real production environment, and even affecting the test results. In addition, the filtering service included in the application sets filtering conditions. By setting the filtering conditions, the generated test data can be flexibly adjusted, thereby improving the variability of the testing process. For testers, different test goals can also be achieved by simply modifying the filtering conditions without manually reconstructing or filtering the test data, thereby ensuring the test effect while improving the test efficiency.
[0028] In addition, when the new application needs to be handovered with the original system after it is launched, the present application can connect the external application to the adapter with the original interface by adopting the adapter solution. At the same time, the filtering service in the adapter can control the external data to be cut into the new system in part by filtering rules, thereby completing the smooth switching between the new and old systems. The technical solution of the present application shortens the cycle required for the new application to be launched and the old application to be offline, and can complete the smooth switching between the new and old systems without the external application being aware of it. If the external application changes the interface, then only the adapter application needs to be removed. When new requirements are developed, developers and testers do not need to spend twice as much time maintaining two sets of applications at the same time, streamlining the handover process between the new and old systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0030] Figure 1 is a flow chart of a testing method according to an exemplary embodiment of the present application;
[0031] Figure 2 This is a schematic diagram of a network architecture of an adapter application shown in an exemplary embodiment of the present application;
[0032] Figure 3 is a flow chart showing a system switching method according to an exemplary embodiment of the present application;
[0033] Figure 4 is a schematic diagram of an electronic device according to an exemplary embodiment of the present application;
[0034] Figure 5 is a block diagram of a testing device according to an exemplary embodiment of the present application;
[0035] Figure 6 It is a block diagram of a system switching device according to an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0036] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0037] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0038] It should be understood that although the terms first, second, third, etc. may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0039] During software development, after a system is launched, it often requires refactoring for the following reasons: First, the constant evolution of a company's business model and strategy, as well as technological innovation, constantly places new demands on the existing system. To meet these demands, developers are required to continuously modify and release existing systems. As business data accumulates, the amount of data the existing system must handle increases. Furthermore, due to the churn of technical developers and the lack of relevant documentation, refactoring existing systems is extremely risky. Modifications can only be made through patches, which can lead to increasing bloat and consuming data resources.
[0040] In related technologies, the mainstream approach is to use a grayscale release method. Based on the characteristics or weight of the data, a very small amount of data will flow into the new system, and most of the data will still flow into the original system for operation. However, the new system may have code defects, resulting in errors in the calculation or execution of data. If this data is important (such as transaction amount, account balance), etc., even if only a small amount of diversion is performed, it will cause serious production accidents, and the data will need to be cut back and repaired. In addition, this release method of only flowing in a very small amount of data may also result in the inability to fully cover all functions of the application due to insufficient sample number. There are still risks after a large amount of data is cut in. At the same time, grayscale release cannot estimate the hardware resource configuration requirements and quantity requirements of the new system, and it is easy to over-configure or under-configure.
[0041] In view of this, the present application provides a testing method for testing a new system before it goes online, and restoring the real production environment as much as possible during the test.
[0042] Next, the embodiments of the present application are described in detail.
[0043] Figure 1 FIG. 1 is a flow chart of a testing method according to an exemplary embodiment of the present application. Figure 1 As shown, in one case, the above method can be applied to an adapter application, that is, the adapter application can be used as an independently packaged application to implement the method.
[0044] Figure 2 FIG. 1 is a system architecture diagram of an adapter application according to an exemplary embodiment of the present application. Figure 2 As shown, the adapter application includes a filtering service that defines filtering rules. The adapter application can transfer data requests from external applications from the original system to itself, forward these external requests to the original system for processing, and then return the processing results of the original system to the external application.
[0045] The above method may include the following steps:
[0046] Step 102: Obtain the external request flow from the external application and forward it to the original system.
[0047] In one embodiment, the external application can be a downstream application of the original system, such as a customer-facing application. For example, when a user places an order on the order app, the external application sends the corresponding external request to the adapter application. The adapter application then acts as a bridge to forward the external request to the original system. In a production environment, external requests typically exist in the form of a request stream. This application refers to the continuous external requests from external applications in a production environment as an external request stream.
[0048] When processing external request flows, adapter applications can utilize request queues to ensure efficient processing within the original application. For example, for ordering or purchasing food, tens of thousands of order requests may be sent to the original system for processing. Simply following the standard request processing and response methods without any processing can result in long wait times for customers, unresponsiveness, and uncertainty about whether their orders were successful. Alternatively, the order quantity may exceed the available number of items, leading to over-ordering. For the adapter application, this can also lead to excessive load, lags, and even crashes. The unique first-in-first-out (FIFO) structure of the request queue ensures the order of requests within the external request flow, allowing the original system to process each request sequentially and avoid lags. Furthermore, the request queue capacity can be set to reflect indicators such as the number of items. When orders exceed the request queue capacity, a sold-out notification is quickly displayed, improving the user experience.
[0049] Step 104: Filter and process the external request flow according to the filtering rules to generate a test request flow.
[0050] In one embodiment, the initial version of a new system (i.e., the system to be tested) may have more or less defects and need to be tested and modified in the production environment. If current limiting is not performed, the software and hardware resources and other facilities of the system to be tested are too few and cannot withstand data requests. In addition, most current cloud service providers charge by time, and too many software and hardware resources of the system to be tested are deployed, which will waste corresponding resources. For the above considerations, a filtering service is set up in the adapter application of this application. The filtering service can first control a small part of the external request flow through the filtering rules, generate a corresponding test request flow for testing, and then control the other external request flows through by adjusting the filtering rules to test the other parts of the external request flow. In addition, in addition to controlling the number of test request flows through the filtering rules, the source, form, etc. of the test request flow can also be controlled through the filtering rules. For example, if it is only necessary to test the response of the system to be tested to the request of a certain external application A, the external requests from the external application A can be filtered out through the filtering rules, and then the corresponding test request flow can be generated based on this part of the external request flow. If you only want to test the response of the system to be tested to the "order request", then you can use the filtering rules to filter out external requests of type "order request", and then generate the corresponding test request stream based on this part of the external requests. It can be seen that the present application can control the different scenarios targeted by the test by simply adjusting the filtering rules, thereby improving the flexibility of the test process and the efficiency of the test. For example, Redis (data storage service) is used as a filtering service for example: the adapter application can store the external request stream in Redis, and use the key key as the filtering rule by configuring it. If you need to modify the filtering rules, you can directly modify the value of the key key in Redis, which directly affects the adapter application's screening of the external request stream.
[0051] In one case, the external request stream is screened and processed according to the filtering rules, including: screening the external request stream according to the filtering rules to obtain an external request stream that meets the filtering rules; copying the external request stream that meets the filtering rules and processing it according to the input parameter requirements of the system to be tested to generate the test request stream. In this case, the adapter application first screens the external request stream according to the filtering rules, copies the obtained external request stream that meets the rules, and then modifies the external request stream according to the input parameter requirements of the system to be tested to generate a test request stream. This method only requires format conversion of the data of the external request stream that needs to be tested, which reduces the computing pressure of the system.
[0052] In another scenario, the adapter application copies all requests in the external request stream and processes them according to the input requirements of the system under test, generating a test request stream corresponding to the entire external request stream. The adapter then filters the test request stream to the required parts based on the filtering rules. This approach eliminates the need to generate a new test request stream when testing other parts later, simply re-filtering the test request stream, improving testing efficiency.
[0053] It is worth noting that since the scenario in which the above method is applied is to test a new system, the new system has not yet been launched. Therefore, during the test process, the original system is still running. After forwarding the external request flow to the original system for processing, the processing results of the original system will be obtained and returned to the external application. The testing process will not affect the normal operation of the business. In other words, although the test request flow generated in this application is derived from the external request flow, it is independent of the original external request flow and does not interfere with each other.
[0054] In one embodiment, because the external service capabilities of the original system, that is, the overall response time and the impact of failures, cannot be hindered before the system to be tested is officially launched, synchronous processing cannot be used for the system to be tested, which will cause coupling between systems. The use of asynchronous processing can eliminate the overall time occupied by the request response time of the application to be tested and the impact of the failure of the application to be tested on the current system. At the same time, asynchronous data processing cannot wait for the result of the application to be tested to be returned, and the application to be tested that has not been officially launched cannot directly return the result to the external application, so waiting is worthless. In order to avoid the occurrence of the system coupling and other situations as described above, this application feeds back the original processing results to the external application after the original system finishes processing the external request flow, and further distributes the test request flow to the system to be tested to test the system to be tested.
[0055] Step 106: Distribute the test request flow to the system to be tested, and obtain the operation status information corresponding to the test request flow processed by the system to be tested.
[0056] It is worth noting that obtaining the operational status information corresponding to the test request stream processed by the system under test in this step can be understood as obtaining a generated test result, where the test result is used to indicate the processing status of the test request stream by the system under test; alternatively, the operational status information can be understood as any information expressing the impact of the test request stream on the system under test, and this application does not limit this. The following description uses the generation of test results as an example.
[0057] In one embodiment, the adapter application can obtain the original processing result generated by the original system processing the external request flow; and obtain the test processing result obtained by the system to be tested processing the test request flow; if the corresponding original processing result is the same as the test processing result, it means that the system to be tested processes the test request flow correctly, and the test result can be generated based on the processing of the test request flow by the system to be tested.
[0058] In another case, if the corresponding original processing result is different from the test processing result, it means that there is a problem in the processing process of the system to be tested. In order to prevent the subsequent request flow from encountering the same error again and causing the system to crash, the filtering rules defined by the filtering service can be adjusted to stop generating new test request flows and generate an alarm message to remind the relevant technical personnel to correct the relevant errors. For example, assuming that the test processing result output by the test request flow corresponding to external application A is different from the result of the original system processing the external request flow of external application A, the filtering rules can be set so that external application A no longer generates new test request flows. The relevant personnel can correct the relevant errors and then reopen this part of the test.
[0059] In one embodiment, the test results generated based on the processing of the test request flow by the system to be tested can also be used to represent the stress test results of the application to be tested. After the processing result comparison (business verification) mentioned in the above embodiment is passed, the flow of the test request flow can be gradually increased by modifying the filtering rules defined by the filtering service, while observing the stress test results of the application to be tested, and then continuously increasing the pressure and adding machines until the filtering rules are completely cancelled and continued observation for a period of time to confirm that there are no problems. The system to be tested is then capable of completely replacing the original system, and the test is completed.
[0060] It can be seen from the technical solution provided by the above application that when the new application is tested before it is officially launched, the application generates processed and filtered test data that flows into the new system without affecting the data flowing into the original system. However, the processing results returned by the new system will not be returned to the external application, but will be used to test the operation of the new system. The application tests the new system in the above manner, which can ensure that the data for testing is derived from the real data flowing into the original system, and simulates the authenticity of the test data to a great extent, thereby ensuring the credibility of the test results. It avoids the situation where the test data and the online data are different, resulting in the inability to simulate the real production environment, and even affecting the test results. In addition, the filtering service included in the application sets filtering conditions. By setting the filtering conditions, the generated test data can be flexibly adjusted, thereby improving the variability of the testing process. For testers, different test goals can also be achieved by simply modifying the filtering conditions without manually reconstructing or filtering the test data, thereby ensuring the test effect while improving the test efficiency.
[0061] After an application system has been in use for a while, minor requirements can be met through patch release iterations. However, due to the continuous improvement or change of the various related application technologies or components that the application system relies on, as well as major adjustments to the business logic, the original system can no longer meet the existing requirements. Therefore, a completely new system needs to be developed to support business needs. However, the handover of the old and new systems is often a very long process. The tedious steps of the transition may lead to a lack of willingness to change upstream applications. Moreover, the new system is often incomplete. Even after testing, adjustments to business processing logic, differences between test data and actual data, and deviations between the performance parameters of the tested machines and the production performance parameters are often significant. While small systems can be maintained through downtime, the cost of downtime for high-traffic distributed systems is prohibitive.
[0062] In view of this, the present application provides a system switching method, which aims to achieve the alternating transition between the old and new systems without stopping maintenance and making the upstream system unaware, and can fall back to the original system when an error occurs.
[0063] Figure 3 FIG. 1 is a flow chart showing a system switching method according to an exemplary embodiment of the present application. Figure 3 As shown, the method is applied to an adapter application, which includes a filtering service with filtering rules defined. The adapter application can transfer data requests from external applications from the original system to itself, forward these external requests to the original system for processing, and then return the processing results of the original system to the external application.
[0064] The above method may include the following steps:
[0065] Step 302: Obtain an external request flow from an external application and forward it to the original system.
[0066] In one embodiment, the external application can be a downstream application of the original system, such as a customer-facing application. For example, when a user places an order on the order app, the external application sends the corresponding external request to the adapter application. The adapter application then acts as a bridge to forward the external request to the original system. In a production environment, external requests typically exist in the form of a request stream. This application refers to the continuous external requests from external applications in a production environment as an external request stream.
[0067] When processing external request flows, adapter applications can utilize request queues to ensure efficient processing within the original application. For example, for ordering or purchasing food, tens of thousands of order requests may be sent to the original system for processing. Simply following the standard request processing and response methods without any processing can result in long wait times for customers, unresponsiveness, and uncertainty about whether their orders were successful. Alternatively, the order quantity may exceed the available number of items, leading to over-ordering. For the adapter application, this can also lead to excessive load, lags, and even crashes. The unique first-in-first-out (FIFO) structure of the request queue ensures the order of requests within the external request flow, allowing the original system to process each request sequentially and avoid lags. Furthermore, the request queue capacity can be set to reflect indicators such as the number of items. When orders exceed the request queue capacity, a sold-out notification is quickly displayed, improving the user experience.
[0068] Step 304: Filter the external request flow according to the filtering rule to obtain a filtered external request flow that meets the filtering rule.
[0069] In one embodiment, by adopting an adapter application, the downstream application (external application) can be connected to the adapter application with the original interface. The filtering service in the adapter application filters the external request flow according to the filtering rules and separates the filtered external request flow that meets the filtering rules.
[0070] Step 306: Switch the filtered external request flow to the new system for processing.
[0071] In one embodiment, the adapter application may control the filtered external request flow to enter the new system, and the new system processes the external request flow.
[0072] Specifically, the adapter application can process the filtered external request stream so that it meets the input requirements of the new system. That is, the adapter application internally transforms the filtered external request stream into corresponding request data that meets the interface requirements of the new system. Furthermore, by changing the filtering rules, partial data can be introduced into the new system, achieving a smooth transition between the old and new systems.
[0073] In one embodiment, when switching between the old and new systems, the adapter application can first obtain the processing results of the external request stream by the original system. If the processing results are normal, indicating that the data in the external request stream does not have serious defects, the external request stream can then be imported into the new system based on filtering rules. Using this approach, the data security of the external request stream can be initially verified by the original system. If no issues are found, the external request stream can then be gradually switched to the new system based on filtering rules, ensuring the security of the system switching process.
[0074] In one embodiment, if the new system encounters a defect, the external data flow can be switched back to the original system by modifying the filtering rules, ensuring a smooth rollback when the system encounters a problem. Similarly, if the new system is fully launched, or if the upstream application changes its interface to allow direct connection to the new system, all external request flows can be switched to the new system to complete the complete transition between the new and old systems.
[0075] As can be seen from the above embodiments, when the present application needs to be handed over to the original system after the new application is launched, by adopting the adapter solution, the external application can be docked to the adapter with the original interface, and at the same time, the filtering service in the adapter can control the external data to be cut into the new system in part by filtering rules, thereby completing the smooth switching of the new and old systems. The technical solution of the present application shortens the cycle required for the new application to be launched and the old application to be offline, and can complete the smooth switching of the new and old systems without the external application being aware of it. If the external application changes the interface, it only needs to remove the adapter application. When new requirements are developed, developers and testers do not need to spend twice as much time maintaining two sets of applications at the same time, which simplifies the handover process between the new and old systems. In addition, even if there is a problem with the new system, it can also be quickly rolled back through the adapter application, ensuring the security of the system switching process.
[0076] Corresponding to the above method embodiment, this specification also provides an embodiment of a device.
[0077] Figure 4 FIG1 is a schematic diagram showing the structure of an electronic device according to an exemplary embodiment of the present application. Figure 4At the hardware level, the electronic device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410, and may also include hardware required for other services. The processor 402 reads the corresponding computer program from the non-volatile memory 410 into the memory 408 and then runs it, forming a test device or a system switching device at the logical level. Of course, in addition to software implementation, this application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0078] Figure 5 FIG. 1 is a block diagram of a testing device according to an exemplary embodiment of the present application. Figure 5 , the apparatus may include a first acquiring unit 502, a processing unit 504, and a testing unit 506, wherein:
[0079] A first acquiring unit 502 is configured to acquire an external request flow from an external application and forward it to the original system;
[0080] The processing unit 504 is configured to filter and process the external request flow according to the filtering rule to generate a test request flow;
[0081] The testing unit 506 is configured to distribute the test request flow to the system to be tested, and obtain the operation status information corresponding to the test request flow processed by the system to be tested.
[0082] Optionally, the processing unit 504 is specifically configured to:
[0083] Filtering the external request flow according to the filtering rule to obtain the external request flow that meets the filtering rule;
[0084] The external request flow that meets the filtering rules is copied and processed according to the input parameter requirements of the system to be tested to generate the test request flow.
[0085] Optionally, the testing unit 506 is specifically configured to:
[0086] Obtaining an original processing result generated by the original system processing the external request flow;
[0087] Obtaining a test processing result obtained by the system to be tested processing the test request flow;
[0088] If the corresponding original processing result is the same as the test processing result, then the operation status information corresponding to the test request flow processed by the system to be tested is obtained.
[0089] Optionally, if the corresponding original processing result is different from the test processing result, the filtering rule defined by the filtering service is adjusted to stop generating new test requests and generate an alarm message.
[0090] Optionally, the testing unit 506 is specifically configured to:
[0091] After the original system finishes processing the external request flow, the original processing result is fed back to the external application, and then the test request flow is distributed to the system to be tested.
[0092] Figure 6 FIG. 1 is a block diagram of a system switching device according to an exemplary embodiment of the present application. Figure 6 The apparatus may include a second acquiring unit 602, a screening unit 604, and a switching unit 606, wherein:
[0093] The second acquisition unit 602 is configured to acquire an external request flow from an external application and forward it to the original system;
[0094] A screening unit 604 is configured to screen the external request according to the filtering rule to obtain a filtered external request flow that meets the filtering rule;
[0095] The switching unit 606 is configured to switch the filtered external request flow to the new system for processing.
[0096] Optionally, the apparatus further includes: a parameter processing unit 608 configured to process the filtered external request flow so that the filtered external request flow meets the input parameter requirements of the new system.
[0097] Optionally, the apparatus further includes: a monitoring unit 610 configured to obtain a processing result of the original system on the external request flow;
[0098] If there is no abnormality in the processing result, the external request is filtered according to the filtering rule.
[0099] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0100] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0101] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is further provided, such as a memory including instructions. The instructions may be executed by a processor of a testing device to implement any of the methods described in the above embodiments. For example, the method may include:
[0102] Obtain external request flows from external applications and forward them to the original system;
[0103] Filtering and processing the external request flow according to the filtering rules to generate a test request flow;
[0104] The test request stream is distributed to the system to be tested, and a test result is generated according to how the system to be tested processes the test request stream.
[0105] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is further provided, such as a memory including instructions. The instructions may be executed by a processor of a system switching device to implement any of the methods described in the above embodiments. For example, the method may include:
[0106] Obtain external request flows from external applications and forward them to the original system;
[0107] Filtering the external requests according to the filtering rules to obtain a filtered external request flow that meets the filtering rules;
[0108] The filtered external request flow is switched to the new system for processing.
[0109] The non-temporary computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc., and this application does not limit this.
[0110] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A system switching method, characterized in that: Applied to adapter applications, the method includes: The adapter application obtains the external request flow from the external application and forwards it to the original system. The external application that generates the external request flow is connected to the adapter application through the original interface. The adapter application obtains the processing result of the original system on the external request flow; If the processing result does not show any abnormality, the adapter application filters the external request flow according to the filtering rules to obtain a filtered external request flow that satisfies the filtering rules, and switches the filtered external request flow to the new system for processing, thereby switching the external request flow from the original system to the new system in parts by changing the filtering rules; When the new system is fully launched or the interface of the external application is changed to a new interface for docking with the new system, all external request flows are switched to the new system, the switch between the original system and the new system is completed, and the adapter application is removed; The method further includes: if the new system has defects, adjusting the filtering rules so that the adapter application switches the external request flow that meets the filtering rules back to the original system for processing.
2. The method according to claim 1, characterized in that The method further comprises: The filtered external request flow is processed so that the filtered external request flow meets the input parameter requirements of the new system.
3. The method according to claim 1, characterized in that The external request flow from the external application and forwarded to the original system is also used by the adapter application to test the system to be tested. The testing process includes: Filtering and processing the external request flow according to the filtering rules to generate a test request flow; The test request flow is distributed to the system to be tested, and operation status information corresponding to the processing of the test request flow by the system to be tested is obtained.
4. The method according to claim 3, characterized in that Filter and process the external request flow according to the filtering rules, including: Filtering the external request flow according to the filtering rule to obtain the external request flow that meets the filtering rule; The external request flow that meets the filtering rules is copied and processed according to the input parameter requirements of the system to be tested to generate the test request flow.
5. The method according to claim 3, characterized in that The obtaining of the operating status information corresponding to the test request flow processed by the system to be tested includes: Obtaining an original processing result generated by the original system processing the external request flow; Obtaining a test processing result obtained by the system to be tested processing the test request flow; If the corresponding original processing result is the same as the test processing result, then the operation status information corresponding to the test request flow processed by the system to be tested is obtained.
6. The method according to claim 5, characterized in that If the corresponding original processing result is different from the test processing result, the filtering rules defined by the filtering service are adjusted to stop generating a new test request flow and / or generate an alarm message.
7. The method according to claim 5 or 6, characterized in that The distributing the test request stream to the system to be tested includes: After the original system finishes processing the external request flow, the original processing result is fed back to the requester corresponding to the external request flow, and then the test request flow is distributed to the system to be tested.
8. The method according to claim 3, characterized in that Also includes: If the impact of the test request flow on the system to be tested is within a preset range, the filtered external request flow is switched from the original system to the system to be tested for processing.
9. A system switching device, characterized in that: Applicable to adapter applications, the device comprises: A second acquisition unit is configured to acquire an external request flow from an external application and forward it to the original system; A monitoring unit configured to obtain a processing result of the original system on the external request flow; The monitoring unit is further configured to filter the external request flow according to a filtering rule if the processing result does not show any abnormality; a screening unit configured to screen the external request flow according to a screening rule to obtain a screened external request flow that satisfies the screening rule; a switching unit configured to switch the filtered external request flow to a new system for processing; The screening unit is further configured to switch the external request flow from the original system to the new system in parts by changing the filtering rules; The switching unit is further configured to adjust the filtering rules to switch the external request flow that meets the filtering rules back to the original system for processing if a defect occurs in the new system; The external application used to generate the external request flow is connected to the adapter application using the original interface. When the new system is fully launched or the interface of the external application is changed to a new interface for connecting to the new system, the external request flow is completely switched to the new system, the switch between the original system and the new system is completed, and the adapter application is removed. The system switching device is further configured to adjust the filtering rules if a defect occurs in the new system, so as to switch the external request flow that meets the filtering rules back to the original system for processing.
10. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 8 by running the executable instructions.
11. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Traffic processing method, gateway, traffic comparison system and device
CN113381913A