Database character string comparison method and device, electronic equipment and storage medium

By converting database strings into preset data base values ​​for comparison, the problem of high computing resources consumption in big data storage is solved, and a more efficient string comparison is achieved.

CN119474476APending Publication Date: 2025-02-18PING AN BANK CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411496150.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

Traditional database string comparison methods consume a lot of computing resources and their performance needs to be improved, especially when dealing with big data storage.

Method used

By parsing the received string comparison request, obtaining the string to be compared, and converting it into preset data-based values ​​for comparison, reducing the consumption and occupation of system computing resources and improving the efficiency of database string comparison .

Benefits of technology

This method not only reduces the consumption and occupation of system computing resources, but also improves the efficiency of database string comparison, and is suitable for handling big data storage scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474476A_ABST
    Figure CN119474476A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computers, and discloses a database character string comparison method and device, electronic equipment and a storage medium. The method comprises the following steps: analyzing a received character string comparison request to obtain a first character string to be compared; acquiring a corresponding second character string from a target database according to the character string comparison request; converting the first character string into a first numerical value corresponding to a preset data system, and converting the second character string into a second numerical value corresponding to the preset data system; and comparing whether the first numerical value and the second numerical value are the same or not, and setting a comparison result as a return result of the character string comparison request, so that consumption and occupation of system computing resources are reduced, and the efficiency of database character string comparison is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a database string comparison method, device, electronic device and storage medium. Background Art

[0002] In the financial technology system, a database is generally used to maintain the corresponding customer group information data, and the salesperson can add, delete, modify and query the customer group information data in the database. With the continuous growth of customer group information data, big data technology is generally used to maintain the customer group information data, such as MongoDB database. The financial business system receives the data request initiated by the salesperson, and then compares the received interface data with the obtained database data. If the comparison result is that the data is the same, the business operation corresponding to the data request is executed, such as modifying the data. For example, the specific comparison method can be to first convert the interface data and MongoDB data corresponding to the data request into a Json string, then convert them into a char array, and finally traverse and compare the char arrays one by one to see if they are the same. Although the aforementioned traditional database string comparison method is feasible, it is an operation that consumes a lot of CPU computing resources for big data storage with a data volume of hundreds of millions or even billions, and the computing performance of string comparison still needs to be improved. Summary of the invention

[0003] The main technical problem solved by the implementation methods of the present application is that traditional database string comparison consumes a lot of computing resources and the performance of the string comparison process needs to be improved.

[0004] To solve the above technical problems, the first technical solution adopted in the implementation mode of the present application is: to provide a database string comparison method, including: parsing a received string comparison request to obtain a first string to be compared; according to the string comparison request, obtaining a corresponding second string from a target database; converting the first string into a first numerical value corresponding to a preset data system, and converting the second string into a second numerical value of the preset data system; comparing whether the first numerical value and the second numerical value are the same, and setting the comparison result as the return result of the string comparison request.

[0005] Optionally, the step of converting the first character string into a first numerical value corresponding to a preset data system includes: initializing a first initial value and a second initial value, wherein the first initial value is not equal to the second initial value; obtaining each target character in the first character string in turn, and converting the target character into a target character code value encoded in a preset character set; accumulating the target character code value and the first initial value to obtain a first sum value; accumulating the target character code value, the second initial value and the first sum value to obtain a second sum value; converting the first sum value and the second sum value into a third sum value and a fourth sum value of the preset data system, respectively; and linking the third sum value and the fourth sum value to obtain the first numerical value.

[0006] Optionally, the step of converting the second character string into a second numerical value in the preset data system includes: replacing the first character string with the second character string; re-executing the steps of setting the first initial value to a third numerical value, the second initial value to a fourth numerical value and linking the third sum value and the fourth sum value to obtain the second numerical value.

[0007] Optionally, the preset character set encoding is ASCII encoding, and the step of converting the target character to the target character encoding value of the preset character set encoding is: converting the target character to a corresponding ASCII encoding value, wherein the ASCII encoding value is in decimal.

[0008] Optionally, the preset data system is hexadecimal, and the steps of respectively converting the first sum value and the second sum value into a third sum value and a fourth sum value of the preset data system include: respectively converting the first sum value and the second sum value into the third sum value and the fourth sum value of hexadecimal.

[0009] Optionally, the step of linking the third sum and the fourth sum to obtain the first numerical value includes: setting the third sum to the high word of the first numerical value, and setting the fourth sum to the low word of the first numerical value; or setting the third sum to the low word of the first numerical value, and setting the fourth sum to the high word of the first numerical value.

[0010] Optionally, before the step of parsing the received string comparison request, the step further includes: parsing the received string storage request to obtain a second string to be stored; replacing the first string with the second string, and executing the step of initializing the first initial value and the second initial value to link the third sum value and the fourth sum value to obtain a second character value corresponding to the second string; storing the second string and the second character value in the target database; and when a comparison request for the second string is received, obtaining the second character value from the target database.

[0011] To solve the above technical problems, the second technical solution adopted in the implementation mode of the present application is: to provide a database string comparison device, including: a comparison request parsing module, used to parse the received string comparison request to obtain a first string to be compared; a character data acquisition module, used to obtain the corresponding second string from the target database according to the string comparison request; a data conversion processing module, used to convert the first string into a first numerical value corresponding to a preset data system, and convert the second string into a second numerical value of the preset data system; a data comparison processing module, used to compare whether the first numerical value and the second numerical value are the same, and set the comparison result as the return result of the string comparison request.

[0012] To solve the above technical problems, the third technical solution adopted in the implementation of the present application is: to provide an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the database string comparison method as described above.

[0013] In order to solve the above technical problems, the fourth technical solution adopted in the implementation mode of the present application is: providing a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by an electronic device, the electronic device executes the database string comparison method as described above.

[0014] Different from the related art, the present application obtains a first string to be compared by parsing a received string comparison request; obtains a corresponding second string from a target database according to the string comparison request; converts the first string into a first numerical value corresponding to a preset data system, and converts the second string into a second numerical value of the preset data system; compares whether the first numerical value and the second numerical value are the same, and sets the comparison result as the return result of the string comparison request, which not only reduces the consumption and occupation of system computing resources, but also improves the efficiency of database string comparison. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] One or more embodiments are exemplarily described by corresponding drawings, which do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and the figures in the drawings do not constitute proportional limitations unless otherwise stated.

[0016] Figure 1It is a schematic diagram of the operating environment of the database string comparison method provided in the embodiment of the present application.

[0017] Figure 2 It is a schematic diagram of the execution flow of the database string comparison method provided in an embodiment of the present application.

[0018] Figure 3 It is a schematic diagram of the execution flow of string conversion in the database string comparison method provided in an embodiment of the present application.

[0019] Figure 4 It is a schematic diagram of the execution flow of pre-storing strings in the database string comparison method provided in an embodiment of the present application.

[0020] Figure 5 Schematic diagram of the system structure of the database string comparison device provided in the embodiment of the present application.

[0021] Figure 6 It is a schematic diagram of the hardware structure of an electronic device for executing a database string comparison method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0023] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a different order than the module division in the device schematic diagram or the order in the flow chart.

[0024] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used in this specification includes any and all combinations of one or more of the related listed items.

[0025] To facilitate understanding of this embodiment, a database string comparison method disclosed in the embodiment of the present application is first described in detail. Figure 1 , Figure 1 is a schematic diagram of the operating environment of the database string comparison method provided in the embodiment of the present application, such as Figure 1As shown, the execution subject of the database string comparison method provided in the embodiment of the present application is generally an electronic device with certain computing capabilities, such as a computer device. In some possible implementations, the database string comparison method can be implemented by a processor calling a computer-readable instruction stored in a memory. Figure 1 The computer device in the term can be a server. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. It can be understood that Figure 1 The number of computer devices in the figure is only for reference and can be expanded to any number according to actual needs.

[0026] Please continue reading Figure 2 , Figure 2 is a schematic diagram of the execution flow of the database string comparison method provided in the embodiment of the present application, such as Figure 2 As shown, the following steps are included:

[0027] S1. Parse the received string comparison request to obtain a first string to be compared.

[0028] Among them, the above-mentioned string comparison request is generally initiated by the client through the access interface provided by the server. The client first generates a corresponding string comparison request according to the business needs and the string to be compared, and then sends the generated string comparison request to the server. For example, in the insurance sales system, the salesperson uses the customer's name on the client to inquire whether the customer has purchased a certain insurance product. After receiving the customer's name, the server needs to use the name to compare one by one in the list of people who have purchased the insurance product stored in the database.

[0029] S2. According to the string comparison request, obtain a corresponding second string from the target database.

[0030] The target database may be a non-relational database (NoSQL), such as a document database (such as MongoDB), a key-value database (such as Redis), a column family database (such as Cassandra), a graph database (such as Neo4j), etc. In the traditional comparison method, the interface string data and the database string data (such as the string in MongoDB) are uniformly converted into Json strings, and then converted into char arrays, and finally the char data are traversed one by one to compare whether they are the same. However, when dealing with a scenario with more than one billion string data, performance issues need to be considered. From the above program operation, it can be seen that it is an operation that consumes a lot of CPU resources.

[0031] S3. Convert the first character string into a first numerical value corresponding to a preset data system, and convert the second character string into a second numerical value corresponding to the preset data system.

[0032] Please continue reading Figure 3 , Figure 3 is a schematic diagram of the execution flow of string conversion in the database string comparison method provided in the embodiment of the present application, such as Figure 3 As shown, it may specifically include steps S31 to S36.

[0033] S31. Initialize a first initial value and a second initial value, wherein the first initial value is not equal to the second initial value.

[0034] For example, the first initial value X is set to 1, and the second initial value Y is set to 0;

[0035] S32, sequentially obtain each target character in the first character string, and convert the target character into a target character code value encoded in a preset character set.

[0036] As an optional implementation, the above-mentioned preset character set encoding is ASCII encoding, and the step of converting the target character to the target character encoding value of the preset character set encoding in step S32 can be: converting the target character to the corresponding ASCII encoding value, wherein the ASCII encoding value is decimal.

[0037] For example, taking the character string "CUST123" as an example, after converting to ASCII code values, the values ​​​​can be obtained in sequence: 67, 85, 83, 84, 1, 2, 3 (C corresponds to 67, U corresponds to 85, and so on).

[0038] S33, accumulating the target character code value and the first initial value to obtain a first sum value.

[0039] For example, continuing to accumulate according to the above example of the string “CUST123”, the first sum value can be 326.

[0040] S34, accumulating the target character code value, the second initial value and the second sum value to obtain a second sum value.

[0041] For example, continuing to accumulate according to the above example of the string "CUST123", the second sum value can be 1756.

[0042] S35, converting the first sum value and the second sum value into a third sum value and a fourth sum value of a preset data system respectively.

[0043] As an optional implementation, if the preset data system is hexadecimal, then step S35 may specifically include: converting the first sum value and the second sum value into the third sum value and the fourth sum value in hexadecimal respectively.

[0044] For example, continuing with the example of the above character string "CUST123", the first sum value 326 is converted to the third sum value 0x146, and the second sum value 1756 is converted to 0x06dc.

[0045] S36. Link the third sum and the fourth sum to obtain the first value.

[0046] As an optional implementation, the above step S36 can be specifically as follows: setting the third sum value to the high-order word of the first numerical value, and setting the fourth sum value to the low-order word of the first numerical value; or, setting the third sum value to the low-order word of the first numerical value, and setting the fourth sum value to the high-order word of the first numerical value.

[0047] For example, continuing with the example of the above character string "CUST123", the third sum value is set as the high-order word, and the fourth sum value is set as the low-order word, then the first numerical value 0x06dc016 can be obtained.

[0048] As an optional implementation, the conversion method of the second string is the same as the conversion method of the first string, that is, the second string can be used to replace the first string, and then the steps of setting the first initial value to the third value, the second initial value to the fourth value to linking the third sum value and the fourth sum value are re-executed to obtain the second value.

[0049] As a preferred implementation, please continue to refer to Figure 4 , Figure 4 is a schematic diagram of the execution flow of pre-storing strings in the database string comparison method provided in an embodiment of the present application, such as Figure 4 As shown, the process may include steps S11 to S14.

[0050] S11. Parse the received string storage request to obtain a second string to be stored.

[0051] Among them, similar to the aforementioned string comparison request, the client sends a string storage request to the server. After the server verifies, it stores the corresponding string in the import database. For example, the salesperson of the insurance sales system adds a customer purchase record to the sales system on the client, and the customer's name will be sent to the server of the insurance sales system. After the server performs the corresponding data verification, it will save the customer name to the corresponding deployed database.

[0052] S12, replace the first string with the second string, and perform the steps of initializing the first initial value and the second initial value to linking the third sum value and the fourth sum value, to obtain the second character value corresponding to the second string. That is, using the same string conversion rule as above, it can be ensured that when comparing, the character values ​​corresponding to the same string are the same, and the character values ​​corresponding to different strings are different.

[0053] S13, storing the second character string and the second character value in the target database.

[0054] S14, when receiving a comparison request for the second character string, obtaining a second character value from the target database. When performing character string comparison, only the character string in the comparison request can be converted into a corresponding character value, thereby reducing the step of converting the character string in the database into a character value, further reducing the consumption and occupation of system computing resources during character string comparison, and improving the efficiency of database character string comparison.

[0055] S4. Compare the first value and the second value to see whether they are the same, and set the comparison result as the return result of the string comparison request.

[0056] As another preferred implementation, when the client initiates a string comparison request, the client can first convert the string to be compared into a corresponding character value, and the process of converting the above-mentioned first string into a corresponding first value is processed on the client. Such an operation can further reduce the conversion processing of string data on the server side, and the string value comparison can be directly performed on the server side to obtain the comparison result. In addition to reducing the consumption and occupation of system computing resources, the efficiency of database string comparison is improved, and the security during data transmission can be improved. What is transmitted during the transmission process is the string value rather than the specific string.

[0057] The database string comparison method provided in the embodiment of the present application obtains a first string to be compared by parsing a received string comparison request; obtains a corresponding second string from a target database according to the string comparison request; converts the first string into a first numerical value corresponding to a preset data system, and converts the second string into a second numerical value of the preset data system; compares whether the first numerical value and the second numerical value are the same, and sets the comparison result as the return result of the string comparison request, which not only reduces the consumption and occupation of system computing resources, but also improves the efficiency of database string comparison.

[0058] Please continue reading Figure 5 , Figure 5 is a schematic diagram of the system structure of the database string comparison device provided in the embodiment of the present application, such as Figure 5 As shown, the device 50 includes: a comparison request parsing module 51, a character data acquisition module 52, a data conversion processing module 53 and a data comparison processing module 54.

[0059] The comparison request parsing module 51 is used to parse the received string comparison request to obtain a first string to be compared;

[0060] The character data acquisition module 52 is used to acquire the corresponding second character string from the target database according to the character string comparison request;

[0061] The data conversion processing module 53 is used to convert the first character string into a first value corresponding to a preset data system, and convert the second character string into a second value of the preset data system;

[0062] The data comparison processing module 54 is used to compare whether the first value and the second value are the same, and set the comparison result as the return result of the string comparison request.

