Disclosure of Invention
In order to improve data modification efficiency, the embodiment of the application provides a method and a device for modifying data.
In one aspect, an embodiment of the present application provides a method for modifying data, where the method includes:
receiving a service data modification file sent by a transaction end of a service, wherein the service data modification file comprises a data identifier and a data modification value;
acquiring a processing record of the service, wherein the processing record comprises processing state information;
and if the processing state information of the processing record is processing failure, modifying the data value corresponding to the data identifier into the data modified value.
Optionally, before the modifying the file of the service data sent by the transaction side receiving the service, the method further includes:
generating a processing result file of the service according to the current processing record of the service;
and sending the processing result file of the service to the transaction end of the service.
Optionally, before generating the processing result file of the service according to the current processing record of the service, the method further includes:
determining the processing state information of the current service processing record as processing failure;
after the modifying the data value corresponding to the data identifier to the data modified value, the method further includes:
and reprocessing the service according to the data modification value.
Optionally, the processing record further comprises data validity information;
before the re-processing the service according to the data modification value, the method further includes:
and modifying the data validity information in all the processing records of the service into invalid.
Optionally, the method further comprises:
and creating a new processing record corresponding to the re-processing of the service, wherein the data validity information in the new processing record is determined to be valid.
Optionally, the service data modification file further includes a service identifier;
before the modifying the data value corresponding to the data identifier to the data modified value, the method further includes:
and determining that the data identification and the data modification value are correct according to the service identification.
In another aspect, an embodiment of the present application provides an apparatus for data modification, where the apparatus includes:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a service data modification file sent by a transaction end of a service, and the service data modification file comprises a data identifier and a data modification value;
the acquisition module is used for acquiring a processing record of the service, wherein the processing record comprises processing state information;
and the first modification module is used for modifying the data value corresponding to the data identifier into the data modification value when the recorded processing state information is processing failure.
Optionally, the apparatus further comprises:
the generating module is used for generating a processing result file of the service according to the current processing record of the service;
and the sending module is used for sending the processing result file of the service to the transaction end of the service.
Optionally, the apparatus further comprises:
the first determining module is used for determining that the processing state information of the current service processing record is processing failure;
and the processing module is used for reprocessing the service according to the data modification value.
Optionally, the processing record further comprises data validity information;
the device, still include:
and the second modification module is used for modifying the data validity information in all the service processing records into invalid data.
Optionally, the apparatus further comprises:
and the creating module is used for creating a new processing record corresponding to the re-processing of the service, and the data validity information in the new processing record is determined to be valid.
Optionally, the service data modification file further includes a service identifier;
the device, still include:
and the second determining module is used for determining that the data identification and the data modification value are correct according to the service identification.
The beneficial effects are as follows:
and after receiving the service data modification file sent by the service handling end, acquiring all processing records of the service, and modifying the data value corresponding to the data identifier into a data modification value when the processing state information of all the processing records is processing failure, so that the data modification efficiency is improved.
Detailed Description
In order to make the technical solutions and advantages of the present application more apparent, the following further detailed description of the exemplary embodiments of the present application with reference to the accompanying drawings makes it clear that the described embodiments are only a part of the embodiments of the present application, and not an exhaustive list of all embodiments. And the embodiments and features of the embodiments in the present description may be combined with each other without conflict.
At present, when business data is modified, manual operation is needed, and the data modification efficiency is reduced. In order to improve the data modification efficiency, the data modification method can acquire a processing record of a service after receiving a service data modification file sent by a transaction end of the service, and modify a data value corresponding to a data identifier into a data modification value when the processing state information of the processing record is processing failure, so that the data modification efficiency is improved. In addition, the data modification method provided by the application modifies the data value corresponding to the data identifier into the data modification value only when the processing state information of all the processing records is processing failure, limits the data modification condition and avoids the data value being modified by mistake.
The data modification method provided by the application can be used in various business processing scenes during specific implementation, and the data modification method provided by the application is described in detail below by taking only a financial platform, such as a collection business processing scene of a money bringing platform, as an example.
In a recruitment service processing scene of a money bringing platform, each money printing behavior of recruitment service corresponds to a money printing pipelining WITHDRAW _ ORDER which comprises basic money printing information such as financer bank card numbers and the like, and a STATUS field STATUS is used for indicating the current stage and success of money printing processing; IS _ INVALDS indicates whether the flow IS active, ensuring that a collect behavior has only one active state of the flow.
Generating fund payment assembly line with the status word of NEW after successful recruitment; then the money printing request requests a bank system through a payment system, a gateway and the like, and waits for the processing and the reply of the bank system, and the money printing running state is updated to be PROCESSS in the PROCESS; if the bank system is successfully processed, updating the payment running state to SUCCESS after receiving the asynchronous receipt of successful payment; if the processing FAILs, after receiving the receipt of the payment failure, updating the payment flow state to FAIL. The money-making pipelining state machine can refer to fig. 1.
In combination with a recruitment service processing scenario, the embodiment provides a data modification method, and the method is applied to a server to which a money and treasury bringing platform belongs. The typing pipeline IS a processing record in the method provided by this embodiment, the STATUS field STATUS IS processing STATUS information in the method provided by this embodiment, and IS _ INVAILD IS data validity information in the method provided by this embodiment. Referring to fig. 2, the method flow provided by this embodiment is specifically as follows:
201: the financial platform determines the processing state information of the current processing record of the business;
each time the service is recruited for a deposit, a processing record (i.e., a deposit flow) is generated as shown in table 1, which includes the service identifier (INS _ ID), the processing record identifier (ORD _ ID), and user account information (e.g., basic information such as the bank name, bank code, financer name, financer identification number, etc.). The process record may also include process state information (STA) and data validity information (IS _ INVAILD). When a processing record IS newly generated, a field corresponding to the service identifier (ORD _ ID) IS "NEW", which indicates that the processing record IS in an initial state, a field corresponding to the validity information (IS _ INVAILD) IS a character "Y", and a field corresponding to the validity information (IS _ INVAILD) may also be a character "N". When the field corresponding to the validity information (IS _ INVAILD) IS the character "Y", it indicates that the process record IS valid. When the field corresponding to the validity information (IS _ INVAILD) IS the character "N", it indicates that the processing record IS invalid.
When the money-making behavior is implemented, the processing record can adjust the field content corresponding to the corresponding information included in the processing record at any time according to the actual state of the money-making process so as to represent the latest processing state of the processing service corresponding to the processing record. For example, the processing record shown in table 1, which is a beat stream of recruited traffic. When the money-making PROCESS is in the PROCESS of the money-making flow, the field content corresponding to the processing state information (STA) in the processing record shown in table 1 is changed from "NEW" to "PROCESS", so that the latest processing state of the money-making PROCESS, which represents the collected service corresponding to the processing record, is in the PROCESS of the money-making PROCESS, see table 2. If the money-making action FAILs, the field content corresponding to the processing state information (STA) in the processing record shown in table 2 is changed from "PROCESS" to "FAIL", so that the latest processing state of the money-making action of the collected service corresponding to the processing record is the money-making failure state, which is shown in table 3. If the money-making action is successful, the field content corresponding to the processing state information (STA) in the processing record shown in table 2 is changed from "PROCESS" to "SUCCESS", so that the latest processing state of the money-making action for collecting the service corresponding to the processing record is the money-making successful state, see table 4.
In summary, in this step, the current processing state of the service corresponding to the payment record may be determined according to the content of the field corresponding to the processing state information (STA) in the payment record. And if the content of the field corresponding to the processing state information (STA) is 'FAIL', determining that the current processing state of the processing record to the service is a failure state, and if the content of the field corresponding to the processing state information (STA) is 'SUCCESS', determining that the current processing state of the processing record to the service is a SUCCESS state.
In this embodiment, only the case where the content of the field corresponding to the processing state information (STA) is "FAIL" to represent that the current processing state of the processing record to the service is a failure state, and the content of the field corresponding to the processing state information (STA) is "SUCCESS" to represent that the current processing state of the processing record to the service is a SUCCESS state is described as an example. The content of the processing state information (STA) corresponding field representing that the current processing state of the processing record to the service is a success state may also be other content, for example, a number "1", or, a character "Y", etc.
TABLE 1
INS_ID
|
ORD_ID
|
ACC_INFO
|
…
|
STA
|
IS_INVAILD
|
007
|
1
|
A
|
…
|
NEW
|
Y |
TABLE 2
INS_ID
|
ORD_ID
|
ACC_INFO
|
…
|
STA
|
IS_INVAILD
|
007
|
1
|
A
|
…
|
PROCESS
|
Y |
TABLE 3
INS_ID
|
ORD_ID
|
ACC_INFO
|
…
|
STA
|
IS_INVAILD
|
007
|
1
|
A
|
…
|
FAIL
|
Y |
TABLE 4
INS_ID
|
ORD_ID
|
ACC_INFO
|
…
|
STA
|
IS_INVAILD
|
007
|
1
|
A
|
…
|
SUCCESS
|
Y |
When the current processing state of the processing record to the service is determined to be the failure state in this step, the following steps 202 to 208 are performed to modify the service-related data, so as to implement the data modification method provided by the present application.
When it is determined in this step that the current processing state of the processing record for the service is a successful state, steps 202 to 204 may also be executed to send the content in the processing record to the transaction side of the service for data analysis by the transaction side of the service.
202: the financial platform generates a service processing result file according to the current service processing record;
the processing record is a money printing flow when money printing is performed on the same recruitment service, the same recruitment service can correspond to a plurality of money prints, each money print corresponds to one money printing flow, and each money printing flow is one processing record, that is, the same recruitment service corresponds to a plurality of processing records. The processing record includes contents such as a service identifier (INS _ ID), a processing record identifier (ORD _ ID), user account information, processing status information (STA), and data validity information (IS _ INVAILD). The service identification (INS _ ID) IS an identification for collecting service, and the processing record identification (ORD _ ID), user account information, processing state information (STA), data validity information (IS _ INVALD) and the like are identifications of various contents actually involved in the payment. That IS, the service identifiers (INS _ ID) in different processing records corresponding to the same recruitment service are the same, and the processing record identifiers (ORD _ ID), the user account information, the processing state information (STA), the data validity information (IS _ INVAILD), and the like may vary.
Thus, the content in the processing record can be divided into 3 parts, 1) the service identification (INS _ ID) and the content of the corresponding field, 2) the data identification, 3) the data value.
Wherein, 1) the service identification (INS _ ID) is used for identifying the service corresponding to the processing record, and the field contents corresponding to the service identification (INS _ ID) in the processing record corresponding to the same service are the same.
2) The data identification is used for identifying various contents actually involved in the money making, and the field contents corresponding to the data identification in the processing record of the same service are different. The data identification is an identification other than the service identification (INS _ ID) in the processing record, for example: process record identification (ORD _ ID), user account information, process status information (STA), data validity information (IS _ INVAILD), and the like.
3) The data value is the content of the corresponding field of the data identification.
For example: the processing result file includes a service identifier INS _ ID and a corresponding field content is 007, and the data identifiers and data values included in the processing result file are shown in table 5.
TABLE 5
203: the financial platform sends a service processing result file to a service handling end;
specifically, a service processing result file can be sent to a service handling end through a data interaction platform;
the data interaction platform can be a data interaction platform shared by all services, if the recruitment service has the own recruitment data platform, the service processing result file can be uploaded to the recruitment data platform, then the service processing result file is transmitted to the data interaction platform through a specific interface between the recruitment data platform and the data interaction platform, and finally the data interaction platform transmits the service processing result file to a service handling end.
By executing steps 201 to 203, the content in the processing record corresponding to each payment pipeline for collecting the service is transmitted to the service transaction terminal in real time.
204: processing result files of the business by the business handling end;
and if the content of the field corresponding to the processing state information (STA) in the service processing result file is FAIL, determining the data value corresponding to the data identifier at the transaction end in the service processing result file, and using the data value corresponding to the transaction end as a data modification value to generate a service data modification file.
Specifically, a data value corresponding to each data identifier in the service processing result file at the transaction end may be determined, and the data value corresponding to the transaction end is used as a data modification value to generate a service data modification file.
Or, a part of data identifiers may be selected from the service processing result file (for example, a data identifier affecting the processing state information is selected, or a data identifier corresponding to data exists at the transaction end of the service is selected), a data value corresponding to the selected part of data identifiers at the transaction end is determined, the data value corresponding to the transaction end is used as a data modification value, and a service data modification file is generated.
Because the service identifier identifies the service corresponding to the piece of data, the service identifier in the service data modification file is the same as the service identifier and the content of the corresponding field in the processing result file no matter whether the data identifier in the service data modification file is the same as the data identifier in the processing result file.
For example, if the data value corresponding to the bank code at the transaction end is B, the service identifier in the generated service data modification file is INS _ ID, the content of the corresponding field is 007, and the data identifier and the data value in the service data modification file are shown in table 6.
TABLE 6
Data identification
|
Data value
|
Name of bank
|
Bank A
|
Bank code
|
B
|
Financer name
|
XX
|
Financer ID card number
|
111111111111111111 |
If the content of the field corresponding to the processing state information (STA) in the processing result file of the service is "SUCCESS", the process of this embodiment is ended, and the transaction end of the service can use the content in the processing result file of the service during the subsequent statistical analysis.
205: the financial platform receives a business data modification file sent by a business handling end;
the service data modification file received in this step is generated from the processing result file in step 204. And the processing result file is generated in step 202.
In step 202, the processing result file includes a service identifier and contents of corresponding fields, a data identifier, a data value, and the like, where the service identifier IS an INS _ ID for identifying a service corresponding to a processing record, the data identifier IS a processing record identifier (ORD _ ID), user account information, processing state information (STA), data validity information (IS _ INVAILD), and the like for identifying each item of content actually involved in the money-making process, and the data value IS the content of a field corresponding to each data identifier.
In step 204, the service identifier and the content of the corresponding field in the processing result file are not changed, and the data value in the processing result file is modified to become a data modified value. That is, the service data modification file includes 1) service identifier and content of corresponding field, 2) data identifier, and 3) data modification value. The service data modification file may also include 4) data values.
The contents of the service identifier and the corresponding field in the service data modification file are the same as the contents of the service identifier and the corresponding field in the processing result file.
The data identifier in the service data modification file may be all data identifiers in the processing result file, or may be a part of data identifiers in the processing result file.
The field content corresponding to the data identifier in the service data modification file may be the same as the field content corresponding to the data identifier in the processing result file (both are corresponding data values in the processing result file), or may be different from the field content corresponding to the data identifier in the processing result file (the field content corresponding to the data identifier is changed from the data value in the processing result file to the data modification value in the service data modification file).
In this step, the money and treasures bringing platform may receive the service data modification file sent by the transaction end of the service through the data interaction platform.
And the money and treasures bringing platform checks whether a service data modification file sent by a service transaction end exists on the data interaction platform or not through a polling task.
206: the financial platform determines whether the data identification and the data modification value are correct or not according to the service identification;
in order to prevent errors in the data identification and/or the data modification value in the received service data modification file, step 206 is performed to perform the necessary check after the service data modification file is received in step 205. For example: and determining whether the data identification and the data modification value are correct or not according to the service identification. Specific verification contents include but are not limited to:
performing non-null check on mandatory fields of the business data modification file, and checking whether the bank name and the code are in accordance; in order to avoid the mechanism from transmitting the file by mistake and causing capital and legal risks, the names and identity numbers of financers in the user information updating file need to be checked to be consistent with the former names and identity numbers, and the financers are not allowed to be replaced; in addition, it is checked whether the recruitment service name is consistent, whether the recruitment service has been completed.
If the verification fails, the money and treasures bringing platform gives a system alarm, and sends a message that the business data modification file is wrong to the business handling end while stopping the program so as to enable the business handling end to resend the business data modification file.
And if the verification is successful, executing the subsequent steps.
It should be noted that, in this embodiment, only after the transaction end that receives the service data modification file sent by the service end performs step 205, step 206 is performed to determine whether the data identifier and the data modification value are correct. This implementation may improve execution efficiency. For example: if the step 206 is executed to determine that the data id and the data modification value are incorrect, the subsequent steps are not executed again, and the process is terminated directly. If the data id and the data modification value are determined to be correct in step 206, the subsequent steps are continued.
However, in the actual application process, step 206 determines whether the data identifier and the data modification value are correct or not, and after the service data modification file sent by the transaction terminal of the service is received in step 205, step 208 modifies the data value corresponding to the data identifier to any position before the data modification value, that is, it is ensured that the data value corresponding to the data identifier is modified to the correct data modification value. The embodiment does not limit the specific execution position of step 206.
207: the financial platform acquires a processing record of the service, determines whether the processing state information of the processing record is in a processing failure state, if so, executes 208, and if not, ends the process;
the processing record comprises processing state information, wherein the processing state information is an initial state, a processing failure state and a processing success state.
When the step is executed, if the content of the field corresponding to the processing state information (STA) is the processing record of "NEW" or "processing", it is considered that the collected service has the behavior of being in the money making PROCESS, and at this time, if the data value is modified, the execution of the money making PROCESS is affected, so the data value corresponding to the data identifier cannot be modified into the data modified value.
If there is a processing record whose content of the field corresponding to the processing state information (STA) is "SUCCESS", it is considered that the recruitment service has succeeded, and therefore, the data value corresponding to the data identification cannot be modified to the data modification value.
And only if the processing state information of all the processing records is the processing failure state, modifying the data value corresponding to the data identifier into a data modification value.
For example: and determining whether the contents of the fields corresponding to the processing state information (STA) in the history processing record corresponding to the recruitment service are all 'FAIL', if the contents of the fields corresponding to the processing state information (STA) are 'NEW', 'PROCESS' and 'SUCCESS', the data value corresponding to the data identifier cannot be modified into a data modification value.
208: and the financial platform modifies the data value corresponding to the data identification into a data modification value.
After the data value corresponding to the data identifier is modified to the data modification value, if the content of the field corresponding to the processing state information (STA) of the last processing record for recruiting the service is "FAIL", that is, the processing state of the processing record on the service is a failure state, the service also needs to be reprocessed according to the data modification value.
Specifically, referring to table 7, 1) a new processing record corresponding to the reprocessed service IS created, a field corresponding to the validity information (IS _ INVAILD) in the new processing record IS "Y", that IS, the new processing record IS valid, 2) a field corresponding to the validity information (IS _ INVAILD) in all history processing records of the service IS modified to be "N", that IS, the history processing record IS invalid; 3) and re-processing the service according to the data modification value.
After the money-depositing PROCESS shown in table 8, if the money-depositing PROCESS is successful, the field content corresponding to the PROCESS status information (STA) in the new PROCESS record shown in table 8 is changed from "PROCESS" to "SUCCESS", see table 9. If the data fails again, the steps 202 to 208 are repeated, and the automatic modification of the data of the whole money and treasury platform is realized.
TABLE 7
INS_ID
|
ORD_ID
|
ACC_INFO
|
…
|
STA
|
IS_INVAILD
|
007
|
1
|
A
|
…
|
FAIL
|
N
|
007
|
2
|
B
|
…
|
NEW
|
Y |
TABLE 8
INS_ID
|
ORD_ID
|
ACC_INFO
|
…
|
STA
|
IS_INVAILD
|
007
|
1
|
A
|
…
|
FAIL
|
N
|
007
|
2
|
B
|
…
|
PROCESS
|
Y |
TABLE 9
INS_ID
|
ORD_ID
|
ACC_INFO
|
…
|
STA
|
IS_INVAILD
|
007
|
1
|
A
|
…
|
FAIL
|
N
|
007
|
2
|
B
|
…
|
SUCCESS
|
Y |
For further explanation of the method provided in this embodiment, taking a transaction end of a business as an organization and a data interaction platform as an example, referring to fig. 3 again, the organization provides an account information file, and sends the account information file to a money bringing device through the data interaction platform; and collecting and paying money for the money bringing treasures based on the account information file. And after the money printing is finished, generating a money printing result file, sending the money printing result file to the mechanism through the data interaction platform, and finishing the process if the money printing result file shows that the money printing is successful. And if the money making result file shows that the money making is failed, generating an account updating file, and sending the account updating file to the money bringing treasure through the data interaction platform. And the money and treasures are analyzed to obtain the account updating file, and the account updating file is verified. And after the verification is passed, determining whether the updating is allowed, if the updating is allowed, updating the money-making running information, refreshing the borrowing account cache, marking the money-making failure running as invalid, and generating a new money-making running. And if the file is not verified or the updating is not allowed, monitoring and alarming to enable the mechanism to upload the account updating file again.
Has the advantages that:
and after receiving a service data modification file sent by a service handling end, acquiring a service processing record, and modifying a data value corresponding to the data identifier into a data modification value when the processing state information of the processing record is processing failure, so that the data modification efficiency is improved.
Based on the same inventive concept, the present embodiment provides a data modification apparatus, and since the principle of the apparatus for solving the problem is similar to that of the data modification method shown in fig. 2, the implementation of the apparatus may refer to the embodiment of the method shown in fig. 2, and repeated details are not repeated.
Referring to fig. 4, the apparatus includes:
the receiving module 401 is configured to receive a service data modification file sent by a service handling end, where the service data modification file includes a data identifier and a data modification value;
an obtaining module 402, configured to obtain a processing record of a service, where the processing record includes processing state information;
a first modification module 403, configured to modify a data value corresponding to the data identifier into a data modification value when the processing status information of the processing record indicates that the processing fails.
Referring to fig. 5, the apparatus further comprises:
a generating module 404, configured to generate a processing result file of the service according to the current processing record of the service;
a sending module 405, configured to send a processing result file of the service to a service transaction end.
Referring to fig. 6, the apparatus further comprises:
a first determining module 406, configured to determine that processing state information of the current service processing record is processing failure;
and the processing module 407 is configured to reprocess the service according to the data modification value.
Referring to fig. 7, the processing record further includes data validity information;
the device also comprises:
and a second modification module 408, configured to modify the data validity information in all the processing records of the service to be invalid.
Referring to fig. 8, the apparatus further comprises:
and the creating module 409 is configured to create a new processing record corresponding to the reprocessing service, where the data validity information in the new processing record is determined to be valid.
Referring to fig. 9, the service data modification file further includes a service identifier;
the device also comprises:
and a second determining module 410, configured to determine, according to the service identifier, that the data identifier and the data modification value are correct.
The beneficial effects are as follows:
and after receiving a service data modification file sent by a service handling end, acquiring a service processing record, and modifying a data value corresponding to the data identifier into a data modification value when the processing state information of the processing record is processing failure, so that the data modification efficiency is improved.
For convenience of description, each part of the above apparatus is separately described as being functionally divided into various modules or units. Of course, the functionality of the various modules or units may be implemented in the same one or more pieces of software or hardware in practicing the invention.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.