CN112822284A - Data processing method and device based on dynamic proxy and computer equipment - Google Patents

Data processing method and device based on dynamic proxy and computer equipment Download PDF

Info

Publication number
CN112822284A
CN112822284A CN202110088517.0A CN202110088517A CN112822284A CN 112822284 A CN112822284 A CN 112822284A CN 202110088517 A CN202110088517 A CN 202110088517A CN 112822284 A CN112822284 A CN 112822284A
Authority
CN
China
Prior art keywords
transaction
information
database
identification information
connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110088517.0A
Other languages
Chinese (zh)
Other versions
CN112822284B (en
Inventor
孙君雅
丁雪丰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An E Wallet Electronic Commerce Co Ltd
Original Assignee
Ping An E Wallet Electronic Commerce Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An E Wallet Electronic Commerce Co Ltd filed Critical Ping An E Wallet Electronic Commerce Co Ltd
Priority to CN202110088517.0A priority Critical patent/CN112822284B/en
Publication of CN112822284A publication Critical patent/CN112822284A/en
Application granted granted Critical
Publication of CN112822284B publication Critical patent/CN112822284B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data processing method and device based on a dynamic proxy and computer equipment. The method comprises the following steps: acquiring to-be-executed transaction information of a to-be-processed service request, generating corresponding connection resources according to database information of transactions in the to-be-executed transaction information, storing the corresponding connection resources into a connection resource pool, acquiring transaction identification information corresponding to each transaction, storing the transaction identification information into a data stack, generating a database connection function corresponding to each transaction identification information according to an agent field table and the connection resource pool, sequentially executing according to the generation sequence of the database connection functions to establish corresponding data transmission channels, and performing correlation execution on the transactions corresponding to the database connection functions to process the data information in the corresponding databases through the established data transmission channels. The invention relates to a database connection technology, belongs to the field of data processing, and also relates to a block chain technology.

Description

Data processing method and device based on dynamic proxy and computer equipment
Technical Field
The invention relates to the technical field of data processing, belongs to an application scene of processing data information in a database based on a dynamic agent in a smart city, and particularly relates to a data processing method and device based on the dynamic agent and computer equipment.
Background
In the process of processing a service request, a server generally needs to establish data transmission connection with a database and acquire and process data information in the database, the data information can be stored in a plurality of databases of different types, and the acquisition and processing of the data information in one database need to be realized by using a program code matched with the type of the database. In the prior art, only program codes are supported to switch different data sources, and one set of program codes cannot be used for acquiring and processing data information in databases of different types, that is, the universality of the program codes is poor. Therefore, the program code for processing the data information of the database in the prior art method has the problem of poor universality.
Disclosure of Invention
The embodiment of the invention provides a data processing method, a data processing device and a computer device based on a dynamic proxy, and aims to solve the problem of poor universality of a program code for processing data information of a database in the prior art.
In a first aspect, an embodiment of the present invention provides a data processing method based on a dynamic proxy, including:
if a service request to be processed is received, acquiring transaction information to be executed of the service request to be processed;
generating a connection resource corresponding to each transaction according to database information of each transaction in the to-be-executed transaction information and a pre-stored resource configuration table, and storing the connection resource into a preset connection resource pool;
acquiring transaction identification information corresponding to each transaction from the to-be-executed transaction information and storing the transaction identification information in a preset data stack;
sequentially reading the transaction identification information in the data stack, and configuring a pre-stored connection function according to a preset agent field table and the connection resource pool to generate a database connection function corresponding to each transaction identification information;
sequentially executing the database connection functions according to the generation sequence of each database connection function to establish a data transmission channel corresponding to the database connection function;
and executing the correlation execution on the transaction corresponding to the database connection function after executing each database connection function so as to process the data information in the database corresponding to the database connection function through the data transmission channel.
In a second aspect, an embodiment of the present invention provides a data processing apparatus based on a dynamic proxy, including:
a to-be-executed transaction information obtaining unit, configured to obtain to-be-executed transaction information of a to-be-processed service request if the to-be-processed service request is received;
the connection resource storage unit is used for generating connection resources corresponding to each transaction according to the database information of each transaction in the to-be-executed transaction information and a pre-stored resource configuration table and storing the connection resources into a preset connection resource pool;
the transaction identification information storage unit is used for acquiring the transaction identification information corresponding to each transaction from the to-be-executed transaction information and storing the transaction identification information into a preset data stack;
a database connection function generating unit, configured to sequentially read the transaction identification information in the data stack, and configure a pre-stored connection function according to a preset proxy field table and the connection resource pool to generate a database connection function corresponding to each transaction identification information;
the data transmission channel establishing unit is used for sequentially executing the database connection functions according to the generation sequence of each database connection function so as to establish a data transmission channel corresponding to the database connection function;
and the data information processing unit is used for executing the correlation execution on the transaction corresponding to the database connection function after executing each database connection function so as to process the data information in the database corresponding to the database connection function through the data transmission channel.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor, when executing the computer program, implements the dynamic proxy-based data processing method described in the first aspect.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, causes the processor to execute the method for processing data based on a dynamic proxy according to the first aspect.
The embodiment of the invention provides a data processing method and device based on a dynamic proxy and computer equipment. Acquiring to-be-executed transaction information of a to-be-processed service request, generating corresponding connection resources according to database information of each transaction in the to-be-executed transaction information, storing the corresponding connection resources into a connection resource pool, acquiring transaction identification information corresponding to each transaction, storing the transaction identification information into a data stack, generating a database connection function corresponding to each transaction identification information according to an agent field table and the connection resource pool, sequentially executing according to the generation sequence of the database connection functions to establish corresponding data transmission channels, and performing correlation execution on the transactions corresponding to the database connection functions to process the data information in the corresponding databases through the established data transmission channels. By the method, the connection function is configured based on the dynamic proxy, and the connection function can be suitable for various databases of different types through configuration, so that the universality and maintainability of the program code are greatly enhanced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a data processing method based on a dynamic proxy according to an embodiment of the present invention;
FIG. 2 is a sub-flowchart of a data processing method based on dynamic proxy according to an embodiment of the present invention;
FIG. 3 is a schematic view of another sub-flow of a data processing method based on a dynamic proxy according to an embodiment of the present invention;
FIG. 4 is a schematic view of another sub-flow of a data processing method based on a dynamic proxy according to an embodiment of the present invention;
FIG. 5 is a schematic view of another sub-flow of a data processing method based on a dynamic proxy according to an embodiment of the present invention;
FIG. 6 is a schematic view of another sub-flow of a data processing method based on a dynamic proxy according to an embodiment of the present invention;
FIG. 7 is a schematic flow chart illustrating a data processing method based on a dynamic proxy according to an embodiment of the present invention;
FIG. 8 is a schematic block diagram of a dynamic proxy-based data processing apparatus according to an embodiment of the present invention;
FIG. 9 is a schematic block diagram of a computer device provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1, fig. 1 is a schematic flowchart of a data processing method based on a dynamic proxy according to an embodiment of the present invention, where the data processing method based on a dynamic proxy is applied to a management server, and the method is executed by application software installed in the management server, where the management server is a server side for executing the data processing method based on a dynamic proxy to process data information, and the management server may be a server set in an enterprise or a government agency. As shown in fig. 1, the method includes steps S110 to S160.
S110, if a service request to be processed is received, acquiring the information of the transaction to be executed of the service request to be processed.
And if a service request to be processed is received, acquiring the information of the transaction to be executed contained in the service request to be processed. The management server can receive the to-be-processed service request sent by other terminal equipment or an administrator, the administrator is also a user of the management server, the user can process the to-be-processed service request to execute corresponding service handling operation, the to-be-processed service request at least comprises one to-be-executed transaction for processing data information, the to-be-executed transaction information can be obtained by acquiring specific information of the transaction contained in the to-be-processed service request, and the transactions contained in the to-be-executed transaction information are all used for processing the data information.
Specifically, in an embodiment, as shown in fig. 2, the step S110 includes the sub-steps of: s111, S112, S113 and S114.
S111, acquiring a first transaction in the service request to be processed as a main transaction; s112, judging whether the main transaction contains a sub-transaction; s113, if the main transaction contains the sub-transaction, taking the sub-transaction as the main transaction and returning to execute the step of judging whether the main transaction contains the sub-transaction.
Specifically, a first transaction in the service request to be processed can be obtained, whether the transaction contains a sub-transaction or not is judged, a plurality of transactions can be combined in a nesting mode, a nested combination containing two transactions is correspondingly formed when one sub-transaction inherits one main transaction, whether each transaction contains a sub-transaction or not can be judged until all the main transactions do not contain the sub-transaction is finally judged, and the inheritance relationship of all the transactions contained in the service request to be processed can be obtained.
S114, if the main transaction does not contain the sub-transactions, sequencing the transactions contained in the service request to be processed according to the inheritance relationship among the transactions in the service request to be processed so as to obtain the information of the transactions to be executed.
And ordering the contained transactions according to the inheritance relationship among the transactions in the service request to be processed to obtain the information of the transactions to be executed, specifically, ordering the transactions of the previous level before the transactions of the next level according to the inheritance relationship, and ordering the specific information of each transaction according to the inheritance relationship to obtain the information of the transactions to be executed.
And S120, generating a connection resource corresponding to each transaction according to the database information of each transaction in the to-be-executed transaction information and a pre-stored resource configuration table, and storing the connection resource into a preset connection resource pool.
And generating a connection resource corresponding to each transaction according to the database information of each transaction in the to-be-executed transaction information and a preset resource configuration table, and storing the connection resource into a preset connection resource pool. Specifically, the information of the transaction to be executed further includes database information of each transaction, the management server further stores a plurality of databases, and the data information in the database matched with the transaction can be acquired and processed in the process of executing the transaction, wherein the database information includes a database type and a database address. The database type is specific type information of the database corresponding to the transaction in the execution process, for example, the database type may be MySql, Oracle, and the like; the database address is address information of a database corresponding to the transaction in the execution process, and the database address may be represented by a Uniform Resource Locator (URL). The management server also prestores a resource configuration table, which is a data table used for storing connection configuration information corresponding to each database type, wherein the connection configuration information comprises configuration information such as a transmission protocol, an encoding rule, an encryption rule and the like corresponding to the corresponding database type. The connection resource pool is a resource pool preset in the management server and used for temporarily storing the connection resources, and the connection resources corresponding to each transaction can be generated according to the database information of the transactions and the resource configuration information table and stored in the connection resource pool.
Specifically, in an embodiment, as shown in fig. 3, the step S120 includes the sub-steps of: s121 and S122.
S121, acquiring connection configuration information matched with the database type of each transaction in the resource configuration table; s122, configuring the database address of each transaction in the corresponding connection configuration information to obtain the connection resource of each transaction.
The resource allocation table includes connection allocation information corresponding to each database type, so that connection allocation information matched with each transaction can be acquired according to the database type of each transaction in the to-be-executed transaction information, the database address of each transaction is allocated in the corresponding connection allocation information, connection resources with each transaction are obtained, and the connection resources include the database address of each transaction and configuration information such as transmission protocols, channel numbers, encoding rules, encryption rules and the like.
S130, acquiring the transaction identification information corresponding to each transaction from the information of the to-be-executed transaction and storing the transaction identification information in a preset data stack.
And acquiring the transaction identification information corresponding to each transaction from the to-be-executed transaction information and storing the transaction identification information in a preset data stack. The data stack is a storage container preset in the management server and used for storing the transaction identification information, the information stored in the data stack follows a first-in-last-out principle, specifically, the transaction identification information of each transaction can be obtained from the database information of each transaction of the to-be-executed transaction information, and the transaction identification information of each transaction is stored in the data stack according to the ordering of the transactions in the to-be-executed transaction information.
Specifically, in one embodiment, as shown in fig. 4, step S130 includes sub-steps S131 and S132.
S131, acquiring a database type from the database information of each transaction as the transaction identification information of each transaction; s132, sequentially storing the transaction identification information of each transaction into the data stack according to the ordering of the transactions in the to-be-executed transaction information.
Specifically, the database type of each transaction may be acquired as corresponding transaction identification information, the database address in the database information may also be acquired as corresponding transaction identification information, and other information in the to-be-executed transaction information may also be acquired as transaction identification information, for example, an identification code of a transaction in the to-be-executed transaction information may be acquired as corresponding transaction identification information. And storing the transaction identification information corresponding to the first-ordered transaction in the to-be-executed transaction information into a data stack firstly, and storing the transaction identification information corresponding to the penultimate-ordered transaction into the data stack finally.
S140, sequentially reading the transaction identification information in the data stack, and configuring a pre-stored connection function according to a preset proxy field table and the connection resource pool to generate a database connection function corresponding to each transaction identification information.
And sequentially reading the transaction identification information in the data stack, and configuring a pre-stored connection function according to a preset agent field table and the connection resource pool to generate a database connection function corresponding to each transaction identification information. The agent field table is a data table preset in the management server and used for storing agent field information, the agent field table comprises agent field information corresponding to each database type, and the agent field information comprises a plurality of agent fields. The method comprises the steps that stored transaction identification information in a data stack can be read in sequence, corresponding target agent field information in an agent field table is obtained according to the read transaction identification information, and connection resources corresponding to a connection resource pool and a transaction to which the transaction identification information belongs are obtained; the management server prestores initialized connection functions, namely function methods expressed in the form of program codes, and can configure the connection functions according to the target agent field information and corresponding connection resources to obtain database connection functions corresponding to the transaction identification information, and the database connection functions are executed to establish corresponding data transmission channels with corresponding databases.
Specifically, in one embodiment, as shown in fig. 5, step S140 includes sub-steps S141, S142, S143, S144, and S145.
S141, sequentially reading one transaction identification information in the data stack as target identification information; s142, acquiring target agent field information matched with the target identification information in the agent field table; s143, carrying out keyword replacement on keywords matched with the target agent field information in the pre-stored connection function according to the target agent field information to obtain the agent connection function.
Specifically, the transaction identification information in the data stack is sequentially read, and since the information stored in the data stack follows a principle of first entering and then exiting, the transaction identification information which is first entered into the stack is first exited, and the transaction identification information which is last entered into the stack is first exited. Reading transaction identification information in a data stack as target identification information, if a database type is used as the target identification information, directly obtaining target agent field information corresponding to an agent field table according to the target identification information, wherein the target agent field information comprises a plurality of groups of field mapping relations, one group of field mapping relations comprises a mapping relation between an initial keyword and a replacement keyword, then performing mapping replacement on a keyword corresponding to each initial keyword in a connection function according to the plurality of groups of field mapping relations contained in the target agent field information, replacing the keyword corresponding to the initial keyword in the connection function with the replacement keyword, and performing keyword field replacement on the connection function according to the target agent field information to obtain an agent connection function corresponding to the target agent field information.
For example, a set of field mappings includes: the initial field "010014" -the replacement field "Delete", all the keys of "010014" in the join function are replaced by "Delete" according to the set of field mapping relations.
S144, obtaining the connection resources corresponding to the affair to which the target identification information belongs in the connection resource pool, and configuring the proxy connection function to obtain the database connection function corresponding to the target identification information.
The connection resource corresponding to the transaction to which the target identification information belongs in the connection resource pool can be acquired, and the proxy connection function is subjected to parameter configuration according to the connection resource, specifically, the proxy connection function is subjected to parameter configuration according to configuration information such as a database address, a transmission protocol, an encoding rule, an encryption rule and the like included in the connection resource, so that a corresponding database connection function is acquired.
S145, judging whether the data stack contains transaction identification information or not; and if the data stack contains transaction identification information, returning to execute the step of sequentially reading one transaction identification information in the data stack as target identification information.
Judging whether the data stack also contains transaction identification information, if so, continuing to read next transaction identification information from the data stack and generating a corresponding database connection function, namely returning to the step S141 for execution; if the data stack does not contain the transaction identification information, the process is ended, and at this time, all the transaction identification information in the data stack correspondingly generates a database connection function.
S150, sequentially executing the database connection functions according to the generation sequence of each database connection function to establish a data transmission channel corresponding to the database connection function.
And sequentially executing the database connection functions according to the generation sequence of each database connection function to establish a data transmission channel corresponding to the database connection function. Specifically, the obtained database connection functions may be sequentially executed according to the generation sequence of the database connection functions, that is, the database connection functions generated earlier are preferentially executed.
Specifically, in one embodiment, as shown in fig. 6, step S150 includes sub-steps S151 and S152.
S151, correspondingly creating channels with the same number as the channels according to the number of the channels in the database connection function; s152, carrying out parameter configuration on each channel according to the transmission protocol in the database connection function to obtain a corresponding data transmission channel.
Specifically, a plurality of channels equal to the number of channels may be created correspondingly according to the number of channels in the database connection function and the database address in the database connection function, and parameter configuration may be performed on each channel according to the transmission protocol in the database connection function, and if the database connection function further includes the encoding rule and the encryption rule, further parameter configuration may be performed on each channel according to the encoding rule and the encryption rule, so as to obtain the data transmission channel obtained after parameter configuration.
And S160, executing each database connection function, and then performing correlation execution on the transaction corresponding to the database connection function, so as to process the data information in the database corresponding to the database connection function through the data transmission channel.
And executing the correlation execution on the transaction corresponding to the database connection function after executing each database connection function so as to process the data information in the database corresponding to the database connection function through the data transmission channel. After the execution of one database connection function is finished, connection is established with the database corresponding to the database connection function through the data transmission channels, each data transmission channel can transmit and process one data processing instruction, multiple data processing instructions can be transmitted and processed through multiple data transmission channels at the same time, the affairs associated with the database connection function can be continuously executed, the data information in the connected database can be concurrently processed through the multiple data transmission channels during the process of executing the affairs, and the efficiency of acquiring and processing the data information in the database can be improved.
In an embodiment, as shown in fig. 7, step S170 is further included after step S160.
And S170, emptying the connection resource pool after all the transactions are executed.
And emptying the connection resource pool after all the transactions are executed. After the execution of all database connection functions and transactions is completed, the received service request to be processed can be processed, the connection resource pool can be emptied after the service request to be processed is processed, namely, the data information stored in the connection resource pool is deleted, and the emptying of the connection resource pool can release system resources of the management server so as to improve the efficiency of processing subsequent requests to be processed.
In one embodiment, step S160 is followed by step S160 a.
S160a, acquiring the processing records of the service request to be processed and synchronously uploading the processing records to a block chain for storage.
And uploading the processing records to a block chain for storage, and obtaining corresponding summary information based on the processing records, specifically, obtaining the summary information by performing hash processing on the processing records, for example, by using a sha256 algorithm. Uploading summary information to the blockchain can ensure the safety and the fair transparency of the user. The user device may download the summary information from the blockchain to verify that the process record has been tampered with. The blockchain referred to in this example is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The technical method can be applied to application scenes such as intelligent government affairs, intelligent city management, intelligent community, intelligent security protection, intelligent logistics, intelligent medical treatment, intelligent education, intelligent environmental protection and intelligent traffic, wherein the application scenes comprise the step of processing data information in a database based on dynamic agents, and therefore the construction of the intelligent city is promoted.
In the data processing method based on the dynamic proxy provided by the embodiment of the invention, to-be-executed transaction information of a to-be-processed service request is acquired, a corresponding connection resource is generated according to database information of each transaction in the to-be-executed transaction information and is stored in a connection resource pool, transaction identification information corresponding to each transaction is acquired and is stored in a data stack, a database connection function corresponding to each transaction identification information is generated according to a proxy field table and the connection resource pool, the generation sequence of the database connection function is sequentially executed to establish a corresponding data transmission channel, and the transactions corresponding to the database connection function are subjected to associated execution so as to process the data information in the corresponding database through the established data transmission channel. By the method, the connection function is configured based on the dynamic proxy, and the connection function can be suitable for various databases of different types through configuration, so that the universality and maintainability of the program code are greatly enhanced.
The embodiment of the invention also provides a data processing device based on the dynamic proxy, which is used for executing any embodiment of the data processing method based on the dynamic proxy. Specifically, referring to fig. 8, fig. 8 is a schematic block diagram of a data processing apparatus based on a dynamic proxy according to an embodiment of the present invention. The dynamic proxy-based data processing apparatus may be configured in a management server.
As shown in fig. 8, the dynamic proxy-based data processing apparatus 100 includes a to-be-executed transaction information obtaining unit 110, a connection resource storage unit 120, a transaction identification information storage unit 130, a database connection function generating unit 140, a data transmission channel establishing unit 150, and a data information processing unit 160.
The to-be-executed transaction information obtaining unit 110 is configured to, if a to-be-processed service request is received, obtain to-be-executed transaction information of the to-be-processed service request.
In an embodiment, the to-be-executed transaction information obtaining unit 110 includes sub-units: the device comprises a main transaction acquisition unit, a main transaction judgment unit, a matching verification unit, a first judgment unit and a second judgment unit.
A master transaction obtaining unit, configured to obtain a first transaction in the to-be-processed service request as a master transaction; the main transaction judging unit is used for judging whether the main transaction contains a sub-transaction; a return judgment unit, configured to, if the main transaction includes a sub-transaction, take the sub-transaction as a main transaction and return to execute the step of judging whether the main transaction includes the sub-transaction; and the ordering processing unit is used for ordering the affairs contained in the service request to be processed according to the inheritance relationship among the affairs in the service request to be processed to obtain the information of the affairs to be executed if the main affairs do not contain the sub affairs.
And a connection resource storage unit 120, configured to generate a connection resource corresponding to each transaction according to the database information of each transaction in the to-be-executed transaction information and a pre-stored resource configuration table, and store the connection resource in a preset connection resource pool.
In one embodiment, the connection resource storage unit 120 includes sub-units: a connection configuration information obtaining unit, configured to obtain connection configuration information in which the database types of each transaction in the resource configuration table are matched; and the connection resource acquisition unit is used for configuring the database address of each transaction in the corresponding connection configuration information to obtain the connection resource of each transaction.
A transaction identification information storage unit 130, configured to obtain, from the to-be-executed transaction information, transaction identification information corresponding to each transaction, and store the transaction identification information in a preset data stack.
In one embodiment, the transaction identification information storage unit 130 includes sub-units: a transaction identification information determining unit, configured to obtain a database type from database information of each transaction as transaction identification information of each transaction; and the storage unit is used for sequentially storing the transaction identification information of each transaction into the data stack according to the ordering of the transactions in the to-be-executed transaction information.
A database connection function generating unit 140, configured to sequentially read the transaction identification information in the data stack, and configure a pre-stored connection function according to a preset proxy field table and the connection resource pool, so as to generate a database connection function corresponding to each transaction identification information.
In one embodiment, the database connection function generation unit 140 includes sub-units: a target identification information obtaining unit, configured to sequentially read one of the transaction identification information in the data stack as target identification information; a target agent field information obtaining unit, configured to obtain target agent field information that matches the target identification information in the agent field table; the proxy connection function acquisition unit is used for carrying out keyword replacement on keywords matched with the target proxy field information in the prestored connection function according to the target proxy field information to obtain a proxy connection function; and the database connection function acquisition unit is used for acquiring connection resources corresponding to the affair to which the target identification information belongs in the connection resource pool to configure the proxy connection function so as to obtain the database connection function corresponding to the target identification information. The data stack judging unit is used for judging whether the data stack contains the transaction identification information or not; and if the data stack contains transaction identification information, returning to execute the step of sequentially reading one transaction identification information in the data stack as target identification information.
A data transmission channel establishing unit 150, configured to sequentially execute the database connection functions according to the generation sequence of each database connection function to establish a data transmission channel corresponding to the database connection function.
In an embodiment, the data transmission channel establishing unit 150 includes sub-units: the channel creating unit is used for correspondingly creating channels with the same number as the channels according to the number of the channels in the database connection function; and the parameter configuration unit is used for carrying out parameter configuration on each channel according to the transmission protocol in the database connection function to obtain a corresponding data transmission channel.
The data information processing unit 160 is configured to perform correlation execution on the transaction corresponding to the database connection function after each database connection function is executed, so as to process the data information in the database corresponding to the database connection function through the data transmission channel.
In one embodiment, the data processing method based on the dynamic proxy comprises the following subunits: and the connection resource pool emptying unit is used for emptying the connection resource pool after all the transactions are executed.
In an embodiment, the dynamic proxy-based data processing apparatus 100 further comprises sub-units: and the processing record storage unit is used for acquiring the processing record of the service request to be processed and synchronously uploading the processing record to the block chain for storage.
The data processing device based on the dynamic proxy provided by the embodiment of the invention applies the data processing method based on the dynamic proxy to acquire the information of the to-be-executed transaction of the to-be-processed service request, generates the corresponding connection resource according to the database information of each transaction in the information of the to-be-executed transaction and stores the corresponding connection resource into the connection resource pool, acquires the transaction identification information corresponding to each transaction and stores the transaction identification information into the data stack, generates the database connection function corresponding to each transaction identification information according to the proxy field table and the connection resource pool, sequentially executes according to the generation sequence of the database connection function to establish the corresponding data transmission channel, and performs the association execution on the transaction corresponding to the database connection function so as to process the data information in the corresponding database through the established data transmission channel. By the method, the connection function is configured based on the dynamic proxy, and the connection function can be suitable for various databases of different types through configuration, so that the universality and maintainability of the program code are greatly enhanced.
The above-described dynamic proxy-based data processing apparatus may be implemented in the form of a computer program which may be run on a computer device as shown in fig. 9.
Referring to fig. 9, fig. 9 is a schematic block diagram of a computer device according to an embodiment of the present invention. The computer device may be a management server for executing a dynamic agent-based data processing method to process data information in a database based on a dynamic agent.
Referring to fig. 9, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a storage medium 503 and an internal memory 504.
The computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include storage media 503 and internal memory 504.
The storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, may cause the processor 502 to perform a dynamic proxy-based data processing method, wherein the storage medium 503 may be a volatile storage medium or a non-volatile storage medium.
The processor 502 is used to provide computing and control capabilities that support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the operation of the computer program 5032 in the storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can be enabled to execute the data processing method based on the dynamic proxy.
The network interface 505 is used for network communication, such as providing transmission of data information. Those skilled in the art will appreciate that the configuration shown in fig. 9 is a block diagram of only a portion of the configuration associated with aspects of the present invention and is not intended to limit the computing device 500 to which aspects of the present invention may be applied, and that a particular computing device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
The processor 502 is configured to run the computer program 5032 stored in the memory to implement the corresponding functions in the above-mentioned data processing method based on the dynamic proxy.
Those skilled in the art will appreciate that the embodiment of a computer device illustrated in fig. 9 does not constitute a limitation on the specific construction of the computer device, and that in other embodiments a computer device may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device may only include a memory and a processor, and in such embodiments, the structures and functions of the memory and the processor are consistent with those of the embodiment shown in fig. 9, and are not described herein again.
It should be understood that, in the embodiment of the present invention, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In another embodiment of the invention, a computer-readable storage medium is provided. The computer readable storage medium may be a volatile or non-volatile computer readable storage medium. The computer readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps included in the dynamic proxy-based data processing method described above.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses, devices and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided by the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only a logical division, and there may be other divisions when the actual implementation is performed, or units having the same function may be grouped into one unit, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a computer-readable storage medium, which includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned computer-readable storage media comprise: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-only memory (ROM), a magnetic disk, or an optical disk.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A data processing method based on a dynamic proxy, the method comprising:
if a service request to be processed is received, acquiring transaction information to be executed of the service request to be processed;
generating a connection resource corresponding to each transaction according to database information of each transaction in the to-be-executed transaction information and a pre-stored resource configuration table, and storing the connection resource into a preset connection resource pool;
acquiring transaction identification information corresponding to each transaction from the to-be-executed transaction information and storing the transaction identification information in a preset data stack;
sequentially reading the transaction identification information in the data stack, and configuring a pre-stored connection function according to a preset agent field table and the connection resource pool to generate a database connection function corresponding to each transaction identification information;
sequentially executing the database connection functions according to the generation sequence of each database connection function to establish a data transmission channel corresponding to the database connection function;
and executing the correlation execution on the transaction corresponding to the database connection function after executing each database connection function so as to process the data information in the database corresponding to the database connection function through the data transmission channel.
2. The data processing method based on dynamic proxy according to claim 1, wherein the obtaining the transaction information to be executed of the service request to be processed comprises:
acquiring a first transaction in the service request to be processed as a main transaction;
judging whether the main transaction contains a sub transaction;
if the main transaction contains the sub-transaction, taking the sub-transaction as the main transaction and returning to execute the step of judging whether the main transaction contains the sub-transaction;
if the main transaction does not contain the sub-transactions, sequencing the transactions contained in the service request to be processed according to the inheritance relationship among the transactions in the service request to be processed so as to obtain the information of the transactions to be executed.
3. The data processing method based on dynamic proxy of claim 1, wherein the database information includes a database type and a database address, and the generating a connection resource corresponding to each transaction according to the database information of each transaction in the to-be-executed transaction information and a pre-stored resource configuration table and storing the connection resource into a preset connection resource pool comprises:
acquiring connection configuration information matched with the database type of each transaction in the resource configuration table;
and configuring the database address of each transaction in the corresponding connection configuration information to obtain the connection resource of each transaction.
4. The data processing method based on dynamic proxy of claim 1, wherein the obtaining transaction identification information corresponding to each transaction from the transaction information to be executed and storing the transaction identification information in a preset data stack comprises:
acquiring a database type from database information of each transaction as transaction identification information of each transaction;
and sequentially storing the transaction identification information of each transaction into the data stack according to the ordering of the transactions in the to-be-executed transaction information.
5. The data processing method based on dynamic proxy of claim 1, wherein the configuring a pre-stored connection function according to a preset proxy field table and the connection resource pool to generate a database connection function corresponding to each transaction identification information comprises:
sequentially reading one transaction identification information in the data stack as target identification information;
acquiring target agent field information matched with the target identification information in the agent field table;
carrying out keyword replacement on keywords matched with the target agent field information in the prestored connection function according to the target agent field information to obtain an agent connection function;
acquiring a connection resource corresponding to the transaction to which the target identification information belongs in the connection resource pool, and configuring the proxy connection function to obtain a database connection function corresponding to the target identification information;
judging whether the data stack contains transaction identification information or not;
and if the data stack contains transaction identification information, returning to execute the step of sequentially reading one transaction identification information in the data stack as target identification information.
6. The data processing method based on dynamic proxy of claim 1, wherein the sequentially executing the database connection functions according to the generation order of each database connection function to establish the data transmission channel corresponding to the database connection function comprises:
correspondingly creating channels with the same number as the channels according to the number of the channels in the database connection function;
and performing parameter configuration on each channel according to a transmission protocol in the database connection function to obtain a corresponding data transmission channel.
7. The data processing method according to claim 1, wherein the executing of each database connection function is performed to perform correlation execution on the transaction corresponding to the database connection function, so as to process data information in the database corresponding to the database connection function through the data transmission channel, further comprising:
and emptying the connection resource pool after all the transactions are executed.
8. A dynamic proxy-based data processing apparatus, comprising:
a to-be-executed transaction information obtaining unit, configured to obtain to-be-executed transaction information of a to-be-processed service request if the to-be-processed service request is received;
the connection resource storage unit is used for generating connection resources corresponding to each transaction according to the database information of each transaction in the to-be-executed transaction information and a pre-stored resource configuration table and storing the connection resources into a preset connection resource pool;
the transaction identification information storage unit is used for acquiring the transaction identification information corresponding to each transaction from the to-be-executed transaction information and storing the transaction identification information into a preset data stack;
a database connection function generating unit, configured to sequentially read the transaction identification information in the data stack, and configure a pre-stored connection function according to a preset proxy field table and the connection resource pool to generate a database connection function corresponding to each transaction identification information;
the data transmission channel establishing unit is used for sequentially executing the database connection functions according to the generation sequence of each database connection function so as to establish a data transmission channel corresponding to the database connection function;
and the data information processing unit is used for executing the correlation execution on the transaction corresponding to the database connection function after executing each database connection function so as to process the data information in the database corresponding to the database connection function through the data transmission channel.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the dynamic agent-based data processing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, causes the processor to execute the dynamic proxy-based data processing method according to any one of claims 1 to 7.
CN202110088517.0A 2021-01-22 2021-01-22 Data processing method and device based on dynamic proxy and computer equipment Active CN112822284B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110088517.0A CN112822284B (en) 2021-01-22 2021-01-22 Data processing method and device based on dynamic proxy and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110088517.0A CN112822284B (en) 2021-01-22 2021-01-22 Data processing method and device based on dynamic proxy and computer equipment

Publications (2)

Publication Number Publication Date
CN112822284A true CN112822284A (en) 2021-05-18
CN112822284B CN112822284B (en) 2022-11-11

Family

ID=75858923

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110088517.0A Active CN112822284B (en) 2021-01-22 2021-01-22 Data processing method and device based on dynamic proxy and computer equipment

Country Status (1)

Country Link
CN (1) CN112822284B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113518384A (en) * 2021-07-29 2021-10-19 中移(杭州)信息技术有限公司 Distributed transaction processing method, device, equipment and computer readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109634996A (en) * 2018-10-25 2019-04-16 深圳壹账通智能科技有限公司 Customer information table generating method, device, equipment and computer readable storage medium
CN110532487A (en) * 2019-09-11 2019-12-03 北京百度网讯科技有限公司 The generation method and device of label
CN110659287A (en) * 2019-09-11 2020-01-07 北京亚信数据有限公司 Method for processing field names of table and computing equipment
CN110826001A (en) * 2019-10-30 2020-02-21 深圳前海环融联易信息科技服务有限公司 Data acquisition request processing method and device, computer equipment and storage medium
CN111444161A (en) * 2020-02-26 2020-07-24 中国平安财产保险股份有限公司 Data processing method and device, electronic equipment and storage medium
CN111522849A (en) * 2020-04-22 2020-08-11 深圳市春蚕智能信息技术有限公司 Database dynamic access method, server and storage medium
CN111752549A (en) * 2020-06-24 2020-10-09 中国银行股份有限公司 SQL function generation method and device
CA3048699A1 (en) * 2019-05-03 2020-11-03 Looker Data Sciences, Inc. Join pattern agnostic aggregate computation in database query operations

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109634996A (en) * 2018-10-25 2019-04-16 深圳壹账通智能科技有限公司 Customer information table generating method, device, equipment and computer readable storage medium
CA3048699A1 (en) * 2019-05-03 2020-11-03 Looker Data Sciences, Inc. Join pattern agnostic aggregate computation in database query operations
CN110532487A (en) * 2019-09-11 2019-12-03 北京百度网讯科技有限公司 The generation method and device of label
CN110659287A (en) * 2019-09-11 2020-01-07 北京亚信数据有限公司 Method for processing field names of table and computing equipment
CN110826001A (en) * 2019-10-30 2020-02-21 深圳前海环融联易信息科技服务有限公司 Data acquisition request processing method and device, computer equipment and storage medium
CN111444161A (en) * 2020-02-26 2020-07-24 中国平安财产保险股份有限公司 Data processing method and device, electronic equipment and storage medium
CN111522849A (en) * 2020-04-22 2020-08-11 深圳市春蚕智能信息技术有限公司 Database dynamic access method, server and storage medium
CN111752549A (en) * 2020-06-24 2020-10-09 中国银行股份有限公司 SQL function generation method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113518384A (en) * 2021-07-29 2021-10-19 中移(杭州)信息技术有限公司 Distributed transaction processing method, device, equipment and computer readable storage medium
CN113518384B (en) * 2021-07-29 2023-12-01 中移(杭州)信息技术有限公司 Distributed transaction processing method, device, equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN112822284B (en) 2022-11-11

Similar Documents

Publication Publication Date Title
CN109558748B (en) Data processing method and device, electronic equipment and storage medium
US11048690B2 (en) Contribution of multiparty data aggregation using distributed ledger technology
CN107491519B (en) Method and device for inquiring block chain account book
CN108305055B (en) Payment testing method and device
EP3895370A1 (en) Proof-of-work for blockchain applications
CN110830577A (en) Service request call tracking method and device, computer equipment and storage medium
CN112883361A (en) Function jump method and device of application program, computer equipment and storage medium
WO2021139467A1 (en) Federated learning method and system, and computer device and storage medium
CN111371858A (en) Group control equipment identification method, device, medium and electronic equipment
CN111753320A (en) Data encryption method and device based on interceptor and computer equipment
CN112235423A (en) Cross-chain transaction processing method and device, electronic equipment and storage medium
CN112822284B (en) Data processing method and device based on dynamic proxy and computer equipment
CN114116401A (en) Method, device, equipment and medium for tracking and monitoring all links of cluster message
CN110689218A (en) Risk user identification method and device, computer equipment and storage medium
CN112434094A (en) Database connection method and device based on encryption algorithm and computer equipment
CN109815227B (en) Data lock management method, device, computer equipment and storage medium
CN112751785A (en) Method and device for sending to-be-processed request, computer equipment and storage medium
FR3099257A1 (en) PROCESS FOR OBTAINING AN AUTHENTICATED DIGITAL ASSET
CN111078649A (en) Block chain-based on-cloud file storage method and device and electronic equipment
CN113051622B (en) Index construction method, device, equipment and storage medium
EP4022872B1 (en) Distributed ledger system
CN113703735A (en) Application generation method, device, equipment and medium based on independent code block arrangement
CN115080147A (en) H5 page loading method, device, equipment and medium based on artificial intelligence
US20210028949A1 (en) Securing a provable resource possession
CN112328882A (en) Information recommendation method and device, terminal equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant