CN117131545A - Data processing method and device, storage medium and terminal - Google Patents

Data processing method and device, storage medium and terminal Download PDF

Info

Publication number
CN117131545A
CN117131545A CN202310043475.8A CN202310043475A CN117131545A CN 117131545 A CN117131545 A CN 117131545A CN 202310043475 A CN202310043475 A CN 202310043475A CN 117131545 A CN117131545 A CN 117131545A
Authority
CN
China
Prior art keywords
test
connection
data operation
storage space
target
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.)
Pending
Application number
CN202310043475.8A
Other languages
Chinese (zh)
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.)
Beijing Shuidi Technology Group Co ltd
Original Assignee
Beijing Shuidi Technology Group 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 Beijing Shuidi Technology Group Co ltd filed Critical Beijing Shuidi Technology Group Co ltd
Priority to CN202310043475.8A priority Critical patent/CN117131545A/en
Publication of CN117131545A publication Critical patent/CN117131545A/en
Pending legal-status Critical Current

Links

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B29WORKING OF PLASTICS; WORKING OF SUBSTANCES IN A PLASTIC STATE IN GENERAL
    • B29CSHAPING OR JOINING OF PLASTICS; SHAPING OF MATERIAL IN A PLASTIC STATE, NOT OTHERWISE PROVIDED FOR; AFTER-TREATMENT OF THE SHAPED PRODUCTS, e.g. REPAIRING
    • B29C64/00Additive manufacturing, i.e. manufacturing of three-dimensional [3D] objects by additive deposition, additive agglomeration or additive layering, e.g. by 3D printing, stereolithography or selective laser sintering
    • B29C64/30Auxiliary operations or equipment
    • B29C64/307Handling of material to be used in additive manufacturing
    • B29C64/321Feeding
    • B29C64/336Feeding of two or more materials
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B29WORKING OF PLASTICS; WORKING OF SUBSTANCES IN A PLASTIC STATE IN GENERAL
    • B29CSHAPING OR JOINING OF PLASTICS; SHAPING OF MATERIAL IN A PLASTIC STATE, NOT OTHERWISE PROVIDED FOR; AFTER-TREATMENT OF THE SHAPED PRODUCTS, e.g. REPAIRING
    • B29C64/00Additive manufacturing, i.e. manufacturing of three-dimensional [3D] objects by additive deposition, additive agglomeration or additive layering, e.g. by 3D printing, stereolithography or selective laser sintering
    • B29C64/10Processes of additive manufacturing
    • B29C64/106Processes of additive manufacturing using only liquids or viscous materials, e.g. depositing a continuous bead of viscous material
    • B29C64/124Processes of additive manufacturing using only liquids or viscous materials, e.g. depositing a continuous bead of viscous material using layers of liquid which are selectively solidified
    • B29C64/129Processes of additive manufacturing using only liquids or viscous materials, e.g. depositing a continuous bead of viscous material using layers of liquid which are selectively solidified characterised by the energy source therefor, e.g. by global irradiation combined with a mask
    • B29C64/135Processes of additive manufacturing using only liquids or viscous materials, e.g. depositing a continuous bead of viscous material using layers of liquid which are selectively solidified characterised by the energy source therefor, e.g. by global irradiation combined with a mask the energy source being concentrated, e.g. scanning lasers or focused light sources
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B33ADDITIVE MANUFACTURING TECHNOLOGY
    • B33YADDITIVE MANUFACTURING, i.e. MANUFACTURING OF THREE-DIMENSIONAL [3-D] OBJECTS BY ADDITIVE DEPOSITION, ADDITIVE AGGLOMERATION OR ADDITIVE LAYERING, e.g. BY 3-D PRINTING, STEREOLITHOGRAPHY OR SELECTIVE LASER SINTERING
    • B33Y40/00Auxiliary operations or equipment, e.g. for material handling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • 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/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Materials Engineering (AREA)
  • Chemical & Material Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Manufacturing & Machinery (AREA)
  • Optics & Photonics (AREA)
  • General Physics & Mathematics (AREA)
  • Mechanical Engineering (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Quality & Reliability (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data processing method and device, a storage medium and a terminal, relates to the technical field of data processing and test development, and mainly aims to solve the technical problem that the data security of a product in an operation database is low in a test process. The method mainly comprises the steps of responding to a data operation request sent by a terminal, and obtaining operation environment information for generating the data operation request and user attribute information of the terminal; matching target connection corresponding to a target storage space from a storage space connection pool according to the operation environment information and the user attribute information, and establishing data connection with the target storage space based on connection information of the target connection; determining a data operation statement based on the data operation request, and sending the data operation statement to the target storage space so that the target storage space executes data operation according to the data operation statement. The method is mainly used for data processing.

Description

Data processing method and device, storage medium and terminal
Technical Field
The present invention relates to the field of data processing and test development technologies, and in particular, to a data processing method and apparatus, a storage medium, and a terminal.
Background
Development and testing of products such as application programs and web browsing interfaces are often fully periodic, and even if the products are already online to provide services for clients, the products still relate to the development of new functions, problem repair and other updated contents. Aiming at the development of new functions and the repair of problems, the development, test and online processes are required, and regression test is also required after the online process, namely verification test is performed in the actual use environment of a user so as to ensure the accuracy of the test.
The existing regression testing process is based on a database in the running environment of the existing product, and newly adds or modifies data in the database to generate data only for testing, wherein the testing data has risks of being called by a user, and if the modified content is not restored after the testing is completed by a tester, normal functions of the product, such as functions of a signboard, data analysis and the like, can be influenced, and inaccuracy of the data can be caused. Meanwhile, the operation authority of the current product operation environment database is required to be opened for the testers, and the risk of data leakage exists. Therefore, a data processing method is needed to solve the above-mentioned problems.
Disclosure of Invention
In view of the above, the invention provides a data processing method and device, a storage medium and a terminal, and mainly aims to solve the technical problem that the data security of a product in an operation database is low in the existing test process.
According to one aspect of the present invention, there is provided a data processing method comprising:
responding to a data operation request sent by a terminal, and acquiring operation environment information for generating the data operation request and user attribute information of the terminal;
matching target connection corresponding to a target storage space from a storage space connection pool according to the operation environment information and the user attribute information, and establishing data connection with the target storage space based on the connection information of the target connection, wherein the storage space connection pool comprises a test connection pool and a non-test connection pool, and the test connection pool and the non-test connection pool are mutually isolated;
determining a data operation statement based on the data operation request, and sending the data operation statement to the target storage space so that the target storage space executes data operation according to the data operation statement.
Further, the matching the target connection corresponding to the target storage space from the storage space connection pool according to the operating environment information and the user attribute information includes:
Determining an operation environment category according to the operation environment information, wherein the operation environment category comprises a test operation environment and a non-test operation environment;
if the operation environment type is the test operation environment, determining one idle connection in the test connection pool as a target connection;
and if the test operation environment is a non-test operation environment, matching the target connection from the storage space connection pool according to the user attribute information.
Further, if the test operation environment is a non-test operation environment, matching the target connection from the storage space connection pool according to the user attribute information includes:
determining user categories according to the user attribute information, wherein the user categories comprise test users and non-test users;
if the user category is the test user, determining one idle connection in the test connection pool as a target connection;
and if the user category is a non-test user, determining one idle connection in the non-test connection as a target connection.
Further, the determining an operating environment category according to the operating environment information includes:
extracting target parameters in the operation environment information, and comparing the target parameters with a first preset parameter and a second preset parameter;
If the target parameter is matched with the first preset parameter, determining the operating environment type as a test operating environment;
and if the target parameter is matched with the second preset parameter, determining the operating environment type as a non-test operating environment.
Further, the determining the user category according to the user attribute information includes:
if the user attribute information is matched with any user attribute information in the test user attribute information set, determining the user category as a test user;
and if the matching of the user attribute information and all the user attribute information in the tested user attribute information set fails, determining the user category as a non-tested user.
Further, after the data operation statement is sent to the target storage space so that the target storage space performs the data operation according to the data operation statement, the method further includes:
when the data operation statement determined based on the data operation request is a statement, acquiring a data operation execution result of the target storage space;
when more than one data operation statement is determined based on the data operation request, a first data operation statement in the data operation statements is sent to the target storage space, after a first execution result of the first data operation statement is obtained, a second data operation statement is sent to the target storage space, and a second execution result of the second data operation statement is obtained until all execution results of all data operation statements corresponding to the data operation request are obtained, and the all execution results are used as data operation execution results;
And sending the data operation execution result to the terminal so that the terminal displays the data operation execution result.
Further, the method further comprises:
and monitoring the transmission state of the target connection, and if the idle time of the target connection is greater than a preset time threshold, releasing the target connection.
According to another aspect of the present invention, there is provided a data processing method apparatus, including:
the acquisition module is used for responding to a data operation request sent by the terminal and acquiring operation environment information for generating the data operation request and user attribute information of the terminal;
the matching module is used for matching target connection corresponding to a target storage space from a storage space connection pool according to the operation environment information and the user attribute information, and establishing data connection with the target storage space based on the connection information of the target connection, wherein the storage space connection pool comprises a test connection pool and a non-test connection pool, and the test connection pool and the non-test connection pool are mutually isolated;
and the sending module is used for determining a data operation statement based on the data operation request and sending the data operation statement to the target storage space so that the target storage space executes data operation according to the data operation statement.
Further, the matching module includes:
the first determining unit is used for determining an operation environment category according to the operation environment information, wherein the operation environment category comprises a test operation environment and a non-test operation environment;
the second determining unit is used for determining one idle connection in the test connection pool as a target connection if the operation environment type is the test operation environment;
and the third determining unit is used for matching the target connection from the storage space connection pool according to the user attribute information if the test operation environment is a non-test operation environment.
Further, in a specific application scenario, the third determining unit is specifically configured to determine a user category according to the user attribute information, where the user category includes a test user and a non-test user;
if the user category is the test user, determining one idle connection in the test connection pool as a target connection;
and if the user category is a non-test user, determining one idle connection in the non-test connection as a target connection.
Further, in a specific application scenario, the third determining unit is specifically configured to extract a target parameter in the operating environment information, and compare the target parameter with a first preset parameter and a second preset parameter;
If the target parameter is matched with the first preset parameter, determining the operating environment type as a test operating environment;
and if the target parameter is matched with the second preset parameter, determining the operating environment type as a non-test operating environment.
Further, in a specific application scenario, the third determining unit is specifically configured to determine, if the user attribute information matches any user attribute information in the test user attribute information set, that the user category is a test user;
and if the matching of the user attribute information and all the user attribute information in the tested user attribute information set fails, determining the user category as a non-tested user.
Further, the apparatus further comprises:
the acquisition module is further used for acquiring a data operation execution result of the target storage space when the data operation statement determined based on the data operation request is a sentence;
the acquiring module is further configured to send, when more than one data operation statement is determined based on the data operation request, a first data operation statement in the data operation statements to the target storage space, send, after acquiring a first execution result of the first data operation statement, a second data operation statement to the target storage space, and acquire a second execution result of the second data operation statement until acquiring all execution results of all data operation statements corresponding to the data operation request, where all the execution results are used as data operation execution results;
The sending module is further configured to send the data operation execution result to the terminal, so that the terminal displays the data operation execution result.
Further, the apparatus further comprises:
and the monitoring module is used for monitoring the transmission state of the target connection, and if the idle time of the target connection is greater than a preset time threshold, releasing the target connection.
According to still another aspect of the present invention, there is provided a storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the above-described data processing method.
According to still another aspect of the present invention, there is provided a terminal including: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the data processing method.
By means of the technical scheme, the technical scheme provided by the embodiment of the invention has at least the following advantages:
the embodiment of the invention obtains the operation environment information for generating the data operation request and the user attribute information of the terminal by responding to the data operation request sent by the terminal; matching target connection corresponding to a target storage space from a storage space connection pool according to the operation environment information and the user attribute information, and establishing data connection with the target storage space based on the connection information of the target connection, wherein the storage space connection pool comprises a test connection pool and a non-test connection pool, and the test connection pool and the non-test connection pool are mutually isolated; determining a data operation statement based on the data operation request, and sending the data operation statement to the target storage space, so that the target storage space executes data operation according to the data operation statement, the influence of the data operation generated by the test on the data in the actual running storage space of the product is avoided, effective isolation between test data and actual user operation data is realized, and the safety of the data of the product in the running database is greatly improved.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
FIG. 1 shows a flow chart of a data processing method provided by an embodiment of the invention;
FIG. 2 is a flowchart of another data processing method according to an embodiment of the present invention;
FIG. 3 is a block diagram showing a data processing apparatus according to an embodiment of the present invention;
fig. 4 shows a schematic structural diagram of a terminal according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Aiming at the existing regression testing process, based on a database in the running environment of the existing product, and carrying out new addition or modification on data in the database, generating data only used for testing, wherein the testing data has risks of being called by a user, if a tester does not recover modified contents after completing testing, normal functions of the product are affected, such as functions of a signboard, data analysis and the like, inaccuracy of the data can be caused. Meanwhile, the database modification permission is required to be opened for the testers, and the technical problem of risk of data leakage exists. The embodiment of the invention provides a data processing method, as shown in fig. 1, which comprises the following steps:
101. and responding to the data operation request sent by the terminal, and acquiring the operation environment information for generating the data operation request and the user attribute information of the terminal.
In the embodiment of the present invention, the current execution body is a server corresponding to an application program or a web browsing program, for example, an application server, a browser backend server, etc., which is not limited in particular. When a real user or a product tester performs function use through an application program use interface or a web browsing use interface in the terminal device, or when the product tester performs function verification through an application program verification interface or a web browsing verification interface, operations such as adding, deleting, modifying, checking and the like on corresponding data are involved, so that the terminal device can generate a data operation request and send the data operation request to a corresponding server. The use interface of the real user is different from the operation environment of the verification interface of the product tester, so that the operation environment information can be used as a basis for identifying the sending intention of the data operation request. The user attribute information may be a login account number, a terminal device ID, etc. of the user, and the embodiment of the present invention is not particularly limited.
It should be noted that, based on the operation environment information, the data operation request sent by the tester and the real user can be distinguished from the operation environment, the tester and the real user can be distinguished from the identity authentication of the operator according to the user attribute information, so as to provide accurate data basis for the selection of the subsequent data storage space, ensure the accuracy of the selection of the data storage space,
102. and matching target connection corresponding to a target storage space from a storage space connection pool according to the operation environment information and the user attribute information, and establishing data connection with the target storage space based on the connection information of the target connection.
In the embodiment of the invention, the storage space connection pool comprises a test connection pool and a non-test connection pool, and the test connection pool and the non-test connection pool are mutually isolated, namely the connection in the test connection pool and the connection in the non-test connection pool are mutually isolated and do not interfere with each other. In order to determine a storage space which needs to execute data operation, namely a target storage space, a target connection for connecting to the target storage space is determined from a storage space connection pool according to operation environment information and user attribute information corresponding to a data operation request. And then establishing connection with the target storage space according to the connection information of the target connection. For example, if the operating environment type represented by the operating environment information is a test operating environment, one connection and the test storage space are selected from the test connection pool as target connections, and if the operating environment type represented by the operating environment information is a non-test type, the target connections are further selected from the user attribute information. And then establishing connection with the target storage space based on the connection information of the target connection. The storage space is a database, and may be other spaces with data storage functions, which is not particularly limited in the embodiment of the present invention. The storage space connection pool is responsible for distributing, managing and releasing storage space connection, allows an application program to repeatedly use the same existing storage space connection, and releases the storage space connection with idle time exceeding the maximum idle time so as to avoid the missing of the storage space connection caused by untimely release of the database connection, and can also create new storage space connection if the idle connection is insufficient.
In the embodiment of the invention, the operating environment type and the user type can be identified based on the tangent plane-oriented programming (Aspect Oriented Programming, spring AOP), specifically, in the Spring Boot application, the operating environment information of the current interface is acquired through annotation (@ Value ("$ { Spring. Profiles. Active }) before the target method is executed, the user attribute information of the current operating user is acquired, the operating environment type and the user type are respectively identified according to the operating environment information and the user attribute information, and then the target connection is selected according to the operating environment type and the user type.
It should be noted that, whether the current data operation request is initiated by a tester or initiated by a real user can be effectively determined based on the operation environment information and the user attribute information, so as to accurately identify whether the data to be generated in the data storage space by the data operation request is the data generated by the user or the data generated by the test, if the data is the test data, the data operation is connected to the test storage space, and if the data is the test data, the data operation is connected to the non-test storage space (product operation storage space) to realize the dynamic switching of the storage space, thereby separating the data generated by the test from the product operation storage space, avoiding the data generated by the test from being viewed by the real user, avoiding the influence on the data in the product operation storage space due to the test, and in addition, the operation authority of the product operation storage space is not required to be issued to the tester, thereby effectively ensuring the data safety in the product operation storage space.
103. Determining a data operation statement based on the data operation request, and sending the data operation statement to the target storage space so that the target storage space executes data operation according to the data operation statement.
In the embodiment of the invention, in order to enable the target storage space to execute the data content of the operation requested by the data operation request, the data operation request is parsed to obtain the data operation statement which can be identified by the storage space, for example, when the storage space is a database, the data operation statement is a structured query statement (Structured Query Language, SQL). The data manipulation statement may perform operations on the memory space including at least an addition process, a deletion process, a modification process, and a query process on the data content.
In an embodiment of the present invention, for further explanation and limitation, as shown in fig. 2, the step of matching, according to the operating environment information and the user attribute information, the target connection corresponding to the target storage space from the storage space connection pool includes:
201. and determining the operating environment category according to the operating environment information.
202. If the operating environment class is the test operating environment, determining one free connection in the test connection pool as a target connection.
203. And if the test operation environment is a non-test operation environment, matching the target connection from the storage space connection pool according to the user attribute information.
In the embodiment of the invention, the operation environment category comprises a test operation environment and a non-test operation environment. The non-test operating environment is a user operating environment for normal operation of the product. If the operating environment class is a test operating environment, indicating that the current data operation request is generated by a test, and the data generated by the data operation is test data, a test connection capable of being connected with the test storage space should be selected as a target connection. Further, in order to ensure timeliness of execution of the data operation request, a test connection with a space running state is selected from the test connection pool as a target connection. If the test operating environment is a non-test operating environment, it indicates that the current data operating request may be generated by a user or by a tester simulating a user interface of a real user to perform a verification test, so that it is required to further determine an issuer of the data operating request based on user attribute information, and then match the target connection from the storage space connection pool.
In an embodiment of the present invention, for further explanation and limitation, if the test operating environment is a non-test operating environment, the matching the target connection from the storage space connection pool according to the user attribute information includes:
determining a user category according to the user attribute information;
if the user category is the test user, determining one idle connection in the test connection pool as a target connection;
and if the user category is a non-test user, determining one idle connection in the non-test connection as a target connection.
In the embodiment of the invention, the user category comprises test users and non-test users. The test user is a product tester, such as a product manager, a product business person, a tester, etc. The non-test user is the real user. If the user sending the data operation request is confirmed to be a test user according to the user attribute information, the data to be generated by the data operation request is indicated to be test data, the data needs to be connected to a storage space for testing, an idle connection is randomly selected from a test connection pool to serve as a target connection, if the user sending the data operation request is confirmed to be a non-test user according to the user attribute information, the data to be generated by the data operation request is indicated to be user use data, the data needs to be connected to the storage space for actually running of a product, and the idle connection is randomly selected from the non-test connection pool to serve as the target connection.
It should be noted that, through the user attribute information, the testing personnel can be identified based on the condition that the user uses the interface to test, thus ensuring the no omission of the testing condition and further ensuring the isolation between the test generated data and the actual running storage space of the product.
In one embodiment of the present invention, for further explanation and limitation, the determining the operating environment category according to the operating environment information includes:
extracting target parameters in the operation environment information, and comparing the target parameters with a first preset parameter and a second preset parameter;
if the target parameter is matched with the first preset parameter, determining the operating environment type as a test operating environment;
and if the target parameter is matched with the second preset parameter, determining the operating environment type as a non-test operating environment.
In the embodiment of the invention, the operation environment information is script information of the user operation interface for generating the data operation request, and can also be parameter information in the interface script information. The target parameter is a script difference parameter between the user use interface and the user test verification interface, and can be configured according to a specific application scene, and the embodiment of the invention is not particularly limited. The first preset parameter is a script difference parameter corresponding to the test operation interface, and the second preset parameter is a script difference parameter corresponding to the non-test operation interface. The interface environment generating the data operation request at present can be accurately identified as a test environment or a non-test environment actually used by a user based on the matching of script parameters, so that the data operation purpose can be accurately identified.
In one embodiment of the present invention, for further explanation and limitation, the determining the user category according to the user attribute information includes:
if the user attribute information is matched with any user attribute information in the test user attribute information set, determining the user category as a test user;
and if the matching of the user attribute information and all the user attribute information in the tested user attribute information set fails, determining the user category as a non-tested user.
In the embodiment of the invention, because the number of the test users is greatly smaller than that of the non-test users, the attribute information set of the test users is constructed in advance according to the user information of the test users, so that the user category is judged based on the attribute information set of the test users. If the user attribute information is matched with any user attribute information in the test user attribute information set, the current user is indicated to be the test user, otherwise, the current user is indicated to not belong to the test user, and the user category is non-test user.
In an embodiment of the present invention, for further explanation and limitation, after the step of sending the data operation statement to the target storage space so that the target storage space performs the data operation according to the data operation statement, the method further includes:
When the data operation statement determined based on the data operation request is a statement, acquiring a data operation execution result of the target storage space;
when more than one data operation statement is determined based on the data operation request, a first data operation statement in the data operation statements is sent to the target storage space, after a first execution result of the first data operation statement is obtained, a second data operation statement is sent to the target storage space, and a second execution result of the second data operation statement is obtained until all execution results of all data operation statements corresponding to the data operation request are obtained, and the all execution results are used as data operation execution results;
and sending the data operation execution result to the terminal so that the terminal displays the data operation execution result.
In the embodiment of the invention, in order to confirm the execution condition of the data operation and feed back the condition to the terminal so that the user can know the execution state of the data operation, the execution result of the data operation needs to be acquired from the target storage space. Because the data structure statement corresponding to one data operation request is not limited to one statement, that is, the situation that one data operation request needs to be divided into multiple steps is existed, when one data operation statement is generated according to the data operation request, after the data operation statement is sent, the execution result of the statement is obtained and is used as the data operation execution result to return to the terminal, when more than one data operation statement is generated according to the data operation request, the data operation execution result is generated according to the execution result of each statement in all the data operation statements. For example, if the data operation request is an order generation request of an a product, firstly, the stock quantity of the a product in the database is queried, and the queried original stock quantity of the a product is obtained, if the stock quantity of the a product is greater than the order quantity, the quantity of the a product in the database is modified, so as to deduct the order quantity from the a product quantity, and the modified a product quantity is obtained, and then the original stock quantity of the a product and the modified a product quantity are returned to the terminal as data operation execution results, so that the correctness of the data operation is confirmed by the user.
In one embodiment of the present invention, for further explanation and limitation, the method further comprises:
and monitoring the transmission state of the target connection, and if the idle time of the target connection is greater than a preset time threshold, releasing the target connection.
In the embodiment of the invention, in order to ensure the utilization rate of the connection and avoid the occupation of the connection idleness, the use state of the target connection is monitored, the unused time of the target connection is timed, when the unused time of the target connection is larger than the preset time threshold, the target connection is indicated to be unused for a long time, the connection between the current execution main body and the target storage space is disconnected, and the target connection regression connection pool is released, so that other operations can call the connection. The preset time threshold may be customized according to the requirements of the actual application scenario, and the embodiment of the present invention is not specifically limited.
The embodiment of the invention provides a data processing method, which is characterized in that the operation environment information for generating a data operation request and the user attribute information of a terminal are obtained by responding to the data operation request sent by the terminal; matching target connection corresponding to a target storage space from a storage space connection pool according to the operation environment information and the user attribute information, and establishing data connection with the target storage space based on the connection information of the target connection, wherein the storage space connection pool comprises a test connection pool and a non-test connection pool, and the test connection pool and the non-test connection pool are mutually isolated; determining a data operation statement based on the data operation request, and sending the data operation statement to the target storage space, so that the target storage space executes data operation according to the data operation statement, the influence of the data operation generated by the test on the data in the actual running storage space of the product is avoided, effective isolation between test data and actual user operation data is realized, and the safety of the data of the product in the running database is greatly improved.
Further, as an implementation of the method shown in fig. 1, an embodiment of the present invention provides a data processing method apparatus, as shown in fig. 3, where the apparatus includes:
an obtaining module 31, configured to obtain, in response to a data operation request sent by a terminal, operation environment information for generating the data operation request, and user attribute information of the terminal;
the matching module 32 is configured to match, according to the operating environment information and the user attribute information, a target connection corresponding to a target storage space from a storage space connection pool, and establish a data connection with the target storage space based on connection information of the target connection, where the storage space connection pool includes a test connection pool and a non-test connection pool, and the test connection pool and the non-test connection pool are isolated from each other;
and a sending module 33, configured to determine a data operation statement based on the data operation request, and send the data operation statement to the target storage space, so that the target storage space performs a data operation according to the data operation statement.
Further, the matching module 32 includes:
the first determining unit is used for determining an operation environment category according to the operation environment information, wherein the operation environment category comprises a test operation environment and a non-test operation environment;
The second determining unit is used for determining one idle connection in the test connection pool as a target connection if the operation environment type is the test operation environment;
and the third determining unit is used for matching the target connection from the storage space connection pool according to the user attribute information if the test operation environment is a non-test operation environment.
Further, in a specific application scenario, the third determining unit is specifically configured to determine a user category according to the user attribute information, where the user category includes a test user and a non-test user;
if the user category is the test user, determining one idle connection in the test connection pool as a target connection;
and if the user category is a non-test user, determining one idle connection in the non-test connection as a target connection.
Further, in a specific application scenario, the third determining unit is specifically configured to extract a target parameter in the operating environment information, and compare the target parameter with a first preset parameter and a second preset parameter;
if the target parameter is matched with the first preset parameter, determining the operating environment type as a test operating environment;
And if the target parameter is matched with the second preset parameter, determining the operating environment type as a non-test operating environment.
Further, in a specific application scenario, the third determining unit is specifically configured to determine, if the user attribute information matches any user attribute information in the test user attribute information set, that the user category is a test user;
and if the matching of the user attribute information and all the user attribute information in the tested user attribute information set fails, determining the user category as a non-tested user.
Further, the apparatus further comprises:
the obtaining module 31 is further configured to obtain a data operation execution result of the target storage space when the data operation sentence determined based on the data operation request is a sentence;
the obtaining module 31 is further configured to send, when there is more than one data operation statement determined based on the data operation request, a first data operation statement in the data operation statements to the target storage space, send, after obtaining a first execution result of the first data operation statement, a second data operation statement to the target storage space, and obtain a second execution result of the second data operation statement, until obtaining all execution results of all data operation statements corresponding to the data operation request, and take all the execution results as data operation execution results;
The sending module 33 is further configured to send the data operation execution result to the terminal, so that the terminal displays the data operation execution result.
Further, the apparatus further comprises:
and the monitoring module is used for monitoring the transmission state of the target connection, and if the idle time of the target connection is greater than a preset time threshold, releasing the target connection.
The embodiment of the invention provides a data processing device, which is used for acquiring operation environment information for generating a data operation request and user attribute information of a terminal by responding to the data operation request sent by the terminal; matching target connection corresponding to a target storage space from a storage space connection pool according to the operation environment information and the user attribute information, and establishing data connection with the target storage space based on the connection information of the target connection, wherein the storage space connection pool comprises a test connection pool and a non-test connection pool, and the test connection pool and the non-test connection pool are mutually isolated; determining a data operation statement based on the data operation request, and sending the data operation statement to the target storage space, so that the target storage space executes data operation according to the data operation statement, the influence of the data operation generated by the test on the data in the actual running storage space of the product is avoided, effective isolation between test data and actual user operation data is realized, and the safety of the data of the product in the running database is greatly improved.
According to one embodiment of the present invention, there is provided a storage medium storing at least one executable instruction for performing the data processing method of any of the above-described method embodiments.
Fig. 4 is a schematic structural diagram of a terminal according to an embodiment of the present invention, and the specific embodiment of the present invention is not limited to the specific implementation of the terminal.
As shown in fig. 4, the terminal may include: a processor 402, a communication interface (Communications Interface) 404, a memory 406, and a communication bus 408.
Wherein: processor 402, communication interface 404, and memory 406 communicate with each other via communication bus 408.
A communication interface 404 for communicating with network elements of other devices, such as clients or other servers.
Processor 402 is configured to execute program 410, and may specifically perform relevant steps in the above-described data processing method embodiment.
In particular, program 410 may include program code including computer-operating instructions.
The processor 402 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement embodiments of the present invention. The one or more processors included in the terminal may be the same type of processor, such as one or more CPUs; but may also be different types of processors such as one or more CPUs and one or more ASICs.
Memory 406 for storing programs 410. Memory 406 may comprise high-speed RAM memory or may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
Program 410 may be specifically operable to cause processor 402 to:
responding to a data operation request sent by a terminal, and acquiring operation environment information for generating the data operation request and user attribute information of the terminal;
matching target connection corresponding to a target storage space from a storage space connection pool according to the operation environment information and the user attribute information, and establishing data connection with the target storage space based on the connection information of the target connection, wherein the storage space connection pool comprises a test connection pool and a non-test connection pool, and the test connection pool and the non-test connection pool are mutually isolated;
determining a data operation statement based on the data operation request, and sending the data operation statement to the target storage space so that the target storage space executes data operation according to the data operation statement.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of data processing, comprising:
responding to a data operation request sent by a terminal, and acquiring operation environment information for generating the data operation request and user attribute information of the terminal;
matching target connection corresponding to a target storage space from a storage space connection pool according to the operation environment information and the user attribute information, and establishing data connection with the target storage space based on the connection information of the target connection, wherein the storage space connection pool comprises a test connection pool and a non-test connection pool, and the test connection pool and the non-test connection pool are mutually isolated;
determining a data operation statement based on the data operation request, and sending the data operation statement to the target storage space so that the target storage space executes data operation according to the data operation statement.
2. The method according to claim 1, wherein the matching the target connection corresponding to the target storage space from the storage space connection pool according to the operating environment information and the user attribute information includes:
determining an operation environment category according to the operation environment information, wherein the operation environment category comprises a test operation environment and a non-test operation environment;
if the operation environment type is the test operation environment, determining one idle connection in the test connection pool as a target connection;
and if the test operation environment is a non-test operation environment, matching the target connection from the storage space connection pool according to the user attribute information.
3. The method of claim 2, wherein if the test operating environment is a non-test operating environment, matching the target connection from the pool of storage space connections according to the user attribute information comprises:
determining user categories according to the user attribute information, wherein the user categories comprise test users and non-test users;
if the user category is the test user, determining one idle connection in the test connection pool as a target connection;
and if the user category is a non-test user, determining one idle connection in the non-test connection as a target connection.
4. The method of claim 2, wherein said determining an operating environment category from said operating environment information comprises:
extracting target parameters in the operation environment information, and comparing the target parameters with a first preset parameter and a second preset parameter;
if the target parameter is matched with the first preset parameter, determining the operating environment type as a test operating environment;
and if the target parameter is matched with the second preset parameter, determining the operating environment type as a non-test operating environment.
5. A method according to claim 3, wherein said determining a user category from said user attribute information comprises:
if the user attribute information is matched with any user attribute information in the test user attribute information set, determining the user category as a test user;
and if the matching of the user attribute information and all the user attribute information in the tested user attribute information set fails, determining the user category as a non-tested user.
6. The method of claim 1, wherein after the sending the data operation statement to the target storage space to cause the target storage space to perform a data operation in accordance with the data operation statement, the method further comprises:
When the data operation statement determined based on the data operation request is a statement, acquiring a data operation execution result of the target storage space;
when more than one data operation statement is determined based on the data operation request, a first data operation statement in the data operation statements is sent to the target storage space, after a first execution result of the first data operation statement is obtained, a second data operation statement is sent to the target storage space, and a second execution result of the second data operation statement is obtained until all execution results of all data operation statements corresponding to the data operation request are obtained, and the all execution results are used as data operation execution results;
and sending the data operation execution result to the terminal so that the terminal displays the data operation execution result.
7. The method according to any one of claims 1-6, further comprising:
and monitoring the transmission state of the target connection, and if the idle time of the target connection is greater than a preset time threshold, releasing the target connection.
8. A data processing apparatus, comprising:
The acquisition module is used for responding to a data operation request sent by the terminal and acquiring operation environment information for generating the data operation request and user attribute information of the terminal;
the matching module is used for matching target connection corresponding to a target storage space from a storage space connection pool according to the operation environment information and the user attribute information, and establishing data connection with the target storage space based on the connection information of the target connection, wherein the storage space connection pool comprises a test connection pool and a non-test connection pool, and the test connection pool and the non-test connection pool are mutually isolated;
and the sending module is used for determining a data operation statement based on the data operation request and sending the data operation statement to the target storage space so that the target storage space executes data operation according to the data operation statement.
9. A storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the data processing method of any one of claims 1-7.
10. A terminal, comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
The memory is configured to store at least one executable instruction, where the executable instruction causes the processor to perform operations corresponding to the data processing method according to any one of claims 1 to 7.
CN202310043475.8A 2023-01-12 2023-01-12 Data processing method and device, storage medium and terminal Pending CN117131545A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310043475.8A CN117131545A (en) 2023-01-12 2023-01-12 Data processing method and device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310043475.8A CN117131545A (en) 2023-01-12 2023-01-12 Data processing method and device, storage medium and terminal

Publications (1)

Publication Number Publication Date
CN117131545A true CN117131545A (en) 2023-11-28

Family

ID=88857033

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310043475.8A Pending CN117131545A (en) 2023-01-12 2023-01-12 Data processing method and device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN117131545A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117539949A (en) * 2024-01-10 2024-02-09 腾讯科技(深圳)有限公司 Processing method and device of database access request, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117539949A (en) * 2024-01-10 2024-02-09 腾讯科技(深圳)有限公司 Processing method and device of database access request, electronic equipment and storage medium
CN117539949B (en) * 2024-01-10 2024-04-12 腾讯科技(深圳)有限公司 Processing method and device of database access request, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111177005B (en) Service application testing method, device, server and storage medium
CN107656874B (en) Interface testing method and device, simulation baffle and system
CN109474578B (en) Message checking method, device, computer equipment and storage medium
US9489292B2 (en) Devices and methods for acquiring abnormal information
CN108459850B (en) Method, device and system for generating test script
CN107659455B (en) Method, storage medium, device and system for Mock data of iOS (internet operating system) end
CN110764980A (en) Log processing method and device
CN111522728A (en) Method for generating automatic test case, electronic device and readable storage medium
CN108959086B (en) Program package testing deployment method, device, system, electronic equipment and storage medium
CN112650676A (en) Software testing method, device, equipment and storage medium
CN117131545A (en) Data processing method and device, storage medium and terminal
CN107357721B (en) Method and device for testing system
CN111045935B (en) Automatic version auditing method, device, equipment and storage medium
CN116627849B (en) System test method, device, equipment and storage medium
CN107291612A (en) A kind of method and device of test
CN112015715A (en) Industrial Internet data management service testing method and system
CN113127345B (en) Application testing method and device, electronic equipment and storage medium
CN109669829A (en) A kind of diagnosis adjustment method, device and server based on BMC
CN115061924A (en) Automatic test case generation method and generation device
CN112181485B (en) Script execution method and device, electronic equipment and storage medium
CN113110996A (en) Test method and device
CN113051178A (en) Test data construction method, device, equipment and medium
CN110362464B (en) Software analysis method and equipment
CN111651429B (en) Big data scheduling parameter management method, device and distributed platform
CN117724986B (en) Method and device for automatically operating kafka in use case execution

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