Primary key ID generation method, device, electronic device and storage medium

By generating global tracking flow numbers and comparing the update primary key ID, the problem of primary key ID consistency between new and old systems is solved, and the consistency and stability of primary key IDs in high concurrency and architectural differences scenarios are achieved, and it is suitable for a variety of scenarios of Banking system architecture.

CN114168606BActive Publication Date: 2024-12-20CHINA CONSTRUCTION BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111507472.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-10
Publication Date
2024-12-20
Estimated Expiration
2041-12-10

AI Technical Summary

Technical Problem

When the prior art ensures consistency of primary key IDs between new and old systems, there are problems such as high configuration requirements, limited applicable conditions, and the need for external call functions, resulting in the primary key IDs that may be confused and cannot meet the scenarios of high concurrency and architectural differences.

Method used

By receiving service requests, a global tracking flow number and primary key ID are generated, and the primary key ID of the corresponding system is called for comparison and update, ensuring the consistency of the primary key ID and not relying on third-party systems or external call functions.

Benefits of technology

It realizes the consistency of primary key IDs between the old and new systems, reduces resource waste, has a wide range of application and low configuration requirements, laying the foundation for the transactions and accounts of both systems of both parties.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114168606B_ABST
    Figure CN114168606B_ABST
Patent Text Reader

Abstract

The present application relates to the field of database technology, and provides a method, device, electronic device and storage medium for generating a primary key ID, which are applied to a first business system, and the method includes: receiving a business request; the business request is a business request successfully processed by a second business system; determining the number of primary key IDs to be generated based on the business request; if the number of primary key IDs to be generated is multiple, then generating a global tracking serial number, multiple first primary key IDs and the first business element corresponding to each primary key ID based on the business request, and calling the corresponding second primary key ID and second business element in the second business system based on the global tracking serial number, and updating the first primary key ID based on the result of comparing the first business element and the second business element. In this way, the consistency of the primary key ID stored in the database of both systems is guaranteed, laying the foundation for the two-way transaction tracking of both systems, and the method has low configuration requirements and a wide range of applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of database technology, and in particular to a primary key ID generation method, device, electronic device and storage medium. Background Art

[0002] With the continuous development and changes in international trade, many banks are stepping up their efforts to remove IOE, that is, in Alibaba's IT architecture, they are removing IBM's minicomputers, Oracle databases, and EMC storage devices, and gradually adjusting to a distributed architecture. The new core system of a bank usually adopts a distributed architecture, which is quite different from the old mainframe architecture system. How to ensure the consistency of the primary key unique code (Identity Document, ID) of the new and old system databases during the data comparison stage is the key to the success of the data comparison. For example, the primary key ID can be a customer number, debit card number, online banking shield number, etc.

[0003] In the prior art, when a new system and an old system process the same transaction logic, they can directly use the primary key self-increment mechanism of their respective databases to generate the corresponding primary key ID; they can also directly use the timestamp stored in the database after their respective systems process the transaction and concatenate it with the specific business field in the transaction to generate the corresponding primary key ID; they can also use an outbound call to obtain the number provided by a third-party number generation system to generate the corresponding primary key ID.

[0004] However, the method of using the database primary key auto-increment mechanism to generate the primary key ID is only applicable when the logic of the new system and the old system are highly consistent, and the configuration requirements are high. If a transaction is successfully processed in the old system but fails in the new system, the primary key IDs generated by the new and old systems will be confused. The method of using timestamps and specific business fields to generate primary key IDs has limited applicable conditions. It is necessary to ensure that the clocks of the new and old systems are completely consistent, and the system concurrency cannot be very high, otherwise the primary key ID will be confused. The method of using a third-party numbering system to generate primary key IDs requires that both the new and old systems have outbound call conditions, and the architecture of many banks' old system applications currently does not allow outbound calls, so the applicable scenarios of this solution are limited. Summary of the invention

[0005] The present application provides a method, device, electronic device and storage medium for generating a primary key ID, which can ensure the consistency of the primary key ID stored in the database of the new and old systems without relying on a third-party system and does not require the old system to support the transaction outbound call function, thereby laying a foundation for the double-transmission and account tracking of transactions between the two systems, and has low configuration requirements and a wide range of applications.

[0006] In a first aspect, the present application provides a primary key ID generation method, which is applied to a first business system, and the method includes:

[0007] Receiving a service request; the service request is a service request successfully processed by the second service system;

[0008] The number of primary key IDs to be generated is determined based on the business request degree;

[0009] If there are multiple primary key IDs to be generated, a global tracking serial number, multiple first primary key IDs, and first business elements corresponding to each primary key ID are generated based on the business request, and the corresponding second primary key ID and second business element in the second business system are called based on the global tracking serial number, and a comparison result is obtained by comparing the first business element and the second business element, and the first primary key ID is updated based on the comparison result using the second primary key ID;

[0010] Each service request corresponds to a unique global tracking serial number.

[0011] Optionally, the method further includes:

[0012] If the number of primary key IDs to be generated is one, the global tracking serial number and table name generated by the second business system based on the business request are called, and the primary key ID is obtained using the global tracking serial number and the table name.

[0013] Optionally, obtaining a primary key ID using the global tracking serial number and the table name includes:

[0014] Based on the table name, a corresponding table in the database is obtained, wherein the table is used to store the corresponding relationship between the global tracking serial number and the primary key ID;

[0015] The global tracking serial number is used to search the corresponding primary key ID in the table.

[0016] Optionally, each primary key ID corresponds to at least one business element, and the business element is an element that does not appear repeatedly among multiple primary key IDs corresponding to one business; calling the corresponding second primary key ID and the second business element in the second business system based on the global tracking serial number includes:

[0017] Initiate a polling process to read the processing records corresponding to the services in the pre-stored table in the second business system; the pre-stored table is used to store the global tracking serial number, the second business element, the second primary key ID and the processing records of the services generated by the second business system processing the business request; the processing records include processed records and unprocessed records; the processed records are records that have been called and used to update the first primary key ID; the unprocessed records are records that have not been called;

[0018] The global tracking serial number is used to search for the second primary key ID and the second business element corresponding to the unprocessed record in the processing record.

[0019] Optionally, the number of the first business element and the number of the second business element are both plural; and updating the first primary key ID by using the second primary key ID based on the comparison result includes:

[0020] If a plurality of the first business elements correspond to the second business elements, updating the first primary key ID by using the second primary key ID based on the correspondence between the first business elements and the second business elements;

[0021] If any of the first business elements does not correspond to the second business element, multiple second business elements will replace multiple first business elements, and multiple first primary key IDs will be replaced with multiple second primary key IDs. The replaced primary key ID and its corresponding business element will be fed back to the operation and maintenance personnel for them to check whether there is any problem with this replacement.

[0022] Optionally, updating the first primary key ID by using the second primary key ID based on the correspondence between the first business element and the second business element includes:

[0023] For each first primary key ID corresponding to a first business element, determine a second primary key ID corresponding to a second business element that matches the first business element, and determine whether the first primary key ID is the same as the second primary key ID;

[0024] If they are the same, the first primary key ID is retained;

[0025] If they are different, the first primary key ID is replaced by the second primary key ID.

[0026] Optionally, also include:

[0027] At every preset period, storing the processing record corresponding to the business request based on the primary key ID, and generating a first change download file;

[0028] Comparing the first changed downstream file with the second changed downstream file corresponding to the second business system;

[0029] If the first record existing in the second changed downstream file does not exist in the first changed downstream file, storing the first record in the second business system;

[0030] If there is a difference between the first record in the second changed downstream file and the second record in the first changed downstream file, the second record is replaced by the first record.

[0031] In a second aspect, the present application provides a primary key ID generating device, the device comprising:

[0032] A receiving module, used to receive a service request; the service request is a service request successfully processed by the second service system;

[0033] A determination module, used to determine the number of primary key IDs to be generated based on the business request;

[0034] a processing module, configured to generate, when there are multiple primary key IDs to be generated, a global tracking serial number, multiple first primary key IDs, and first business elements corresponding to each primary key ID based on the business request, and call the corresponding second primary key ID and second business element in the second business system based on the global tracking serial number, obtain a comparison result by comparing the first business element with the second business element, and update the first primary key ID using the second primary key ID based on the comparison result;

[0035] Each service request corresponds to a unique global tracking serial number.

[0036] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;

[0037] The memory stores computer-executable instructions;

[0038] The processor executes the computer-executable instructions stored in the memory to implement the method as described in any one of the first aspects.

[0039] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the primary key ID generation method as described in any one of the first aspects.

[0040] In a fifth aspect, the present application provides a computer program product, comprising a program code. When a computer runs the computer program, the program code executes the method as described in any one of the first aspects.

[0041] In summary, the present application provides a method, device, electronic device and storage medium for generating a primary key ID, which can be performed by receiving a business request; the business request is a business request successfully processed by the second business system; further, the number of primary key IDs to be generated is determined based on the business request; when the number of primary key IDs to be generated is multiple, a global tracking serial number, multiple first primary key IDs and the first business element corresponding to each primary key ID are generated based on the business request, and the corresponding second primary key ID and the second business element in the second business system are called based on the generated global tracking serial number, and the comparison result is obtained by comparing the first business element and the second business element, and further, the first primary key ID is updated with the second primary key ID according to the comparison result to generate the final primary key ID of the first business system; wherein each business request corresponds to a unique global tracking serial number. In this way, it is possible to ensure the consistency of the primary key ID in the database of the first and second business systems without relying on a third-party system, and without requiring the second business system to support the transaction outbound call function, thereby laying a foundation for the two-way transaction tracking of the two systems, and the configuration requirements are relatively low and the application range is wide. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0043] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0044] Figure 2 A schematic diagram of a process for generating a primary key ID provided in an embodiment of the present application;

[0045] Figure 3 A schematic diagram of a scenario of a data comparison and update method provided in an embodiment of the present application;

[0046] Figure 4 A flowchart of a specific method for generating a primary key ID provided in an embodiment of the present application;

[0047] Figure 5 A flowchart of another specific method for generating a primary key ID provided in an embodiment of the present application;

[0048] Figure 6 A schematic diagram of the structure of a primary key ID generating device provided in an embodiment of the present application;

[0049] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0050] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present invention in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0051] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0052] The term "multiple" in this application refers to two or more than two. The term "and / or" in this application is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the previous and next associated objects are in an "or" relationship; in the formula, the character " / " indicates that the previous and next associated objects are in a "division" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0053] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. For example, the first device and the second device are only used to distinguish different devices, and their order is not limited. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit them to be different.

[0054] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0055] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.

[0056] It should be understood that in the embodiments of the present application, the sequence numbers of the following processes do not imply the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0057] First, the terms involved in this application are explained:

[0058] Transaction double tracking: When the old bank system is technically reconstructed, there is usually a data tracking and comparison stage, that is, the business transactions produced are sent to the old system and the new system at the same time. By comparing the data differences between the old and new systems, it can be determined whether the new system has completely and smoothly inherited all the business logic of the old system. For example, the old system can be a system using the old IBM mainframe architecture system, and the new system can be a system using a distributed architecture. The specific types of the new and old systems are not limited in the embodiments of this application.

[0059] Primary key ID: Database primary key number, usually a random number. For example, customer number, debit card number, online banking shield number, etc., can be used to distinguish the identification number of the corresponding user. The embodiment of the application does not limit the number of random numbers of the primary key ID. For example, it can be "11" or "8809813321".

[0060] The embodiments of the present application are introduced below with reference to the accompanying drawings. Figure 1 This is a schematic diagram of an application scenario provided in an embodiment of the present application. A primary key ID generation method provided in the present application can be applied to: Figure 1 In the application scenario shown, the application scenario includes terminal equipment 101, routing platform 102, old system 103 and new system 104; in order to adapt to the development of the times, the bank's system needs to be updated. However, there are significant differences between the bank's new core system and the old line system. Therefore, in order to ensure the consistency of the primary key ID in the new and old system databases during the parallel dual-transmission tracking stage of the new and old systems, it is necessary to determine whether the new system has completely and smoothly inherited all the business logic of the old system.

[0061] Specifically, the terminal device 101 sends the business request to the routing platform 102. Further, after receiving the business request, the routing platform 102 will first send the business request to the old system 103 for processing. If the old system 103 successfully processes the business request and feeds back a message of successful processing to the routing platform 102, further, after receiving the message, the routing platform 102 sends the business request to the new system 104 for processing. Because the new system 104 and the old system 103 have different architectures, the processing order of multiple information in the same business may be different, and the multiple primary key IDs generated by the two systems may not correspond. Therefore, it is necessary to adopt the primary key ID generation method of the present application, and update the primary key ID generated in the new system 104 through the primary key ID generated in the old system 103, so as to ensure the consistency of the primary key IDs in the databases of both systems, and lay the foundation for double-transmission and account tracking of transactions between the two systems.

[0062] It should be noted that when the routing platform 102 sends a service request to the old system and the old system reports an error during processing, the process will be terminated and the routing platform 102 can return the error information directly to the terminal device.

[0063] It should be noted that the embodiment of the present application does not specifically limit the number of terminal devices and the number of service requests.

