CN113448788A - Test-based service processing method and device, electronic equipment and storage medium - Google Patents

Test-based service processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113448788A
CN113448788A CN202110728034.2A CN202110728034A CN113448788A CN 113448788 A CN113448788 A CN 113448788A CN 202110728034 A CN202110728034 A CN 202110728034A CN 113448788 A CN113448788 A CN 113448788A
Authority
CN
China
Prior art keywords
transaction
test
processing
transaction object
request
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
CN202110728034.2A
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.)
Ping An Securities Co Ltd
Original Assignee
Ping An Securities 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 Securities Co Ltd filed Critical Ping An Securities Co Ltd
Priority to CN202110728034.2A priority Critical patent/CN113448788A/en
Publication of CN113448788A publication Critical patent/CN113448788A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a pedestal operation and maintenance technology, and discloses a service processing method based on testing, which comprises the following steps: acquiring a distributed transaction creation request, and creating a transaction object according to the distributed transaction creation request; sending the transaction object to a transaction processing party for test processing, and acquiring a test field returned by the transaction processing party for test processing of the transaction object; if the test field is different from the preset standard field, sending an instruction for discarding the transaction object to the transaction processing party; if the test field is the same as the standard field, the transaction processing party is used for carrying out service processing on the transaction object. In addition, the invention also relates to a blockchain technology, and the transaction object can be stored in the node of the blockchain. The invention also provides a test-based service processing device, electronic equipment and a computer readable storage medium. The invention can solve the problem of low efficiency when the distributed system processes the service.

Description

