A service processing method and device, electronic equipment and computer readable medium

By generating a combined unique index and performing uniqueness verification, the problem of high error rate in business processing caused by cache breakdown was solved, improving the accuracy and stability of business processing.

CN117076437BActive Publication Date: 2026-06-16JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
Filing Date
2023-08-14
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

In existing technologies, when using middleware caching for exclusive processing in business processes, cache breakdown can lead to a high error rate in business processing.

Method used

By generating a composite unique index, performing uniqueness checks, obtaining the auto-incrementing identifier of existing data, and performing the data insertion process based on the updated existing data, errors caused by direct table insertion are avoided.

🎯Benefits of technology

It improved the accuracy of business processing and effectively avoided unnecessary losses caused by the transfer of business process risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117076437B_ABST
    Figure CN117076437B_ABST
Patent Text Reader

Abstract

The application discloses a business processing method and device, electronic equipment and computer readable medium, and relates to the technical field of computers. A specific embodiment comprises receiving a business processing request, obtaining corresponding to-be-inserted data, a business identifier and a duplicate prevention value; generating a joint unique index based on the business identifier and the duplicate prevention value; performing a uniqueness check according to the joint unique index, and obtaining corresponding existing data based on the joint unique index in response to a failed check; obtaining a self-incrementing identifier corresponding to the existing data, updating the existing data based on the self-incrementing identifier and the duplicate prevention value; and performing an insertion process of the to-be-inserted data based on the updated existing data. By creating a joint unique index and performing data checking based on the joint unique index to perform data insertion, the accuracy of business processing can be improved, and unnecessary losses caused by risk transfer of business processes can be effectively avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a business processing method, apparatus, electronic device, and computer-readable medium. Background Technology

[0002] When the server-side interface requires business idempotency, using middleware caching in the business process and distributed locks for exclusive processing can solve most problems. However, when the cache is breached and data is directly inserted into the table, the error rate of business processing will be high. Summary of the Invention

[0003] In view of this, embodiments of this application provide a business processing method, apparatus, electronic device, and computer-readable medium that can solve the problem of high error rates in business processing caused by directly inserting business data into tables in existing methods.

[0004] To achieve the above objectives, according to one aspect of an embodiment of this application, a business processing method is provided, comprising:

[0005] Receive business processing requests and obtain the corresponding data to be inserted, business identifier, and anti-duplicate value;

[0006] Generate a combined unique index based on the business identifier and anti-duplicate value;

[0007] Perform a uniqueness check based on the composite unique index. If the check fails, retrieve the corresponding existing data based on the composite unique index.

[0008] Obtain the auto-incrementing identifier corresponding to the existing data, and update the existing data based on the auto-incrementing identifier and the anti-duplicate value;

[0009] The insertion process for the data to be inserted is performed based on the updated existing data.

[0010] Optionally, a uniqueness check is performed based on the composite unique index, including:

[0011] The composite unique index is compared with each index in the index pool. If an index in the index pool is the same as the composite unique index, the verification fails; otherwise, the verification succeeds.

[0012] Optionally, existing data can be updated based on the auto-incrementing identifier and the anti-duplicate value, including:

[0013] The auto-incrementing identifier and the anti-duplicate value are assembled to generate assembled data;

[0014] Update the anti-repetition value corresponding to the existing data based on the assembly data;

[0015] Update the status of the existing data from valid to deleted.

[0016] Optionally, after performing a uniqueness check based on the composite unique index, the method further includes:

[0017] Upon successful verification, the target insertion position is determined based on the business identifier;

[0018] Insert the data to be inserted into the target insertion position.

[0019] Optionally, the insertion process of the data to be inserted is performed based on the updated existing data, including:

[0020] Get the location of the updated existing data;

[0021] Determine the target insertion position based on the location;

[0022] Insert the data to be inserted into the target insertion position.

[0023] Optionally, in response to a verification failure, the method further includes:

[0024] Generate and output unique constraint exception information.

[0025] Optionally, the insertion process of the data to be inserted is performed based on the updated existing data, including:

[0026] Determine the auto-increment identifier corresponding to the data to be inserted based on the auto-increment identifier corresponding to the updated existing data;

[0027] Insert the data to be inserted into the position corresponding to the auto-incrementing identifier of the data to be inserted.