[0064] The above-mentioned terminal equipment can be a wireless terminal or a wired terminal. The wireless terminal can be a device that provides voice and / or other business data connectivity to users, a handheld device with wireless connection function, or other processing equipment connected to a wireless modem. The wireless terminal can communicate with one or more core network devices via a radio access network (Radio Access Network, RAN). The wireless terminal can be a mobile terminal, such as a mobile phone (or "cellular" phone) and a computer with a mobile terminal. For example, it can be a portable, pocket-sized, handheld, computer-built-in or vehicle-mounted mobile device that exchanges language and / or data with the radio access network. For another example, the wireless terminal can also be a personal communication service (Personal Communication Service, PCS) phone, a cordless phone, a Session Initiation Protocol (Session Initiation Protocol, SIP) phone, a wireless local loop (Wireless Local Loop, WLL) station, a personal digital assistant (Personal Digital Assistant, PDA) and other devices. The wireless terminal may also be referred to as a system, a subscriber unit, a subscriber station, a mobile station, a mobile station, a remote station, a remote terminal, an access terminal, a user terminal, a user agent, a user device or user equipment, without limitation. Optionally, the terminal device may also be a smart watch, a tablet computer or other device.

[0065] In the prior art, when a new system and an old system process the same transaction logic, they can directly use the primary key self-increment mechanism of their respective databases to generate the corresponding primary key ID; they can also directly use the timestamp stored in the database after their respective systems process the transaction and concatenate it with the specific business field in the transaction to generate the corresponding primary key ID; they can also use an outbound call to obtain the number provided by a third-party number generation system to generate the corresponding primary key ID.

[0066] However, the method of using the database primary key auto-increment mechanism to generate the primary key ID is only applicable when the logic of the new system and the old system are highly consistent, and the configuration requirements are high. If a transaction is successfully processed in the old system but fails in the new system, the primary key IDs generated by the new and old systems will be confused. The method of using timestamps and specific business fields to generate primary key IDs has limited applicable conditions. It is necessary to ensure that the clocks of the new and old systems are completely consistent, and the system concurrency cannot be very high, otherwise the primary key ID will be confused. The method of using a third-party numbering system to generate primary key IDs requires that both the new and old systems have outbound call conditions, and the architecture of many banks' old system applications currently does not allow outbound calls, so the applicable scenarios of this solution are limited.

[0067] Therefore, the present application provides a primary key ID generation method, which is applied to a system with an outbound call function. The method can generate primary key IDs by judging the number of services corresponding to the received service requests; and select the corresponding primary key ID generation method according to the number of generated primary key IDs. The method mainly utilizes the outbound call function of the system to call the corresponding primary key ID in the system to be compared based on the global tracking serial number corresponding to each service for comparison and update, and further ensures the consistency of the generated primary key ID with the primary key ID in the system to be compared, which can lay the foundation for the double-transmission and account tracking of transactions between the two systems.

[0068] For example, Figure 2 A flowchart of a method for generating a primary key ID provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the method of the embodiment of the present application includes:

[0069] S201, receiving a service request; the service request is a service request successfully processed by the second service system.

[0070] In this step, the first business system receives the business request, and the first business system may refer to a system with an outbound call function, which may be a new core system of the bank, and the second business system may be an old line system of the bank.

[0071] It should be noted that the business request received by the first business system must be a business request successfully processed by the second business system. If the second business system fails to process a business request, it will report an error to terminate the execution of the business request, and return the error information directly to the user's terminal device. If the second business system succeeds in processing a business request, the second business system will record the global tracking serial number of the business transaction, the business elements that will not be repeated within a business transaction, and the generated primary key ID in the table. For example, the table name is OLD_SYS_TRACE2, and its structure is as follows:

[0072]

[0073] Among them, OLD_SYS_TRACE2 represents the table name; EVT_TRACE_ID represents the global tracking serial number, which is a globally unique serial number that identifies a transaction, that is, one business corresponds to a unique global tracking serial number; TABLE_NAME represents the database table name, which is a table in the database that stores the correspondence between the global tracking serial number and the primary key ID and other related data. TABLE_NAME is a subtable in OLD_SYS_TRACE2; BIZ_FIELD1 represents business element 1, BIZ_FIELD2 represents business element 2, and BIZ_FIELD3 represents business element 3; OLD_SYS_ID represents the old system primary key ID, which is the primary key ID in a database table generated in a business transaction.

[0074] It is understandable that the above table is not limited to the form of a table, for example, it can also be other data structures, such as an array, a queue or a stack, etc., and the above table can also include other factors. The present application does not specifically limit the specific form of the table and the content of the table, but the above table must include various factors required by the present application. Among them, the naming of the table name "OLD_SYS_TRACE2", the global tracking serial number "EVT_TRACE_ID" in the column, the business element 1 "BIZ_FIELD1", etc. can also be in other forms, for example, the table name "old table 2", the global tracking serial number "ID number" in the column, the business element 1 "D1", etc., and the present application does not specifically limit this.

[0075] It should be noted that the structure of the table appearing in the following embodiments is similar to that of the above-mentioned table, but the types and quantities of factors included are different. This application does not limit the structure of the table appearing in the following embodiments, and will not be repeated below.

[0076] S202: Determine the number of primary key IDs to be generated based on the business request.

[0077] In this step, after receiving the service request, the first service system determines how many primary key IDs can be generated for the service corresponding to the service request, and further selects a corresponding method for generating primary key IDs according to the number of generated primary key IDs.

[0078] For example, if there are multiple possibilities for the same option in a certain service, for example, the contact method corresponding to service 1 can be a landline number or a mobile phone number. When the landline number and the mobile phone number exist at the same time, the service will generate two primary key IDs accordingly. After the first service system receives the service request of the service, it will determine that the service will generate two primary key IDs.

[0079] S203. If there are multiple primary key IDs to be generated, a global tracking serial number, multiple first primary key IDs and the first business element corresponding to each primary key ID are generated based on the business request, and the corresponding second primary key ID and the second business element in the second business system are called based on the global tracking serial number. A comparison result is obtained by comparing the first business element and the second business element, and the first primary key ID is updated using the second primary key ID based on the comparison result; wherein each business request corresponds to a unique global tracking serial number.

[0080] In the embodiments of the present application, the global tracking serial number may refer to a coding number generated by the top-level system, which is sequentially transmitted, stored, and printed in the log output by the back-end system. It is used for operation and maintenance query problems, full-link business tracking, and testing. The global tracking serial number is unique. Each business generates a unique global tracking serial number when it is processed, that is, each business request corresponds to a unique global tracking serial number. Business elements may refer to elements that do not appear repeatedly among multiple primary key IDs corresponding to a business, such as customer name, business license number, organization code, etc. In order to distinguish different primary key IDs, the number of business elements is at least one.