[0063] As an optional implementation, the data conversion processing module 53 is also used to initialize a first initial value and a second initial value, wherein the first initial value is not equal to the second initial value; obtain each target character in the first character string in turn, and convert the target character into a target character code value encoded in a preset character set; accumulate the target character code value and the first initial value to obtain a first sum value; accumulate the target character code value, the second initial value and the first sum value to obtain a second sum value; convert the first sum value and the second sum value into a third sum value and a fourth sum value of the preset data system, respectively; link the third sum value and the fourth sum value to obtain the first value.

[0064] As an optional implementation, the data conversion processing module 53 is also used to replace the first string with the second string; re-execute the steps of setting the first initial value to the third numerical value, the second initial value to the fourth numerical value to linking the third sum value and the fourth sum value to obtain the second numerical value.

[0065] As an optional implementation, the preset character set encoding in the data conversion processing module 53 is ASCII encoding, and the data conversion processing module 53 is also used to convert the target character into a corresponding ASCII encoding value, wherein the ASCII encoding value is decimal.

[0066] As an optional implementation, the preset data system in the data conversion processing module 53 is hexadecimal, and the data conversion processing module 53 is also used to convert the first sum value and the second sum value into the third sum value and the fourth sum value in hexadecimal respectively.

[0067] As an optional implementation, the data conversion processing module 53 is also used to set the third sum value to the high-order word of the first numerical value, and set the fourth sum value to the low-order word of the first numerical value; or, set the third sum value to the low-order word of the first numerical value, and set the fourth sum value to the high-order word of the first numerical value.

[0068] As an optional implementation, the database string comparison device also includes a character storage processing module, which is used to parse the received string storage request to obtain a second string to be stored; use the second string to replace the first string, and execute the steps of initializing the first initial value and the second initial value to link the third sum value and the fourth sum value to obtain a second character value corresponding to the second string; store the second string and the second character value in the target database; when a comparison request for the second string is received, obtain the second character value from the target database.

[0069] It should be noted that the above-mentioned database string comparison device can execute the database string comparison method provided in the embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in the embodiment of the database string comparison device, please refer to the database string comparison method provided in the embodiment of the present application.

[0070] Please continue reading Figure 6 , Figure 6 is a schematic diagram of the hardware structure of an electronic device 600 for executing a database string comparison method provided in an embodiment of the present application, such as Figure 6 As shown, the electronic device 600 includes:

[0071] One or more processors 610 and memory 620, Figure 6 A processor 610 is taken as an example.

[0072] The processor 610 and the memory 620 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0073] The memory 620, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the database string comparison method in the embodiment of the present application. The processor 610 executes various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory 620, that is, the database string comparison method in the above method embodiment is implemented.

[0074] The memory 620 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function; the data storage area may store data created according to the use of the database string comparison device, etc. In addition, the memory 620 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 620 may optionally include a memory remotely arranged relative to the processor 610, and these remote memories may be connected to the database string comparison device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0075] The one or more modules are stored in the memory 620, and when executed by the one or more processors 610, execute the database string comparison method in any of the above method embodiments, for example, execute the above described Figure 2 Step S1 to step S2 of the method, Figure 3 Steps S31 to S36 of the method, Figure 4 Steps S11 to S14 of the method are implemented Figure 5 The functions of modules 51-54 in.

[0076] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.

[0077] The embodiment of the present application provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by one or more processors, such as Figure 6 A processor 610 in the embodiment may enable the one or more processors to execute the database string comparison method in any of the above method embodiments, for example, to execute the above described Figure 2 Step S1 to step S2 of the method, Figure 3 Steps S31 to S36 of the method, Figure 4 Steps S11 to S14 of the method are implemented Figure 5 The functions of modules 51-54 in.

