Method, apparatus, electronic device, and storage medium for data processing
Patent Information
- Application Number
- CN202311189428.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-14
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-09-14
AI Technical Summary
为了避免数据访问过于频繁导致数据库异常等而无法满足业务应用的需求,现有技术通常采用“冗余”机制来对数据库的进行保护,即设置数据库的备用库,在数据库因出现异常而无法访问时,将业务应用的数据访问切换至备用库,以保证业务应用的正常数据处理
[0050]上述发明中的一个实施例具有如下优点或有益效果:本发明实施例中,对数据库的访问请求,可以基于其中预设参数的参数值来确定访问类型;如果访问类型为预设类型,则可以基于访问请求的频次信息来确定访问请求的处理类型;如果访问类型不为预设类型,则可以基于访问决策树来确定访问请求的处理类型;在确定处理类型后即可对访问请求进行处理。本发明实施例中,对数据库的访问请求可以进行分类,不同类型的访问请求可以采用不同的处理类型,如此在对数据库访问时各访问请求按照不同的处理类型处理,从而减少对数据库稳定性的影响,以提高数据库在连续访问的场景下的稳定性,进而无需设置备用库,降低成本和数据冗余,提高数据库的整体性能。
Smart Images

Figure CN117390121B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a data processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] In various business processing scenarios, business application data is primarily stored in databases. With the development of information technology, to meet the data processing needs of business applications, the requirements for continuous database access are becoming increasingly stringent, placing significant pressure on database stability. To prevent excessively frequent data access from causing database anomalies and failing to meet business application needs, existing technologies typically employ a "redundancy" mechanism to protect the database. This involves setting up a backup database, and when the backup database becomes inaccessible due to an anomaly, the business application's data access is switched to the backup database to ensure normal data processing. However, this approach not only incurs significant costs but also creates data redundancy, reducing overall database performance. Summary of the Invention
[0003] In view of this, embodiments of the present invention provide a data processing method, apparatus, electronic device, and storage medium that can set up a backup database, which not only requires a large cost but also causes data redundancy and reduces the overall performance of the database.
[0004] To achieve the above objectives, according to one aspect of the present invention, a method for data comparison is provided.
[0005] A data processing method according to an embodiment of the present invention includes: receiving an access request from a database, obtaining parameter values of preset parameters corresponding to the access request, and determining the access type of the access request;
[0006] In response to the access type being a preset type, the frequency information of the access request is obtained to determine the corresponding processing type; in response to the access request not being the preset type, a preset access decision tree is invoked to determine the processing type of the access request.
[0007] The handler associated with the processing type is invoked to process the access request, obtain the processing result, and send the processing result.
[0008] In one embodiment, obtaining the frequency information of the access requests to determine the corresponding processing type includes:
[0009] The number of times the request was accessed within a preset time period is determined based on the frequency information;
[0010] In response to the access count being greater than a preset threshold, the processing type of the access request is determined to be a first type; in response to the access count not being greater than the preset threshold, the processing type of the access request is determined to be a second type; wherein, the first type includes retrieving the data corresponding to the access request from the cache, and the second type includes retrieving the data corresponding to the access request from the database.
[0011] In yet another embodiment, a preset access decision tree is invoked to determine the processing type of the access request, including:
[0012] Obtain the parameter values of the preset decision parameters corresponding to the access request to generate a decision vector;
[0013] The decision vector is matched with the access decision tree to determine the type node corresponding to the access request, thereby determining the processing type of the access request.
[0014] In yet another embodiment, a preset access decision tree is invoked to determine the processing type of the access request, including:
[0015] Obtain the operating language type corresponding to the access request, so as to match the corresponding node branch from the corresponding access decision tree;
[0016] Obtain the attribute value of the associated attribute of the node branch in the access request, so as to determine the processing type of the access request from the node branch based on the attribute value.
[0017] In yet another embodiment, before invoking the handler associated with the processing type, the method further includes:
[0018] Obtain the attribute information corresponding to the access request in order to query the corresponding permission scope;
[0019] If the permission scope includes the processing type, the handler associated with the processing type is invoked; if the permission scope does not include the processing type, a stop execution prompt message is sent.
[0020] In yet another embodiment, obtaining attribute information corresponding to the access request to query the corresponding permission scope includes:
[0021] Obtain the interface information corresponding to the access request, and query the corresponding permission scope based on the interface information.
[0022] In yet another embodiment, before receiving a database access request, the method further includes:
[0023] Obtain the historical access requests and corresponding processing types of the database, input them into a preset decision tree, train the preset decision tree based on a preset algorithm, and derive an access decision tree.
[0024] To achieve the above objectives, according to another aspect of the present invention, a data processing apparatus is provided.
[0025] An embodiment of the present invention provides a data processing apparatus comprising: a receiving unit, configured to receive a database access request, obtain parameter values of preset parameters corresponding to the access request, and determine the access type of the access request;
[0026] The determining unit is configured to, in response to the access type being a preset type, acquire the frequency information of the access request to determine the corresponding processing type; and in response to the access request not being the preset type, invoke a preset access decision tree to determine the processing type of the access request.
[0027] The processing unit is used to call the processing program associated with the processing type to process the access request, obtain the processing result, and send the processing result.
[0028] In one embodiment, the determining unit is specifically used for:
[0029] The number of times the request was accessed within a preset time period is determined based on the frequency information;
[0030] In response to the access count being greater than a preset threshold, the processing type of the access request is determined to be a first type; in response to the access count not being greater than the preset threshold, the processing type of the access request is determined to be a second type; wherein, the first type includes retrieving the data corresponding to the access request from the cache, and the second type includes retrieving the data corresponding to the access request from the database.
[0031] In yet another embodiment, the determining unit is specifically used for:
[0032] Obtain the parameter values of the preset decision parameters corresponding to the access request to generate a decision vector;
[0033] The decision vector is matched with the access decision tree to determine the type node corresponding to the access request, thereby determining the processing type of the access request.
[0034] In yet another embodiment, the determining unit is specifically used for:
[0035] Obtain the operating language type corresponding to the access request, so as to match the corresponding node branch from the corresponding access decision tree;
[0036] Obtain the attribute value of the associated attribute of the node branch in the access request, so as to determine the processing type of the access request from the node branch based on the attribute value.
[0037] In yet another embodiment, the processing unit is specifically used for:
[0038] Obtain the attribute information corresponding to the access request in order to query the corresponding permission scope;
[0039] If the permission scope includes the processing type, the handler associated with the processing type is invoked; if the permission scope does not include the processing type, a stop execution prompt message is sent.
[0040] In yet another embodiment, the processing unit is specifically used for:
[0041] Obtain the interface information corresponding to the access request, and query the corresponding permission scope based on the interface information.
[0042] In yet another embodiment, the apparatus further includes:
[0043] The training unit is used to obtain the historical access requests and the corresponding processing types of the database, input them into a preset decision tree, train the preset decision tree based on a preset algorithm, and obtain an access decision tree.
[0044] To achieve the above objectives, according to another aspect of the present invention, an electronic device is provided.
[0045] An electronic device according to an embodiment of the present invention includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method provided in the embodiment of the present invention.
[0046] To achieve the above objectives, according to another aspect of the present invention, a computer-readable medium is provided.
[0047] An embodiment of the present invention provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the data processing method provided in the embodiment of the present invention.
[0048] To achieve the above objectives, according to another aspect of the present invention, a computer program product is provided.
[0049] A computer program product according to an embodiment of the present invention includes a computer program that, when executed by a processor, implements the data processing method provided in the embodiment of the present invention.
[0050] One embodiment of the above invention has the following advantages or beneficial effects: In this embodiment, the access type of a database access request can be determined based on the parameter values of preset parameters; if the access type is a preset type, the processing type of the access request can be determined based on the frequency information of the access request; if the access type is not a preset type, the processing type of the access request can be determined based on an access decision tree; after determining the processing type, the access request can be processed. In this embodiment, database access requests can be classified, and different types of access requests can use different processing types. Thus, when accessing the database, each access request is processed according to a different processing type, thereby reducing the impact on database stability and improving the stability of the database in continuous access scenarios. This eliminates the need for a backup database, reduces costs and data redundancy, and improves the overall performance of the database.
[0051] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0052] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0053] Figure 1 This is a schematic diagram of a main flow of a data processing method according to an embodiment of the present invention;
[0054] Figure 2 This is a schematic diagram of a database operation language type according to an embodiment of the present invention;
[0055] Figure 3 This is a schematic diagram of an access decision tree according to an embodiment of the present invention;
[0056] Figure 4 This is a schematic diagram of another main flow of a data processing method according to an embodiment of the present invention;
[0057] Figure 5 This is a schematic diagram of the main units of a data processing apparatus according to an embodiment of the present invention;
[0058] Figure 6 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0059] Figure 7 This is a schematic diagram of the structure of a computer system suitable for implementing embodiments of the present invention. Detailed Implementation
[0060] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0061] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The acquisition, storage, use, and processing of data in the technical solutions of this application all comply with the relevant provisions of national laws and regulations.
[0062] This invention provides a data processing system that can be used in scenarios involving database access, specifically for processing database access requests. In this embodiment, the data processing system can be positioned between an application system and the database. When the application system accesses the database, it sends an access request. The data processing system can intercept and process these access requests, determining how to execute them. The application system can include a business processing system or a system responsible for database management and maintenance. To prevent frequent and continuous database access from affecting database stability, this invention uses the data processing system to process database access requests, intercepting requests that significantly impact database stability and reducing database access.
[0063] This invention provides a data processing method, which can be executed by a data processing system, such as... Figure 1 As shown, the method includes:
[0064] S101: Receive the database access request, obtain the parameter values of the preset parameters corresponding to the access request, and determine the access type of the access request.
[0065] Database access requests refer to requests to access the database. These can include access requests during business system data processing, such as query requests and write requests, as well as access requests during database maintenance, such as database add requests and delete requests.
[0066] Databases provide data support for business systems. Taking database operations as an example, which are implemented through SQL statements, the main operation languages used in database operations are DDL (Data Definition Language), DML (Data Manipulation Language), DQL (Data Query Language), and DCL (Data Control Language). These operation languages correspond to SQL statements in the database, enabling different operations on the database and directly affecting its stability. Furthermore, different operations have different impacts on the database.
[0067] Specifically, different operating languages can perform different database operations, such as Figure 2 The diagram illustrates database operations implemented using various programming languages. Insert, delete, update, and select are commonly used operations in business processing, while others are primarily used for database management and maintenance. In this embodiment of the invention, a preset algorithm can be used to classify and analyze various database operations to determine which access request types can be intercepted and which need to be sent to the database.
[0068] Therefore, in this embodiment of the invention, preset parameters can be derived through analysis. The access type of the access request can be determined by the parameter values of the preset parameters in the access request, thereby determining the appropriate processing method. Specifically, the preset parameters can be parameters representing the operation type in the access request, such as insert, delete, update, select, create, drop, alter, grant, revoke, and show, each representing an access type. Therefore, the parameter values of the preset parameters can be matched with the above access types to determine which access type the access request belongs to.
[0069] For example, in the free implementation, access requests of the insert, delete, and update types have little impact on database stability, so they can be determined as allowed access types. On the other hand, access requests of other types such as create, drop, alter, grant, revoke, show, and select have an impact on database stability that cannot be directly determined, so they can be determined as temporarily blocked access types.
[0070] S102: In response to an access type being a preset type, obtain the frequency information of the access request to determine the corresponding processing type; in response to an access request not being a preset type, call the preset access decision tree to determine the processing type of the access request.
[0071] The preset type can be set in advance, such as insert, delete, and update types. In this embodiment of the invention, the access request can be divided into two different processing methods by the preset type. For access requests belonging to the preset type, the further processing method can be determined based on the frequency information. For access requests without a preset type, the further processing method can be determined based on the decision tree.
[0072] For access requests of a preset type, the impact on the database is usually small and the database can be accessed directly. However, in this embodiment of the invention, in order to further reduce the number of database accesses, the result data corresponding to frequently accessed access requests can be cached locally. Therefore, for access requests with cached result data, there is no need to send them to the database for processing, but the data corresponding to the access request can be obtained from the cache.
[0073] Specifically, in this step, determining the corresponding processing type based on frequency information can be performed as follows: determining the number of times the request is accessed within a preset time period based on frequency information; in response to the number of accesses being greater than a preset threshold, determining the processing type of the access request as the first type; in response to the number of accesses not being greater than the preset threshold, determining the processing type of the access request as the second type; wherein, the first type includes retrieving the data corresponding to the access request from the cache, and the second type includes retrieving the data corresponding to the access request from the database.
[0074] The preset time period can be set based on requirements, for example, it can be set to a period of time before the access request is received, such as within a week before the access request is received. The preset threshold can also be set based on requirements.
[0075] For access requests that do not belong to the preset type, the processing type can be determined based on the preset access decision tree. Since access requests that do not belong to the preset type are temporarily blocked, their subsequent processing can also be divided into two categories: they can be sent to the database for processing, or the access request can be left unprocessed, i.e., the processing of the access request can be stopped.
[0076] The access decision tree is pre-trained, for example, it can be trained using the C4.5 algorithm. The access decision tree can include root nodes and branches, with leaf nodes within each branch. The last leaf node of each branch can represent the type node for the processing type corresponding to that branch. Both the root node and leaf nodes can correspond to a decision parameter used to determine the processing type.
[0077] On the one hand, specifically, in this embodiment of the invention, decision parameters required to determine the processing type can be preset based on the decision tree. Therefore, the parameter values of the preset decision parameters corresponding to the access request are obtained to generate a decision vector, which is then input into the access decision tree and matched with each branch in the access decision tree. The branch that best matches the decision vector is determined, and then the processing type represented by the type node of that branch is determined as the processing type of the access request.
[0078] On the other hand, specifically, in this embodiment of the invention, the database operation language can include types such as create, drop, alter, grant, revoke, show, and select. Therefore, corresponding access decision trees can be established for different types of operation languages. Thus, in this step, the operation language type corresponding to the access request can be obtained first, so as to match the corresponding node branch from the corresponding access decision tree; then, the attribute value of the associated attribute of the corresponding node branch in the access request can be obtained, so as to determine the processing type of the access request from the node branch based on the attribute value. The associated attribute of the node branch can be predetermined based on the decision tree.
[0079] like Figure 3 The diagram illustrates a method for determining the processing type in an embodiment of the present invention. In this diagram, for an `alter` type access request, `leukemia` determines the corresponding processing type based on the operating tool used and whether it falls during a low-peak business period. For an `elect` type access request, further determination of the corresponding processing type is needed based on factors such as memory usage, I / O usage, SQL execution speed, and access frequency. Therefore, after determining that the operating language type is `select`, attributes such as memory usage and I / O usage can be obtained to further determine the processing type. For example... Figure 3 The "normal" indication suggests that the processing type is sending the access request to the database to retrieve the corresponding data from the database. Figure 3 The "prohibit execution" option indicates that the processing type is "prohibit access request execution".
[0080] S103: Invoke the handler associated with the processing type to process the access request, obtain the processing result, and send the processing result.
[0081] The processing program is pre-configured. After the processing type is determined, the corresponding processing type can be directly called to obtain the processing result and return the processing result to the other end.
[0082] Specifically, if the processing type is to send to the database, an access request can be sent to the database, and the data can be received to see the processing result of the access request; if the processing type is to retrieve the processing result from the cache, the processing result corresponding to the access request can be retrieved from the cache; if the processing type is to stop processing, the access request can be left unprocessed, and the processing result can be a stop execution prompt message.
[0083] In one implementation, before performing this step, the access permissions of the party sending the access request can be verified. Specifically, this can be done by: obtaining the attribute information corresponding to the access request to query the corresponding permission range; if the permission range includes a processing type, calling the handler associated with the processing type; if the permission range does not include a processing type, sending a stop execution prompt message. The attribute information can be set based on requirements, such as user information of the accessing user, device information of the accessing device, interface information for receiving access requests, etc.
[0084] In this embodiment of the invention, database access requests can be classified, and different types of access requests can be processed using different processing types. In this way, each access request is processed according to a different processing type when accessing the database, thereby reducing the impact on database stability and improving the stability of the database in continuous access scenarios. This eliminates the need to set up a backup database, reduces costs and data redundancy, and improves the overall performance of the database.
[0085] It should be noted that, before execution, the embodiments of the present invention can also pre-set a decision tree and train it using a pre-set algorithm to obtain the access decision tree required for operation in the embodiments of the present invention. Specifically, the execution can be as follows: obtain the historical access requests of the database and the processing types corresponding to the historical access requests, input them into the pre-set decision tree, train the pre-set decision tree based on the pre-set algorithm, and obtain the access decision tree.
[0086] The following is combined Figure 1 The illustrated embodiments provide a detailed description of the data processing methods in the embodiments of the present invention, such as... Figure 4 As shown, the method includes:
[0087] S401: Receive a database access request, obtain the parameter values of the preset parameters corresponding to the access request, and determine the access type of the access request.
[0088] S402: In response to the access type being a preset type, obtain the frequency information of access requests.
[0089] S403: Determine the number of times the request is accessed within a preset time period based on frequency information; if the number of accesses is greater than a preset threshold, determine that the processing type of the access request is the first type; if the number of accesses is not greater than the preset threshold, determine that the processing type of the access request is the second type.
[0090] S404: In response to an access request that is not of the preset type, obtain the parameter values of the preset decision parameters corresponding to the access request to generate a decision vector.
[0091] S405: Match the decision vector with the access decision tree to determine the type node corresponding to the access request, so as to determine the processing type of the access request.
[0092] S406: Invoke the handler associated with the processing type to process the access request, obtain the processing result, and send the processing result.
[0093] It should be noted that the data processing principle in the embodiments of the present invention is the same as... Figure 1 The data processing principles in the illustrated embodiments are the same and will not be repeated here.
[0094] To address the problems existing in the prior art, embodiments of the present invention provide a data processing apparatus 500, such as... Figure 5 As shown, the device 500 includes:
[0095] The receiving unit 501 is used to receive a database access request, obtain the parameter value of the preset parameter corresponding to the access request, and determine the access type of the access request.
[0096] The determining unit 502 is configured to, in response to the access type being a preset type, obtain the frequency information of the access request to determine the corresponding processing type; and in response to the access request not being the preset type, invoke a preset access decision tree to determine the processing type of the access request.
[0097] The processing unit 503 is used to call the processing program associated with the processing type to process the access request, obtain the processing result, and send the processing result.
[0098] It should be understood that the manner in which embodiments of the present invention are implemented is different from the implementation method. Figure 1 The embodiments shown are the same and will not be described again here.
[0099] In one embodiment, the determining unit 502 is specifically used for:
[0100] The number of times the request was accessed within a preset time period is determined based on the frequency information;
[0101] In response to the access count being greater than a preset threshold, the processing type of the access request is determined to be a first type; in response to the access count not being greater than the preset threshold, the processing type of the access request is determined to be a second type; wherein, the first type includes retrieving the data corresponding to the access request from the cache, and the second type includes retrieving the data corresponding to the access request from the database.
[0102] In yet another embodiment, the determining unit 502 is specifically used for:
[0103] Obtain the parameter values of the preset decision parameters corresponding to the access request to generate a decision vector;
[0104] The decision vector is matched with the access decision tree to determine the type node corresponding to the access request, thereby determining the processing type of the access request.
[0105] In yet another embodiment, the determining unit 502 is specifically used for:
[0106] Obtain the operating language type corresponding to the access request, so as to match the corresponding node branch from the corresponding access decision tree;
[0107] Obtain the attribute value of the associated attribute of the node branch in the access request, so as to determine the processing type of the access request from the node branch based on the attribute value.
[0108] In yet another embodiment, the processing unit 503 is specifically used for:
[0109] Obtain the attribute information corresponding to the access request in order to query the corresponding permission scope;
[0110] If the permission scope includes the processing type, the handler associated with the processing type is invoked; if the permission scope does not include the processing type, a stop execution prompt message is sent.
[0111] In yet another embodiment, the processing unit 503 is specifically used for:
[0112] Obtain the interface information corresponding to the access request, and query the corresponding permission scope based on the interface information.
[0113] In yet another embodiment, the device 500 further includes:
[0114] The training unit is used to obtain the historical access requests and the corresponding processing types of the database, input them into a preset decision tree, train the preset decision tree based on a preset algorithm, and obtain an access decision tree.
[0115] It should be understood that the manner in which embodiments of the present invention are implemented is different from the implementation method. Figure 1 , 2 The embodiments shown are the same and will not be described again here.
[0116] In this embodiment of the invention, database access requests can be classified, and different types of access requests can be processed using different processing types. In this way, each access request is processed according to a different processing type when accessing the database, thereby reducing the impact on database stability and improving the stability of the database in continuous access scenarios. This eliminates the need to set up a backup database, reduces costs and data redundancy, and improves the overall performance of the database.
[0117] According to embodiments of the present invention, an electronic device and a readable storage medium are also provided.
[0118] An electronic device according to an embodiment of the present invention includes: 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, the instructions being executed by the at least one processor to cause the at least one processor to perform the data processing method provided in the embodiment of the present invention.
[0119] Figure 6 An exemplary system architecture 600 is shown, in which a data processing method or data processing apparatus to which embodiments of the present invention can be applied is illustrated.
[0120] like Figure 6 As shown, system architecture 600 may include terminal devices 601, 602, and 603, a network 604, and a server 605. Network 604 serves as the medium for providing communication links between terminal devices 601, 602, and 603 and server 605. Network 604 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0121] Users can use terminal devices 601, 602, and 603 to interact with server 605 via network 604 to receive or send messages, etc. Various client applications can be installed on terminal devices 601, 602, and 603.
[0122] Terminal devices 601, 602, and 603 may be, but are not limited to, smartphones, tablets, laptops, and desktop computers, etc.
[0123] Server 605 can be a server that provides various services. The server can analyze and process data such as received product information query requests, and feed back the processing results (such as product information - just an example) to the terminal device.
[0124] It should be noted that the data processing method provided in the embodiments of the present invention is generally executed by server 605, and correspondingly, the data processing device is generally disposed in server 605.
[0125] It should be understood that Figure 6The 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.
[0126] The following is for reference. Figure 7 It shows a schematic diagram of the structure of a computer system 700 suitable for implementing embodiments of the present invention. Figure 7 The computer system shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of the present invention.
[0127] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 702 or programs loaded from storage section 708 into random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the system 700. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0128] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.
[0129] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs the functions defined above in the system of this invention.
[0130] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0131] 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 the present invention. In this regard, each block in a flowchart or block diagram may represent a unit, 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.
[0132] The units described in the embodiments of the present invention can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor can be described as including a receiving unit, a determining unit, and a processing unit. The names of these units do not necessarily limit the specific unit; for example, a receiving unit can also be described as a "unit with receiving functions."
[0133] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to perform the data processing method provided by the present invention.
[0134] In another aspect, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method provided in the embodiments of the present invention.
[0135] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A data processing method, characterized in that, include: Receive a database access request, obtain the parameter value of the preset parameter corresponding to the access request, and determine the access type of the access request. The preset parameter is the parameter in the access request that represents the operation type. In response to the access type being a preset type, the frequency information of the access request is obtained to determine the corresponding processing type; in response to the access request not being the preset type, a preset access decision tree is invoked to determine the processing type of the access request. Invoke the handler associated with the processing type to process the access request, obtain the processing result, and send the processing result; Invoke a preset access decision tree to determine the processing type of the access request, including: Obtain the parameter values of the preset decision parameters corresponding to the access request to generate a decision vector; The decision vector is matched with the access decision tree to determine the type node corresponding to the access request, thereby determining the processing type of the access request; Invoke a preset access decision tree to determine the processing type of the access request, including: Obtain the operating language type corresponding to the access request, so as to match the corresponding node branch from the corresponding access decision tree; Obtain the attribute value of the associated attribute of the node branch in the access request, so as to determine the processing type of the access request from the node branch based on the attribute value.
2. The method according to claim 1, characterized in that, Obtaining the frequency information of the access requests to determine the corresponding processing type includes: The number of times the access request is accessed within a preset time period is determined based on the frequency information; In response to the access count being greater than a preset threshold, the processing type of the access request is determined to be a first type; in response to the access count not being greater than the preset threshold, the processing type of the access request is determined to be a second type; wherein, the first type includes retrieving the data corresponding to the access request from the cache, and the second type includes retrieving the data corresponding to the access request from the database.
3. The method according to claim 1, characterized in that, Before invoking the handler associated with the aforementioned processing type, the process also includes: Obtain the attribute information corresponding to the access request in order to query the corresponding permission scope; If the permission scope includes the processing type, the handler associated with the processing type is invoked; if the permission scope does not include the processing type, a stop execution prompt message is sent.
4. The method according to claim 3, characterized in that, Obtain the attribute information corresponding to the access request in order to query the corresponding permission scope, including: Obtain the interface information corresponding to the access request, and query the corresponding permission scope based on the interface information.
5. The method according to claim 1, characterized in that, Before receiving database access requests, the following steps are also included: Obtain the historical access requests and corresponding processing types of the database, input them into a preset decision tree, train the preset decision tree based on a preset algorithm, and derive an access decision tree.
6. A data processing apparatus, characterized in that, include: The receiving unit is used to receive database access requests, obtain the parameter values of preset parameters corresponding to the access requests, and determine the access type of the access requests. The preset parameters are parameters representing the operation type in the access requests. The determining unit is configured to, in response to the access type being a preset type, acquire the frequency information of the access request in order to determine the corresponding processing type; In response to the access request not being of the preset type, a preset access decision tree is invoked to determine the processing type of the access request; The processing unit is used to call the processing program associated with the processing type to process the access request, obtain the processing result, and send the processing result. The determining unit is specifically used for: Obtain the parameter values of the preset decision parameters corresponding to the access request to generate a decision vector; The decision vector is matched with the access decision tree to determine the type node corresponding to the access request, thereby determining the processing type of the access request; The determining unit is specifically used for: Obtain the operating language type corresponding to the access request, so as to match the corresponding node branch from the corresponding access decision tree; Obtain the attribute value of the associated attribute of the node branch in the access request, so as to determine the processing type of the access request from the node branch based on the attribute value.
7. The apparatus according to claim 6, characterized in that, The determining unit is specifically used for: The number of times the access request is accessed within a preset time period is determined based on the frequency information; In response to the access count being greater than a preset threshold, the processing type of the access request is determined to be a first type; in response to the access count not being greater than the preset threshold, the processing type of the access request is determined to be a second type; wherein, the first type includes retrieving the data corresponding to the access request from the cache, and the second type includes retrieving the data corresponding to the access request from the database.
8. The apparatus according to claim 6, characterized in that, The processing unit is specifically used for: Obtain the attribute information corresponding to the access request in order to query the corresponding permission scope; If the permission scope includes the processing type, the handler associated with the processing type is invoked; if the permission scope does not include the processing type, a stop execution prompt message is sent.
9. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-5.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-5.
11. A computer program product, comprising a computer program, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Response data processing method and device, storage medium and terminal equipment
CN109871251A
Business data processing method and device based on decision tree, equipment and storage medium
CN113806594A
Data processing method and device, electronic equipment and storage medium
CN116701449A