[0081] In this step, the comparison result may be that the first business element and the second business element correspond one-to-one, or that at least one first business element does not correspond to the second business element. There may be two processing results for the case where the first business element and the second business element correspond one-to-one, that is, if multiple first business elements and second business elements are the same, but their corresponding primary key IDs are different, then the primary key ID corresponding to the second business element shall replace the primary key ID corresponding to the first business element; if their corresponding primary key IDs are also different, then the primary key ID corresponding to the first business element may be directly retained.

[0082] It should be noted that if at least one first business element does not correspond to a second business element, the primary key ID corresponding to the second business element shall prevail, the primary key ID corresponding to the first business element shall be replaced, and the first business element shall be replaced with the second business element.

[0083] In this step, the first business system generates a global tracking serial number, multiple first primary key IDs, and the first business element corresponding to each primary key ID based on the business request, and records the corresponding primary key ID generated by the first business system into the NEW_SYS_TRACE table, where the table also records which data has been processed and which data has not been processed. The processed data refers to the records for which the final primary key ID has been generated, that is, the records after the first primary key ID has been updated after comparing the first business element and the second business element. Corresponding flags are added to the processed records and the unprocessed records, for example, a processing flag "1" is added to the processed records, and a processing flag "0" is added to the unprocessed records. Specifically, the structure of the NEW_SYS_TRACE table is as follows:

[0084]

[0085] Among them, NEW_SYS_TRACE represents the table name; EVT_TRACE_ID represents the global tracking serial number, which is a globally unique serial number that identifies a transaction, that is, one business corresponds to a unique global tracking serial number; TABLE_NAME represents the database table name, which is a table in the database that stores the correspondence between the global tracking serial number and the primary key ID and other related data. TABLE_NAME is a subtable in NEW_SYS_TRACE; BIZ_FIELD1 represents business element 1, BIZ_FIELD2 represents business element 2, and BIZ_FIELD3 represents business element 3; NEW_SYS_ID represents the new system primary key ID, which is the primary key ID in a database table generated in a business transaction; PROCESS_FLLAG represents the processing flag, "1" represents that the business record has been processed, and "0" represents that the business record has not been processed.

[0086] It should be noted that the above-mentioned NEW_SYS_TRACE is a table generated by the first business system based on the business request, and the present application does not specifically limit the addition of corresponding flags for processed records and unprocessed records. The above is only an example, and the two flags can be used to distinguish whether they are processed or not.

[0087] For example, in Figure 1In the application scenario, after receiving the business request, the new system 104 determines that the number of primary key IDs to be generated corresponding to the business request is multiple. First, the new system 104 generates a global tracking serial number "A0410000000131" and two first primary key IDs "034209001" and "034209002" based on the business request, and the first business element "Company 1, business license, 8809811122" corresponding to the first primary key ID "034209001" and the first business element "Company 2, business license, 8809813321" corresponding to the first primary key ID "034209002". Further, the new system 104 generates a global tracking serial number "A0410000000131" based on the business request. 0131" can call out the corresponding second primary key IDs "028709001" and "088773331" in the old system 103, as well as the second business element "Company 1, Business License, 8809811122" corresponding to the second primary key ID "028709001", and the second business element "Company 2, Business License, 8809813321" corresponding to the second primary key ID "088773331". By comparing the first business element and the second business element, it is found that the first primary key ID corresponding to the first business element is different from the second primary key ID corresponding to the second business element. Further, the two first primary key IDs in the new system 104 can be changed to "028709001" and "088773331".

[0088] It should be noted that after the new system 104 obtains the updated primary key ID, the data corresponding to the respective primary key IDs are queried by calling the same primary key IDs in the new system 104 and the old system 103. Furthermore, by comparing the data differences between the new and old systems, it can be determined whether the new system 102 inherits all the business logic of the old system 103. The above process is the process of comparing the data between the new and old systems when the old system 103 is technically reconstructed. This process can be used to test the integrity and stability of the new system, which is conducive to speeding up the process of replacing the old system with the new system.

[0089] Therefore, the primary key ID generation method provided in the present application does not rely on a third-party system, and only requires the first business system to support the transaction outbound call function, while the second business system does not need to support the transaction outbound call function. This can ensure the consistency of the primary key ID in the database of the first and second business systems. This can not only reduce resource waste, but also lay the foundation for dual-transaction tracking between the two systems. It has low configuration requirements and a wide range of applications.

[0090] It should be noted that the new system appearing in the following embodiments represents the first business system proposed in this application, and the old system represents the second business system, which will not be repeated below.

[0091] Optionally, the method further includes:

[0092] If the number of primary key IDs to be generated is one, the global tracking serial number and table name generated by the second business system based on the business request are called, and the primary key ID is obtained using the global tracking serial number and the table name.

[0093] In this step, the number of primary key IDs generated based on the business request is 1. Therefore, after the second business system successfully processes a business request, it only needs to record the global tracking serial number of the business transaction and the generated primary key ID into the table. For example, the table name is OLD_SYS_TRACE1, and its structure is as follows:

[0094]

[0095] Among them, OLD_SYS_TRACE1 is the table name; EVT_TRACE_ID is the global tracking serial number, which is a globally unique serial number that identifies a transaction, that is, one business corresponds to a unique global tracking serial number; TABLE_NAME is the database table name, which is a table in the database that stores the correspondence between the global tracking serial number and the primary key ID and other related data. TABLE_NAME is a subtable in OLD_SYS_TRACE1; OLD_SYS_ID is the old system primary key ID, which is the primary key ID in a database table generated in a business transaction.

[0096] For example, in Figure 1 In the application scenario, after receiving the business request, the new system 104 determines that the number of primary key IDs to be generated corresponding to the business request is one. The new system 104 only needs to generate a global tracking serial number "A0410000000131" and a table name "OLD_SYS_TRACE1" based on the business request. Furthermore, based on the global tracking serial number "A0410000000131" and the table name "OLD_SYS_TRACE1", the corresponding primary key ID "028709001" in the old system 103 can be called out. The primary key ID "028709001" is the primary key ID corresponding to the business in the new system 104.

[0097] It should be noted that if the number of primary key IDs to be generated is one, the second business system only needs to generate a global tracking serial number and table name based on the business request, and does not need to generate a primary key ID.

[0098] Therefore, when a business transaction only generates one primary key ID in the database table, the primary key ID generated by the second business system can be directly called, which not only reduces resource waste and saves space, but also improves processing accuracy.

[0099] Optionally, obtaining a primary key ID using the global tracking serial number and the table name includes:

[0100] Based on the table name, a corresponding table in the database is obtained, wherein the table is used to store the corresponding relationship between the global tracking serial number and the primary key ID;