[0028] In addition, this application also provides a business processing apparatus, including:

[0029] The receiving unit is configured to receive service processing requests and obtain the corresponding data to be inserted, service identifier, and anti-duplicate value.

[0030] The index generation unit is configured to generate a combined unique index based on the business identifier and anti-duplicate value;

[0031] The verification unit is configured to perform a uniqueness check based on the composite unique index, and in response to a verification failure, retrieve the corresponding existing data based on the composite unique index.

[0032] The update unit is configured to obtain the auto-incrementing identifier corresponding to the existing data and update the existing data based on the auto-incrementing identifier and the anti-duplicate value.

[0033] The execution unit is configured to perform the insertion process of the data to be inserted based on the updated existing data.

[0034] Optionally, the verification unit is further configured to:

[0035] The composite unique index is compared with each index in the index pool. If an index in the index pool is the same as the composite unique index, the verification fails; otherwise, the verification succeeds.

[0036] Optionally, the update unit is further configured to:

[0037] The auto-incrementing identifier and the anti-duplicate value are assembled to generate assembled data;

[0038] Update the anti-repetition value corresponding to the existing data based on the assembly data;

[0039] Update the status of the existing data from valid to deleted.

[0040] Optionally, the service processing apparatus further includes a data insertion unit, configured to:

[0041] Upon successful verification, the target insertion position is determined based on the business identifier;

[0042] Insert the data to be inserted into the target insertion position.

[0043] Optionally, the execution unit is further configured to:

[0044] Get the location of the updated existing data;

[0045] Determine the target insertion position based on the location;

[0046] Insert the data to be inserted into the target insertion position.

[0047] Optionally, the service processing apparatus further includes an information generation unit, configured to:

[0048] Generate and output unique constraint exception information.

[0049] Optionally, the execution unit is further configured to:

[0050] Determine the auto-increment identifier corresponding to the data to be inserted based on the auto-increment identifier corresponding to the updated existing data;

[0051] Insert the data to be inserted into the position corresponding to the auto-incrementing identifier of the data to be inserted.

[0052] In addition, this application also provides a business processing electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by one or more processors, enable the one or more processors to implement the business processing method described above.

[0053] In addition, this application also provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the business processing method described above.

[0054] One embodiment of the above invention has the following advantages or beneficial effects: This application receives a business processing request, obtains the corresponding data to be inserted, a business identifier, and an anti-duplicate value; generates a combined unique index based on the business identifier and the anti-duplicate value; performs a uniqueness check based on the combined unique index; in response to a check failure, obtains the corresponding existing data based on the combined unique index; obtains the auto-incrementing identifier corresponding to the existing data, updates the existing data based on the auto-incrementing identifier and the anti-duplicate value; and executes the insertion process of the data to be inserted based on the updated existing data. By creating a combined unique index and performing data verification based on the combined unique index to perform data insertion, the accuracy of business processing can be improved, and unnecessary losses caused by the transfer of business process risks can be effectively avoided.

[0055] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0056] The accompanying drawings are provided to better understand this application and do not constitute an undue limitation thereof. Wherein:

[0057] Figure 1 This is a schematic diagram of the main flow of a business processing method provided according to an embodiment of this application;

[0058] Figure 2 This is a schematic diagram of the main flow of a business processing method provided according to an embodiment of this application;

[0059] Figure 3 This is a schematic diagram illustrating an application scenario of a business processing method provided according to an embodiment of this application;

[0060] Figure 4 This is a schematic diagram of the main units of a service processing apparatus according to an embodiment of this application;

[0061] Figure 5 This is an exemplary system architecture diagram to which embodiments of this application can be applied;

[0062] Figure 6 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers in the embodiments of this application. Detailed Implementation

[0063] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of this application, including various details to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this application. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description. It should be noted that the collection, gathering, updating, analysis, processing, use, transmission, and storage of user personal information involved in the technical solutions of this disclosure all comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. Necessary measures are taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.

[0064] Figure 1 This is a schematic diagram of the main flow of a business processing method provided according to an embodiment of this application, as shown below. Figure 1 As shown, the business processing methods include:

[0065] Step S101: Receive a service processing request and obtain the corresponding data to be inserted, service identifier, and anti-duplicate value.

