Business system reconstruction method and device, electronic equipment and readable medium
By building a traffic replication verification environment and a grayscale publishing method, we solve the problems of low efficiency and poor reliability of business system reconstruction in the existing technology, achieve efficient and stable business system reconstruction and traffic migration, and improve the robustness of the system. and user experience.
Patent Information
- Application Number
- CN202410832279.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-10-29
AI Technical Summary
Existing business system reconstruction solutions have problems such as high labor costs, low traffic migration efficiency, incomplete verification of complex scenarios, and error-prone manual verification, resulting in defects such as poor robustness and reliability of the reconstructed business system, and the need for shutdown and announcements.
By building a traffic copy verification environment, copy the traffic in the production environment of the business system before reconstruction to the system after reconstruction, and perform production verification in this environment. Use the grayscale publishing method to switch the write logic in proportion and set The traffic copy switch performs data verification to ensure data consistency and system stability.
It improves the efficiency of business system reconstruction, improves the robustness, reliability and stability of the reconstructed system, avoids downtime operations, and ensures the smoothness of traffic migration and user experience.
Smart Images

Figure CN118869481A_ABST
Abstract
Description
Background Art
[0002] At present, with the rapid development of business platforms, the old logic of business systems needs to be reconstructed to meet the ever-changing business needs. When migrating traffic to the reconstructed logic, in order to ensure a smooth transition of the business, it is generally necessary to manually extract production environment data to verify whether the system functions before and after the reconstruction are consistent.
[0003] In the related technologies, the existing business system reconstruction solutions have problems such as high labor costs, inefficient traffic migration, incomplete verification of complex scenarios, and easy errors in manual verification, which in turn lead to defects such as poor robustness and reliability of the reconstructed business system and the need to shut down for announcements.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present disclosure is to provide a business system reconstruction method, device, electronic device and readable medium, which are used to overcome the problems such as poor robustness of the reconstructed business system caused by the limitations and defects of related technologies to at least a certain extent.
[0006] According to the first aspect of an embodiment of the present disclosure, a business system reconstruction method is provided, comprising: constructing a traffic replication verification environment, and deploying a reconstructed business system in the traffic replication verification environment; replicating the traffic in the production environment of the business system before reconstruction to the business system after reconstruction; performing production verification on the traffic replicated to the business system after reconstruction; and deploying the reconstructed business system that has passed the production verification in the production environment.
[0007] In an exemplary embodiment of the present disclosure, it further includes:
[0008] After the reconstructed business system is deployed in the production environment, the traffic of the first write logic is switched to the traffic of the second write logic in proportion through grayscale release. The first write logic is the write logic of the business system before reconstruction, and the second write logic is the write logic of the business system after reconstruction.
[0009] In an exemplary embodiment of the present disclosure, after the reconstructed business system is deployed in the production environment, switching the flow of the first write logic to the flow of the second write logic in proportion by grayscale release includes:
[0010] After deploying the reconstructed business system in the production environment, obtaining a user identifier of traffic in the production environment based on the phased release method;
[0011] Performing ratio calculation on the user identification, and determining the ratio according to the result of the ratio calculation;
[0012] The flow rate of the first write logic is switched to the flow rate of the second write logic according to the ratio.
[0013] In an exemplary embodiment of the present disclosure, performing ratio calculation on the user identification, and determining the ratio according to the result of the ratio calculation includes:
[0014] Determine the absolute hash value corresponding to the user identifier according to a preset algorithm;
[0015] A ratio calculation is performed on the hash absolute value, and the ratio is determined according to a result of the ratio calculation.
[0016] In an exemplary embodiment of the present disclosure, building a traffic replication verification environment and deploying a reconstructed business system in the traffic replication verification environment includes:
[0017] Constructing the traffic replication verification environment, and setting a traffic replication switch in a database associated with the business system, wherein the traffic replication switch is used to control the process of replicating the traffic in the database to the business system;
[0018] The reconstructed business system is deployed in the traffic replication verification environment.
[0019] In an exemplary embodiment of the present disclosure, the business system is connected to a first database and a second database, the first database is used to monitor messages for applying for services, and the second database is used to monitor messages for applying for service traffic replication, and replicating the traffic in the production environment of the business system before reconstruction to the business system after reconstruction includes:
[0020] When it is determined that the first database detects the message for applying for the service, writing the traffic to the first database according to the first writing logic;
[0021] When it is determined that the second database detects the message of applying for service traffic replication, the traffic is written into the second database according to the second writing logic.
[0022] In an exemplary embodiment of the present disclosure, performing production verification on the traffic copied to the reconstructed business system includes:
[0023] In response to a request to reconstruct the business system, construct a reconstruction task table, wherein parameters of the reconstruction task table include at least one of a task state, task data, a creation time, and a modification time;
[0024] Updating the reconstruction task table according to the parameters of the traffic during the replication process;
[0025] Scan the task status in the reconstruction task table according to a preset period;
[0026] performing a check process on a designated field of the flow of the first database and a designated field of the flow of the second database according to the task status;
[0027] If it is determined that the verification process fails, the inconsistent fields are written into the difference table, and the traffic replication switch is turned off;
[0028] If it is determined that the verification process has passed, the traffic replication switch is kept turned on.
[0029] According to a second aspect of an embodiment of the present disclosure, there is provided a business system reconstruction device, including:
[0030] A construction module, configured to construct a traffic replication verification environment and deploy a reconstructed business system in the traffic replication verification environment;
[0031] A replication module, configured to replicate the traffic in the production environment of the business system before the reconstruction to the business system after the reconstruction;
[0032] A verification module, configured to perform production verification on the traffic copied to the reconstructed business system;
[0033] A deployment module is configured to deploy the reconstructed business system that has passed the production verification in the production environment.
[0034] According to a third aspect of the present disclosure, there is provided an electronic device, comprising: a memory; and a processor coupled to the memory, wherein the processor is configured to execute any one of the methods described above based on instructions stored in the memory.
[0035] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a program is stored, and when the program is executed by a processor, the business system reconstruction method as described in any one of the above items is implemented.
[0036] The disclosed embodiments construct a traffic replication verification environment, and deploy a reconstructed business system in the traffic replication verification environment, replicate the traffic in the production environment of the business system before reconstruction to the business system after reconstruction, perform production verification on the traffic replicated to the business system after reconstruction, and deploy the reconstructed business system that has passed the production verification in the production environment, thereby improving the efficiency of business system reconstruction and enhancing the robustness, reliability and stability of the business system reconstruction solution.
[0037] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0039] Figure 1 A schematic diagram showing an exemplary system architecture to which the business system reconstruction solution of an embodiment of the present invention can be applied;
[0040] Figure 2 is a flow chart of a business system reconstruction method in an exemplary embodiment of the present disclosure;
[0041] Figure 3 is a flow chart of another business system reconstruction method in an exemplary embodiment of the present disclosure;
[0042] Figure 4 is a flow chart of another business system reconstruction method in an exemplary embodiment of the present disclosure;
[0043] Figure 5 is a flow chart of another business system reconstruction method in an exemplary embodiment of the present disclosure;
[0044] Figure 6 is a flow chart of another business system reconstruction method in an exemplary embodiment of the present disclosure;
[0045] Figure 7 is a flow chart of another business system reconstruction method in an exemplary embodiment of the present disclosure;
[0046] Figure 8 is a flow chart of another business system reconstruction method in an exemplary embodiment of the present disclosure;
[0047] Fig. 9is a schematic diagram of the architecture of a business system reconstruction solution in an exemplary embodiment of the present disclosure;
[0048] Fig.10 is a flow chart of a business system reconstruction solution in an exemplary embodiment of the present disclosure;
[0049] Fig.11 is a block diagram of a business system reconstruction device in an exemplary embodiment of the present disclosure;
[0050] Fig.12 is a block diagram of an electronic device in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0051] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0052] In addition, the accompanying drawings are only schematic diagrams of the present disclosure, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities, which do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0053] The technical terms involved in the embodiments of the present disclosure are described in detail below.
[0054] Base64: One of the most common encoding methods used to transmit 8-bit bytecode on the Internet. Base64 is an algorithm based on 64 printable characters to represent binary data.
[0055] Hbase: A highly reliable, high-performance, column-oriented, scalable distributed storage system.
[0056] Redis: The full name is REmote DIctionary Server. It is a key-value storage system written by Salvatore Sanfilippo. It is a cross-platform non-relational database. Redis is an open source key-value storage database written in ANSI C language, compliant with the BSD protocol, supporting the network, memory-based, distributed, and optionally persistent, and provides APIs in multiple languages. Redis is often called a data structure server because values can be types such as strings, hashes, lists, sets, and sorted sets.
[0057] MySQL: An open source relational database management system (RDBMS). The MySQL database system uses the most commonly used database management language, Structured Query Language (SQL), for database management. Since MySQL is open source, anyone can download it under the General Public License and modify it according to their own needs. MySQL has attracted much attention for its speed, reliability, and adaptability.
[0058] Figure 1 A schematic diagram showing an exemplary system architecture to which the business system reconstruction solution according to an embodiment of the present invention can be applied.
[0059] like Figure 1 As shown, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0060] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.
[0061] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Terminal devices 101, 102, 103 can be various electronic devices with display screens, including but not limited to smart phones, tablet computers, portable computers, desktop computers, etc.
[0062] In some embodiments, the business system reconstruction method provided in the embodiments of the present invention is generally executed by the server 105, and accordingly, the business system reconstruction device is generally set in the terminal device 103 (or the terminal device 101 or 102). In other embodiments, some terminals may have functions similar to those of the server device to execute the method.
[0063] The exemplary embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0064] Figure 2 is a flow chart of a business system reconstruction method in an exemplary embodiment of the present disclosure.
[0065] refer to Figure 2 , the business system reconstruction method may include:
[0066] Step S202: construct a traffic replication verification environment, and deploy the reconstructed business system in the traffic replication verification environment.
[0067] In an exemplary embodiment of the present disclosure, the traffic replication verification environment is an operating environment specially built or simulated to verify the correctness, reliability, stability, compatibility and other characteristics of the replicated traffic, which specifically includes hardware configuration, operating system, database, middleware, etc., but is not limited to these, in order to test the operation of the replicated traffic under various predetermined conditions.
[0068] In an exemplary embodiment of the present disclosure, a business system generally includes a plurality of components, interfaces, data and execution codes of operation data and / or interaction data, but is not limited thereto. In addition, types of business systems include enterprise resource planning (ERP) systems, customer relationship management (CRM) systems, supply chain management (SCM) systems, financial management systems and human resource management systems, but are not limited thereto.
[0069] In an exemplary embodiment of the present disclosure, a traffic replication verification environment is constructed to simulate multiple real production scenarios, and a reconstructed business system is deployed in the traffic replication verification environment to facilitate verification of the reconstructed business system in the subsequent traffic replication verification environment.
[0070] Step S204, copying the traffic in the production environment of the business system before reconstruction to the business system after reconstruction.
[0071] In an exemplary embodiment of the present disclosure, the production environment refers to an environment used to actually run and process real business in software development or business system deployment. In the production environment, the business system directly provides services to clients or other network nodes and processes real business data and traffic.
[0072] In an exemplary embodiment of the present disclosure, the production environment of the business system generally includes the following production components:
[0073] (1) Servers and hardware facilities: such as physical servers, virtual machines, storage devices, and network devices (routers, switches, etc.), but not limited to these.
[0074] (2) Operating system: such as, but not limited to, Windows Server, Linux distribution, etc.
[0075] (3) Database management system: such as MySQL, Oracle, SQL Server, etc., but not limited to these.
[0076] (4) Application server: such as Tomcat, JBoss, WebLogic, etc., but not limited to these.
[0077] (5) Middleware: message queues (RabbitMQ, Kafka, etc.), cache services (Redis, etc.), but not limited to these.
[0078] (6) Application software: specific business applications, such as e-commerce platforms, enterprise resource planning (ERP) systems, etc., but not limited to these.
[0079] (7) Monitoring system: used to monitor server performance, application health, network traffic, etc., such as Nagios, Zabbix, etc., but not limited to these.
[0080] (8) Backup and recovery system: to ensure the security and recoverability of data, but not limited to this.
[0081] (9) Load balancer: used to distribute network traffic and improve system availability and performance, but not limited to this.
[0082] (10) Security protection components: firewalls, intrusion detection / prevention systems (IDS / IPS), antivirus software, etc., but not limited to these.
[0083] (11) Domain Name System (DNS): Responsible for resolving domain names to IP addresses, but not limited to this.
[0084] (12) Automated deployment and configuration management tools: such as Ansible, Puppet, etc., but not limited to these.
[0085] The above production components work together to support the stable operation of the production environment to meet the operation requirements of the business system. The specific component composition can be flexibly combined, set or updated according to the scale, business requirements and technical architecture of the production environment.
[0086] In an exemplary embodiment of the present disclosure, before performing traffic replication, a service request sent by a user is received, and then the business system is reconstructed based on the service request. The legitimacy of the user information is verified for the service request, and the verification content includes the frequency, number of service requests, and user status, but is not limited to this, so as to improve the security and reliability of the reconstruction plan of the business system.
[0087] Step S206: Perform production verification on the traffic copied to the reconstructed business system.
[0088] In an exemplary embodiment of the present disclosure, for example, multiple business scenarios supported by traffic replication include proof of non-consumption, proof of settlement, proof of settlement with a credit report, etc., but are not limited thereto.
[0089] Step S208: deploying the reconstructed business system that has passed the production verification in the production environment.
[0090] The disclosed embodiments construct a traffic replication verification environment, and deploy a reconstructed business system in the traffic replication verification environment, replicate the traffic in the production environment of the business system before reconstruction to the business system after reconstruction, perform production verification on the traffic replicated to the business system after reconstruction, and deploy the reconstructed business system that has passed the production verification in the production environment, thereby improving the efficiency of business system reconstruction and enhancing the robustness, reliability and stability of the business system reconstruction solution.
[0091] Next, each step of the business system reconstruction method is described in detail.
[0092] In an exemplary embodiment of the present disclosure, Figure 3 As shown, the business system reconstruction method also includes:
[0093] Step S302: After the reconstructed business system is deployed in the production environment, the traffic of the first write logic is switched to the traffic of the second write logic in proportion through grayscale release. The first write logic is the write logic of the business system before reconstruction, and the second write logic is the write logic of the business system after reconstruction.
[0094] In an exemplary embodiment of the present disclosure, write logic refers to a collection of rules, processes and operating steps used to regulate and control the storage or update of data from external sources to the system in a business system, specifically including data source and format requirements, data validation rules, application of business rules, storage location and method, transaction processing rules and error handling mechanisms, etc., but not limited to these.
[0095] In an exemplary embodiment of the present disclosure, the application of business rules includes calculating field values, data conversion, and associating data, etc., to meet specific requirements of the business, but is not limited thereto.
[0096] In an exemplary embodiment of the present disclosure, the ratio of switching the traffic of the first write logic to the traffic of the second write logic is determined by grayscale release, and the grayscale release is achieved by embedding a diversion switch in the code. If an abnormality occurs during the traffic switching process, the traffic switching is stopped by closing the diversion switch, that is, the first write logic is still used to process the traffic to provide data services to the client.
[0097] Among them, grayscale release can be used for A / B testing, that is, some users continue to use product feature A, and some users start to use product feature B. If users have no objections or abnormalities to B, then gradually expand the scope and migrate all users to B. Grayscale release can ensure the stability of the overall system, and problems can be discovered and adjusted in the initial grayscale to ensure their impact.
[0098] In an exemplary embodiment of the present disclosure, Figure 4 As shown, after the reconstructed business system is deployed in the production environment, the flow of the first write logic is switched to the flow of the second write logic in proportion by grayscale release, including:
[0099] Step S402: After the reconstructed business system is deployed in the production environment, a user identifier of the traffic in the production environment is obtained based on the phased release method.
[0100] Step S404, performing ratio calculation on the user identification, and determining the ratio according to the result of the ratio calculation.
[0101] Step S406: Switch the flow of the first write logic to the flow of the second write logic according to the ratio.
[0102] In an exemplary embodiment of the present disclosure, a ratio is calculated for the user identifier, and the ratio is determined based on a result of the ratio calculation, and the traffic of the first write logic is switched to the traffic of the second write logic according to the ratio, and the switching traffic is gradually expanded to 100% according to the ratio, thereby finally achieving smooth migration of online traffic to the new logic without the need to shut down for switching of business logic, thereby improving the continuity and reliability of client processing of business data.
[0103] In an exemplary embodiment of the present disclosure, Figure 5 As shown, performing ratio calculation on the user identifier, and determining the ratio according to the result of the ratio calculation includes:
[0104] Step S502: determine the absolute hash value corresponding to the user identifier according to a preset algorithm.
[0105] In an exemplary embodiment of the present disclosure, the preset algorithm includes: determining a base64 value of a pin of the user identification; and determining a hash absolute value of the base64 value.
[0106] Step S504, performing ratio calculation on the hash absolute value, and determining the ratio according to the result of the ratio calculation.
[0107] In an exemplary embodiment of the present disclosure, the expression for calculating the ratio of the user identification is as follows:
[0108] int per=Math.abs(Base64.encodeToString(pin).hashCode()),
[0109] Among them, Math.abs is the absolute value function, Base64.encodeToString(pin) is the pin of the user identifier, hashCode() is the hash value function, if per%100<=20, the traffic is routed to the second write logic (ie, the new logic), otherwise the traffic is routed to the first write logic (ie, the old logic).
[0110] In an exemplary embodiment of the present disclosure, Figure 6 As shown, building a traffic replication verification environment and deploying a reconstructed business system in the traffic replication verification environment includes:
[0111] Step S602, construct the traffic replication verification environment, and set a traffic replication switch in a database associated with the business system, wherein the traffic replication switch is used to control the process of replicating the traffic in the database to the business system.
[0112] In an exemplary embodiment of the present disclosure, the database associated with the business system may be a redis database.
[0113] Step S604: deploying the reconstructed business system in the traffic replication verification environment.
[0114] In an exemplary embodiment of the present disclosure, the traffic replication verification environment is constructed and a scheduled task 1 is preset in the scheduled task scheduling device, that is, the application task table is scanned every 2 seconds, wherein the parameters in the task table include:
[0115] (1) Status: Status;
[0116] (2) TaskData: JSON string corresponding to the context information of the application service;
[0117] (3)CreateDate: creation time;
[0118] (4)UpdateDate: field information such as modification time.
[0119] In an exemplary embodiment of the present disclosure, scheduled task 1 scans the information with status Status=0 in the application task table in batches, with 1000 items in each batch, and then sends a message to apply for service, and updates the record Status=2, and performs traffic replication operations on the sent message records.
[0120] In an exemplary embodiment of the present disclosure, a flow replication switch FlowReplicationSwitch is configured in the database, and the flow replication switch FlowReplicationSwitch is turned on = true. Then, the scheduled task 2 scans the record of Status = 2 every 5 seconds. Status = 2 detects that a service request has been sent, and then sends the same message to apply for service flow replication, and updates status = 3 to indicate that the flow has been replicated.
[0121] In an exemplary embodiment of the present disclosure, Figure 7 As shown, the business system is connected to a first database and a second database, the first database is used to monitor messages for applying for services, and the second database is used to monitor messages for applying for service traffic replication, and replicating the traffic in the production environment of the business system before reconstruction to the business system after reconstruction includes:
[0122] Step S702: When it is determined that the first database detects the message for applying for service, write the traffic into the first database according to the first writing logic.
[0123] Step S704: When it is determined that the second database detects the message of applying for service traffic replication, the traffic is written into the second database according to the second writing logic.
[0124] In an exemplary embodiment of the present disclosure, the first database adopts a mySQL database, and the second database adopts an Hbase database. After detecting that the traffic is written to the second database according to the second write logic, the key fields of the traffic in the second database are checked with the key fields of the traffic in the first database. On the one hand, the matching degree of the traffic before and after the copy is checked, and on the other hand, the integrity of the copied traffic is checked.
[0125] In an exemplary embodiment of the present disclosure, Figure 8As shown, the production verification of the traffic copied to the reconstructed business system includes:
[0126] Step S802: In response to a request to reconstruct the business system, a reconstruction task table is constructed, wherein parameters of the reconstruction task table include at least one of task status, task data, creation time and modification time.
[0127] In an exemplary embodiment of the present disclosure, a reconstruction task table is constructed to record at least one of the task status, task data, creation time and modification time, and the traffic replication and system reconstruction process is recorded based on the reconstruction task table. Subsequent traffic verification, logic verification and system verification are performed based on this, thereby improving the robustness and reliability of the reconstruction of the business system.
[0128] Step S804: updating the reconstruction task table according to the parameters of the traffic during the replication process.
[0129] In an exemplary embodiment of the present disclosure, the reconstruction task table is updated by using the parameters of the traffic during the replication process, and is not only improved by recording the reconstruction task table.
[0130] Step S806: Scan the task status in the reconstruction task table according to a preset period.
[0131] Step S808: Verify the specified field of the traffic of the first database and the specified field of the traffic of the second database according to the task status.
[0132] Step S810: If it is determined that the verification process fails, the inconsistent fields are written into the difference table and the traffic replication switch is turned off.
[0133] In an exemplary embodiment of the present disclosure, if the verification process fails, a verification difference table is written, the flow replication switch FlowReplicationSwitch=fasle is automatically turned off, flow replication is stopped, and an alarm message is issued to notify the developer, who manually intervenes to analyze the cause of the error and promptly fixes the related problems.
[0134] Step S812: If it is determined that the verification process has passed, keep the traffic replication switch turned on.
[0135] In an exemplary embodiment of the present disclosure, the designated fields include ID card type, ID card number, mobile phone number, name, phone number, email address, service file name, etc., but are not limited thereto.
[0136] The following is the service object for application settlement. Fig. 9 and Fig.10 An embodiment of the business system reconstruction solution disclosed in the present invention is described.
[0137] In an exemplary embodiment of the present disclosure, Fig. 9 As shown, in response to the client issuing a settlement certificate document or querying a settlement certificate document, the architecture 900 of the business system reconstruction solution is specifically implemented by the following devices:
[0138] (1) Business front-end device: performs parameter verification, user status verification, pending verification, writing application flow table, writing application task table, settlement certificate query and other steps, but is not limited to these.
[0139] (2) Scheduled task scheduling device: executes the following steps: scanning the application task table every 2 seconds, querying the task table to send information with the status of initial 0, issuing an application settlement certificate MQ message, switching on and off the flow, scanning the application task table every 5 meters, querying the task table to send information with the status of sent 2, and issuing an application settlement certificate flow replication MQ message, but is not limited to these steps.
[0140] (3) Reconstructed business logic device: execute the post-reconstruction logic of the traffic replication environment, monitor the MQ message of the application settlement certificate, perform the original logic processing, write the business table, monitor the traffic replication MQ message of the application settlement certificate, perform the new business logic processing, double write switch and write the traffic replication environment Hbase library and other steps, but not limited to these.
[0141] (4) Grayscale release device: execute steps such as turning off the traffic replication switch, turning off the dual write switch, monitoring the MQ message of the application settlement certificate for both the new and old logics, deploying the reconstructed logic in the production environment, turning on the diversion switch, whitelist diversion and pin ratio diversion, but not limited to these.
[0142] (5) Verification device: executes the steps of querying Hase related data information, querying business data according to pin and application number, comparing hbase data and business information for consistency, issuing an alarm if inconsistent, automatically shutting down traffic services, and checking consistency by marking, but not limited to these.
[0143] (6) Background processing device: executes steps such as querying the application flow and checking the difference table according to the pin, but is not limited to these.
[0144] In an exemplary embodiment of the present disclosure, Fig.10 As shown in the figure, the execution steps of the business system reconstruction plan include:
[0145] Step S1002, parameter verification.
[0146] Step S1004, status check.
[0147] Step S1006, waiting for verification.
[0148] Step S1008, the scheduled task scans the task list.
[0149] Step S1010, turn on the traffic replication switch.
[0150] The embodiments of the present disclosure propose a method based on traffic replication, which automatically collects production environment data, performs dual write operations in the traffic replication verification environment, and performs data integrity verification on the results after the new logic migration to ensure that the results of the entire migration process are reliable. When the verification is inconsistent, the verification difference table can be written, the traffic replication can be automatically stopped, and the alarm information can be automatically issued. Manual intervention is required to ensure that the problem can be handled in a timely manner. The diversion operation is turned on during the grayscale release, and the production traffic is supported to switch in proportion, which is imperceptible to users and has a good user experience.
[0151] Step S1012, sending an MQ message to apply for a certificate of settlement and a traffic replication MQ message to apply for a certificate of settlement.
[0152] Step S1014, monitoring the application settlement certificate MQ message.
[0153] Step S1016, original logic processing.
[0154] Step S1018, monitor the application settlement certificate traffic replication MQ message.
[0155] Step S1020: new logic processing.
[0156] The embodiment of the present disclosure proposes to complete the online system migration operation in a distributed environment. First, a traffic replication verification environment is built and the reconstructed system is deployed. If a problem is found, the traffic replication is automatically stopped, and the entire migration process is controllable. If there is no problem, the reconstructed system is deployed in the production environment, the diversion switch is turned on, and the grayscale release operation is performed, and the new logic can be switched proportionally according to the user identification pin.
[0157] Step S1022, comparison and verification operation.
[0158] Step S1024, turn off the traffic replication switch and the data double write switch.
[0159] Step S1026, turn on the diversion switch and perform grayscale release operations.
[0160] Step S1028, pin ratio diversion.
[0161] The embodiment of the present disclosure proposes a method based on traffic replication, which replicates the traffic of the production environment to a temporarily built verification environment, performs production verification on the reconstructed system, truly simulates multiple production scenarios, and compares the production environment data and the data in the traffic replication environment in real time. Once a difference occurs, an alarm message is issued to ensure that the entire migration process is efficient and the results are reliable. The specific method is as follows:
[0162] In an exemplary embodiment of the present disclosure, the service front-end accepts the service issuance request sent by the user in real time and checks the legitimacy of the user information, including request parameter verification and application number verification: the number of applications per person in a natural month shall not exceed 3 times.
[0163] In an exemplary embodiment of the present disclosure, the user status verification includes: verifying whether the user has opened Baitiao (credit), and if not, prompting the user that Baitiao has not been opened yet and cannot apply for a certificate, and performing real-name verification, consumption record verification, pending payment verification, credit reporting verification, etc. After the verification is passed, the application flow table and the application task table are written, and the initial state in the application task table is equal to 0.
[0164] In an exemplary embodiment of the present disclosure, in the scheduled task scheduling device, scheduled task 1 scans the application task table every 2 seconds, and the parameters in the task table include:
[0165] Status: status;
[0166] TaskData: JSON string of context information for applying for the issuance of a settlement certificate;
[0167] CreateDate: creation time;
[0168] UpdateDate: modification time and other field information.
[0169] In an exemplary embodiment of the present disclosure, scheduled task 1 scans the information of Status=0 in the application task table in batches, with 1000 items in each batch, and then sends an MQ message of application settlement proof, and updates the record Status=2 (sent). For the record of the sent MQ message, a traffic replication operation is performed.
[0170] In an exemplary embodiment of the present disclosure, traffic replication supports multiple business scenarios: proof of non-consumption, proof of settlement, proof of settlement with credit report, etc. First, turn on the traffic replication switch FlowReplicationSwitch = true, which is configured in redis. Then, scheduled task 2 scans the record of Status = 2 every 5 seconds, and sends an additional MQ message for the same application for proof of settlement, and updates status = 3 (traffic has been replicated).
[0171] Among them, REmote DIctionary Server (Redis) is a key-value storage system written by Salvatore Sanfilippo, and is a cross-platform non-relational database. Redis is an open source key-value storage database written in ANSI C, compliant with the BSD protocol, network-supported, memory-based, distributed, and optionally persistent, and provides APIs in multiple languages. Redis is often called a data structure server because values can be types such as strings, hashes, lists, sets, and sorted sets.
[0172] In an exemplary embodiment of the present disclosure, the reconstructed business system device is deployed in a traffic replication verification environment, which is a pre-release machine. The reconstructed system is deployed and connected to the traffic replication Hbase database and the production environment Mysql database at the same time to monitor the two MQ messages of application settlement proof message and application settlement proof traffic replication in real time.
[0173] In an exemplary embodiment of the present disclosure, the message body includes information such as application serial number, user identification, email address, etc., but is not limited thereto.
[0174] In an exemplary embodiment of the present disclosure, after the message is monitored, the message message entity is converted into the corresponding certification application data entity, and the integrity of the necessary information of the certification application entity is checked. When the application settlement certification MQ message is monitored, the original write logic processing is performed and written into the original business database.
[0175] In an exemplary embodiment of the present disclosure, when an MQ message is monitored to replicate the application settlement certificate traffic, a new business write logic process is performed, the double write switch DoubleWriteSwitch=true is turned on, and the business comparison Hbase database is written.
[0176] In an exemplary embodiment of the present disclosure, after the data is written into the Hbase database, the verification device queries the business database based on key field information (such as user identification pin, application serial number), and verifies the consistency of the Hbase data information and the business information in the database: including ID card type, ID card number, mobile phone number, name, telephone number, email address, name of the settlement certificate document, etc.
[0177] In an exemplary embodiment of the present disclosure, if there is any inconsistency, a verification difference table is written, the flow replication switch FlowReplicationSwitch=fasle is automatically turned off, flow replication is stopped, and an alarm message is issued to notify the developer, who manually intervenes to analyze the cause of the error and fix the related problems in a timely manner.
[0178] After the problem is solved, turn on the traffic replication switch again and perform a verification operation. If the verification is normal, continue to observe for a period of time, such as 3 days, to observe whether the application settlement certificate performance is stable and whether there is any fluctuation.
[0179] In an exemplary embodiment of the present disclosure, after observation during the stable period, the grayscale release operation of the reconstructed system is started. In order to ensure that the system is stable and free of abnormalities and users are unaware, the online traffic cannot be directly switched in full, and a grayscale release process is required. The specific switching process is as follows: First, turn off the traffic replication and data dual-write switches (both the new and old logics are written to the production business library), and the new and old logics simultaneously monitor the application settlement certificate MQ message, and then deploy the reconstructed system in a distributed production environment, with the new and old logics coexisting.
[0180] In an exemplary embodiment of the present disclosure, the shunt switch ShuntSwitch=true is then turned on (if the shunt switch is turned off, the old logic is directly used). In order to facilitate production environment verification, a whitelist configuration is performed, and users who hit the whitelist directly follow the new logic.
[0181] In an exemplary embodiment of the present disclosure, production traffic is switched in a manner of gradually increasing percentages. Specifically, whether to route to the new logic is determined based on the modulo 100 of the Base64 value of the user identification pin.
[0182] In an exemplary embodiment of the present disclosure, the new system switches traffic 20, int per = Math.abs(Base64.encodeToString(pin).hashCode()), if per%100<=20, it is routed to the new logic, otherwise it uses the old logic. By gradually expanding the switching traffic to 100, the smooth migration of online traffic to the new logic is finally achieved. If a problem occurs during the traffic switching process, you can turn off the diversion switch and switch back to the old process as soon as possible, and the old process will provide services to users normally.
[0183] In an exemplary embodiment of the present disclosure, the background processing device performs manual processing operations for the difference information that appears during the traffic replication environment. In addition, the background also provides the operation with a user application process query function to solve some user problems.
[0184] Corresponding to the above method embodiment, the present disclosure also provides a business system reconstruction device, which can be used to execute the above method embodiment.
[0185] Fig.11 It is a block diagram of a business system reconstruction device in an exemplary embodiment of the present disclosure.
[0186] refer to Fig.11 , the business system reconstruction device 1100 may include:
[0187] The construction module 1102 is configured to construct a traffic replication verification environment and deploy the reconstructed business system in the traffic replication verification environment.
[0188] The replication module 1104 is configured to replicate the traffic in the production environment of the business system before the reconstruction to the business system after the reconstruction.
[0189] The verification module 1106 is configured to perform production verification on the traffic copied to the reconstructed business system.
[0190] The deployment module 1108 is configured to deploy the reconstructed business system that has passed the production verification in the production environment.
[0191] In an exemplary embodiment of the present disclosure, the business system reconstruction device 1100 is further configured to:
[0192] After the reconstructed business system is deployed in the production environment, the traffic of the first write logic is switched to the traffic of the second write logic in proportion through grayscale release. The first write logic is the write logic of the business system before reconstruction, and the second write logic is the write logic of the business system after reconstruction.
[0193] In an exemplary embodiment of the present disclosure, the business system reconstruction device 1100 is further configured to:
[0194] After deploying the reconstructed business system in the production environment, obtaining a user identifier of traffic in the production environment based on the phased release method;
[0195] Performing ratio calculation on the user identification, and determining the ratio according to the result of the ratio calculation;
[0196] The flow rate of the first write logic is switched to the flow rate of the second write logic according to the ratio.
[0197] In an exemplary embodiment of the present disclosure, the business system reconstruction device 1100 is further configured to:
[0198] Determine the absolute hash value corresponding to the user identifier according to a preset algorithm;
[0199] A ratio calculation is performed on the hash absolute value, and the ratio is determined according to a result of the ratio calculation.
[0200] In an exemplary embodiment of the present disclosure, the construction module 1102 is further configured to:
[0201] Constructing the traffic replication verification environment, and setting a traffic replication switch in a database associated with the business system, wherein the traffic replication switch is used to control the process of replicating the traffic in the database to the business system;
[0202] The reconstructed business system is deployed in the traffic replication verification environment.
[0203] In an exemplary embodiment of the present disclosure, the business system is connected to a first database and a second database, the first database is used to monitor messages for applying for services, and the second database is used to monitor messages for applying for service traffic replication, and the replication module 1104 is further configured to:
[0204] When it is determined that the first database detects the message for applying for the service, writing the traffic to the first database according to the first writing logic;
[0205] When it is determined that the second database detects the message of applying for service traffic replication, the traffic is written into the second database according to the second writing logic.
[0206] In an exemplary embodiment of the present disclosure, the verification module 1106 is further configured to:
[0207] In response to a request to reconstruct the business system, construct a reconstruction task table, wherein parameters of the reconstruction task table include at least one of a task state, task data, a creation time, and a modification time;
[0208] Updating the reconstruction task table according to the parameters of the traffic during the replication process;
[0209] Scan the task status in the reconstruction task table according to a preset period;
[0210] performing a check process on a designated field of the flow of the first database and a designated field of the flow of the second database according to the task status;
[0211] If it is determined that the verification process fails, the inconsistent fields are written into the difference table, and the traffic replication switch is turned off;
[0212] If it is determined that the verification process has passed, the traffic replication switch is kept turned on.
[0213] Since the functions of the device 1100 have been described in detail in the corresponding method embodiments, the present disclosure will not elaborate on them here.
[0214] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0215] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0216] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0217] Refer to the following Fig.12 The electronic device 1200 according to this embodiment of the present invention is described. Fig.12 The electronic device 1200 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0218] like Fig.12 As shown, the electronic device 1200 is in the form of a general computing device. The components of the electronic device 1200 may include but are not limited to: at least one processing unit 1210, at least one storage unit 1220, and a bus 1230 connecting different system components (including the storage unit 1220 and the processing unit 1210).
[0219] The storage unit stores program codes, which can be executed by the processing unit 1210, so that the processing unit 1210 performs the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification. For example, the processing unit 1210 can perform the method shown in the embodiment of the present disclosure.
[0220] The storage unit 1220 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 12201 and / or a cache storage unit 12202 , and may further include a read-only storage unit (ROM) 12203 .
[0221] The storage unit 1220 may also include a program / utility 12204 having a set (at least one) of program modules 12205, such program modules 12205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0222] Bus 1230 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0223] The electronic device 1200 may also communicate with one or more external devices 1240 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1200, and / or communicate with any device that enables the electronic device 1200 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1250. Furthermore, the electronic device 1200 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 1260. As shown, the network adapter 1260 communicates with other modules of the electronic device 1200 via a bus 1230. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0224] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0225] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.
[0226] The program product for implementing the above method according to an embodiment of the present invention can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0227] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0228] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0229] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0230] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0231] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0232] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are to be considered exemplary only, and the true scope and concept of the present disclosure are indicated by the claims.
Claims
1. A business system reconstruction method, characterized in that: include: Building a traffic replication verification environment, and deploying the reconstructed business system in the traffic replication verification environment; Copying the traffic in the production environment of the business system before reconstruction to the business system after reconstruction; Performing production verification on the traffic copied to the reconstructed business system; The reconstructed business system that has passed the production verification is deployed in the production environment.
2. The business system reconstruction method according to claim 1, characterized in that: Also includes: After the reconstructed business system is deployed in the production environment, the traffic of the first write logic is switched to the traffic of the second write logic in proportion through grayscale release. The first write logic is the write logic of the business system before reconstruction, and the second write logic is the write logic of the business system after reconstruction.
3. The business system reconstruction method according to claim 2, characterized in that: After the reconstructed business system is deployed in the production environment, switching the flow of the first write logic to the flow of the second write logic in proportion by means of grayscale release includes: After deploying the reconstructed business system in the production environment, obtaining a user identifier of traffic in the production environment based on the phased release method; Performing ratio calculation on the user identification, and determining the ratio according to the result of the ratio calculation; The flow rate of the first write logic is switched to the flow rate of the second write logic according to the ratio.
4. The business system reconstruction method according to claim 3, characterized in that: Performing ratio calculation on the user identifiers, and determining the ratio according to a result of the ratio calculation includes: Determine the absolute hash value corresponding to the user identifier according to a preset algorithm; A ratio calculation is performed on the hash absolute value, and the ratio is determined according to a result of the ratio calculation.
5. The business system reconstruction method according to claim 3, characterized in that: Building a traffic replication verification environment and deploying the reconstructed business system in the traffic replication verification environment includes: Constructing the traffic replication verification environment, and setting a traffic replication switch in a database associated with the business system, wherein the traffic replication switch is used to control the process of replicating the traffic in the database to the business system; The reconstructed business system is deployed in the traffic replication verification environment.
6. The business system reconstruction method according to claim 5, characterized in that: The business system is connected to a first database and a second database, the first database is used to monitor messages for applying for services, and the second database is used to monitor messages for applying for service traffic replication, and replicating the traffic in the production environment of the business system before reconstruction to the business system after reconstruction includes: When it is determined that the first database detects the message for applying for the service, writing the traffic to the first database according to the first writing logic; When it is determined that the second database detects the message of applying for service traffic replication, the traffic is written into the second database according to the second writing logic.
7. The business system reconstruction method according to any one of claims 1 to 5, characterized in that: The production verification of the traffic copied to the reconstructed business system includes: In response to a request to reconstruct the business system, construct a reconstruction task table, wherein parameters of the reconstruction task table include at least one of a task state, task data, a creation time, and a modification time; Updating the reconstruction task table according to the parameters of the traffic during the replication process; Scan the task status in the reconstruction task table according to a preset period; performing a check process on a designated field of the flow of the first database and a designated field of the flow of the second database according to the task status; If it is determined that the verification process fails, the inconsistent fields are written into the difference table, and the traffic replication switch is turned off; If it is determined that the verification process has passed, the traffic replication switch is kept turned on.
8. A business system reconstruction device, characterized in that: include: A construction module, configured to construct a traffic replication verification environment and deploy a reconstructed business system in the traffic replication verification environment; A replication module, configured to replicate the traffic in the production environment of the business system before the reconstruction to the business system after the reconstruction; A verification module, configured to perform production verification on the traffic copied to the reconstructed business system; A deployment module is configured to deploy the reconstructed business system that has passed the production verification in the production environment.
9. An electronic device, characterized in that: include: Memory; as well as A processor coupled to the memory, wherein the processor is configured to execute the business system reconstruction method according to any one of claims 1 to 7 based on instructions stored in the memory.
10. A computer-readable storage medium having a program stored thereon, wherein when the program is executed by a processor, the business system reconstruction method according to any one of claims 1 to 7 is implemented.