[0101] The global tracking serial number is used to search the corresponding primary key ID in the table.

[0102] For example, in Figure 1 In the application scenario, after the new system 104 generates the global tracking serial number "A0410000000131" and the table name "OLD_SYS_TRACE1" based on the business request, the corresponding table in the database can be obtained based on the table name "OLD_SYS_TRACE1". Further, the primary key ID "028709001" corresponding to the global tracking serial number "A0410000000131" is found in the "OLD_SYS_TRACE1" table.

[0103] Therefore, the search rate can be improved, and the primary key ID corresponding to the business request can be found accurately.

[0104] Optionally, each primary key ID corresponds to at least one business element, and the business element is an element that does not appear repeatedly among multiple primary key IDs corresponding to one business; calling the corresponding second primary key ID and the second business element in the second business system based on the global tracking serial number includes:

[0105] Initiate a polling process to read the processing records corresponding to the services in the pre-stored table in the second business system; the pre-stored table is used to store the global tracking serial number, the second business element, the second primary key ID and the processing records of the services generated by the second business system processing the business request; the processing records include processed records and unprocessed records; the processed records are records that have been called and used to update the first primary key ID; the unprocessed records are records that have not been called;

[0106] The global tracking serial number is used to search for the second primary key ID and the second business element corresponding to the unprocessed record in the processing record.

[0107] In the embodiment of the present application, the polling process may refer to a process created by the system that sequentially inquires whether each record in a pre-stored table has been processed. If not, a call is made. After the call is completed, the next record is asked, and then the process is repeated continuously to read the records in the table that have not been processed.

[0108] In this step, the pre-stored table is used to store the global tracking serial number, the second business element, the second primary key ID and the processing record of the business generated by the second business system processing the business request. The processing record includes processed records and unprocessed records. The structural part of the pre-stored table can be as shown in "OLD_SYS_TRACE2" in the above embodiment, but the pre-stored table also includes processing records.

[0109] For example, in Figure 1 In the application scenario, after the new system 104 generates the global tracking serial number "A0410000000131" and two first primary key IDs "034209001" and "034209002" based on the business request, and the first business element "Company 1, business license, 8809811122" corresponding to the first primary key ID "034209001" and the first business element "Company 2, business license, 8809813321" corresponding to the first primary key ID "034209002", the polling process is started to read the pre-stored data in the old system 103. The processing records corresponding to the business in the storage table are read; further, the records that have not been processed in the pre-storage table are read, and the global tracking serial number "A0410000000131" is used to find the second primary key ID and the second business element corresponding to the unprocessed records in the unprocessed records, which are the second business element "Company 1, Business License, 8809811122" corresponding to the second primary key ID "028709001" and the second business element "Company 2, Business License, 8809813321" corresponding to the second primary key ID "088773331".

[0110] Therefore, by polling to query the unprocessed records in the table of the second business system, all records can be covered.

[0111] Reduce omissions and increase success rate.

[0112] Optionally, the number of the first business element and the number of the second business element are both plural; and updating the first primary key ID by using the second primary key ID based on the comparison result includes:

[0113] If a plurality of the first business elements correspond to the second business elements, updating the first primary key ID by using the second primary key ID based on the correspondence between the first business elements and the second business elements;

[0114] If any of the first business elements does not correspond to the second business element, multiple second business elements will replace multiple first business elements, and multiple first primary key IDs will be replaced with multiple second primary key IDs. The replaced primary key ID and its corresponding business element will be fed back to the operation and maintenance personnel for them to check whether there is any problem with this replacement.

[0115] In this step, there is no limitation on the way in which the primary key ID and its corresponding business elements after the final replacement are fed back to the operation and maintenance personnel for review. It can be sent to the terminal device of the operation and maintenance personnel in the form of a prompt message for the operation and maintenance personnel to check whether there is a problem with the replacement. The replacement result can also be directly displayed on the display screen of the first business system, and a prompt message can be sent for the operation and maintenance personnel to check whether there is a problem with the replacement. The embodiment of the present application does not make specific limitations on this.

[0116] For example, in Figure 1 In the application scenario, if the new system 104 generates a global tracking serial number "A0410000000131" and two first primary key IDs "034209001" and "034209002" based on the business request, and there are also the first business element "Company 1, Business License, 8809811122" corresponding to the first primary key ID "034209001" and the first business element "Company 2, Business License, 8809813321" corresponding to the first primary key ID "034209002", the old system 103 generates a global tracking serial number "A0410000000131" based on the business request. 0000131" and two first primary key IDs "034209001" and "034209002", as well as the second business element "Company 1, Business License, 8809811122" corresponding to the second primary key ID "034209001", and the second business element "Company 2, Business License, 8809813321" corresponding to the second primary key ID "034209002", it can be determined that the above-mentioned first business elements and second business elements correspond to each other, and based on the above comparison results, the first primary key ID is determined to be "034209001" and "034209002".

[0117] Optionally, if the old system 103 generates a global tracking serial number "A0410000000131" and two second primary key IDs "034209003" and "034209004" based on the business request, and the second business element "Company 3, Business License, 8809811123" corresponding to the second primary key ID "034209003" and the second business element "Company 3, Business License, 8809813324" corresponding to the second primary key ID "034209004", then the first business element and the second business element do not correspond one to one, then the second business elements corresponding to the two second primary key IDs are The first business elements corresponding to the two first primary key IDs generated by the first business system are replaced by the two second primary key IDs, and the two first primary key IDs generated by the first business system are replaced by the above two second primary key IDs to generate corresponding primary key IDs "034209003" and "034209004", and the primary key IDs "034209003" and "034209004" and their corresponding business elements "Company 3, Business License, 8809811123" and "Company 3, Business License, 8809813324" are sent to the terminal device of the operation and maintenance personnel in the form of prompt messages for the operation and maintenance personnel to check whether there are any problems with this replacement.

[0118] Optionally, if the old system 103 generates a global tracking serial number "A0410000000131" and two second primary key IDs "034209001" and "034209004" based on the business request, and there are the second business element "Company 1, business license, 8809811121" corresponding to the second primary key ID "034209001", and the second business element "Company 3, business license, 8809813324" corresponding to the second primary key ID "034209004", then only the first business element corresponding to the first primary key ID "034209002" and the second business element corresponding to the second primary key ID "034209004" do not correspond, then the above will be The second business element corresponding to the second primary key ID "034209004" replaces the first business element corresponding to the first primary key ID "034209002" generated by the first business system, and the second primary key ID is used to replace the first primary key ID generated by the first business system, and the corresponding primary key ID is "034209004". The other first primary key ID "034209001" is retained and does not need to be replaced. The primary key ID "034209004" and its corresponding business element "Company 3, Business License, 8809811124" are sent to the terminal device of the operation and maintenance personnel in the form of a prompt message for the operation and maintenance personnel to check whether there is any problem with this replacement.