[0066] In this embodiment, the entity executing the business processing method (e.g., a server) can receive business processing requests via wired or wireless connections. Specifically, the business processing request can be a request to insert data into a preset data table or a request to insert data into a preset data pool. This embodiment does not specifically limit the content of the business processing request.

[0067] Upon receiving a business processing request, the executing entity can obtain the data to be inserted, the business identifier, and the anti-duplicate value corresponding to the request. Specifically, the data to be inserted can be waybill data or item listing data; this embodiment does not specifically limit the data to be inserted. The business identifier is used to characterize the business type to which the data to be inserted belongs, so as to call the corresponding data table to execute the data insertion process based on the business type. The anti-duplicate value is used to verify whether the data in the data table already exists, to prevent duplicate data insertion, and to ensure the simplicity of the data table and the accuracy of related business processing.

[0068] Step S102: Generate a combined unique index based on the business identifier and anti-duplicate value.

[0069] Specifically, a business identifier (e.g., 00001) and a deduplication prevention value (e.g., bizUniqueValue) can be concatenated to generate a composite unique index, such as 0001bizUniqueValue. Validating the composite unique index can determine if there is duplicate data in the table.

[0070] Step S103: Perform a uniqueness check based on the composite unique index. In response to the check failure, retrieve the corresponding existing data based on the composite unique index.

[0071] Specifically, a uniqueness check is performed based on the composite unique index, including comparing the composite unique index with each index in the index pool. If an index in the index pool is identical to the composite unique index, the check fails; otherwise, the check succeeds.

[0072] The verification result is determined by checking whether the composite unique index is unique. If there is no index in the data table that is the same as the composite unique index, the verification is successful. If there is an index in the data table that is the same as the composite unique index, the verification fails.

[0073] Specifically, after performing a uniqueness check based on the composite unique index, the method further includes: in response to a successful check, determining the target insertion position based on the business identifier; and inserting the data to be inserted into the target insertion position.

[0074] If the validation is successful and there is no index in the data table that matches the composite unique index, the target insertion position can be determined based on the business identifier. For example, if the business identifier is 00003, the target insertion position can be determined to be between business identifiers 00002 and 00004. Then, the corresponding data to be inserted can be inserted according to the determined target insertion position.

[0075] Specifically, in response to a verification failure, the business processing method also includes: generating and outputting uniqueness constraint exception information.

[0076] For example, when verification fails, the executing entity can combine the business identifier with the anti-duplicate value as uniqueness constraint exception information, such as "00001bizUniqueValue data insertion exception, please process". This can then be output to the terminal bound to the user identifier corresponding to the business processing request. This embodiment of the application does not specifically limit the type of output terminal.

[0077] Step S104: Obtain the auto-incrementing identifier corresponding to the existing data, and update the existing data based on the auto-incrementing identifier and the anti-duplicate value.

[0078] An auto-incrementing identifier, for example, 1. A deduplication prevention value, for example, bizUniqueValue. Based on the auto-incrementing identifier and the deduplication prevention value, the modified data bizUniqueValue_1 is obtained. The existing deduplication prevention value bizUniqueValue is then changed to the newly obtained modified data bizUniqueValue_1.

[0079] Step S105: Perform the insertion process of the data to be inserted based on the updated existing data.

[0080] Specifically, the insertion process of the data to be inserted is performed based on the updated existing data, including: obtaining the position of the updated existing data; determining the target insertion position based on the position; and inserting the data to be inserted into the target insertion position.

[0081] For example, the updated position of the existing data is position 1. The target insertion position determined based on position 1 can be position 2. Position 2 can be located after position 1, immediately adjacent to position 1. Of course, position 2 can also be after position 1 and separated from position 1 by one or more positions. This application embodiment does not specifically limit the position 2 after position 1.

[0082] This embodiment receives a business processing request, obtains the corresponding data to be inserted, a business identifier, and an anti-duplicate value; generates a combined unique index based on the business identifier and the anti-duplicate value; performs a uniqueness check based on the combined unique index; in response to a check failure, retrieves the corresponding existing data based on the combined unique index; obtains the auto-incrementing identifier corresponding to the existing data, and updates the existing data based on the auto-incrementing identifier and the anti-duplicate value; and executes the data insertion process based on the updated existing data. By creating a combined unique index and performing data validation based on it to perform data insertion, the accuracy of business processing can be improved, effectively avoiding unnecessary losses caused by the transfer of business process risks.