Test-based service processing method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of pedestal operation and maintenance, in particular to a test-based service processing method and device, electronic equipment and a computer readable storage medium.
Background
As the computer system supports more and more functions, a large amount of resources are consumed for maintaining and operating the computer system, and therefore, the concept of distributed service is increasingly used in a large computer system, but when network jitter or a large amount of services are faced, due to the distributivity of the distributed system, when a plurality of distributed servers process the services, the processing results cannot be coordinated.
In the existing method, in order to reduce the situation that processing results cannot be coordinated when a distributed system processes services, a service rollback means is mostly adopted, that is, when the processing results are asynchronous, the whole service is rolled back to a user, and service processing is restarted.
Disclosure of Invention
The invention provides a test-based service processing method and device and a computer readable storage medium, and mainly aims to solve the problem of low efficiency when a distributed system processes services.
In order to achieve the above object, the present invention provides a service processing method based on test, which includes:
acquiring a distributed transaction creation request, and creating a transaction object according to the distributed transaction creation request;
sending the transaction object to a transaction processing party for test processing, and acquiring a test field returned by the transaction processing party for test processing of the transaction object;
if the test field is different from a preset standard field, sending an instruction for discarding the transaction object to the transaction processing party;
and if the test field is the same as the standard field, performing service processing on the transaction object by using the transaction processing party.
Optionally, the obtaining a distributed transaction creation request includes:
intercepting a data request in the distributed system by using a preset interceptor;
performing request header analysis on the intercepted data request to obtain a request header field;
and selecting a data request corresponding to a request head field which is the same as the preset field, and determining that the selected data request is a distributed transaction establishment request.
Optionally, the creating a transaction object according to the distributed transaction creation request includes:
analyzing a request body of the distributed transaction establishing request to obtain transaction parameters;
retrieving in a preset transaction flow table according to the transaction parameters to obtain a transaction establishing flow;
and creating a transaction object according to the transaction creating flow.
Optionally, the sending the transaction object to a transaction handler for test processing, and acquiring a test field returned by the transaction handler for test processing on the transaction object includes:
performing field conversion on the transaction object to obtain a transaction field;
compiling the transaction field into a preset transaction test request;
and requesting a transaction processing party to perform test processing on the transaction object by using the transaction test request, and acquiring a test field returned by the transaction processing party to perform test processing on the transaction object.
Optionally, after sending the instruction to discard the transaction object to the transaction handler, the method further includes:
analyzing the command of discarding the transaction object to obtain a target transaction object in the command;
storing the target transaction object to a preset transaction cache, and recording the storage time of the transaction object;
and when the storage time is larger than a preset time threshold value, discarding the target transaction object.
Optionally, the performing, by the transaction handler, a service process on the transaction object includes:
calculating the priority value of the transaction object by using a preset priority value algorithm;
according to the priority value, sequencing the transaction objects in a descending order;
and informing the transaction processing party to process the transaction object according to the sequencing order.
Optionally, the calculating the priority value of the transaction object by using a preset priority value algorithm includes:
calculating a priority value for the transaction object using a priority value algorithm as follows:
Y=α*T+β*D
wherein Y is the priority value, T is the creation duration of the transaction object, D is the transaction grade of the transaction object, and alpha and beta are preset weight coefficients.
In order to solve the above problem, the present invention further provides a test-based service processing apparatus, including:
the object creating module is used for acquiring a distributed transaction creating request and creating a transaction object according to the distributed transaction creating request;
the test processing module is used for sending the transaction object to a transaction processing party for test processing and acquiring a test field returned by the transaction processing party for test processing of the transaction object;
the object discarding module is used for sending an instruction for discarding the transaction object to the transaction processing party if the test field is different from a preset standard field;
and the object processing module is used for performing service processing on the transaction object by using the transaction processing party if the test field is the same as the standard field.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one instruction; and
and the processor executes the instructions stored in the memory to realize the test-based service processing method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, in which at least one instruction is stored, and the at least one instruction is executed by a processor in an electronic device to implement the test-based service processing method described above.
The embodiment of the invention creates the transaction object according to the distributed transaction creating request, and sends the transaction object to the transaction processing party for test processing before the transaction object is processed by the transaction processing party, so that the transaction object which cannot be processed by the transaction processing party is discarded according to the test result, and the problem that the transaction object cannot be executed after the transaction processing party executes the transaction object and then is rolled back is avoided. Therefore, the test-based service processing method, the test-based service processing device, the electronic equipment and the computer-readable storage medium can solve the problem of low identification accuracy of the electronic seal.
Drawings
Fig. 1 is a schematic flowchart of a test-based service processing method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of acquiring a distributed transaction creation request according to an embodiment of the present invention;
FIG. 3 is a functional block diagram of a test-based service processing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device implementing the test-based service processing method according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides a service processing method based on testing. The execution subject of the test-based service processing method includes, but is not limited to, at least one of electronic devices, such as a server and a terminal, which can be configured to execute the method provided by the embodiments of the present application. In other words, the test-based service processing method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Fig. 1 is a schematic flow chart of a test-based service processing method according to an embodiment of the present invention. In this embodiment, the test-based service processing method includes:
s1, obtaining the distributed transaction creating request, and creating the transaction object according to the distributed transaction creating request.
In the embodiment of the invention, the distributed transaction creation request can be used for creating a transaction object which can be used for execution in a distributed system with a distributed service support function.
For example, after a shopping website supported by a distributed system receives a shopping request for purchasing a target item sent by a user, an object is created according to the shopping request, and the object includes services related to trading the target item, such as inventory query service, payment service, and the like, so that different distributed servers of the shopping website are respectively called according to different services in the object, and the called distributed servers are further used for processing the object created by the distributed transaction creation request.
The shopping request is the distributed transaction establishing request, and the item transaction object is a transaction object established according to the distributed transaction establishing request.
In the embodiment of the invention, the distributed transaction creation request can be obtained from the intercepted data request by intercepting the data request in the distributed system and screening the intercepted data request.
In this embodiment of the present invention, referring to fig. 2, the acquiring a distributed transaction creation request includes:
s21, intercepting a data request in the distributed system by using a preset interceptor;
s22, performing request header analysis on the intercepted data request to obtain a request header field;
and S23, selecting a data request corresponding to the request head field which is the same as the preset field, and determining that the selected data request is a distributed transaction creation request.
In detail, the interceptor may be a computer sentence having a data request intercepting function, or a plug-in tool having a data request intercepting function, which is pre-installed in the distributed system.
Specifically, the data request may be structurally divided according to an international standard protocol (e.g., HTTP protocol, TCP protocol, etc.) of the data request, to obtain a request header of the data request, and the request header may be parsed by a parser having a request parsing function to obtain a request header field, where the parser includes, but is not limited to, an xhtml-engine parser, an htmlpacker parser, and a Fruit-HTML parser.
In the embodiment of the present invention, the request header field may be used to identify a type of the data request, and the preset field is a field used to identify a type of the distributed transaction creation request.
In detail, the request header field is compared with a preset field, and a distributed transaction creation request containing the preset field can be screened from intercepted data requests according to the comparison result.
Specifically, when the request header field is not the same as the preset field, it may be determined that the data request including the request header field is not a distributed transaction creation request, and when the request header field is the same as the preset field, it may be determined that the data creation request including the request header field is a distributed transaction creation request.
In one practical application scenario of the present invention, because the distributed transaction creation request often needs to be processed by multiple distributed servers in the distributed system, in order to facilitate different distributed servers to process the distributed transaction creation request, a transaction object can be created according to the distributed transaction creation request, and the distributed system is used to perform targeted processing on the content of the transaction object, so as to improve the accuracy and efficiency of the distributed system in processing the distributed transaction creation request.
In this embodiment of the present invention, the creating a transaction object according to the distributed transaction creation request includes:
analyzing a request body of the distributed transaction establishing request to obtain transaction parameters;
retrieving in a preset transaction flow table according to the transaction parameters to obtain a transaction establishing flow;
and creating a transaction object according to the transaction creating flow.
In detail, the step of analyzing the request body of the distributed transaction creation request is consistent with the step of analyzing the request header of the intercepted data request, and is not described herein again.
The transaction parameters include, but are not limited to: and processing the distributed object to obtain a service name, a service interface name, a data transmission mode and the like which need to be called.
In detail, the transaction flow table includes a plurality of transaction parameters and a transaction object creation flow corresponding to each transaction parameter, and the transaction object creation flow corresponding to the transaction parameters is obtained by constructing an index of the transaction flow table, retrieving in the transaction flow table according to the index and the transaction parameters, and creating a transaction object according to the transaction object creation flow.
For example, the request body of the distributed transaction creation request is analyzed, and the obtained transaction parameters are service names: and searching from the transaction flow table according to the transaction parameters to obtain a creating flow of the transaction object corresponding to the query service and a creating flow of the transaction object corresponding to the payment service, and creating the service objects for the query service and the payment service according to the queried service flows respectively.
S2, sending the transaction object to a transaction processing party for test processing, and acquiring a test field returned by the transaction processing party for test processing of the transaction object.
In the embodiment of the present invention, the transaction processing party is a set of all distributed servers in the distributed system.
In one practical application scenario of the present invention, different transaction objects need to be processed by different distributed servers in the distributed system, for example, a transaction object of an inquiry service needs to be processed by a distributed server including a database storing the inquiry object of the inquiry service, and a service object of a payment service needs to be processed by a distributed server having a payment clearing function, but processing schedules of different distributed servers in the distributed system are different, and if a large number of transaction objects are directly processed, a system jam or a processing process disorder may occur.
For example, the transaction processing party includes a distributed server a and a distributed server B, where the distributed server a is in a state where the transaction object can be processed, and the distributed server B is in a state where the transaction object cannot be processed, and if the transaction processing party is used to process a plurality of transaction objects at the same time, a problem that the transaction object is blocked at the distributed server B may occur, or a problem that the processing schedules of two distributed servers are different, which may cause a schedule disorder.
In the embodiment of the invention, the transaction object is sent to the transaction processing party for test processing, the test field returned by the transaction processing party for test processing on the transaction object is obtained, and then the transaction object is selectively processed according to the test field subsequently, so as to avoid the condition of system blockage or process disorder.
In the embodiment of the present invention, the sending the transaction object to a transaction processing party for performing test processing, and acquiring a test field returned by the transaction processing party for performing test processing on the transaction object includes:
performing field conversion on the transaction object to obtain a transaction field;
compiling the transaction field into a preset transaction test request;
and requesting a transaction processing party to perform test processing on the transaction object by using the transaction test request, and acquiring a test field returned by the transaction processing party to perform test processing on the transaction object.
In detail, the transaction test request may be used to initiate a test of a transaction to a transaction object to the transaction handler.
Specifically, the transaction object may be encoded by a preset encoder to convert the transaction object into a transaction field in the form of a computer-readable data field, and the transaction field is compiled into a preset transaction test request by a preset compiler.
For example, there is a transaction object a, a transaction test request http.xxxx.zzzz, and the transaction object is encoded by using a preset encoder to obtain a transaction field: and qwer, compiling the transaction field into a preset transaction test request by using a preset compiler to obtain the transaction test request: http.xxxx.zzzz.qwer, and further performing test processing on the transaction processing party by using the transaction test request to obtain a test field returned by the transaction processing party for performing test processing on the transaction object.
In the embodiment of the present invention, the test field may be used to identify whether a transaction handler can process the transaction object.
And S3, judging whether the test field is the same as a preset standard field, if the test field is not the same as the standard field, executing S4, and sending an instruction for discarding the transaction object to the transaction processing party.
In the embodiment of the present invention, whether the test field is the same as a preset standard field or not may be determined by comparing the test field with the preset standard field, and if the test field is not the same as the standard field, it indicates that the transaction processing party cannot process the transaction object, an instruction to discard the transaction object is sent to the transaction processing party.
In one embodiment of the present invention, after the instruction for discarding the transaction object is sent to the transaction processing party, the step of obtaining the distributed transaction creation request may be returned to re-create the transaction object, so as to try to re-test the transaction object, and return to the step of re-creating the transaction object.
In one practical application scenario of the present invention, due to system deviation or erroneous judgment, a situation that a transaction object that can be processed by a distributed system is discarded erroneously may occur, and therefore, in order to avoid a situation that the distributed system cannot process the transaction object after the transaction object is discarded erroneously, the embodiment of the present invention may construct a preset transaction cache to store the discarded transaction object for a preset duration, so that when the transaction object is found to be discarded erroneously, the transaction object that is discarded erroneously may be recalled from the transaction cache.
In another embodiment of the present invention, after the sending the instruction to discard the transaction object to the transaction handler, the method further includes:
analyzing the command of discarding the transaction object to obtain a target transaction object in the command;
storing the target transaction object to a preset transaction cache, and recording the storage time of the transaction object;
and when the storage time is larger than a preset time threshold value, discarding the target transaction object.
In detail, the transaction cache may be a redis cache, a NoSQL database, a blockchain node, and the like.
For example, after an instruction for analyzing and discarding the transaction object is sent to the transaction processor, the instruction is analyzed and analyzed, and the discarded transaction object is obtained as follows: and the transaction object A stores the transaction object A into a preset transaction cache, records the cache time of the transaction object A, analyzes and judges the cache time of the transaction object A according to a preset time interval, does not continuously process the transaction object A when the storage time is less than or equal to the time threshold, and discards the target transaction object when the storage time is greater than the time threshold.
And if the test field is the same as the standard field, executing S5 and performing service processing on the transaction object by using the transaction processing party.
In this embodiment of the present invention, if the test field is the same as the standard field, which indicates that the transaction processing party can process the transaction object, the transaction processing party is used to process the transaction object.
In one practical application scenario of the present invention, because a plurality of transaction objects may exist in the distributed system and need to be processed simultaneously, which further causes too much computing resources to be occupied, and reduces the efficiency of processing the transaction objects, in order to improve the efficiency of processing the transaction objects, the embodiment of the present invention may calculate the priority values of the transaction objects, and process the transaction objects step by step according to the priority values.
In this embodiment of the present invention, the performing, by the transaction handler, a service process on the transaction object includes:
calculating the priority value of the transaction object by using a preset priority value algorithm;
according to the priority value, sequencing the transaction objects in a descending order;
and informing the transaction processing party to process the transaction object according to the sequencing order.
In one embodiment of the present invention, the calculating the priority value of the transaction object by using a preset priority value algorithm includes:
calculating a priority value for the transaction object using a priority value algorithm as follows:
Y=α*T+β*D
wherein Y is the priority value, T is the creation duration of the transaction object, D is the transaction grade of the transaction object, and alpha and beta are preset weight coefficients.
In detail, in the embodiment of the present invention, the transaction objects are sorted in the order from the largest priority value to the smallest priority value, and the transaction objects are processed by the transaction processing party according to the sorted order.
For example, there are a transaction object a, a transaction object B, a transaction object C, and a transaction object D, and after calculation, the priority value of the transaction object a is 90, the priority value of the transaction object B is 60, the priority value of the transaction object C is 70, and the priority value of the transaction object D is 60, and then the transaction objects can be sorted into the transaction object a, the transaction object C, the transaction object B, and the transaction object D according to the descending order of the priority values, wherein the transaction object B and the transaction object D are parallel, and then the transaction object a is processed by the transaction processing party, then the transaction object C is processed by the transaction processing party, and finally the transaction object B and the transaction object D are simultaneously processed by the transaction processing party.
The embodiment of the invention creates the transaction object according to the distributed transaction creating request, and sends the transaction object to the transaction processing party for test processing before the transaction object is processed by the transaction processing party, so that the transaction object which cannot be processed by the transaction processing party is discarded according to the test result, and the problem that the transaction object cannot be executed after the transaction processing party executes the transaction object and then is rolled back is avoided. Therefore, the test-based service processing method, the test-based service processing device, the electronic equipment and the computer-readable storage medium can solve the problem of low identification accuracy of the electronic seal.
Fig. 3 is a functional block diagram of a test-based service processing apparatus according to an embodiment of the present invention.
The test-based transaction processing device 100 of the present invention can be installed in an electronic device. According to the implemented functions, the test-based service processing apparatus 100 may include an object creation module 101, a test processing module 102, an object discarding module 103, and an object processing module 104. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the object creating module 101 is configured to obtain a distributed transaction creating request, and create a transaction object according to the distributed transaction creating request;
the test processing module 102 is configured to send the transaction object to a transaction processing party for test processing, and obtain a test field returned by the transaction processing party for test processing on the transaction object;
the object discarding module 103 is configured to send an instruction to discard the transaction object to the transaction processing party if the test field is different from a preset standard field;
the object processing module 104 is configured to perform service processing on the transaction object by using the transaction processing party if the test field is the same as the standard field.
In detail, when the modules in the test-based service processing apparatus 100 according to the embodiment of the present invention are used, the same technical means as the test-based service processing method described in fig. 1 to fig. 2 are adopted, and the same technical effects can be produced, which is not described herein again.
Fig. 4 is a schematic structural diagram of an electronic device implementing a test-based service processing method according to an embodiment of the present invention.
The electronic device may comprise a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may further comprise a computer program, such as a test-based transaction processing program, stored in the memory 11 and executable on the processor 10.
In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same function or different functions, and includes one or more Central Processing Units (CPUs), a microprocessor, a digital Processing chip, a graphics processor, a combination of various control chips, and the like. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the whole electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules (e.g., executing test-based business processing programs, etc.) stored in the memory 11 and calling data stored in the memory 11.
The memory 11 includes at least one type of readable storage medium including flash memory, removable hard disks, multimedia cards, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disks, optical disks, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as codes of a front-end monitoring program, but also to temporarily store data that has been output or will be output.
The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
The communication interface 13 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
Fig. 4 only shows an electronic device with components, and it will be understood by those skilled in the art that the structure shown in fig. 4 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The memory 11 in the electronic device 1 stores a test-based transaction processing program that is a combination of instructions that, when executed in the processor 10, enable:
acquiring a distributed transaction creation request, and creating a transaction object according to the distributed transaction creation request;
sending the transaction object to a transaction processing party for test processing, and acquiring a test field returned by the transaction processing party for test processing of the transaction object;
if the test field is different from a preset standard field, sending an instruction for discarding the transaction object to the transaction processing party;
and if the test field is the same as the standard field, performing service processing on the transaction object by using the transaction processing party.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiment corresponding to fig. 1, which is not described herein again.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring a distributed transaction creation request, and creating a transaction object according to the distributed transaction creation request;
sending the transaction object to a transaction processing party for test processing, and acquiring a test field returned by the transaction processing party for test processing of the transaction object;
if the test field is different from a preset standard field, sending an instruction for discarding the transaction object to the transaction processing party;
and if the test field is the same as the standard field, performing service processing on the transaction object by using the transaction processing party.
In the embodiments provided in 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 apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules 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 modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules 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, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an 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.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A service processing method based on test is characterized in that the method comprises the following steps:
acquiring a distributed transaction creation request, and creating a transaction object according to the distributed transaction creation request;
sending the transaction object to a transaction processing party for test processing, and acquiring a test field returned by the transaction processing party for test processing of the transaction object;
if the test field is different from a preset standard field, sending an instruction for discarding the transaction object to the transaction processing party;
and if the test field is the same as the standard field, performing service processing on the transaction object by using the transaction processing party.
2. The test-based traffic processing method of claim 1, wherein the obtaining a distributed transaction creation request comprises:
intercepting a data request in the distributed system by using a preset interceptor;
performing request header analysis on the intercepted data request to obtain a request header field;
and selecting a data request corresponding to a request head field which is the same as the preset field, and determining that the selected data request is a distributed transaction establishment request.
3. The test-based business process method of claim 1, wherein said creating a transaction object from said distributed transaction creation request comprises:
analyzing a request body of the distributed transaction establishing request to obtain transaction parameters;
retrieving in a preset transaction flow table according to the transaction parameters to obtain a transaction establishing flow;
and creating a transaction object according to the transaction creating flow.
4. The test-based business process method of claim 1, wherein said sending the transaction object to a transaction handler for test processing and obtaining a test field returned by the transaction handler for test processing of the transaction object comprises:
performing field conversion on the transaction object to obtain a transaction field;
compiling the transaction field into a preset transaction test request;
and requesting a transaction processing party to perform test processing on the transaction object by using the transaction test request, and acquiring a test field returned by the transaction processing party to perform test processing on the transaction object.
5. The test-based transaction processing method of claim 1, wherein after sending the transaction handler an instruction to discard the transaction object, the method further comprises:
analyzing the command of discarding the transaction object to obtain a target transaction object in the command;
storing the target transaction object to a preset transaction cache, and recording the storage time of the transaction object;
and when the storage time is larger than a preset time threshold value, discarding the target transaction object.
6. The test-based business processing method of any one of claims 1 to 5, wherein the utilizing the transaction handler to conduct business processing on the transaction object comprises:
calculating the priority value of the transaction object by using a preset priority value algorithm;
according to the priority value, sequencing the transaction objects in a descending order;
and informing the transaction processing party to process the transaction object according to the sequencing order.
7. The test-based transaction processing method of claim 6, wherein the calculating the priority value of the transaction object using a preset priority value algorithm comprises:
calculating a priority value for the transaction object using a priority value algorithm as follows:
Y=α*T+β*D
wherein Y is the priority value, T is the creation duration of the transaction object, D is the transaction grade of the transaction object, and alpha and beta are preset weight coefficients.
8. A test-based traffic processing apparatus, the apparatus comprising:
the object creating module is used for acquiring a distributed transaction creating request and creating a transaction object according to the distributed transaction creating request;
the test processing module is used for sending the transaction object to a transaction processing party for test processing and acquiring a test field returned by the transaction processing party for test processing of the transaction object;
the object discarding module is used for sending an instruction for discarding the transaction object to the transaction processing party if the test field is different from a preset standard field;
and the object processing module is used for performing service processing on the transaction object by using the transaction processing party if the test field is the same as the standard field.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a test-based transaction processing method according to any of claims 1 to 7.
10. A computer-readable storage medium, storing a computer program, wherein the computer program, when executed by a processor, implements the test-based traffic processing method according to any one of claims 1 to 7.
CN202110728034.2A 2021-06-29 2021-06-29 Test-based service processing method and device, electronic equipment and storage medium Pending CN113448788A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110728034.2A CN113448788A (en) 2021-06-29 2021-06-29 Test-based service processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110728034.2A CN113448788A (en) 2021-06-29 2021-06-29 Test-based service processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113448788A true CN113448788A (en) 2021-09-28