[0119] It should be noted that, for each first business element corresponding to the first primary key ID, if any first business element does not correspond to the second business element, not only the non-corresponding first business element shall be replaced with the second business element, but also the first primary key ID corresponding to the first element shall be replaced with the second primary key ID corresponding to the second business element.

[0120] Therefore, for the above-mentioned different situations, this application has coping and solution methods and has a wide range of applications.

[0121] Optionally, updating the first primary key ID by using the second primary key ID based on the correspondence between the first business element and the second business element includes:

[0122] For each first primary key ID corresponding to a first business element, determine a second primary key ID corresponding to a second business element that matches the first business element, and determine whether the first primary key ID is the same as the second primary key ID;

[0123] If they are the same, the first primary key ID is retained;

[0124] If they are different, the first primary key ID is replaced by the second primary key ID.

[0125] For example, in Figure 1 In the application scenario, if the new system 104 generates a global tracking serial number "A0410000000131" and two first primary key IDs "034209001" and "034209002" based on the business request, and there are also the first business element "Company 1, Business License, 8809811122" corresponding to the first primary key ID "034209001" and the first business element "Company 2, Business License, 8809813321" corresponding to the first primary key ID "034209002", the old system 103 generates a global tracking serial number "A0410000000131" based on the business request. 131" and two first primary key IDs "034209001" and "034209002", and the second business element "Company 1, Business License, 8809811122" corresponding to the second primary key ID "034209001", and the second business element "Company 2, Business License, 8809813321" corresponding to the second primary key ID "034209002", it can be determined that the first primary key ID corresponding to the first business element and the second primary key ID corresponding to the second business element are the same, then the first primary key IDs "034209001" and "034209002" are retained.

[0126] Optionally, if the old system 103 generates a global tracking serial number "A0410000000131" and two first primary key IDs "034209001" and "034209002" based on the business request, and the second business element "Company 1, business license, 8809811122" corresponding to the second primary key ID "034209002", and the second business element "Company 2, business license, 8809813321" corresponding to the second primary key ID "034209002" is used. The first primary key IDs "034209001" and "034209002" are replaced by the second primary key IDs "034209002" and "034209001".

[0127] Therefore, if the business processing sequence is confused, that is, multiple business elements corresponding to the same business correspond to different primary key IDs, the consistency of the primary key ID can also be guaranteed, reducing the possibility of primary key ID confusion and improving the success rate of the call.

[0128] Optionally, the method further includes:

[0129] At every preset period, storing the processing record corresponding to the business request based on the primary key ID, and generating a first change download file;

[0130] Comparing the first changed downstream file with the second changed downstream file corresponding to the second business system;

[0131] If the first record existing in the second changed downstream file does not exist in the first changed downstream file, storing the first record in the second business system;

[0132] If there is a difference between the first record in the second changed downstream file and the second record in the first changed downstream file, the second record is replaced by the first record.

[0133] In the embodiment of the present application, the preset period may refer to a time period set by the system for checking whether the data in the system is complete and starting the comparison process. For example, the preset period may be 1 day. The embodiment of the present application does not limit the specific time of the preset period, and it may also be set manually.

[0134] In this step, the changed download file is the data of the changed table record, and the changed table is used to store the processing records within a preset period.

[0135] For example, Figure 3 A schematic diagram of a scenario of a data comparison and update method provided in an embodiment of the present application, such as Figure 3As shown, every other day, the old system can store the processing records corresponding to the business requests based on the primary key ID. For example, the global tracking serial number corresponding to the primary key ID 028709001 is A0410000000131, and the business elements are company 1, business license, and number 8809811122; the global tracking serial number corresponding to the primary key ID 028709002 is A0410000000132, and the business elements are company 2, organization code, and Code 09832211-1; the primary key ID is 028709003, and the corresponding global tracking serial number is A0410000000133, and the business elements are public institution 1, public legal person certificate, and certificate number 99933322101 and other data records are stored. Furthermore, the data records in Table A in the old system are archived to generate the old system's daily change archive file (i.e., the second change archive file), which can be uploaded to the new system.

[0136] Correspondingly, every other day, the new system can store the processing records corresponding to the business requests based on the primary key ID. For example, the global tracking serial number A04100000001 and the business elements of the primary key ID 028709001, which is A0410000000131, and the business elements are company 1, business license and number 8809811122; the global tracking serial number A0410000000133 and the business elements of the primary key ID 028709003, which is A0410000000133, and the business elements are public institution 1, public legal person certificate and certificate number 77733322101, etc. can be stored. Furthermore, the data records in Table A in the new system are archived to generate the new system's daily change archive file (i.e., the first change archive file). Furthermore, the old system's daily change archive file transmitted by the old system can be obtained, and the new system's daily change archive file can be compared with the old system's daily change archive file. By comparing the records in the daily change downstream file of the new system, it can be found that the new system's daily change downstream file lacks the record with the global tracking serial number A0410000000132 corresponding to the primary key ID 028709002 and the business elements of company 2, organizational structure code and code 09832211-1. The new system directly inserts the record into the new system. The business factor 3 in the record corresponding to the primary key ID 028709003 in the new system's daily change downstream file is different from the business factor 3 in the record corresponding to the primary key ID 028709003 in the old system's daily change downstream file. The "99933322101" corresponding to the business factor 3 in the old system's daily change downstream file is used to replace the "77733322101" corresponding to the business factor 3 in the new system's daily change downstream file to complete the data comparison and update.

[0137] Therefore, for the scenario where the first business system fails in making an outbound call to the second business system for a transaction or an error occurs in the first business system's own business processing, the method provided in the present application can ensure the consistency of the data of the two systems and improve the accuracy of the system.

[0138] In combination with the above embodiments, the primary key ID generation method provided by the present application can be applied to the scenario where only one primary key ID is generated in a database table for a business transaction. Figure 4 A flow chart of a specific method for generating a primary key ID provided in an embodiment of the present application is shown as follows: Figure 4 As shown, the specific execution method steps of the embodiment of the present application include:

[0139] Step S1: The application sends the business transaction to the routing platform and executes step S2.

[0140] In this step, the application end may refer to the terminal device mentioned in the above embodiment, which will not be repeated here. The routing platform is a chassis with a router card inserted, and the chassis includes a routing engine and a power supply and heat dissipation device for providing network services.

[0141] Step S2: The routing platform receives the business transaction and sends the business transaction to the old system (ie, the second business system), and executes step S3.