[0083] Figure 2 This is a schematic diagram of the main flow of a business processing method provided according to an embodiment of this application, such as... Figure 2 As shown, the business processing methods include:

[0084] Step S201: Receive a service processing request and obtain the corresponding data to be inserted, service identifier, and anti-duplicate value.

[0085] A business processing request can be a request to insert data into a database or data table. After receiving the business processing request, the executing entity can obtain the corresponding data to be inserted. The data to be inserted can be, for example, new employee data or new resident data; this embodiment does not specifically limit the data to be inserted. A business identifier, such as the code or name of the business corresponding to the data to be inserted, is also not specifically limited in this embodiment. A deduplication prevention value can be used to characterize whether the data to be inserted overlaps with the data to be inserted into the database or data table.

[0086] Step S202: Generate a combined unique index based on the business identifier and anti-duplicate value.

[0087] The business identifier can be segmented to obtain data in each segment. A deduplication prevention value is then inserted between adjacent segments to generate a composite unique index. For example, the business identifier could be 00001, resulting in segment data of 00 and 001. Inserting a deduplication prevention value, such as `bizUniqueValue`, between 00 and 001 creates the composite unique index `00bizUniqueValue001`.

[0088] Step S203: Perform a uniqueness check based on the composite unique index. In response to the check failure, retrieve the corresponding existing data based on the composite unique index.

[0089] Uniqueness verification involves matching a composite unique index against all records in the database or table. If a matching index exists, the verification fails; otherwise, it succeeds. If the verification fails, it indicates that a matching index exists in the database or table, meaning there is duplicate data in the database or table that is being inserted. In this case, the executing entity can retrieve the existing data corresponding to the composite unique index from the database or table for later use.

[0090] Step S204: Obtain the auto-incrementing identifier corresponding to the existing data, and assemble the auto-incrementing identifier and the anti-duplicate value to generate assembled data.

[0091] Specifically, the auto-incrementing identifier and anti-duplicate value in the existing data can be assembled. The assembly method can be to place the auto-incrementing identifier first and the anti-duplicate value after it, resulting in assembled data. For example, if the auto-incrementing identifier is 1 and the anti-duplicate value is bizUniqueValue, the generated assembled data could be 1_bizUniqueValue. Alternatively, the auto-incrementing identifier can be placed after the anti-duplicate value, resulting in assembled data like bizUniqueValue_1.

[0092] Step S205: Update the anti-duplication value corresponding to the existing data based on the assembly data.

[0093] Replace the duplicate values ​​in the existing data with the obtained assembled data to update the existing data.

[0094] Step S206: Update the status of the existing data from valid to deleted.

[0095] After updating the existing data, the status of the row in the existing data corresponding to the latest anti-duplicate value is updated to the deleted status, thereby updating the database or data table. For example, the status of the row with an auto-incrementing flag of 1 is changed from 0 to 1, where a status flag of 0 indicates a valid status, and a status flag of 1 indicates a deleted status.

[0096] Step S207: Perform the insertion process of the data to be inserted based on the updated existing data.

[0097] Specifically, the process of inserting data to be inserted is performed based on the updated existing data, including: determining the auto-increment identifier corresponding to the data to be inserted according to the auto-increment identifier corresponding to the updated existing data; and inserting the data to be inserted into the position corresponding to the auto-increment identifier corresponding to the data to be inserted.

[0098] For example, if the auto-incrementing identifier corresponding to the updated existing data is 1, then the auto-incrementing identifier corresponding to the data to be inserted can be 2 (i.e., 1+1=2), meaning the data to be inserted can be inserted after the existing data. After determining the auto-incrementing identifier corresponding to the data to be inserted, the executing entity can insert the data to be inserted into the position corresponding to the auto-incrementing identifier 2.

[0099] As shown below:

[0100]

[0101] Among them, 2 00001bizUniqueValue First data 0 is the data to be inserted.