Family

ID=77813999

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110728034.2A Pending CN113448788A (en) 2021-06-29 2021-06-29 Test-based service processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113448788A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106331153A (en) * 2016-09-20 2017-01-11 北京华为数字技术有限公司 Service request filtering method, service request filtering device and service request filtering system
WO2018103318A1 (en) * 2016-12-06 2018-06-14 上海壹账通金融科技有限公司 Distributed transaction handling method and system
CN108664650A (en) * 2018-05-17 2018-10-16 百度在线网络技术(北京)有限公司 A kind of transaction methods, device, equipment and the storage medium of block chain network
CN111045794A (en) * 2019-12-17 2020-04-21 深圳前海环融联易信息科技服务有限公司 Distributed transaction processing method, device, system, computer equipment and storage medium
CN111625323A (en) * 2019-02-28 2020-09-04 北京京东尚科信息技术有限公司 Distributed task processing method, device, equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106331153A (en) * 2016-09-20 2017-01-11 北京华为数字技术有限公司 Service request filtering method, service request filtering device and service request filtering system
WO2018103318A1 (en) * 2016-12-06 2018-06-14 上海壹账通金融科技有限公司 Distributed transaction handling method and system
CN108664650A (en) * 2018-05-17 2018-10-16 百度在线网络技术(北京)有限公司 A kind of transaction methods, device, equipment and the storage medium of block chain network
CN111625323A (en) * 2019-02-28 2020-09-04 北京京东尚科信息技术有限公司 Distributed task processing method, device, equipment and computer readable storage medium
CN111045794A (en) * 2019-12-17 2020-04-21 深圳前海环融联易信息科技服务有限公司 Distributed transaction processing method, device, system, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN112732567B (en) Mock data testing method and device based on ip, electronic equipment and storage medium
CN112702228B (en) Service flow limit response method, device, electronic equipment and readable storage medium
CN114491047A (en) Multi-label text classification method and device, electronic equipment and storage medium
CN112115145A (en) Data acquisition method and device, electronic equipment and storage medium
CN112733531A (en) Virtual resource allocation method and device, electronic equipment and computer storage medium
CN113379391A (en) Work order processing method and device, electronic equipment and computer readable storage medium
CN114881616A (en) Business process execution method and device, electronic equipment and storage medium
CN114398194A (en) Data collection method and device, electronic equipment and readable storage medium
CN112949278A (en) Data checking method and device, electronic equipment and readable storage medium
CN112579621A (en) Data display method and device, electronic equipment and computer storage medium
CN113327136A (en) Attribution analysis method and device, electronic equipment and storage medium
CN111985194A (en) Data storage method and device, electronic equipment and storage medium
CN112541688B (en) Service data verification method and device, electronic equipment and computer storage medium
CN113434542A (en) Data relation identification method and device, electronic equipment and storage medium
CN113051224A (en) File transmission method and device, electronic equipment and computer readable storage medium
CN112085611A (en) Asynchronous data verification method and device, electronic equipment and storage medium
CN114896164A (en) Interface optimization method and device, electronic equipment and storage medium
CN113448788A (en) Test-based service processing method and device, electronic equipment and storage medium
CN115022397A (en) Interface parameter simplifying method and device, electronic equipment and storage medium
CN114490137A (en) Service data real-time statistical method and device, electronic equipment and readable storage medium
CN113051171A (en) Interface test method, device, equipment and storage medium
CN115225489B (en) Dynamic control method for queue service flow threshold, electronic equipment and storage medium
CN113360505B (en) Time sequence data-based data processing method and device, electronic equipment and readable storage medium
CN115964307B (en) Automatic test method, device, equipment and medium for transaction data
CN112328960B (en) Optimization method and device for data operation, electronic 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210928

RJ01 Rejection of invention patent application after publication