[0142] Step S3: The old system receives the business transaction and processes it. After completing the business logic processing of the transaction, the global tracking serial number and the generated primary key ID of the transaction are recorded in Table 1, and step S4 is executed.

[0143] In this step, Table 1 is used to store the correspondence between the global tracking serial number and the primary key ID. For example, the data in the dotted box in Table 1, the global tracking serial number is A0410000000131, and the corresponding primary key ID is 028709001. It can be understood that Table 1 can extract relevant data such as ID 028709001 and global tracking serial number A0410000000131 from Table A.

[0144] Step S4: The old system returns a transaction response message, which indicates the result of the old system's processing of the business transaction, and then executes step S5.

[0145] Step S5: If the old system returns a successful transaction response message, the routing platform continues to send the business transaction to the new system (ie, the first business system) and executes step S6.

[0146] Step S6: The new system receives the business transaction and processes it. When the primary key corresponding to Table A needs to be generated for processing the business, the global tracking serial number and table name are sent through an outbound call to the old system transaction. Further, the primary key ID registered in Table 1 is obtained and step S7 is executed.

[0147] Step S7: The old system returns the corresponding primary key ID according to the global tracking serial number for use by the new system.

[0148] Optionally, the primary key ID generation method provided in this application can also be applied to the scenario where a business transaction may generate multiple primary key IDs in a database table. Figure 5 A flowchart of another specific method for generating a primary key ID provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the specific execution method steps of the embodiment of the present application include:

[0149] The process of step S1 to step S2 is the same as Figure 4 The process of steps S1-S2 in the embodiment is similar and will not be repeated here.

[0150] Step S3: The old system receives the business transaction and processes it. After completing the business logic processing of the transaction, the global tracking serial number of the transaction, the business elements that will not be repeated within a business transaction, and the generated primary key ID are recorded in Table 2, and step S4 is executed.

[0151] In this step, the non-repeated business elements may refer to customer names, business license numbers, etc., for example Figure 5 In the old system, business element 1 is company 1, business element 2 is business license, and business element 3 is business license number: 8809811122. The corresponding primary key ID is 028709001, and the global tracking serial number is A0410000000131.

[0152] Among them, Table 2 is used to store the correspondence between the global tracking serial number, at least one business element and the primary key ID. For example, the data in the dotted box in Table 2, the global tracking serial number is A0410000000131, the corresponding primary key ID is 028709001, and the corresponding business elements are company 1, business license and number 8809811122. It can be understood that Table 2 can extract relevant data such as ID 028709001, business elements are company 1, business license and number 8809811122, and global tracking serial number A0410000000131 from Table A.

[0153] The process of steps S4-S5 is the same as Figure 4 The process of steps S4-S5 in the embodiment is similar and will not be repeated here.

[0154] Step S6: The new system generates a primary key ID based on the business transaction through its own internal transaction logic. Correspondingly, the new system records the corresponding generated primary key ID in Table 3. Further, the new system starts a daemon process to poll Table 2, reads the unprocessed records in Table 2, and stores the read data records in Table 3, and adds corresponding processing flags to the read data, that is, processes the records corresponding to the processing flag 1, and executes step S7.

[0155] It should be noted that in Figure 5 In the table, the processing flag is 1, the new system primary key ID is 034209001, the global tracking serial number is A0410000000131, and the records with business elements of Company 1, Business License, and Number 8809811122 are processed records.

[0156] Step S7: The new system calls the old system to obtain the old system primary key ID corresponding to the record, and then executes step S8.

[0157] Step S8: Update the primary key ID in table A in the new system to the primary key ID of the old system.

[0158] It should be noted that the acquisition, storage and application of user personal information involved in the technical solution of this application are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0159] In the above-mentioned embodiments, the primary key ID generation method provided by the embodiments of the present application is introduced. In order to realize the functions in the method provided by the embodiments of the present application, the electronic device as the execution subject may include a hardware structure and / or a software module, and the above functions are realized in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether one of the above functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.

[0160] For example, Figure 6 A schematic diagram of the structure of a primary key ID generating device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the device comprises:

[0161] A receiving module 610 is used to receive a service request; the service request is a service request successfully processed by the second service system;

[0162] A determination module 620, configured to determine the number of primary key IDs to be generated based on the business request;

[0163] The processing module 630 is used for, when there are multiple primary key IDs to be generated, generating a global tracking serial number, multiple first primary key IDs, and first business elements corresponding to each primary key ID based on the business request, and calling the corresponding second primary key ID and second business element in the second business system based on the global tracking serial number, obtaining a comparison result by comparing the first business element and the second business element, and updating the first primary key ID by using the second primary key ID based on the comparison result;

[0164] Each service request corresponds to a unique global tracking serial number.

[0165] Optionally, the processing module 630 is further configured to:

[0166] When the number of primary key IDs to be generated is one, the global tracking serial number and table name generated by the second business system based on the business request are called, and the primary key ID is obtained using the global tracking serial number and the table name.

[0167] Optionally, the processing module 630 includes an acquisition unit; the acquisition unit is used to:

[0168] Based on the table name, a corresponding table in the database is obtained, wherein the table is used to store the corresponding relationship between the global tracking serial number and the primary key ID;

[0169] The global tracking serial number is used to search the corresponding primary key ID in the table.

[0170] Optionally, the processing module 630 includes a calling unit and an updating unit;

[0171] Specifically, each primary key ID corresponds to at least one business element, and the business element is an element that does not appear repeatedly among multiple primary key IDs corresponding to a business; the calling unit is used to:

[0172] Initiate a polling process to read the processing records corresponding to the services in the pre-stored table in the second business system; the pre-stored table is used to store the global tracking serial number, the second business element, the second primary key ID and the processing records of the services generated by the second business system processing the business request; the processing records include processed records and unprocessed records; the processed records are records that have been called and used to update the first primary key ID; the unprocessed records are records that have not been called;

[0173] The global tracking serial number is used to search for the second primary key ID and the second business element corresponding to the unprocessed record in the processing record.

[0174] Optionally, the number of the first business element and the number of the second business element are both plural; and the updating unit is used to:

[0175] When a plurality of the first business elements correspond to the second business elements, updating the first primary key ID by using the second primary key ID based on the correspondence between the first business element and the second business element;

[0176] When any of the first business elements does not correspond to the second business element, multiple second business elements are used to replace multiple first business elements, and multiple first primary key IDs are replaced with multiple second primary key IDs. The replaced primary key IDs and their corresponding business elements are fed back to the operation and maintenance personnel for the operation and maintenance personnel to check whether there are any problems with this replacement.

[0177] Optionally, the updating unit is specifically used to:

[0178] For each first primary key ID corresponding to a first business element, determine a second primary key ID corresponding to a second business element that matches the first business element, and determine whether the first primary key ID is the same as the second primary key ID;