[0102] Therefore, since the combined unique index "00001" + "bizUniqueValue" is unique at this time, it can be inserted into the table normally. At this time, the table "Business Identifier" can have multiple records at the same time and in a valid state, which can achieve the effect of preventing duplicate business requests.

[0103] Figure 3 This is a schematic diagram illustrating an application scenario of a business processing method provided according to an embodiment of this application. The business processing method of this embodiment can be applied to scenarios where data is inserted into a table. For example... Figure 3 As shown, firstly, a table and a composite unique index are created, resulting in the following table fields: auto-incrementing ID (i.e., auto-incrementing identifier), business identifier, anti-duplicate value, business data, and status (0: valid; 1: deleted). A composite unique index is created between the business identifier and the anti-duplicate value fields. The value rule for this field is: bizUniqueValue_serial number. The following describes the business processing method of this embodiment through several requests for a single piece of business data, demonstrating how anti-duplicate measures are implemented using the table and its composite unique index. The table's format fields include: auto-incrementing identifier, business unique identifier, anti-duplicate value, business data, and status (0: valid; 1: deleted).

[0104] For example, after creating the table and its composite unique index, the following table data is requested: Business ID: 00001; Anti-duplicate value: bizUniqueValue; Business data; Status: 0. During the first request, the execution entity creates the table based on data 00001. The request content can be: Assembled data; Business ID 00001; Anti-duplicate value: bizUniqueValue; Business data; Status: 0. When performing the insert operation, it is detected that the composite unique index 00001bizUniqueValue does not exist in the table. Therefore, the insert operation is performed normally, and the table data after the first request is:

[0105]

[0106] Because the value of the combined unique index "00001" + "bizUniqueValue" is unique, it can be inserted into the table normally.

[0107] For example, after creating the table and its composite unique index, the following table data is requested: Business ID: 00001; Anti-duplicate value: bizUniqueValue; Business data; Status: 0. During the second request, the execution entity concurrently generates a second request (00001) to create the table. The request content can be: Assembled data; Business ID 00001; Anti-duplicate value: bizUniqueValue; Business data; Status: 0. When performing an insert operation, if the composite unique index 00001bizUniqueValue already exists, a uniqueness constraint exception is thrown. Therefore, the table data after the second request is:

[0108]

[0109] Because the combined index value of "00001" + "bizUniqueValue" is not unique, a uniqueness constraint exception will occur, and the insertion will fail. If the current valid data undergoes a status change while processing other processes, the existing data will be modified: the status will be updated to 1, and the anti-duplicate value will be the original value + the auto-incrementing ID value.

[0110] For example, after creating the table and the composite unique index, before this (the third) request, the anti-duplicate value and status of the current data have been changed in the process. The data to be inserted is: Business ID: 00001; Anti-duplicate value: bizUniqueValue; Business data; Status: 0. During the third request, the executing entity concurrently generates a third request to create the data. The request content can be: Assembled data; Business ID 00001; Anti-duplicate value: bizUniqueValue; Business data; Status: 0. When performing the table insertion operation, it is detected that the composite unique index 00001bizUniqueValue does not exist in the table, so a normal table insertion operation is performed. After the third request, the table data is as follows:

[0111]

[0112] In this context, status 0 indicates that the application is valid, while status 1 indicates that it has been deleted.

[0113] Because the composite index “00001” + “bizUniqueValue” is unique at this time, it can be inserted into the table normally. At this time, the table “Business Identifier” can have multiple records at the same time and in a valid state, which can achieve the effect of preventing duplicate business requests.

[0114] Since the business scenario requires that only one valid piece of business data exist at a time, a composite unique index is created on the "Business Identifier" and "Anti-Duplicate Value" fields in the table. A fixed "Anti-Duplicate Value" is designed for insertion operations in the business process. Each insertion automatically verifies uniqueness based on the database table; if it is not unique, a uniqueness constraint violation exception is thrown. When the business needs to record this valid business data, the "Anti-Duplicate Value" can be updated to the "Anti-Duplicate Value" plus the auto-incrementing identifier of the table record, and the status can be changed to "Deleted." Then, when this business data is inserted again, it will not violate the uniqueness constraint and can be successfully inserted. By designing a table-level composite unique index using the "Business Identifier" and the business-independent "Anti-Duplicate Value," and appending the business auto-incrementing identifier to the "Anti-Duplicate Value" when needed, the problem of not being able to create a table-level unique index with only a business identifier is solved, effectively avoiding the transfer of business process risks to the database.

