Verification method, device and equipment of software system and storage medium
By intercepting interface and database operations under the same operating environment, the target comparison information is obtained and compared with data records, solving the problems of time consumption and data integrity damage in the existing technology, and realizing efficient data verification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA CONSTRUCTION BANK
- Filing Date
- 2024-11-28
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technology retrieves recently changed data by adding a change time field to the data table. This process is time-consuming when there are many data tables and may compromise data integrity.
Under the same operating environment, the verified version is run in an interface-operable mode and the unverified version is run in an interface-locked mode. The interface operations of the verified version are intercepted, and the target comparison information, including the target table identifier, primary key identifier and data, is obtained by intercepting database operations. Data record comparison is performed to avoid changing the table structure.
It improves data comparison efficiency, avoids data integrity damage and loss, and reduces workload.
Smart Images

Figure CN119830352B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and in particular to a verification method, apparatus, device, and storage medium for a software system. Background Technology
[0002] The localization of banking systems refers to the transformation of a bank's software systems to domestic standards. Before the localized banking system goes live, the bank needs to thoroughly verify it to ensure its proper functioning after the transformation. The verification process involves running the new and old software systems simultaneously. However, the new software system does not handle actual business transactions. It intercepts transaction request messages and outbound call return messages that actually occur on the old software system and forwards them to the new software system for replay. At the end of the day, the data in the new database corresponding to the new software system is compared with the data in the old database corresponding to the old system. If they match, the new software system has been successfully tested.
[0003] When an old system has been in existence for a long time, a large number of inactive users exist, and the data corresponding to these users remains unchanged. Therefore, to improve comparison efficiency, when comparing the new and old databases, only the changed data needs to be compared. In existing technologies, a change time field is added to the data table to record when the data was updated. Therefore, only data with recent changes needs to be compared, thus improving comparison efficiency.
[0004] Therefore, when there are a large number of tables in the system, adding a change time field to the table structure will consume a lot of time, and changing a large number of table structures may compromise data integrity, leading to data loss or inconsistency. Summary of the Invention
[0005] This application provides a verification method, apparatus, device, and storage medium for a software system, which solves the problem that in the prior art, obtaining recently changed data by changing the table structure results in a lot of time consumption when there are a large number of data tables, and may also lead to the destruction of data integrity.
[0006] Firstly, this application provides a method for verifying a software system, comprising:
[0007] Under the same operating environment, the verified version of the software system is run in an interface-operable manner, and the unverified version of the software system is run in an interface-locked manner, and the first interface operation of the verified version is intercepted.
[0008] The first interface operation is mapped to the second interface operation of the verified version, so as to forward the second interface operation to the version to be verified;
[0009] When a database operation of the software system is intercepted, an operation table identifier is extracted from the database operation information corresponding to the database operation, and the operation table identifier is matched with a preset table identifier in the configuration information; the database operation includes: the operation of the unverified version on the first database, and / or, the operation of the verified version on the second database;
[0010] If the preset table identifier and the operation table identifier match, then target comparison information is extracted and recorded from the database operation information. The target comparison information includes: the target table identifier, the target primary key identifier, and the target primary key data. The target table identifier is the operation table identifier.
[0011] Read the target data record corresponding to the target comparison information from the target database. The target database includes the first database and the second database. The target data record includes: a first data record corresponding to the target comparison information in the first database and a second data record corresponding to the target comparison information in the second database.
[0012] The first data record and the second data record are compared and used as the verification result of the version to be verified. When the first data record and the second data record are consistent, the verification result of the version to be verified is that the verification is successful. When the first data record and the second data record are inconsistent, the verification result of the version to be verified is that the verification is unsuccessful.
[0013] In one possible design, reading the target data record corresponding to the target comparison information from the target database includes:
[0014] Extract the preset comparison period of the target table identifier from the configuration information. The preset comparison period is used to indicate the comparison period of the data in the target table identifier.
[0015] According to the preset comparison period, the target data record corresponding to the target comparison information is read from the target database.
[0016] In one possible design, the configuration information further includes: a preset field identifier corresponding to the target table identifier, the preset field identifier being used to indicate the fields to be compared in the data table corresponding to the target table identifier, and the comparison of the first data record and the second data record as the verification result of the version to be verified includes:
[0017] Obtain the first field data corresponding to the preset field identifier from the first data record;
[0018] Obtain the second field data corresponding to the preset field identifier from the second data record;
[0019] The data in the first field and the data in the second field are compared to obtain the verification result of the version to be verified.
[0020] In one possible design, the configuration information further includes: a preset format conversion rule corresponding to the preset field identifier; and the comparison of the first field data and the second field data as the verification result of the version to be verified includes:
[0021] If the first field data and the second field data correspond to different formats, then according to the preset format conversion rules, the first field data and the second field data are converted to the same format;
[0022] The first field data and the second field data, which have the same format, are compared and used as the verification result of the version to be verified.
[0023] In one possible design, running the verified version of the software system in a user-friendly manner includes:
[0024] Extract database call statements from the verified version of the software code;
[0025] Determine the software interface where the database call statement is located;
[0026] Starting from the software interface in the verified version's interface call chain, recursively analyze upstream to obtain the upstreammost business interface that calls the software interface;
[0027] Display the first interface control corresponding to the upstream business interface on the verified version of the operable interface, and gray out the second interface control other than the first interface control.
[0028] In one possible design, extracting the target comparison information from the database operation information includes:
[0029] Extract the operation field identifier from the database operation information;
[0030] If the operation field identifier is the preset field identifier, then the target comparison information is extracted from the database operation information.
[0031] In one possible design, obtaining the pre-recorded target comparison information includes:
[0032] After reading data from a pre-generated comparison information storage file as the target comparison information, the data in the comparison information storage file is deleted.
[0033] Secondly, this application provides a task scheduling device, comprising:
[0034] The interception module is used to run the verified version of the software system in an interface-operable manner and the unverified version of the software system in an interface-locked manner under the same operating environment, and to intercept the first interface operation of the verified version.
[0035] The sending module is used to map the first interface operation to the second interface operation of the verified version, so as to forward the second interface operation to the version to be verified;
[0036] The processing module is used to extract the operation table identifier from the database operation information corresponding to the database operation when the database operation of the software system is intercepted, and match the operation table identifier with the preset table identifier in the configuration information; the database operation includes: the operation of the unverified version on the first database, and / or, the operation of the verified version on the second database;
[0037] The processing module is further configured to extract and record target comparison information from the database operation information if the preset table identifier and the operation table identifier match. The target comparison information includes: the target table identifier, the target primary key identifier, and the target primary key data. The target table identifier is the operation table identifier.
[0038] The processing module is further configured to read target data records corresponding to the target comparison information from the target database. The target database includes the first database and the second database. The target data records include: a first data record corresponding to the target comparison information in the first database and a second data record corresponding to the target comparison information in the second database.
[0039] The processing module is further configured to compare the first data record and the second data record as the verification result of the version to be verified. When the first data record and the second data record are consistent, the verification result of the version to be verified is verification passed; when the first data record and the second data record are inconsistent, the verification result of the version to be verified is verification failed.
[0040] One possible design includes:
[0041] The processing module is used to extract a preset comparison period of the target table identifier from the configuration information, wherein the preset comparison period is used to indicate the comparison period of the data in the target table identifier;
[0042] The processing module is used to read the target data record corresponding to the target comparison information from the target database according to the preset comparison period.
[0043] One possible design includes:
[0044] The acquisition module is used to acquire the first field data corresponding to the preset field identifier from the first data record;
[0045] The acquisition module is also used to acquire the second field data corresponding to the preset field identifier from the second data record;
[0046] The processing module is also used to compare the first field data and the second field data as the verification result of the version to be verified.
[0047] One possible design includes:
[0048] If the first field data and the second field data correspond to different formats, the processing module will convert the first field data and the second field data into the same format according to the preset format conversion rules.
[0049] The processing module is used to compare first field data and second field data with the same format as the verification result of the version to be verified.
[0050] One possible design also includes:
[0051] The processing module is used to extract database call statements from the verified version of the software code;
[0052] The processing module is also used to determine the software interface where the database call statement is located;
[0053] The processing module is also used to recursively analyze upstream from the software interface in the interface call chain of the verified version to obtain the upstream business interface that calls the software interface;
[0054] The processing module is also used to display the first interface control corresponding to the upstream business interface on the verified version of the operable interface, and to gray out the second interface control other than the first interface control.
[0055] One possible design includes:
[0056] The processing module is used to extract the operation field identifier from the database operation information;
[0057] If the operation field identifier is the preset field identifier, the processing module extracts the target comparison information from the database operation information.
[0058] One possible design includes:
[0059] After reading data from a pre-generated comparison information storage file as the target comparison information, the processing module deletes the data in the comparison information storage file.
[0060] Thirdly, embodiments of this application provide an electronic device, including: at least one processor and a memory; the memory stores computer execution instructions; the at least one processor executes the computer execution instructions stored in the memory, causing the at least one processor to perform a verification method for a software system as described in the first aspect above and various possible designs of the first aspect.
[0061] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements a software system verification method as described in the first aspect and various possible designs of the first aspect.
[0062] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements a verification method for a software system as described in the first aspect and various possible designs of the first aspect.
[0063] This application provides a software system verification method, apparatus, device, and storage medium. Under the same operating environment, a verified version of the software system is run in an interface-operable manner, and a version to be verified is run in an interface-locked manner. The method intercepts a first interface operation of the verified version, maps the first interface operation to a second interface operation of the verified version, and forwards the second interface operation to the version to be verified. Then, when a database operation of the software system is intercepted, an operation table identifier is extracted from the database operation information corresponding to the database operation, and the operation table identifier is matched with a preset table identifier in the configuration information. The database operation includes: an operation of the version to be verified on a first database, and / or, an operation of the verified version on a second database. If the preset table identifier and the operation table identifier match... The target comparison information is extracted and recorded from the database operation information. This information includes the target table identifier, the target primary key identifier, and the target primary key data. The target table identifier is the operation table identifier. The target data record corresponding to the target comparison information is read from the target database, which includes a first database and a second database. The target data record includes a first data record corresponding to the target comparison information in the first database and a second data record corresponding to the target comparison information in the second database. The first and second data records are compared, and the result is used as the verification result for the version to be verified. If the first and second data records match, the verification result for the version to be verified is successful; if they do not match, the verification result for the version to be verified is unsuccessful. Compared to existing technologies that add a change time period to the table structure to obtain changed data, which consumes a lot of time and leads to data loss, this application obtains the target comparison information by intercepting database operations and reads the changed data from the database based on the target comparison information. This avoids data integrity corruption and data loss, and improves comparison efficiency. Attached Figure Description
[0064] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0065] Figure 1 This is a schematic diagram illustrating an application scenario of the verification method for the software system provided in the embodiments of this application.
[0066] Figure 2 Verification method flow of the software system provided in the embodiments of this application Figure 1 ;
[0067] Figure 3 Verification method flow of the software system provided in the embodiments of this application Figure 2 ;
[0068] Figure 4 Verification method flow of the software system provided in the embodiments of this application Figure 3 ;
[0069] Figure 5 Verification method flow of the software system provided in the embodiments of this application Figure 4 ;
[0070] Figure 6 Verification method flow of the software system provided in the embodiments of this application Figure 5 ;
[0071] Figure 7 A schematic diagram of the structure of the verification device for the software system provided in the embodiments of this application;
[0072] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0073] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0074] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0075] The collection, storage, use, processing, transmission, provision, and disclosure of financial data or user data involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0076] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.
[0077] In existing technologies, to improve comparison efficiency when comparing new and old data, a change time field is added to the data table to record the data update time. Finally, based on this change time field, data with recent changes are compared. However, in banking systems, the number of data tables to be compared is enormous. Adding a change time field to the table structure increases the workload significantly, and altering numerous table structures may compromise data integrity, leading to data loss or inconsistency.
[0078] Based on this, the inventive concept of this application lies in providing a software system verification method that, without changing the data table structure, filters out data that has recently changed for comparison, thereby verifying the software system. Based on this, database operations can be intercepted, and the table identifier, primary key identifier, and change data of the database operations can be recorded as relevant information about the changed data, indicating the data to be compared. The recorded information is independent of any file outside the database and does not require modification of the table structure within the database. Therefore, it can improve comparison efficiency while reducing workload and minimizing the possibility of compromising data integrity.
[0079] Figure 1 This is a schematic diagram illustrating an application scenario of the verification method for the software system provided in this application embodiment. For example... Figure 1 As shown, the new system includes new system applications and a new system database; data generated by the new system applications is stored in the new system database. The old system includes old system applications and an old system database; data generated by the old system applications is stored in the old system database. The data comparison tool includes a data tagging module, a data comparison module, and a configuration library. The data tagging module takes over the database operation module through a proxy, intercepting database operations. The data comparison module compares the data tables in the old system database and the data tables in the new system database based on the configuration information stored in the configuration library and the target comparison information obtained by the data tagging module from intercepted database operations, ultimately generating a verification result.
[0080] Figure 2 The software system verification method flow provided in the embodiments of this application Figure 1 ,like Figure 1 As shown, the method includes the following steps:
[0081] S201: Under the same operating environment, run the verified version of the software system in an interface-operable manner and the unverified version of the software system in an interface-locked manner, and intercept the first interface operation of the verified version.
[0082] In this embodiment, the verified version of the software system refers to the banking system before its localization transformation, while the version to be verified refers to the banking system after its localization transformation. First, it is ensured that the verified and unverified versions of the software system operate in the same environment. Optionally, the same operating environment means the same operating system, the same hardware configuration, and the same software dependencies. To simplify the complexity of environment configuration and management, virtualization technology can be used to create a consistent development and testing environment during software system verification, allowing the same operating environment to be simulated on different physical hardware.
[0083] Then, the verified version of the software system is run in an interactive manner, allowing users to operate it. However, the unverified version is run with a locked interface to prevent direct user interaction and to intercept the first interface operation when the verified version is accessed. This ensures operational consistency between the verified and unverified versions, effectively verifying data consistency at the database operation level and preventing incomparability due to operational discrepancies. For example, users can directly operate the verified version of the software system through the user interface without any special restrictions or interceptions. They can use a mouse, keyboard, and other input devices to click and input normally. However, for the unverified version, the operating system's API can be used to disable the mouse and keyboard, or a window or control can be created, made transparent and non-interactive, and covered entirely by the unverified version's window, preventing users from directly clicking or inputting on the unverified version's interface.
[0084] S202: Map the first interface operation to the verified version of the second interface operation, so as to forward the second interface operation to the version to be verified.
[0085] In this embodiment, the intercepted first interface operation is mapped to a verified second interface, and then the second interface operation is forwarded to the version to be verified, so that the operation of the version to be verified is the same as the operation of the verified version. Specifically, an event listener can be used to monitor the operation in the verified version of the software system to generate a first interface operation, and then the first interface operation is mapped to a verified second interface operation, so that the second interface operation is forwarded to the version to be verified to perform the same interface operation.
[0086] S203: When a database operation of the software system is intercepted, the operation table identifier is extracted from the database operation information corresponding to the database operation, and the operation table identifier is matched with the preset table identifier in the configuration information; the database operation includes: the operation of the unverified version on the first database, and / or, the operation of the verified version on the second database.
[0087] In this embodiment, when the unverified and verified versions of the software system perform interface operations, their operations on their respective databases are intercepted to extract operation table identifiers from the database operation information corresponding to the database operations. These operation table identifiers are then matched against preset table identifiers in the configuration information. For example, by deploying middleware between the database and the software system, when the unverified version of the software system operates on the first database, the middleware intercepts the operation on the first database to obtain the corresponding operation information. Similarly, the middleware intercepts the verified version of the software system's operations on the second database to obtain the corresponding operation information. Then, by parsing the Structured Query Language (SQL) statements in the database operation information, the operation table identifier is extracted. Optionally, the operation table identifier is the operation table name. It should be noted that since the interface operations of the unverified and verified versions of the software system are the same, their database operations are also the same; therefore, the operation table identifiers extracted from the database operation information should also be the same. Finally, the operation table identifiers are matched against preset table identifiers in the configuration information to obtain the matching result.
[0088] The configuration information is predefined by the user and includes the table name to be compared, the table fields to be compared, and the comparison rules.
[0089] S204: If the preset table identifier and the operation table identifier match, then extract and record the target comparison information from the database operation information. The target comparison information includes: target table identifier, target primary key identifier, and target primary key data. The target table identifier is the operation table identifier.
[0090] In this embodiment of the application, if the preset table identifier and the operation table identifier match, the target comparison information is extracted and recorded from the database operation information. The target comparison information includes: the target table identifier, the target primary key identifier, and the target primary key data. The target table identifier is the operation table identifier.
[0091] For example, when the preset table identifier and the operation table identifier match, the target primary key identifier and the target primary key data in the operation table identifier are extracted using an SQL query.
[0092] S205: Read the target data record corresponding to the target comparison information from the target database. The target database includes a first database and a second database. The target data record includes: a first data record corresponding to the target comparison information in the first database and a second data record corresponding to the target comparison information in the second database.
[0093] In this embodiment of the application, the corresponding target data records are read from the first database and the second database respectively according to the obtained target comparison information. That is, the first data record is read from the first database according to the target table identifier, the target primary key identifier and the target primary key data, and the second data record is read from the second database according to the target table identifier, the target primary key identifier and the target primary key data.
[0094] S206: Compare the first data record and the second data record as the verification result of the version to be verified. If the first data record and the second data record are consistent, the verification result of the version to be verified is verification passed. If the first data record and the second data record are inconsistent, the verification result of the version to be verified is verification failed.
[0095] In this embodiment, the first data record and the second data record are compared. For example, the target primary key identifiers of the first data record and the second data record are traversed, and the target primary key data corresponding to the target primary key identifiers are compared sequentially, which serves as the verification result of the version to be verified. If the first data record and the second data record are consistent, the verification result of the version to be verified is that the verification is successful; if the first data record and the second data record are inconsistent, the verification result of the version to be verified is that the verification is unsuccessful.
[0096] In this embodiment, by running a verified version of the software system in an operable manner and a pending version of the software system in a locked manner under the same operating environment, and intercepting the first interface operation of the verified version, mapping the first interface operation to the second interface operation of the verified version, and forwarding the second interface operation to the pending version, and then, when the database operation of the software system is intercepted, the operation table identifier is extracted from the database operation information corresponding to the database operation, and the operation table identifier is matched with the preset table identifier in the configuration information; the database operation includes: the operation of the pending version on the first database, and / or the operation of the verified version on the second database. If the preset table identifier and the operation table identifier match, then the database operation information is used to extract the operation table identifier. The process extracts and records target comparison information, including target table identifier, target primary key identifier, and target primary key data. The target table identifier is the operation table identifier. Target data records corresponding to the target comparison information are read from the target database, which includes a first database and a second database. Target data records include a first data record corresponding to the target comparison information in the first database and a second data record corresponding to the target comparison information in the second database. The first and second data records are compared, and the comparison result is used as the verification result for the version to be verified. If the first and second data records match, the verification result for the version to be verified is successful; if they do not match, the verification result for the version to be verified is unsuccessful. Compared to existing technologies that add a change time period to the table structure to obtain changed data, thus consuming a lot of time and causing data loss, this application obtains target comparison information by intercepting database operations and reads the changed data from the database based on the target comparison information. This avoids data integrity corruption and data loss, and improves comparison efficiency.
[0097] Figure 3 Verification method flow of the software system provided in the embodiments of this application Figure 2 In the above Figure 2 Based on the illustrated embodiments, as Figure 3 As shown, one specific implementation method for reading the target data record corresponding to the target comparison information from the target database is as follows:
[0098] S301: Extract the preset comparison period of the target table identifier from the configuration information. The preset comparison period is used to indicate the comparison period of the data in the target table identifier.
[0099] In this embodiment of the application, when reading the target data record corresponding to the target comparison information from the target database, the configuration information stored in the configuration library is first obtained. The configuration information includes a preset comparison period of the target table identifier. The preset comparison period is used to indicate the comparison period of the data in the target table identifier.
[0100] S302: Read the target data record corresponding to the target comparison information from the target database according to the preset comparison period.
[0101] In this embodiment, for example, the preset comparison period can be set uniformly for all tables in the target database; it can also be set differently for each table in the target database; or it can be set differently for some tables in the target database. The target data records corresponding to the target comparison information are read from the target database according to the preset comparison period.
[0102] In this embodiment, when reading the target data record corresponding to the target comparison information from the target database, configuration information is obtained. This configuration information includes a preset comparison period for the target table identifier. The preset comparison period indicates the comparison period for data in the target table identifier. The target data record corresponding to the target comparison information is then read from the target database according to the preset comparison period. Frequent data comparisons consume significant system resources, such as CPU, memory, or network bandwidth. By setting a reasonable preset comparison period, the accuracy and synchronization of the data can be ensured while avoiding unnecessary impact on system performance.
[0103] Figure 4 Verification method flow of the software system provided in the embodiments of this application Figure 3 In the above Figure 2 or Figure 3 Based on the illustrated embodiments, as Figure 4 As shown, one specific implementation of step S206 is as follows:
[0104] S401: Retrieve the first field data corresponding to the preset field identifier from the first data record.
[0105] In this embodiment, the configuration information includes a preset field identifier corresponding to the target table identifier. The preset field identifier refers to the field to be compared in the data table corresponding to the target table identifier. The first field data corresponding to the preset field identifier is obtained from the first data record. For example, if the preset field identifier is the name of the field to be compared, and the first field data is the specific value of the field name to be compared in the first database, then the specific value of the field name to be compared in the first database is obtained from the first data record.
[0106] S402: Retrieve the second field data corresponding to the preset field identifier from the second data record.
[0107] In this embodiment of the application, the second field data corresponding to the preset field identifier is obtained from the second data record. For example, the preset field identifier is the field name to be compared, and the second field data is the specific value of the field name to be compared in the second database. That is, the specific value of the field name to be compared in the second database is obtained from the second data record.
[0108] S403: Compare the data in the first field and the data in the second field to obtain the verification result of the version to be verified.
[0109] In this embodiment of the application, the extracted first field data and second field data are compared. Optionally, the comparison includes whether the field data is consistent and which field data is inconsistent. Based on the comparison results of the field data, a verification report or log is generated as the verification result of the version to be verified.
[0110] The configuration information also includes: preset format conversion rules corresponding to preset field identifiers, comparing the data in the first field and the data in the second field as the verification result of the version to be verified, including:
[0111] If the first field data and the second field data correspond to different formats, then according to the preset format conversion rules, the first field data and the second field data will be converted to the same format.
[0112] In this embodiment, when the first field data and the second field data correspond to different formats, the first field data and the second field data are converted to the same format according to the preset format conversion rules corresponding to the preset field identifiers in the configuration information. For example, the format conversion includes various types such as date format, number format, and string format. Optionally, the first data field format can be converted to the second field data format, or the second field format can be converted to the first field data format, or both the first field data and the second field data can be converted to other identical formats according to the preset format conversion rules stored in the configuration information.
[0113] The first and second field data, which have the same format, are compared to obtain the verification result of the version to be verified.
[0114] In this embodiment of the application, first field data and second field data with the same format are compared to generate a verification report or log, which serves as the verification result of the version to be verified.
[0115] In this embodiment, when the configuration information includes a preset field identifier corresponding to the target table identifier, the first field data corresponding to the preset field identifier is obtained from the first data record, and the second field data corresponding to the preset field identifier is obtained from the second data record. The first field data and the second field data are compared as the verification result of the version to be verified. The target table identifier and preset field identifier in the configuration information provide clear guidance for the data comparison and verification process, helping to ensure the accuracy and consistency of the data. When the configuration information includes a preset format conversion rule corresponding to the preset field identifier, if the first field data and the second field data correspond to different formats, the first field data and the second field data are converted to the same format according to the preset format conversion rule. The first field data and the second field data with the same format are compared as the verification result of the version to be verified. Providing a preset format conversion rule corresponding to the preset field identifier in the configuration information, converting the first field data and the second field data of different formats to the same format before comparison, ensures that the data have the same rules during comparison, improving the accuracy of the comparison.
[0116] Figure 5 Verification method flow of the software system provided in the embodiments of this application Figure 4 In the above Figures 2 to 4 Based on any of the illustrated embodiments, such as Figure 5 As shown, the specific implementation method for running the verified version of the software system in a user-friendly manner in step S201 is as follows:
[0117] S501: Extract database call statements from verified versions of software code.
[0118] In this embodiment of the application, database call statements are extracted from the verified version of the software code to identify the code segments in which the verified version of the software system interacts with the first database. For example, the search function of the code editor is used to find specific SQL keywords to extract the database call statements.
[0119] S502: Determine the software interface where the database call statement is located.
[0120] In this embodiment of the application, the software interface to which the code segment containing the database call statement belongs is determined. Through code structure analysis, the class or module to which the code segment containing the database call statement belongs is identified, and the software interface provided by these classes or modules is determined.
[0121] S503: Starting from the software interface in the verified version of the interface call chain, recursively analyze upstream to obtain the upstream business interface that calls the software interface.
[0122] In this embodiment, the analysis proceeds recursively upstream from the software interface in the verified version's interface call chain to trace the call chain and find the upstreammost business interface that calls the target software interface. Starting from the verified version's interface, the analysis proceeds upstream to other interfaces or components of the software interface containing the database call statement. By using code analysis tools or manually reviewing the code, the call relationships are identified, and the top-level business interface that interacts with the user is found at the very top of the call chain.
[0123] S504: Display the first interface control corresponding to the upstream business interface on the verified version's operable interface, and gray out the second interface controls other than the first interface control.
[0124] In this embodiment of the application, the first interface control corresponding to the upstream business interface is displayed on the operable interface of the verified version of the software system, and the second interface control other than the first interface control is grayed out, so as to limit the user's operation range and prevent the user from triggering unverified business logic through other interface controls.
[0125] In this embodiment, database call statements are extracted from the verified version of the software code. Then, the software interface where the database call statements are located is determined. Starting from the software interface in the interface call chain of the verified version, the analysis proceeds recursively upstream to obtain the upstream business interface that calls the software interface. The first interface control corresponding to the upstream business interface is displayed on the operable interface of the verified version, and the second interface control other than the first interface control is grayed out. When the verified version of the software system is run in an operable manner, by extracting database call statements from the software code of the verified version, determining the interface location, tracing the call chain, and highlighting the interface control corresponding to the upstream business interface on the user interface, while graying out other controls to limit the user's operation range, the user can only operate the interface that interacts with the database. This ensures that the verified version of the software system will modify the first database when processing operations, thereby improving the verification speed of the software system.
[0126] To reduce the amount of target comparison information and save storage space, the target comparison information extracted from the database operation information includes:
[0127] Extract the operation field identifier from the database operation information.
[0128] In this embodiment of the application, the operation field identifier is extracted from the database operation information, that is, when the database operation data table changes, the table name is extracted.
[0129] If the operation field identifier is a preset field identifier, then the target comparison information is extracted from the database operation information.
[0130] In this embodiment, if the extracted operation field identifier is a preset field identifier, i.e., the extracted table name is a table name pre-stored in the configuration database, then the target comparison information is extracted from the database operation information. If the extracted identifier is not a table name pre-stored in the configuration database, then the database operation is intercepted again, and the operation data table identifier is extracted from the database operation information.
[0131] In this embodiment, database operations are intercepted. These operations include: operations on a first database by the version to be verified, and / or operations on a second database by the verified version. In response to intercepting a database operation, an operation data table identifier is extracted from the database operation information corresponding to the database operation. If the operation data table identifier is a preset table identifier, target comparison information is extracted from the database operation information and recorded. By configuring a preset table identifier and intercepting database operations to extract and record target comparison information, real-time data changes can be captured. Furthermore, to reduce the amount of target comparison information and save storage space, when intercepting a database operation, it can be determined whether it is an operation field identifier that needs to be compared; only if it is an operation field identifier that needs to be compared is the information recorded.
[0132] Figure 6 Verification method flow of the software system provided in the embodiments of this application Figure 5 In the above Figures 2 to 5 Based on any of the illustrated embodiments, such as Figure 6 As shown, one specific implementation method for obtaining pre-recorded target comparison information is as follows:
[0133] S601: After reading data from a pre-generated comparison information storage file as the target comparison information, delete the data in the comparison information storage file.
[0134] In this embodiment of the application, after each interception of database operation to obtain comparison information, the comparison information is stored in a pre-generated comparison information storage file through snapshot records. When the data in the pre-generated comparison information storage file is used as the target comparison information, the data in the comparison information storage file is deleted.
[0135] In this embodiment of the application, after reading data from a pre-generated comparison information storage file as target comparison information, the data in the comparison information storage file is deleted to avoid the data being regarded as target comparison information again in the next comparison, thus avoiding repeated comparisons and unnecessary calculations.
[0136] Figure 7 This is a schematic diagram of the structure of a verification device for a software system provided in an embodiment of this application. Figure 7 As shown, the verification device for a software system includes: an interception module 701, a sending module 702, and a processing module 703.
[0137] The interception module 701 is used to run a verified version of the software system in an interface-operable manner and a pending version of the software system in an interface-locked manner under the same operating environment, and to intercept the first interface operation of the verified version; the sending module 702 is used to map the first interface operation to the second interface operation of the verified version, so as to forward the second interface operation to the pending version; the processing module 703 is used to extract the operation table identifier from the database operation information corresponding to the database operation when the database operation of the software system is intercepted, and to match the operation table identifier with the preset table identifier in the configuration information; the database operation includes: the operation of the pending version on the first database, and / or, the operation of the verified version on the second database; the processing module 703 is also used to, if the preset table identifier and the operation table identifier match, extract the operation table identifier from the database operation information. The processing module 703 extracts and records target comparison information from the operation information. This target comparison information includes: target table identifier, target primary key identifier, and target primary key data. The target table identifier is the operation table identifier. The processing module 703 is also used to read target data records corresponding to the target comparison information from the target database. The target database includes a first database and a second database. The target data records include: a first data record corresponding to the target comparison information in the first database and a second data record corresponding to the target comparison information in the second database. The processing module 703 further compares the first data record and the second data record as the verification result of the version to be verified. If the first data record and the second data record are consistent, the verification result of the version to be verified is "verification passed"; if the first data record and the second data record are inconsistent, the verification result of the version to be verified is "verification failed".
[0138] The software system verification device provided in this application embodiment can be used to execute the technical solution of the software system verification method in the above embodiment. Its implementation principle and technical effect are similar, and will not be described again here.
[0139] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented by processing element calls to software, while others are implemented in hardware. For example, the interception module 701 can be a separate processing element, or it can be integrated into a chip in the above device. Alternatively, it can be stored as program code in the memory of the above device, and its functions can be called and executed by a processing element of the device. The implementation of other modules is similar. Moreover, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed through the integrated logic circuits in the hardware of the processor element or through software instructions.
[0140] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 8 As shown, the electronic device may include a transceiver 801, a processor 802, and a memory 803.
[0141] Processor 802 executes computer execution instructions stored in memory, causing processor 802 to perform the scheme in the above embodiments. Processor 802 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0142] The memory 803 is connected to the processor 802 via the system bus and completes communication between them. The memory 803 is used to store computer program instructions.
[0143] Transceiver 801 can be used to obtain the task to be run and its configuration information.
[0144] The system bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus. The system bus can be categorized as an address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the figures, but this does not indicate that there is only one bus or a single type of bus. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write databases, and read-only databases).
[0145] The memory may include random access memory (RAM) or non-volatile memory (VNM).
[0146] This application also provides a chip for executing instructions, which is used to execute the technical solution of a software system verification method in the above embodiments.
[0147] This application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on a computer, the computer performs the technical solution of the verification method for a software system described in the above embodiment.
[0148] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, it can implement the technical solution of the verification method of a software system in the above embodiments.
[0149] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0150] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.
[0151] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.
[0152] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.
[0153] The aforementioned storage medium can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.
[0154] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. The processor and storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic control unit or main control device.
[0155] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0156] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A verification method for a software system, characterized in that, include: Under the same operating environment, the verified version of the software system is run in an interface-operable manner, and the unverified version of the software system is run in an interface-locked manner, and the first interface operation of the verified version is intercepted. The first interface operation is mapped to the second interface operation of the verified version, so as to forward the second interface operation to the version to be verified; When a database operation of the software system is intercepted, an operation table identifier is extracted from the database operation information corresponding to the database operation, and the operation table identifier is matched with a preset table identifier in the configuration information; the database operation includes: the operation of the unverified version on the first database, and / or, the operation of the verified version on the second database; If the preset table identifier and the operation table identifier match, then target comparison information is extracted and recorded from the database operation information. The target comparison information includes: target table identifier, target primary key identifier, and target primary key data. The target table identifier is the operation table identifier. Read the target data record corresponding to the target comparison information from the target database. The target database includes the first database and the second database. The target data record includes: a first data record corresponding to the target comparison information in the first database and a second data record corresponding to the target comparison information in the second database. The first data record and the second data record are compared and used as the verification result of the version to be verified. When the first data record and the second data record are consistent, the verification result of the version to be verified is that the verification is successful. When the first data record and the second data record are inconsistent, the verification result of the version to be verified is that the verification is unsuccessful.
2. The method according to claim 1, characterized in that, The step of reading the target data record corresponding to the target comparison information from the target database includes: Extract the preset comparison period of the target table identifier from the configuration information; the preset comparison period is used to indicate the comparison period of the data in the target table identifier. According to the preset comparison period, the target data record corresponding to the target comparison information is read from the target database.
3. The method according to claim 2, characterized in that, The configuration information also includes: a preset field identifier corresponding to the target table identifier, the preset field identifier being used to indicate the fields to be compared in the data table corresponding to the target table identifier, and the comparison of the first data record and the second data record as the verification result of the version to be verified includes: Obtain the first field data corresponding to the preset field identifier from the first data record; Obtain the second field data corresponding to the preset field identifier from the second data record; The data in the first field and the data in the second field are compared to obtain the verification result of the version to be verified.
4. The method according to claim 3, characterized in that, The configuration information also includes: the preset format conversion rule corresponding to the preset field identifier; and the comparison of the first field data and the second field data as the verification result of the version to be verified includes: If the first field data and the second field data correspond to different formats, then according to the preset format conversion rules, the first field data and the second field data are converted to the same format; The first field data and the second field data, which have the same format, are compared and used as the verification result of the version to be verified.
5. The method according to any one of claims 1 to 4, characterized in that, The verified version of the software system that runs in a user-friendly interface includes: Extract database call statements from the verified version of the software code; Determine the software interface where the database call statement is located; Starting from the software interface in the verified version's interface call chain, recursively analyze upstream to obtain the upstreammost business interface that calls the software interface; Display the first interface control corresponding to the upstream business interface on the verified version of the operable interface, and gray out the second interface control other than the first interface control.
6. The method according to claim 5, characterized in that, Extracting the target comparison information from the database operation information includes: Extract the operation field identifier from the database operation information; If the operation field identifier is the preset field identifier, then the target comparison information is extracted from the database operation information.
7. The method according to any one of claims 1-3, characterized in that, Obtain pre-recorded target comparison information, including: After reading data from a pre-generated comparison information storage file as the target comparison information, the data in the comparison information storage file is deleted.
8. A verification device for a software system, characterized in that, include: The interception module is used to run the verified version of the software system in an interface-operable manner and the unverified version of the software system in an interface-locked manner under the same operating environment, and to intercept the first interface operation of the verified version. The sending module is used to map the first interface operation to the second interface operation of the verified version, so as to forward the second interface operation to the version to be verified; The processing module is used to extract the operation table identifier from the database operation information corresponding to the database operation when the database operation of the software system is intercepted, and match the operation table identifier with the preset table identifier in the configuration information; the database operation includes: the operation of the unverified version on the first database, and / or, the operation of the verified version on the second database; The processing module is further configured to extract and record target comparison information from the database operation information if the preset table identifier and the operation table identifier match. The target comparison information includes: target table identifier, target primary key identifier, and target primary key data, wherein the target table identifier is the operation table identifier. The processing module is further configured to read target data records corresponding to the target comparison information from the target database. The target database includes the first database and the second database. The target data records include: a first data record corresponding to the target comparison information in the first database and a second data record corresponding to the target comparison information in the second database. The processing module is further configured to compare the first data record and the second data record as the verification result of the version to be verified. When the first data record and the second data record are consistent, the verification result of the version to be verified is verification passed; when the first data record and the second data record are inconsistent, the verification result of the version to be verified is verification failed.
9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-7.
11. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-7.
Citation Information
Patent Citations
Database transformation method and device, equipment, storage medium and program product
CN116483806A
Data migration verification method and system, electronic equipment and storage medium
CN118445266A