[0179] If they are the same, the first primary key ID is retained;

[0180] If they are different, the first primary key ID is replaced by the second primary key ID.

[0181] Optionally, the device further comprises a comparison module, wherein the comparison module is used to:

[0182] At every preset period, storing the processing record corresponding to the business request based on the primary key ID, and generating a first change download file;

[0183] Comparing the first changed downstream file with the second changed downstream file corresponding to the second business system;

[0184] If the first record existing in the second changed downstream file does not exist in the first changed downstream file, storing the first record in the second business system;

[0185] If there is a difference between the first record in the second changed downstream file and the second record in the first changed downstream file, the second record is replaced by the first record.

[0186] The specific implementation principle and effect of the primary key ID generation device provided in the embodiment of the present application can be found in the relevant description and effects corresponding to the above embodiment, and will not be elaborated here.

[0187] Exemplarily, an embodiment of the present application further provides a structural diagram of an electronic device, Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 702 and a memory 701 communicatively connected to the processor; the memory 701 stores a computer program; the processor 702 executes the computer program stored in the memory 701, so that the processor 702 executes the method described in any of the above embodiments.

[0188] The memory 701 and the processor 702 may be connected via a bus 703 .

[0189] An embodiment of the present application also provides a computer-readable storage medium, which stores computer program execution instructions. When the computer execution instructions are executed by a processor, they are used to implement a primary key ID generation method as described in any of the aforementioned embodiments of the present application.

[0190] An embodiment of the present application also provides a chip for executing instructions, which is used to execute the primary key ID generation method executed by an electronic device in any of the aforementioned embodiments of the present application.

[0191] An embodiment of the present application also provides a computer program product, including program code. When a computer runs the computer program, the program code executes the primary key ID generation method executed by the electronic device in any of the aforementioned embodiments of the present application.

[0192] In the several embodiments provided in the present 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 only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0193] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.

[0194] In addition, each functional module in each embodiment of the present 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 above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0195] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present application.

[0196] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the application may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.

[0197] The memory may include high-speed random access memory (RAM), and may also include non-volatile memory (NVM), such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a disk or an optical disk, etc.

[0198] The bus can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0199] The above storage medium can be implemented by 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 memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0200] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.

[0201] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.

Claims

1. A method for generating a primary key ID, characterized in that: Applied to the first business system, the method includes: receiving a service request; the service request is a service request successfully processed by the second service system, the first service system is a new core system, and the second service system is an old line system; Determine the number of primary key IDs to be generated based on the business request; If there are multiple primary key IDs to be generated, a global tracking serial number, multiple first primary key IDs, and first business elements corresponding to each primary key ID are generated based on the business request, and the corresponding second primary key ID and second business element in the second business system are called based on the global tracking serial number, and a comparison result is obtained by comparing the first business element and the second business element, and the first primary key ID is updated based on the comparison result using the second primary key ID; Wherein, each service request corresponds to a unique global tracking serial number; The method further comprises: If the number of primary key IDs to be generated is one, the global tracking serial number and table name generated by the second business system based on the business request are called, and the primary key ID is obtained using the global tracking serial number and the table name.

2. The method according to claim 1, characterized in that Obtaining the primary key ID using the global tracking serial number and the table name includes: Based on the table name, a corresponding table in the database is obtained, wherein the table is used to store the corresponding relationship between the global tracking serial number and the primary key ID; The global tracking serial number is used to search the corresponding primary key ID in the table.

3. The method according to claim 1, characterized in that Each primary key ID corresponds to at least one business element, and the business element is an element that does not appear repeatedly among multiple primary key IDs corresponding to a business; Calling the corresponding second primary key ID and second business element in the second business system based on the global tracking serial number includes: Initiate a polling process to read the processing records corresponding to the services in the pre-stored table in the second business system; the pre-stored table is used to store the global tracking serial number, the second business element, the second primary key ID and the processing records of the services generated by the second business system processing the business request; the processing records include processed records and unprocessed records; the processed records are records that have been called and used to update the first primary key ID; the unprocessed records are records that have not been called; The global tracking serial number is used to search for the second primary key ID and the second business element corresponding to the unprocessed record in the processing record.

4. The method according to claim 1, characterized in that: The number of the first business element and the number of the second business element are both plural; and updating the first primary key ID by using the second primary key ID based on the comparison result includes: If a plurality of the first business elements correspond to the second business elements, updating the first primary key ID by using the second primary key ID based on the correspondence between the first business elements and the second business elements; If any of the first business elements does not correspond to the second business element, multiple second business elements will replace multiple first business elements, and multiple first primary key IDs will be replaced with multiple second primary key IDs. The replaced primary key ID and its corresponding business element will be fed back to the operation and maintenance personnel for them to check whether there is any problem with this replacement.

5. The method according to claim 4, characterized in that Updating the first primary key ID by using the second primary key ID based on the correspondence between the first business element and the second business element includes: For each first primary key ID corresponding to a first business element, determine a second primary key ID corresponding to a second business element that matches the first business element, and determine whether the first primary key ID is the same as the second primary key ID; If they are the same, the first primary key ID is retained; If they are different, the first primary key ID is replaced by the second primary key ID.

6. The method according to any one of claims 1 to 5, characterized in that: Also includes: At every preset period, storing the processing record corresponding to the business request based on the primary key ID, and generating a first change download file; Comparing the first changed downstream file with the second changed downstream file corresponding to the second business system; If the first record existing in the second changed downstream file does not exist in the first changed downstream file, storing the first record in the second business system; If there is a difference between the first record in the second changed downstream file and the second record in the first changed downstream file, the second record is replaced by the first record.

7. A primary key ID generating device, characterized in that: The device is used in a first business system, and includes: A receiving module, configured to receive a service request; the service request is a service request successfully processed by the second service system, the first service system is a new core system, and the second service system is an old line system; A determination module, used to determine the number of primary key IDs to be generated for the business based on the business request; a processing module, configured to generate, when there are multiple primary key IDs to be generated, a global tracking serial number, multiple first primary key IDs, and first business elements corresponding to each primary key ID based on the business request, and call the corresponding second primary key ID and second business element in the second business system based on the global tracking serial number, obtain a comparison result by comparing the first business element with the second business element, and update the first primary key ID using the second primary key ID based on the comparison result; Wherein, each service request corresponds to a unique global tracking serial number; The processing module is also used to call the global tracking serial number and table name generated by the second business system based on the business request when the number of primary key IDs to be generated is one, and obtain the primary key ID using the global tracking serial number and the table name.

8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the primary key ID generation method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The computer program comprises program codes, and when a computer runs the computer program, the program codes execute the method according to any one of claims 1 to 6.