[0115] Figure 4 This is a schematic diagram of the main units of a service processing apparatus according to an embodiment of this application. Figure 4 As shown, the service processing device 400 includes a receiving unit 401, an index generation unit 402, a verification unit 403, an update unit 404, and an execution unit 405.

[0116] The receiving unit 401 is configured to receive service processing requests and obtain the corresponding data to be inserted, service identifier, and anti-duplicate value.

[0117] The index generation unit 402 is configured to generate a combined unique index based on the business identifier and the anti-duplicate value.

[0118] Verification unit 403 is configured to perform a uniqueness check based on the composite unique index, and in response to a check failure, retrieve the corresponding existing data based on the composite unique index.

[0119] Update unit 404 is configured to obtain the auto-incrementing identifier corresponding to the existing data and update the existing data based on the auto-incrementing identifier and the anti-duplicate value.

[0120] Execution unit 405 is configured to perform the insertion process of the data to be inserted based on the updated existing data.

[0121] In some embodiments, the verification unit 403 is further configured to: compare the composite unique index with each index in the index pool; if there is an index in the index pool that is the same as the composite unique index, the verification fails; otherwise, the verification succeeds.

[0122] In some embodiments, the update unit 404 is further configured to: assemble the auto-incrementing identifier and the anti-duplicate value to generate assembled data; update the anti-duplicate value corresponding to the existing data based on the assembled data; and update the status corresponding to the existing data from the valid status to the deleted status.

[0123] In some embodiments, the business processing apparatus further includes Figure 4 The data insertion unit (not shown) is configured to: in response to successful verification, determine the target insertion position based on the service identifier; and insert the data to be inserted into the target insertion position.

[0124] In some embodiments, the execution unit 405 is further configured to: obtain the location of the updated existing data; determine the target insertion location based on the location; and insert the data to be inserted into the target insertion location.

[0125] In some embodiments, the business processing apparatus further includes Figure 4 The information generation unit, not shown, is configured to generate and output uniqueness constraint exception information.

[0126] In some embodiments, the execution unit 405 is further configured to: determine the auto-increment identifier corresponding to the data to be inserted based on the auto-increment identifier corresponding to the updated existing data; and insert the data to be inserted into the position corresponding to the auto-increment identifier corresponding to the data to be inserted.

[0127] It should be noted that the business processing method and business processing device in this application are related in terms of specific implementation content, so repeated content will not be described again.

[0128] Figure 5An exemplary system architecture 500 is shown that can be applied to the business processing method or business processing apparatus of the embodiments of this application.

[0129] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, and 503, a network 504, and a server 505. Network 504 serves as the medium for providing communication links between terminal devices 501, 502, and 503 and server 505. Network 504 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0130] Users can use terminal devices 501, 502, and 503 to interact with server 505 via network 504 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 501, 502, and 503, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0131] Terminal devices 501, 502, and 503 can be various electronic devices with business processing screens and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0132] Server 505 can be a server providing various services, such as a backend management server supporting business processing requests submitted by users using terminal devices 501, 502, and 503 (for example only). The backend management server can receive business processing requests, obtain the corresponding data to be inserted, business identifier, and anti-duplicate value; generate a composite unique index based on the business identifier and anti-duplicate value; perform uniqueness verification based on the composite unique index; in response to verification failure, retrieve the corresponding existing data based on the composite unique index; obtain the auto-incrementing identifier corresponding to the existing data, update the existing data based on the auto-incrementing identifier and anti-duplicate value; and execute the insertion process of the data to be inserted based on the updated existing data. By creating a composite unique index and performing data verification based on it to perform data insertion, the accuracy of business processing can be improved, effectively avoiding unnecessary losses caused by the transfer of business process risks.

[0133] It should be noted that the business processing method provided in this application embodiment is generally executed by server 505, and correspondingly, the business processing device is generally set in server 505.

[0134] It should be understood that Figure 5 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0135] The following is for reference. Figure 6It shows a schematic diagram of the structure of a computer system 600 suitable for implementing a terminal device according to the embodiments of this application. Figure 6 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0136] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the computer system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0137] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0138] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs the functions defined above in the system of this application.

