Transaction processing method and apparatus, electronic device, and computer-readable storage medium
By using char type strings to store permission data in the core system of commercial banks, the problem of low efficiency in accessing and storing transaction permissions has been solved, resulting in faster permission detection and higher system response speed.
Patent Information
- Application Number
- CN202411492568.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-10-24
AI Technical Summary
In traditional commercial bank core systems, transaction access efficiency is low, resulting in slow teller response times and poor user experience. Furthermore, CLOB type storage occupies a large amount of space and is inconvenient to maintain.
Permission data is stored as a char string of the target storage type. The first string is obtained through a single I/O operation and processed in memory to determine the permission detection result, thereby reducing the number of I/O operations and improving the efficiency of reading transaction permissions and the speed of permission detection.
By reducing I/O operations and memory processing, the efficiency of reading transaction permissions and the speed of permission detection are improved, thereby enhancing system response speed and user experience.
Smart Images

Figure CN119444228B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of big data technology, and more specifically to a transaction processing method, apparatus, electronic device, computer-readable storage medium, and program product. Background Technology
[0002] In traditional commercial bank core systems, tellers use transaction codes at the counter to access services for customers. Due to the complexity of banking operations, there are typically nearly a thousand transaction codes for tellers to choose from, and tellers with different roles have different transaction permissions. Therefore, a faster method for accessing and managing transaction permissions is needed. Summary of the Invention
[0003] In view of the above problems, this disclosure provides a transaction processing method, apparatus, electronic device and computer-readable storage medium.
[0004] According to a first aspect of this disclosure, a transaction processing method is provided, comprising: responding to receiving a request sent by a user, parsing the user's user role and a target transaction to be acquired from the request; determining a first string of a target storage type matching the user role from a permission data table, wherein the first string includes a plurality of first characters, each first character representing transaction permissions for a plurality of transactions, and the target storage type including a string type with a character length limit; determining a single first target character from the first string according to the target transaction, wherein the first target character represents transaction permissions for the target transaction and at least one other transaction; converting the single first target character into a second string if it is determined that the first target character is not a first preset character, wherein the second string includes a plurality of second characters, each second character representing transaction permissions for a single transaction; determining a permission detection result for the target transaction according to the second string; and acquiring the target transaction from a database if the permission detection result is passed.
[0005] According to an embodiment of this disclosure, the method further includes: if it is determined that the first target character is a first preset character, determining that the permission detection result of the target transaction is not passed, and returning an error message; wherein, the first preset character is a character that indicates that the transaction permissions of multiple transactions corresponding to the first target character are all not passed.
[0006] According to an embodiment of this disclosure, determining a single first target character from a first string based on a target transaction includes: obtaining a transaction permission location table; determining the permission location of the target transaction from the transaction permission location table based on the transaction code of the target transaction; calculating a first position in the first string corresponding to the target transaction based on the permission location according to the conversion relationship between the second string and the first string; and determining the first character located at the first position in the first string as the first target character.
[0007] According to an embodiment of this disclosure, determining the permission detection result of a target transaction based on a second string includes: performing a modulo operation on the permission position based on the conversion relationship between the second string and the first string to obtain a remainder, wherein the remainder represents the second position of the target transaction in the second string; determining a single second character located at the second position in the second string as the second target character corresponding to the target transaction; and determining the permission detection result of the target transaction based on the second target character.
[0008] According to embodiments of this disclosure, determining the permission detection result of a target transaction based on a second target character includes: determining the permission detection result as passed if the second target character is a second preset character; and determining the permission detection result as failed if the second target character is a first preset character.
[0009] According to embodiments of this disclosure, before determining a first string of a target storage type matching a user role from a permission data table, the method further includes: determining a third string matching a user role from a business category permission table based on the user role, wherein the third string includes a plurality of third characters, each third character representing a data access permission for a single business category; obtaining a third target character corresponding to the target business category from the third string based on the target business category to which the target transaction belongs; and obtaining the permission data table if the third target character indicates that the user has the data access permission for the target business category.
[0010] According to an embodiment of this disclosure, when it is determined that the first target character is not the first preset character, converting a single first target character into a second string includes: when it is determined that the first target character is not the first preset character, converting the hexadecimal first target character into a binary second string, the second string including four second characters.
[0011] According to embodiments of this disclosure, the method further includes: in response to receiving a permission data write request, obtaining permission data for a newly added user role based on the newly added user role in the permission data write request; generating a fourth string corresponding to the newly added user role based on the permission data, wherein the fourth string includes a plurality of fourth characters, each fourth character being used to represent the transaction permission of a single transaction; converting the fourth string into a shorter fifth string; validating the fifth string to obtain a verification result; and writing the fifth string into the permission data table if the verification result indicates that the conversion of the fifth string was successful.
[0012] A second aspect of this disclosure provides a transaction processing apparatus, comprising: a parsing module, configured to, in response to receiving an acquisition request sent by a user, parse the user's user role and the target transaction to be acquired from the request; a first determining module, configured to determine, from a permission data table, a first string of a target storage type matching the user role, wherein the first string includes a plurality of first characters, each first character representing the transaction permissions of a plurality of transactions, and the target storage type includes a string type with a character length limit; a second determining module, configured to, based on the target transaction, determine a single first target character from the first string, wherein the first target character represents the transaction permissions of the target transaction and at least one other transaction; a third determining module, configured to, if the first target character is determined not to be a first preset character, convert the single first target character into a second string, wherein the second string includes a plurality of second characters, each second character representing the transaction permissions of a single transaction; a fourth determining module, configured to, based on the second string, determine the permission detection result of the target transaction; and an acquisition module, configured to, if the permission detection result is passed, acquire the target transaction from a database.
[0013] A third aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0014] A fourth aspect of this disclosure also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.
[0015] The fifth aspect of this disclosure also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method.
[0016] According to embodiments of this disclosure, the permission data table can store a first string using a target storage type (char). Therefore, when a user requests permission for a target transaction, there is no need for two I / O operations using the CLOB type storage method; the first string can be obtained directly with a single I / O operation, reducing the number of I / O operations, minimizing system resource consumption, and improving the efficiency of reading transaction permissions. Subsequently, processing the first target string in memory to determine the permission detection result is faster, further improving permission detection speed while enhancing read efficiency. Furthermore, comparing the first target character with a first preset character before converting it to a second string helps save subsequent character conversion operations, further improving permission detection speed. Attached Figure Description
[0017] The above and other objects, features and advantages of this disclosure will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0018] Figure 1 The illustration shows an application scenario where the transaction processing method of this disclosure can be applied;
[0019] Figure 2 A flowchart illustrating a transaction processing method according to an embodiment of the present disclosure is shown schematically;
[0020] Figure 3 A flowchart illustrating a method for determining a first target character according to an embodiment of the present disclosure is shown schematically;
[0021] Figure 4 A schematic diagram illustrating the correspondence between the first string and the second string according to an embodiment of the present disclosure is provided.
[0022] Figure 5 A flowchart illustrating a method for obtaining an access data table according to an embodiment of the present disclosure is shown schematically.
[0023] Figure 6 This diagram schematically illustrates a method for converting a first target character and a second string according to an embodiment of the present disclosure.
[0024] Figure 7 This illustration schematically shows a flowchart of writing data to the permission data table according to an embodiment of the present disclosure;
[0025] Figure 8 A schematic block diagram of a transaction processing apparatus according to an embodiment of the present disclosure is shown; and
[0026] Figure 9 A block diagram of an electronic device suitable for implementing a transaction processing method according to an embodiment of the present disclosure is shown schematically. Detailed Implementation
[0027] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0028] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0029] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0030] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0031] In the embodiments disclosed herein, the collection, updating, analysis, processing, use, transmission, provision, disclosure, and storage of data (e.g., including but not limited to user personal information) comply with relevant laws and regulations, are used for legitimate purposes, and do not violate public order and good morals. In particular, necessary measures have been taken to prevent unauthorized access to user personal information data and to safeguard user personal information security, network security, and national security.
[0032] In the embodiments disclosed herein, user authorization or consent is obtained before acquiring or collecting user personal information.
[0033] It should be noted that in the embodiments of this disclosure, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solutions of this disclosure. However, it does not mean that this disclosure has used or necessarily used such solutions.
[0034] It should be noted that the transaction processing method and apparatus disclosed herein can be used in the financial field for transaction authorization processing, and can also be used in any related field and scenario other than the financial field. The application field of the transaction processing method and apparatus disclosed herein is not limited.
[0035] In implementing the concept of this disclosure, binary strings are generally used in databases to store permission data. Each binary digit represents the permission for a transaction; for example, 1 represents permission and 0 represents no permission. In practical applications, the banking industry involves multiple permissions, resulting in binary strings that are nearly a thousand bits long. However, the maximum length of a database char string type is 255 bits, making it impossible to store all transaction permissions as char strings. Therefore, a CLOB (Character Large Object) type must be used for storage.
[0036] However, using the CLOB method for storage has two drawbacks: firstly, it consumes a large amount of space and is inconvenient to maintain; secondly, its access efficiency is much lower than that of the char type, resulting in slower transaction response and further degrading the user experience. Specifically, accessing CLOB type data involves two I / O operations: one I / O reads the pointer to the storage address of the permission data in the table, and the other I / O reads the specific permission data from the storage address of the CLOB type data based on the pointer in the table.
[0037] Based on this, embodiments of this disclosure provide a transaction processing method, including: responding to receiving a request sent by a user, parsing the user's user role and the target transaction to be acquired from the request; determining a first string of a target storage type matching the user role from a permission data table, wherein the first string includes a plurality of first characters, each first character representing the transaction permissions of a plurality of transactions, and the target storage type includes a string type with a character length limit; determining a single first target character from the first string according to the target transaction, wherein the first target character represents the transaction permissions of the target transaction and at least one other transaction; converting the single first target character into a second string if it is determined that the first target character is not a first preset character, wherein the second string includes a plurality of second characters, each second character representing the transaction permissions of a single transaction; determining the permission detection result of the target transaction according to the second string; and acquiring the target transaction from the database if the permission detection result is passed.
[0038] Figure 1 An exemplary application scenario 100 in which the transaction processing method can be applied according to embodiments of this disclosure is illustrated. It should be noted that... Figure 1 The examples shown are merely examples of application scenarios that can be applied to the embodiments of this disclosure, in order to help those skilled in the art understand the technical content of this disclosure, but do not mean that the embodiments of this disclosure cannot be used in other devices, systems, environments or scenarios.
[0039] like Figure 1As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0040] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, and / or social media platform software, etc. (for example only).
[0041] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0042] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0043] It should be noted that the transaction processing method provided in this embodiment can generally be executed by server 105. Correspondingly, the transaction processing system provided in this embodiment can generally be located in server 105. The transaction processing method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the transaction processing system provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.
[0044] It should be understood that Figure 1 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.
[0045] The following will be based on Figure 1 The described scene, through Figures 2-7 The transaction processing method of the disclosed embodiments will be described in detail.
[0046] Figure 2 A flowchart illustrating a transaction processing method according to an embodiment of this disclosure is shown schematically.
[0047] like Figure 2 As shown, the method includes operations S201 to S206.
[0048] In operation S201, in response to receiving a request sent by the user, the user's user role and the target transaction to be acquired are parsed from the request.
[0049] According to embodiments of this disclosure, a transaction includes specific financial transaction operations, such as deposits, withdrawals, and transfers. The target transaction is the transaction to be acquired.
[0050] According to embodiments of this disclosure, user roles include system-preset user roles, and different user roles should have different permission levels. For example, in a bank, ordinary tellers, supervisor tellers, and bank managers can be set up, with these three user roles having different permission levels. For instance, ordinary tellers have the authority to perform transactions such as deposits and withdrawals, but do not have the authority to make large remittances, which would require the authority of a supervisor teller or bank manager to perform.
[0051] According to embodiments of this disclosure, a request for a target transaction may include the target transaction and the user role of the user initiating the request; it may also include time information, location information, etc.
[0052] For example, for a deposit transaction, the request may include the user role "ordinary teller", the transaction type "deposit", and may also include the time the request was initiated and the bank branch information from which the request was initiated.
[0053] According to embodiments of this disclosure, requests can be parsed to obtain user roles and target transactions.
[0054] In operation S202, determine the first string of the target storage type that matches the user role from the permissions data table.
[0055] According to embodiments of this disclosure, the permission data table stores data in the database's disk. The database system can retrieve a first string from the permission data table through input / output (I / O) operations with the disk.
[0056] The permission data in the permission data table is stored in the target storage type, which is a string type with a character length limit. For example, the target storage type can be char, and the first string can include a first character of 256 characters from 0 to 255. Each first character can represent the transaction permissions for multiple transactions.
[0057] According to embodiments of this disclosure, the permission data table includes permission strings that correspond one-to-one with multiple user roles. Each permission string includes multiple permission characters, and each permission character includes transaction permissions for multiple transactions corresponding to that user role. For a user role parsed from a request, the permission string corresponding to that user role in the permission data table is called the first string, and the permission characters are called the first characters. Each first character is used to represent the transaction permissions for multiple transactions corresponding to that user role.
[0058] In one embodiment, the first string can be a hexadecimal string, and each first character can represent the transaction permissions of four transactions.
[0059] In the embodiments of this disclosure, the permission data table directly stores the permission data itself, i.e., the first string, which the database system can obtain through a single I / O operation with the disk. However, under the CLOB type, the permission data table stores pointers, requiring another I / O operation to obtain the specific transaction permission.
[0060] In operation S203, based on the target transaction, a single first target character is determined from the first string.
[0061] According to an embodiment of this disclosure, after reading the first string from the permission data table on the disk, operations S203 to S205 are performed in memory.
[0062] According to embodiments of this disclosure, each first character in the first string is used to characterize the transaction permissions of multiple transactions. Therefore, a specific first target character can be determined from the first string. The first target character includes the target transaction and the transaction permissions of at least one other transaction.
[0063] For example, for the first hexadecimal string, the first target character can represent the transaction permissions of the target transaction and the transaction permissions of three other transactions.
[0064] In operation S204, if it is determined that the first target character is not the first preset character, the single first target character is converted into the second string.
[0065] In the embodiments of this disclosure, the first preset character can be 0. Although a single first character can represent the transaction permissions of multiple transactions, to simplify the permission detection process, a specific character can be set to represent the multiple transactions when all transactions have no permission. Therefore, for the target transaction, after obtaining the first target character, a simple judgment can be made to determine whether it is necessary to continue converting the first target character into a second string. That is, if it is determined that the first target character is not the first preset character, subsequent character conversion is performed, i.e., converting the single first target character into a second string.
[0066] According to embodiments of this disclosure, the second string includes a plurality of second characters, each second character being used to characterize the transaction permissions of a single transaction.
[0067] In operation S205, the permission check result of the target transaction is determined based on the second string.
[0068] According to embodiments of this disclosure, the permission detection result includes whether the user role has the transaction permission for the target transaction. Generally, the permission detection result is either pass or fail. In embodiments of this disclosure, the permission detection result of the target transaction can be determined based on a certain second character in the second string corresponding to the target transaction. For example, when the second character is 1, the transaction permission for a certain transaction corresponding to the first character is granted, and the permission detection result is pass; when it is 0, the permission is not granted, and the permission detection result is fail.
[0069] In operation S206, if the permission check result is passed, the target transaction is retrieved from the database.
[0070] According to embodiments of this disclosure, as described above, the permission detection result is generally divided into pass and fail. When the permission detection result is pass, the target transaction is retrieved from the database and returned. Returning the target transaction can be understood as allowing the user requesting the target transaction to perform an operation on it. Furthermore, if the user corresponding to the user role successfully executes the transaction after the pass, the transaction result can also be returned. If the transaction is successful, the result of this transaction, the execution time of the transaction, the transaction content, etc., can also be returned, and a transaction log can be generated based on the above information.
[0071] According to embodiments of this disclosure, if the permission check fails, it indicates that the user role that issued the request does not have permission for the target transaction, and a failure result can be returned. Appropriate prompts can also be set, such as returning information indicating that the user does not have permission for this transaction.
[0072] For example, if the request for a user with the role of "ordinary teller" and the target transaction of "deposit" passes the check, the system retrieves the target transaction from the database and executes the target transaction. If the target transaction is successfully executed, the system returns a transaction success message, as well as information about the deposited account and the deposit time.
[0073] According to embodiments of this disclosure, the permission data table can store a first string using a target storage type (char). Therefore, when a user requests permission for a target transaction, there is no need for two I / O operations using the CLOB type storage method; the first string can be obtained directly with a single I / O operation, reducing the number of I / O operations, minimizing system resource consumption, and improving the efficiency of reading transaction permissions. Subsequently, processing the first target string in memory to determine the permission detection result is faster, further improving permission detection speed while enhancing read efficiency. Furthermore, comparing the first target character with a first preset character before converting it to a second string helps save subsequent character conversion operations, further improving permission detection speed.
[0074] According to an embodiment of this disclosure, when it is determined that the first target character is a first preset character, the permission detection result of the target transaction is determined to be unsuccessful, and an error message is returned; wherein, the first preset character is a character that indicates that the transaction permissions of multiple transactions corresponding to the first target character are all unsuccessful.
[0075] According to embodiments of this disclosure, the first target character can be a hexadecimal character. Hexadecimal is a number system using digits 0-9 and the letters A, B, and C, or using digits 0-9 and lowercase a, totaling 16 characters. Here, A or a represents 10, B or b represents 11, and so on, up to F or f representing 15. Binary is a counting method that uses only two values, 0 and 1, to represent numerical values. Due to the mapping relationship between hexadecimal and binary, one hexadecimal character can express the meaning of four binary characters; for example, a hexadecimal 1 corresponds to binary 0001.
[0076] Therefore, for the first target character in hexadecimal, if the first target character is the first preset character "0", it indicates that its corresponding four binary characters are 0000, meaning that the transaction permissions for all four transactions are denied. Thus, if the first target character is determined to be the first preset character, based on the conversion rules between hexadecimal and binary, the permission check result for the target transaction can be directly determined as denied without converting the first target character or locating the target transaction.
[0077] According to embodiments of this disclosure, error messages are used to notify the user that the target transaction acquisition failed, for example, "no permission".
[0078] The embodiments of this disclosure compare the first target character with a first preset character before converting the first target character into a second string. This allows the step of converting the first target character into a second string to be skipped when the first target character is the first preset character, and the permission detection result can be determined directly. This can save memory computing resources and further improve response speed.
[0079] Figure 3 A flowchart illustrating a method for determining a first target character according to an embodiment of the present disclosure is shown.
[0080] like Figure 3 As shown, as a specific embodiment of operation S203, the permission detection method includes operations S331 to S334.
[0081] Operation S331 retrieves the transaction permission location table.
[0082] Operation S332 determines the permission location of the target transaction from the transaction permission location table based on the transaction code of the target transaction.
[0083] Operation S333 calculates the first position in the first string corresponding to the target transaction based on the conversion relationship between the second string and the first string, according to the permission position.
[0084] Operation S334 determines the first character at the first position in the first string as the first target character.
[0085] According to embodiments of this disclosure, the transaction permission location table includes transaction code, transaction name, and permission location. Specifically, the table structure of the parameters in the transaction permission location table is shown in Table 1:
[0086] Table 1
[0087] Field English name Field Chinese name Field type Tran_code Transaction Code Char(4) Tran_name Transaction Name Char(30) Auth_no Permission location Int
[0088] In one illustrative embodiment, the transaction permission location table is shown in Table 2:
[0089] Table 2
[0090] Transaction Code Transaction Name Permission location 0001 Institutional check-in 0 0002 Teller sign-in 1 0003 Print daily report 2 0004 Query transaction history 3
[0091] According to embodiments of this disclosure, each transaction uniquely corresponds to a transaction code, and in the transaction permission location table, each transaction code uniquely corresponds to a permission location. For operation S332, the corresponding permission location can be retrieved from the transaction permission location table based on the transaction code of the target transaction.
[0092] The permission positions in the transaction permission position table correspond to the permission positions of binary strings, not the positions within the first string after compressing the binary strings. Therefore, after determining the permission positions of the target transaction, the first position needs to be calculated based on the conversion relationship between the first and second strings.
[0093] In one embodiment, the first string is a hexadecimal string, and the second string is a binary string. Therefore, the conversion relationship between the first string and the second string is also a number system conversion relationship. For example, the second string 00000000 corresponds to the first string 00, and the second string 00010010 corresponds to the first string 12. Conversely, the first string 13 corresponds to the second string 00010011.
[0094] Therefore, after obtaining the permission position of the target transaction from the transaction permission position table, the first position can be calculated based on the above conversion relationship, and the first character at the first position can be determined as the first target character. It should be noted that at this time, the first target character at the first position actually corresponds to the target transaction and three other transactions.
[0095] For example, based on the 4-to-1 conversion relationship between the second string and the first string, a division operation can be performed on the permission position to obtain the quotient, which is the first position.
[0096] Taking the query log in Table 2 above, with permission position "3" as an example, based on the 4-to-1 conversion relationship between the second string and the first string, the quotient of the permission position division operation 3 / 4 is 0. Since the position of the first character in the first string is "0", the first character corresponding to the query log is at the beginning of the first string.
[0097] The embodiments of this disclosure calculate the first position based on the permission position of the target transaction in the transaction position permission table, and determine a single first target character from the first string based on the first position, which can automatically and quickly locate the first target character so that permission detection can be performed quickly based on the first target character in the future.
[0098] According to an embodiment of this disclosure, determining the permission detection result of a target transaction based on a second string includes: performing a modulo operation on the permission position based on the conversion relationship between the second string and the first string to obtain a remainder, wherein the remainder represents the second position of the target transaction in the second string; determining a single second character located at the second position in the second string as the second target character corresponding to the target transaction; and determining the permission detection result of the target transaction based on the second target character.
[0099] According to an embodiment of this disclosure, the first target character in the first string includes the transaction permissions of the target transaction and other transactions. One of the second characters in the second string obtained from the first target character represents the transaction permissions of the target transaction. Therefore, after obtaining the second string, it is necessary to first determine the second target character corresponding to the target transaction from the second string.
[0100] According to embodiments of this disclosure, for a binary second string, the second string includes only four second characters. The position of the target transaction in the second string is different from the permission position determined from the transaction permission position table. It is necessary to calculate to locate the second target character from the second string.
[0101] Specifically, based on the base-4 conversion relationship between the second string and the first string, the permission position can be divided by 4 and the remainder can be taken; the remainder is the second position. Therefore, the permission detection result of the target transaction can be determined based on the second target character located at the second position.
[0102] The embodiments of this disclosure calculate the permission position of the target transaction to obtain the second position. When storing a first string with a shorter character length, the second target character can be quickly located based on the conversion relationship between the first string and the second string, and accurate permission detection can be performed based on the second target character.
[0103] According to embodiments of this disclosure, determining the permission detection result of a target transaction based on a second target character includes: determining the permission detection result as passed if the second target character is a second preset character; and determining the permission detection result as failed if the second target character is a first preset character.
[0104] According to embodiments of this disclosure, for a binary second string, each second character is either 0 or 1, and the second preset character is 1. If the second target character is the second preset character, the permission detection result is determined to be passed. The first preset character is the same as the first preset character used when initially determining whether the first target character needs to be converted, both being 0.
[0105] For example, for the first target character in hexadecimal, if the first target character is 0, the permission check results for all four transactions corresponding to the first target character will fail. If the first target character is a third preset character that is not the first preset character, such as 1~9 or A~F, the first target character is converted into a second binary string. For the second target character in the second string, if the second target character is 0, the check fails; if the second target character is 1, the check passes.
[0106] In one embodiment, Table 3 is taken as an example of the permission data table.
[0107] Table 3
[0108] Character Code First string 0001 FFD0EA83FCBA45210000000000000000000000000000000000000000000000000000000000
[0109] As shown in Table 3, the first string matching the user role with role code 0001 is FFD0EA83FCBA452100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, which belongs to the char storage type. Therefore, the first string in the permission data table is the specific value.
[0110] Furthermore, Figure 4 A schematic diagram illustrating the correspondence between the first string and the second string according to an embodiment of the present disclosure is provided.
[0111] For example, such as Figure 4 As shown, taking user role 0001 and target transaction 3 as an example, such as printing a daily report, the first string determined from the permission data table is... Figure 4 The string in the first line, such as: FFD0EA83FCBA45210000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000.
[0112] Based on the permission position 3 of transaction three, the first character of the first string is calculated as the first position, and the first target character is "F". Since "F" is not the first preset character "0", the first target character can be converted into the second string, as follows: Figure 4 In the second line, "1111", each second character in the second string "1111" corresponds to a transaction permission. Dividing the permission position 3 by 4 and taking the remainder, we get "3". Therefore, the second position of the second string "1111" is 3. The second target character "1" at the second position corresponds to transaction three. Based on the second target character "1", the permission check result for transaction three is determined to be passed.
[0113] The embodiments of this disclosure determine the first target character and the second target character step by step, and then determine the permission detection result directly based on the second target character after determining the second target character. This allows for accurate location of the second target character even when the first string is stored in the permission data table. This achieves the technical effect of ensuring low storage resource consumption and fast reading speed in the entire storage system, thereby reducing system pressure.
[0114] In one embodiment, after performing operation S201, the permission data table can be directly obtained, and operation S202 can be performed. In another embodiment, in the banking industry, corresponding permissions are also set for the data that users can see.
[0115] Figure 5 A flowchart illustrating a method for obtaining a permission data table according to an embodiment of the present disclosure is shown. Operations S501 to S503 are included before performing operation S202.
[0116] Operation S501 determines a third string that matches the user's role from the business category permission table, based on the user's role.
[0117] According to embodiments of this disclosure, the third string includes a plurality of third characters, each third character being used to characterize data access permissions for a single business category.
[0118] According to embodiments of this disclosure, similar to the storage of transaction permissions, each user role can have data access permissions for multiple business categories. The business category permission table includes role code, role name, and business category permission data. The table structure of the parameters in the business category permission table is shown in Table 4.
[0119] Table 4
[0120] Field English name Field Chinese name Field type role_code Character Code Char(4) Role_name Character Name Char(30) Auth_data Business category permission data Char(128)
[0121] In one illustrative embodiment, the business category permission table is shown in Table 5:
[0122] Table 5
[0123] Character Code Character Name Business category permission data 0001 ordinary teller 11110100
[0124] Taking a user role of "ordinary teller" as an example, the business category permission data "11110100", which is the third string, is determined from the business category permission table based on the role code 0001. As shown in Table 4, the third string is a binary string and is also of type char. It is understandable that although the banking industry involves hundreds or thousands of transactions, these massive transactions can be divided into fewer business categories. Therefore, the binary business category permission data will not exceed the character limit of the char type.
[0125] Operation S502: Based on the target business category to which the target transaction belongs, retrieve the third target character corresponding to the target business category from the third string.
[0126] According to embodiments of this disclosure, the business category and the permission position of the business category in the third string can be stored in a data permission position table. The data permission position table includes the business category code, the business category name and the permission position, and the storage types are Char(4), Char(30) and int, respectively.
[0127] In one illustrative embodiment, the data permission location table may be as shown in Table 6:
[0128] Table 6
[0129] Business category code Business Category Name Permission location 0001 General Business 0 0002 Bank card business 1 0003 Personal deposit business 2 0004 Credit card business 3
[0130] According to embodiments of this disclosure, after determining the permission position of the target business category in the third string from the data permission position table, the third target character corresponding to the target business category can be directly obtained from the third string.
[0131] Operation S503 retrieves the permission data table if the third target character indicates that the user has the permission to obtain data for the target business category.
[0132] For example, taking a target business category of "personal deposit business" and a third string of "11110100" as an example, the permission position of the target business category in the third string is determined from the data permission location table based on the business category code 0001, such as "2". Based on this, the third target character "1" is determined from the third string "11110100". "1" indicates that a regular teller has the data access permission for personal deposit business; conversely, "0" indicates no data access permission.
[0133] Therefore, after determining that ordinary tellers have data access permissions for the "personal deposit business" business category, the permission data table corresponding to "personal deposit business" is obtained.
[0134] Table 7
[0135] Character Code Business category code First string 0001 0001 FFD0EA83FCBA45210000000000000000000000000000000000000000000000000000000000
[0136] In one illustrative embodiment, for a hierarchical storage structure including business categories, the permission data table can be as shown in Table 7 above. Table 7 is similar to Table 3, except that a business category code is added to the data structure of the permission data table. By adding a business category, the embodiments of this disclosure determine whether the user role in the request has the data access permission to access the permission data table before obtaining it, based on the business category of the target transaction. This achieves hierarchical isolation based on data access permissions and transaction permissions, making the storage structure of the entire system more secure and reliable. According to an embodiment of this disclosure, for operation S204, if it is determined that the first target character is not the first preset character, converting a single first target character into a second string includes: if it is determined that the first target character is not the first preset character, converting the hexadecimal first target character into a binary second string, the second string including four second characters.
[0137] Specifically, according to the number system conversion rules, the first target character with one digit can be converted into a second string with four digits.
[0138] For example, if the first target character is D, the first target character can be converted into the second string 1101.
[0139] Figure 6 The diagram illustrates a process flow of a method for converting a first target character and a second string according to an embodiment of the present disclosure.
[0140] like Figure 6 As shown, after obtaining the first target character in hexadecimal, it is determined whether the first target character in hexadecimal is the first preset character 0. If the first target character is 0, the permission check result is directly returned as failed; if the first target character is not 0, a base conversion is triggered to further convert the first target character in hexadecimal into a second binary string. The binary permission character corresponding to the target transaction is determined from the second string, such as the second target character, and the permission check result is determined based on the second target character.
[0141] For example, the first target character 9 in hexadecimal is converted into the second binary string 1001. Then, based on the second position corresponding to the target transaction in the second string (such as the second bit), the second target character "0" is determined from the first permission string 1001, and the permission check result is determined to be unsuccessful.
[0142] Figure 7 The flowchart illustrating the writing of data to the permission data table according to an embodiment of the present disclosure is shown schematically.
[0143] like Figure 7 As shown, the methods for writing data to the permission data table include operations S701 to S705.
[0144] Operation S701 responds to receiving a permission data write request, and obtains the permission data for the newly added user role based on the newly added user role in the permission data write request.
[0145] Operation S702 generates a fourth string corresponding to the newly added user role based on the permission data. The fourth string includes multiple fourth characters, each of which represents the transaction permission of a single transaction.
[0146] Operation S703 converts the fourth string into a shorter fifth string.
[0147] Operation S704 verifies the fifth string and obtains the verification result.
[0148] Operation S705: If the verification result indicates that the fifth string has been successfully converted, write the fifth string into the permission data table.
[0149] The following will provide a detailed explanation of operations S701 to S705.
[0150] According to embodiments of this disclosure, the permission data includes data representing user roles and data representing various transaction permissions. For example, the permission data could be "The newly added role 1 has permissions for the following multiple transactions: X, Y, Z...; and does not have permissions for the following multiple transactions: A, B, C...".
[0151] According to embodiments of this disclosure, a write request indicates a write operation to the permissions database to add new data.
[0152] According to embodiments of this disclosure, a newly added user role can be one or more new user roles, which can be user roles that do not exist in the permission data table, or user roles that exist in the permission data table. Furthermore, when a newly added user role exists in the permission data table, the write operation can be understood as an operation that overwrites the existing data. The permission data may include information such as the resources that the user role can access, operation permissions, and data access levels.
[0153] For example, in practical applications, for a newly added user role, such as a seconded counter staff member, in order to facilitate their access to transactions, it is necessary to set their permissions and write the permissions to the database.
[0154] According to embodiments of this disclosure, the fourth string is a string comprising multiple binary characters. For newly added user roles, it is typically necessary to convert text, data, and character permission data into a binary third permission string for storage.
[0155] To accommodate the target storage type restrictions for transaction permissions in the permission data table, such as char, the fourth string, which contains thousands of transaction permissions, needs to be converted into a shorter fifth string so that the fifth string meets the 255-bit limit.
[0156] For example, the fourth string is a binary string, and the fifth string is a hexadecimal string. The length of the fifth string is 1 / 4 of the length of the fourth string. The conversion can be performed based on the conversion relationship described above. For instance, starting from the least significant (leftmost) bit of the fourth string, group every 4 bits into a single hexadecimal fifth character. If the length of the fourth string is not a multiple of 4, add 0s to the rightmost bit to complete the last group.
[0157] To ensure data accuracy, the fifth string must be correctly converted before writing it into the permissions data table.
[0158] For example, the hexadecimal fifth string can be converted back to binary based on the conversion rules to obtain the sixth string. If the sixth string is the same as the fourth string, the verification result is that the fifth string was successfully converted; if the sixth string is different from the fourth string, the verification result is that the fifth string was not converted.
[0159] According to embodiments of this disclosure, upon successful verification, the converted hexadecimal fifth string can be written into the permission data table. The permission data table can be stored in a database or any other form of data storage system for use during permission checks and user authentication.
[0160] It should be noted that converting the fourth string to the fifth string involves operations such as padding with zeros and separating four digits. Problems with any of these operations can lead to errors in the converted fifth string, thus affecting the accuracy of transaction permissions. However, converting the fifth string to the sixth string only involves decoding from hexadecimal to binary, and under normal circumstances, the decoding process will not encounter problems.
[0161] Due to the limited number of bits in binary strings, converting a fourth string (hundreds or thousands of bits long) to a fifth string can lead to problems such as padding with zeros or misalignment of 4-bit segments. Any error in this process can result in an incorrect fifth string, affecting the accuracy of transaction permissions. However, converting a fifth string to a sixth string only involves hexadecimal-to-binary decoding, which typically does not encounter problems.
[0162] Therefore, embodiments of this disclosure convert the hexadecimal fifth string back to the binary sixth string and compare the binary fourth permission string with the sixth permission string, thereby ensuring the accuracy of the data written to the permission data table. By verifying before writing, erroneous data is avoided, improving system reliability. Simultaneously, it prevents potential data tampering or inconsistency issues, enhancing system security and data consistency.
[0163] Based on the above transaction processing method, this disclosure also provides a transaction processing apparatus. The following will be combined with... Figure 8 The device is described in detail.
[0164] Figure 8 A schematic block diagram of a transaction processing apparatus according to an embodiment of the present disclosure is shown.
[0165] like Figure 8 As shown, the transaction processing device 800 of this embodiment includes a parsing module 810, a first determining module 820, a second determining module 830, a third determining module 840, a fourth determining module 850, and an acquisition module 860.
[0166] The parsing module 810 is used to parse the user's user role and the target transaction to be acquired from the received acquisition request sent by the user. In one embodiment, the parsing module 810 can be used to perform the operation S201 described above, which will not be repeated here.
[0167] The first determining module 820 is used to determine a first string of a target storage type that matches the user role from the permission data table. The first string includes multiple first characters, each representing the transaction permissions for multiple transactions. The target storage type includes a string type with a character length limit. In one embodiment, the first determining module 820 can be used to perform the operation S202 described above, which will not be repeated here.
[0168] The second determining module 830 is configured to determine a single first target character from a first string based on the target transaction, wherein the first target character is used to characterize the transaction permissions of the target transaction and at least one other transaction. In one embodiment, the second determining module 830 may be used to perform the operation S203 described above, which will not be repeated here.
[0169] The third determining module 840 is used to convert a single first target character into a second string when it is determined that the first target character is not a first preset character. The second string includes multiple second characters, each representing the transaction permission of a single transaction. In one embodiment, the third determining module 840 can be used to perform the operation S204 described above, which will not be repeated here.
[0170] The fourth determining module 850 is used to determine the permission detection result of the target transaction based on the second string. In one embodiment, the fourth determining module 850 can be used to perform the operation S205 described above, which will not be repeated here.
[0171] The acquisition module 860 is used to retrieve the target transaction from the database if the permission check result is passed. In one embodiment, the acquisition module 860 can be used to perform the operation S206 described above, which will not be repeated here.
[0172] According to an embodiment of this disclosure, the transaction processing device 800 further includes: a fifth determining module, configured to determine that the permission detection result of the target transaction is unsuccessful when the first target character is determined to be a first preset character, and return an error message; wherein the first preset character is a character that indicates that the transaction permissions of multiple transactions corresponding to the first target character are all unsuccessful.
[0173] According to embodiments of this disclosure, the second determining module includes a first acquiring submodule, a first calculating submodule, and a first determining submodule.
[0174] The first acquisition submodule is used to acquire the transaction permission location table; based on the transaction code of the target transaction, it determines the permission location of the target transaction from the transaction permission location table. The first calculation submodule is used to calculate the first position in the first string corresponding to the target transaction based on the conversion relationship between the second string and the first string, and according to the permission location. The first determination submodule is used to determine the first character located at the first position in the first string as the first target character.
[0175] According to embodiments of this disclosure, the second determining module includes a second calculation submodule, a second determining submodule, and a third determining submodule. The second calculation submodule is used to perform a modulo operation on the permission position based on the conversion relationship between the second string and the first string, obtaining a remainder, where the remainder represents the second position of the target transaction in the second string. The second determining submodule is used to determine a single second character located at the second position in the second string as the second target character corresponding to the target transaction. The third determining submodule is used to determine the permission detection result of the target transaction based on the second target character.
[0176] According to embodiments of this disclosure, the third determining submodule includes a first determining unit and a second determining unit. The first determining unit is configured to determine that the permission detection result is passed when the second target character is a second preset character. The second determining unit is configured to determine that the permission detection result is failed when the second target character is a first preset character.
[0177] According to embodiments of this disclosure, the transaction processing apparatus 800 further includes a sixth determining module, a seventh determining module, and an authorization data table acquisition module.
[0178] The sixth determination module is used to determine a third string matching the user's role from the business category permission table. This third string includes multiple third characters, each representing data access permission for a single business category. The seventh determination module is used to retrieve the third target character corresponding to the target business category from the third string. The permission data table retrieval module is used to retrieve the permission data table when the third target character indicates that the user has the permission to access data for the target business category.
[0179] According to an embodiment of this disclosure, the third determining module includes: a fourth determining submodule, used to convert the hexadecimal first target character into a binary second string when it is determined that the first target character is not a first preset character, the second string including four second characters.
[0180] According to embodiments of this disclosure, the transaction processing apparatus 800 further includes an authorization acquisition module, a generation module, a conversion module, a verification module, and a writing module.
[0181] The permission acquisition module responds to a received permission data write request by retrieving the permission data for the newly added user role based on the requested role. The generation module generates a fourth string corresponding to the newly added user role, where each fourth string contains multiple fourth characters, each representing a transaction permission for a single transaction. The conversion module converts the fourth string into a shorter fifth string. The validation module validates the fifth string and obtains the validation result. The writing module, if the validation result indicates successful conversion, writes the fifth string to the permission data table.
[0182] According to embodiments of this disclosure, any plurality of modules among the parsing module 810, the first determining module 820, the second determining module 830, the third determining module 840, the fourth determining module 850, and the acquisition module 860 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the parsing module 810, the first determining module 820, the second determining module 830, the third determining module 840, the fourth determining module 850, and the acquisition module 860 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging the circuitry, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in a suitable combination of any of these. Alternatively, at least one of the parsing module 810, the first determining module 820, the second determining module 830, the third determining module 840, the fourth determining module 850, and the obtaining module 860 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.
[0183] Figure 9 A block diagram of an electronic device suitable for implementing a transaction processing method according to an embodiment of the present disclosure is shown schematically.
[0184] like Figure 9 As shown, an electronic device 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage portion 908 into a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0185] RAM 903 stores various programs and data required for the operation of electronic device 900. Processor 901, ROM 902, and RAM 903 are interconnected via bus 904. Processor 901 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 902 and / or RAM 903. It should be noted that the programs may also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0186] According to embodiments of this disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to a bus 904. The electronic device 900 may also include one or more of the following components connected to the input / output (I / O) interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output (I / O) interface 905 as needed. A removable medium 911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 910 as needed so that computer programs read from it can be installed into the storage section 908 as needed.
[0187] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0188] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 902 and / or RAM 903 and / or one or more memories other than ROM 902 and RAM 903 described above.
[0189] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to enable the computer system to implement the transaction processing methods provided in the embodiments of this disclosure.
[0190] When the computer program is executed by the processor 901, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0191] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 909, and / or installed from a removable medium 911. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0192] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0193] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on a user's computing device, partially on a user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0194] 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 disclosure. 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.
[0195] Those skilled in the art will understand that the features described in the various embodiments of this disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments of this disclosure can be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0196] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.
Claims
1. A transaction processing method, characterized in that, The method includes: In response to receiving a request sent by a user, the user's user role and the target transaction to be acquired are parsed from the request; A first string matching the user role is determined from the permission data table for the target storage type, wherein the first string includes a plurality of first characters, each first character being used to characterize the transaction permissions of a plurality of transactions, and the target storage type includes a string type with a character length limit; Based on the target transaction, a single first target character is determined from the first string, wherein the first target character is used to characterize the transaction permissions of the target transaction and at least one other transaction; If it is determined that the first target character is not a first preset character, the single first target character is converted into a second string, wherein the second string includes a plurality of second characters, each of which is used to characterize the transaction permissions of a single transaction; Based on the second string, determine the permission detection result of the target transaction; and If the permission check result is passed, the target transaction is retrieved from the database.
2. The method according to claim 1, characterized in that, The method further includes: If the first target character is determined to be the first preset character, the permission detection result of the target transaction is determined to be unsuccessful, and an error message is returned; wherein, the first preset character is a character that indicates that the transaction permissions of multiple transactions corresponding to the first target character are all unsuccessful.
3. The method according to claim 1, characterized in that, The step of determining a single first target character from the first string based on the target transaction includes: Obtain the transaction permission location table; Based on the transaction code of the target transaction, determine the permission location of the target transaction from the transaction permission location table; Based on the conversion relationship between the second string and the first string, and according to the permission position, calculate the first position in the first string corresponding to the target transaction; and The first character located at the first position in the first string is identified as the first target character.
4. The method according to claim 2, characterized in that, The step of determining the permission detection result of the target transaction based on the second string includes: Based on the conversion relationship between the second string and the first string, a remainder is obtained by performing a modulo operation on the permission position, wherein the remainder represents the second position of the target transaction in the second string; The single second character located at the second position in the second string is identified as the second target character corresponding to the target transaction; and Based on the second target character, the permission detection result of the target transaction is determined.
5. The method according to claim 4, characterized in that, The step of determining the permission detection result of the target transaction based on the second target character includes: If the second target character is the second preset character, the permission detection result is determined to be passed; If the second target character is the first preset character, the permission detection result is determined to be unsuccessful.
6. The method according to claim 1, characterized in that, Before determining the first string of the target storage type that matches the user role from the permissions data table, the method further includes: Based on the user role, a third string matching the user role is determined from the business category permission table, wherein the third string includes multiple third characters, and each third character is used to represent the data access permission of a single business category; Based on the target business category to which the target transaction belongs, obtain the third target character corresponding to the target business category from the third string; and If the third target character indicates that the user has the permission to obtain data for the target business category, then the permission data table is obtained.
7. The method according to claim 1, characterized in that, The step of converting a single first target character into a second string when it is determined that the first target character is not a first preset character includes: If it is determined that the first target character is not the first preset character, the first target character in hexadecimal is converted into the second string in binary, and the second string includes four second characters.
8. The method according to any one of claims 1 to 7, characterized in that, The method further includes: In response to receiving a permission data write request, the permission data of the newly added user role is obtained according to the newly added user role in the permission data write request; Based on the permission data, a fourth string corresponding to the newly added user role is generated, wherein the fourth string includes multiple fourth characters, and each fourth character is used to represent the transaction permission of a single transaction; Convert the fourth string into a shorter fifth string; The fifth string is validated to obtain the validation result; and If the verification result indicates that the fifth string has been successfully converted, the fifth string is written into the permission data table.
9. A transaction processing apparatus, characterized in that, The device includes: The parsing module is used to respond to a request sent by a user and parse the user's user role and the target transaction to be acquired from the request; The first determining module is used to determine a first string of a target storage type that matches the user role from the permission data table. The first string includes a plurality of first characters, each of which is used to represent the transaction permissions of a plurality of transactions. The target storage type includes a string type with a character length limit. The second determining module is configured to determine a single first target character from the first string based on the target transaction, wherein the first target character is used to characterize the transaction permissions of the target transaction and at least one other transaction; The third determining module is used to convert a single first target character into a second string when it is determined that the first target character is not a first preset character, wherein the second string includes a plurality of second characters, each second character being used to characterize the transaction permissions of a single transaction; The fourth determining module is used to determine the permission detection result of the target transaction based on the second string; The acquisition module is used to retrieve the target transaction from the database if the permission detection result is passed.
10. An electronic device, comprising: One or more processors; Memory, used to store one or more programs. The characteristic is that, when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of claims 1 to 8.
11. A computer-readable storage medium having executable instructions stored thereon, characterized in that, When executed by the processor, this instruction causes the processor to implement the method of any one of claims 1 to 8.
12. A computer program product, comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Target object permission determination method and device, storage medium and electronic device
CN112163232A
Permission configuration and verification method and device, electronic equipment and storage medium
CN114491451A