[0078] The present application embodiment provides a computer program product, the computer program product includes a computer program stored on a non-volatile computer-readable storage medium, the computer program includes program instructions, when the program instructions are executed by the electronic device, the electronic device is enabled to perform the database string comparison method in any of the above method embodiments, for example, to perform the above described Figure 2 Step S1 to step S2 of the method, Figure 3 Steps S31 to S36 of the method, Figure 4 Steps S11 to S14 of the method are implemented Figure 5 The functions of modules 51-54 in.

[0079] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units 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 achieve the purpose of the solution of this embodiment.

[0080] Through the description of the above implementation methods, ordinary technicians in this field can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Ordinary technicians in this field can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as described above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A database string comparison method, characterized in that: include: Parsing the received string comparison request to obtain a first string to be compared; According to the string comparison request, obtaining a corresponding second string from a target database; Convert the first character string into a first value corresponding to a preset data system, and convert the second character string into a second value of the preset data system; Compare the first value and the second value to see whether they are the same, and set the comparison result as the return result of the string comparison request.

2. The database string comparison method according to claim 1, characterized in that: The step of converting the first character string into a first numerical value corresponding to a preset data system includes: Initializing a first initial value and a second initial value, wherein the first initial value is not equal to the second initial value; Obtaining each target character in the first character string in turn, and converting the target character into a target character encoding value encoded in a preset character set; Accumulate the target character code value and the first initial value to obtain a first sum value; Accumulate the target character code value, the second initial value and the first sum value to obtain a second sum value; Convert the first sum value and the second sum value into a third sum value and a fourth sum value of the preset data system respectively; The third sum value and the fourth sum value are linked to obtain the first value.

3. The database string comparison method according to claim 2, characterized in that: The step of converting the second character string into a second numerical value in the preset data system includes: Replace the first string with the second string; Re-execute the steps of setting the first initial value to the third value, the second initial value to the fourth value and linking the third sum value and the fourth sum value to obtain the second value.

4. The database string comparison method according to claim 2, characterized in that: The preset character set encoding is ASCII encoding, and the step of converting the target character to the target character encoding value of the preset character set encoding is: Convert the target character to the corresponding ASCII code value, where the ASCII code value is in decimal.

5. The database string comparison method according to claim 2, characterized in that: The preset data system is hexadecimal, and the steps of converting the first sum value and the second sum value into a third sum value and a fourth sum value of the preset data system respectively include: The first sum value and the second sum value are converted into the third sum value and the fourth sum value in hexadecimal respectively.

6. The database character string comparison method according to claim 5, characterized in that: The step of linking the third sum and the fourth sum to obtain the first value comprises: Set the third sum value to the high word of the first value, and set the fourth sum value to the low word of the first value; Alternatively, the third sum is set to the low-order word of the first value, and the fourth sum is set to the high-order word of the first value.

7. The database character string comparison method according to claim 2, characterized in that: Before the step of parsing the received string comparison request, the method further includes: Parsing the received string storage request to obtain a second string to be stored; Use the second character string to replace the first character string, and perform the steps of initializing the first initial value and the second initial value to linking the third sum value and the fourth sum value to obtain a second character value corresponding to the second character string; storing the second character string and the second character value in the target database; When a comparison request for the second character string is received, the second character value is obtained from the target database.

8. A database string comparison device, characterized in that: include: A comparison request parsing module, used for parsing a received string comparison request to obtain a first string to be compared; A character data acquisition module, used for acquiring a corresponding second character string from a target database according to the character string comparison request; A data conversion processing module, used for converting the first character string into a first value corresponding to a preset data system, and converting the second character string into a second value of the preset data system; The data comparison processing module is used to compare whether the first value and the second value are the same, and set the comparison result as the return result of the string comparison request.

9. An electronic device, characterized in that: include: at least one processor; as well as, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the database string comparison method according to any one of claims 1 to 7.

10. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed by an electronic device, the electronic device executes the database string comparison method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Edge construction method and device of graph database

    CN119691234A

  • Edge Construction Method and Device for Graph Database

    CN119691234B