[0139] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. Computer-readable storage media can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0140] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0141] The units described in the embodiments of this application can be implemented in software or hardware. The described units can also be located in a processor; for example, a processor can be described as including a receiving unit, an index generation unit, a verification unit, an update unit, and an execution unit. The names of these units do not necessarily limit the specific unit itself.

[0142] In another aspect, this application also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to receive a service processing request, obtain the corresponding data to be inserted, a service identifier, and an anti-duplicate value; generate a combined unique index based on the service identifier and the anti-duplicate value; perform a uniqueness check based on the combined unique index; in response to a check failure, obtain the corresponding existing data based on the combined unique index; obtain an auto-incrementing identifier corresponding to the existing data; update the existing data based on the auto-incrementing identifier and the anti-duplicate value; and execute the insertion process of the data to be inserted based on the updated existing data.

[0143] According to the technical solution of the embodiments of this application, by creating a composite unique index and performing data verification based on the composite unique index to perform data insertion, the accuracy of business processing can be improved and unnecessary losses caused by the transfer of business process risks can be effectively avoided.

[0144] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A business processing method, characterized in that, include: Receive business processing requests and obtain the corresponding data to be inserted, business identifier, and anti-duplicate value; A joint unique index is generated based on the business identifier and the anti-duplicate value; Perform a uniqueness check based on the composite unique index, and in response to a check failure, retrieve the corresponding existing data based on the composite unique index; Obtain the auto-incrementing identifier corresponding to the existing data, and update the existing data according to the auto-incrementing identifier and the anti-duplicate value; The step of updating the existing data according to the auto-incrementing identifier and the anti-duplicate value includes: assembling the auto-incrementing identifier and the anti-duplicate value to generate assembled data; updating the anti-duplicate value corresponding to the existing data based on the assembled data; and updating the status of the existing data from a valid status to a deleted status. The insertion process for the data to be inserted is performed based on the updated existing data.

2. The method according to claim 1, characterized in that, The step of performing a uniqueness check based on the composite unique index includes: The composite unique index is compared with each index in the index pool. If there is an index in the index pool that is the same as the composite unique index, the verification fails; otherwise, the verification succeeds.

3. The method according to claim 1, characterized in that, After performing a uniqueness check based on the composite unique index, the method further includes: Upon successful verification, the target insertion position is determined based on the service identifier; Insert the data to be inserted into the target insertion position.

4. The method according to claim 1, characterized in that, The process of inserting the data to be inserted based on the updated existing data includes: Get the location of the updated existing data; Based on the stated location, determine the target insertion position; Insert the data to be inserted into the target insertion position.

5. The method according to claim 1, characterized in that, Following the response to the verification failure, the method further includes: Generate and output unique constraint exception information.

6. The method according to claim 1, characterized in that, The process of inserting the data to be inserted based on the updated existing data includes: The auto-incrementing identifier corresponding to the data to be inserted is determined based on the auto-incrementing identifier corresponding to the updated existing data. Insert the data to be inserted into the position corresponding to the auto-incrementing identifier of the data to be inserted.

7. A business processing device, characterized in that, include: The receiving unit is configured to receive service processing requests and obtain the corresponding data to be inserted, service identifier, and anti-duplicate value. The index generation unit is configured to generate a combined unique index based on the business identifier and the anti-duplicate value; The verification unit is configured to perform a uniqueness check based on the composite unique index, and in response to a verification failure, retrieve the corresponding existing data based on the composite unique index. The update unit is configured to obtain the auto-incrementing identifier corresponding to the existing data, and update the existing data according to the auto-incrementing identifier and the anti-duplicate value; The update unit is further configured to: assemble the auto-incrementing identifier and the anti-duplicate value to generate assembled data; and update the anti-duplicate value corresponding to the existing data based on the assembled data. Update the status of the existing data from valid to deleted. The execution unit is configured to perform an insertion process on the data to be inserted based on the updated existing data.

8. The apparatus according to claim 7, characterized in that, The verification unit is further configured to: The composite unique index is compared with each index in the index pool. If there is an index in the index pool that is the same as the composite unique index, the verification fails; otherwise, the verification succeeds.

9. A business processing electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.

10. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-6.