CN114979187A - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN114979187A
CN114979187A CN202210534759.2A CN202210534759A CN114979187A CN 114979187 A CN114979187 A CN 114979187A CN 202210534759 A CN202210534759 A CN 202210534759A CN 114979187 A CN114979187 A CN 114979187A
Authority
CN
China
Prior art keywords
service
processing
target
state
message
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
CN202210534759.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.)
Beijing Jingdong Tuoxian Technology Co Ltd
Original Assignee
Beijing Jingdong Tuoxian Technology 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 Jingdong Tuoxian Technology Co Ltd filed Critical Beijing Jingdong Tuoxian Technology Co Ltd
Priority to CN202210534759.2A priority Critical patent/CN114979187A/en
Publication of CN114979187A publication Critical patent/CN114979187A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Abstract

The invention discloses a data processing method and device, and relates to the technical field of computers. One embodiment of the method comprises: acquiring a plurality of service processing requests; the plurality of service processing requests indicate a plurality of external interface identifications and service data; generating a plurality of service messages respectively corresponding to the plurality of service processing requests, and storing the plurality of service messages in a first state; calling a target external interface according to target service data and a target external interface identifier corresponding to a target service message in a first state in the stored service messages so as to enable a processing system corresponding to the target external interface to process the target service data; and responding to a processing result returned by the processing system, updating the target service message from the first state to the second state, and processing the target service data according to the processing result. The implementation mode ensures the consistency of data among the multi-service systems and improves the reliability of the distributed system for processing the data.

Description

Data processing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data processing method and apparatus.
Background
In a distributed system, the processing of a service involves multiple systems, each of which in turn stores respective data. For example, prescription processing services may involve calls between multiple systems, and when the prescription processing platform needs to push prescription data to a patient, a notification system needs to be called so that the notification system sends a message to the patient's terminal.
In the process of multi-system calling, the systems are directly called through an interface, and data is correspondingly modified according to the calling condition of the systems, so that the problem of inconsistent data among the systems can be caused.
Disclosure of Invention
In view of this, embodiments of the present invention provide a data processing method and apparatus, which can invoke a corresponding target external interface to process service data according to a state of a target service message, and process a processing result returned by the service data through an external service system, modify a state of the target service message, and process the target service data again; therefore, when the same service data is processed among a plurality of service systems, whether the service data is modified and synchronized can be determined according to the state and the processing result of the same service message, so that the data consistency among the plurality of service systems is ensured, and the accuracy and the reliability of data processing of the distributed system are improved.
To achieve the above object, according to a first aspect of embodiments of the present invention, there is provided a data processing method including:
acquiring a plurality of service processing requests; the service processing requests indicate a plurality of external interface identifiers and service data;
generating a plurality of service messages respectively corresponding to the plurality of service processing requests, and storing the plurality of service messages in a first state;
calling a target external interface according to target service data and a target external interface identifier corresponding to a target service message in a first state in stored service messages so as to enable a processing system corresponding to the target external interface to process the target service data;
and responding to a processing result returned by the processing system, updating the target service message from a first state to a second state, and processing the target service data according to the processing result.
Optionally, the invoking the target external interface includes:
respectively determining protocol types corresponding to a plurality of service processing requests;
generating the plurality of service messages according to the protocol type;
and according to the protocol types, concurrently calling the target external interfaces corresponding to the plurality of target service messages corresponding to different protocol types.
Optionally, the generating a plurality of service messages respectively corresponding to the plurality of service processing requests, and storing the plurality of service messages in a first state further includes:
for each service processing request:
and generating a service message according to the external interface identifier, the service data, the service identifier, the service number, the message type, the request identifier, the request message body, the processing state, the version number and the creation time indicated by the service processing request.
Optionally, when the processing result is a processing failure, the second state is a processing failure state, and further includes:
and according to the first period, determining the target service message in the processing failure state from the plurality of service messages, and recalling the target external interface of the target service message in the processing failure state.
Optionally, the second state further includes a processed state, and after the target external interface is called, the method further includes:
and increasing the version number of the target service message and updating the processing time.
Optionally, the method further comprises:
according to the second period, acquiring a plurality of business messages to be archived in a processed state;
and storing the business message to be archived into a data table, and setting archiving time for the business message to be archived.
Optionally, the method further comprises:
in the case where the time period between the calling time to call the target external interface and the present time exceeds a preset time period,
and determining the second state of the target service message as a processing failure state.
Optionally, to a prescription processing system;
the service processing request is a prescription processing request.
According to a second aspect of the embodiments of the present invention, there is provided a data processing apparatus including: the device comprises an acquisition module, a storage module and a processing module; wherein the content of the first and second substances,
the acquisition module is used for acquiring a plurality of service processing requests; the service processing requests indicate a plurality of external interface identifiers and service data;
the storage module is used for generating a plurality of service messages respectively corresponding to the service processing requests and storing the service messages in a first state;
the processing module is used for calling a target external interface according to target service data corresponding to a target service message in a first state in the stored service messages and a target external interface identifier so as to enable a processing system corresponding to the target external interface to process the target service data; and responding to a processing result returned by the processing system, updating the target service message from a first state to a second state, and processing the target service data according to the processing result.
According to a third aspect of embodiments of the present invention, there is provided an electronic apparatus, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method as in any one of the data processing methods provided in the first aspect above.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium, on which a computer program is stored, which when executed by a processor, implements a method as in any one of the data processing methods provided in the above first aspect.
One embodiment of the above invention has the following advantages or benefits: the corresponding target external interface can be called according to the state of the target service message to process the service data, and the target service data is processed again through the returned processing result; therefore, when the service data are processed among a plurality of service systems, the service data can be modified and synchronized according to the processing state and the processing result of the same service message, so that the data consistency among the service systems is ensured, and the accuracy and the reliability of the data processing of the distributed system are improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a flow chart of a data processing method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating a data processing method according to another embodiment of the present invention;
FIG. 3 is a flow chart illustrating a message storage according to an embodiment of the present invention;
FIG. 4 is a flow diagram illustrating message processing according to an embodiment of the invention;
FIG. 5 is a flowchart illustrating a message archiving method according to an embodiment of the present invention
FIG. 6 is a block diagram of a data processing apparatus according to an embodiment of the present invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 8 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that the embodiments of the present invention and the technical features of the embodiments may be combined with each other without conflict.
As shown in fig. 1, an embodiment of the present invention provides a data processing method, which may include the following steps S101 to S104:
step S101: acquiring a plurality of service processing requests; the plurality of service processing requests indicate a plurality of external interface identifications and service data.
Step S102: and generating a plurality of service messages respectively corresponding to the service processing requests, and storing the service messages in a first state.
Step S103: and calling a target external interface according to target service data and a target external interface identifier corresponding to the target service message in the first state in the stored service messages so as to enable a processing system corresponding to the target external interface to process the target service data.
Step S104: and responding to a processing result returned by the processing system, updating the target service message from a first state to a second state, and processing the target service data according to the processing result.
The service processing request may be a request for the current service system to call a service interface of the external service system. The current service system realizes the operations of sending, receiving, modifying and the like of the service data by calling an external service system.
The present invention may be applied to prescription processing systems; when the prescription processing system is applied, the service processing request is a prescription processing request.
For example, in the prescription processing system, the service processing request may be a request for sending prescription data (service data) provided by a doctor for a patient to the patient in a short message manner, and at this time, the prescription processing platform needs to call a corresponding interface (external interface) of the notification system to send the prescription data; the service processing request can also send the prescription data to an ordering system for processing according to an order ordering and medicine purchasing instruction of a patient, and at the moment, the prescription processing platform needs to call a corresponding interface of the ordering system to order according to the prescription data.
In a recipe processing system, a schematic diagram of a data processing method and system architecture can be shown in fig. 2. The prescription service platform comprises a current prescription service system; the prescription processing system may include a message store, a message processor, and a message archiver; the external business system may be a notification system, an ordering system, etc. Specifically, the flow chart of the data processing method may include the following steps:
step S201: a prescription processing request is initiated.
The recipe processing request indicates a target external interface identification and recipe data.
Step S202: a plurality of prescription messages are generated.
Step S203: the message memory is invoked.
A plurality of prescription messages are stored using a message store.
The message store provides functions for holding messages, querying messages, updating status, and deleting messages.
Step S204: invoking a message processor
The message processor provides the functionality to process the prescription message.
Step S205: the target external interface is invoked.
And calling a target external interface corresponding to the prescription message so that the corresponding external business system processes the prescription data.
Step S206: a message archiver is invoked.
The message archiver provides the ability to archive processed prescription messages.
After obtaining a plurality of service processing requests, a plurality of service messages may be generated according to the following manner provided by an embodiment of the present invention: for each service processing request: and generating a service message according to the external interface identifier, the service data, the service identifier, the service number, the message type, the request identifier, the request message body, the processing state, the version number, the creation time and the processing time indicated by the service processing request.
In one embodiment of the present invention, a plurality of service messages may be stored in a data table in the database, the data structure of the data table may be as shown in table 1,
TABLE 1
Figure BDA0003647337580000071
Wherein the primary key identification may indicate a primary key in the database. The message type indicates a request protocol of the service processing request, and when a plurality of service messages are generated, protocol types corresponding to a plurality of service processing requests can be respectively determined; and generating the plurality of service messages according to the protocol type. In one embodiment of the present invention, the message type of the service message may be compatible with multiple communication protocols, and the protocol type may be MQ protocol, HTTP protocol, RPC protocol, etc. The message types can be MQ messages, HTTP messages, RPC messages, short message messages, APP push messages and the like.
The service identification and the service number indicate the service identification and the number of the current service system; the request identifier can be obtained according to the service processing request; the request message body may include an external interface identifier, service data; the processing state may include a pending state, a processed state, a processing failed state, and a processing in-progress state; the subject may be the message subject of an MQ message, and may be null for other protocols; the version number may record a status update record of the service message, and the version number may be incremented once for each status update of the service message, for example, the status is updated once, the version number may be changed from 001 to 002, and so on.
In one embodiment of the present invention, after the service message is generated, the processing state of the service message may be set to a first state, and the first state may be a pending state at this time.
Specifically, the process of generating the service message and storing the service message may be as shown in a flow diagram of message storage provided in the embodiment of the present invention, as shown in steps S301 to S305 in fig. 3:
step S301: a request to invoke an external business system is obtained.
I.e. service handling requests.
Step S302: a request protocol is determined.
The message type is determined according to the request protocol type.
Step S303: and generating a service message according to the service request.
Step S304: the service message is stored in a data table.
The data table may be stored in a database, such as a Mysql database.
Step S305: the status of the service message in the data table is updated.
And updating the processing state into a state to be processed, and updating the version number and the processing time.
In the recipe processing system, the process of FIG. 3 may be performed by a message memory (shown in FIG. 2), in which case the message memory may store service messages, query service messages, update service messages, and delete service messages.
Specifically, when the target external interface is called, the following manner provided by an embodiment of the present invention may be adopted: and according to the protocol types, concurrently calling the target external interfaces corresponding to the plurality of target service messages corresponding to different protocol types.
In one embodiment of the present invention, the message processor of FIG. 2 may be configured to perform the operation of invoking the target external interface, listed in the recipe processing system. Wherein the message processor may be composed of a timing task, a message processing task and a message sender.
As shown in fig. 4, the specific process includes steps S401 to S405:
step S401: a timing task is started.
For example, it may be set to be performed once per second.
Step S402: a message processing task is initiated.
Step S403: the target service message which is unprocessed is inquired.
The state of the unprocessed target service message can be a first state, namely a to-be-processed state, or a processing failure state; the target service message queried from the message memory may be one or more.
Step S404: different message senders are selected according to the message type.
And determining a corresponding protocol type according to the message type in the target service message. Determining the protocol type to select the corresponding message sender.
Wherein the message sender may be a call thread of a certain protocol running on a certain node in the distributed cluster. For example, message sender a corresponds to MQ protocol, message sender B corresponds to RPC protocol, and message sender C corresponds to HTTP protocol.
It will be appreciated that different message senders may be on one or different cluster nodes.
Step S405: the target external interface is invoked by the message sender.
In the case that the plurality of service messages call the target external interface without generating service conflict, the plurality of message senders may be concurrently executed to call the target external interfaces of the plurality of external service systems.
In addition, the message processor may determine a processing order according to whether the queried plurality of target service messages correspond to the same external service; and preferentially calling the target external interface corresponding to the target service message with the processing time earlier according to the processing time of the plurality of target service messages.
After the target external interface is called, the state of the target service message may be updated from the first state (to-be-processed state) to a second state, where the second state is a processing state, and then the version number of the target service message is incremented and the processing time is updated. For example, the version number may be updated from 002 to 003.
The target external interface is called according to the state of the target service message, so that the problem that the calling time sequence is uncontrollable due to the fact that a plurality of external service systems are directly called, and conflicts are generated in calling of the external interface or service data processing can be avoided. Each timing task only processes the service message which is not processed (to-be-processed state), thereby ensuring the response speed of service data processing and improving the efficiency of service data processing.
It can be understood that after the target external interface is called, the processing result of the processing system (i.e. the external service system) can be obtained within a certain time. If the processing result is determined to be successful, it may be determined that the service data has been successfully processed, and then the successfully processed service data may be processed in the current service system, for example, the current service system may perform synchronous update according to the service data modified by the external service system, so as to ensure data consistency among the multiple service systems.
And under the condition that the processing result is determined to be successful, updating the target service message into a second state, wherein the second state is a processed state, then increasing the version number of the target service message and updating the processing time. For example, the version number may be updated from 003 to 004.
However, when the processing result is processing failure, the service data is processed failure in the external service system, and at this time, in order to ensure that the service data which is not processed successfully can be processed again, the following method provided by an embodiment of the present invention may be adopted: when the processing result is a processing failure, the second state is a processing failure state, and the method further includes: and according to the first period, determining the target service message in the processing failure state from the plurality of service messages, and recalling the target external interface of the target service message in the processing failure state.
In the prescription processing system, the first cycle may be a processing cycle of a timed task in the message processor described above. After the notification system is called and the prescription data is sent to the notification system, the result of processing failure returned by the notification system is obtained. At this time, the state of the service message calling the notification system may be updated from the in-process state to the process failure state. When the next first period comes, the target service message in the processing failure state in the message memory is inquired, and the target service message is processed again, so that the purpose of retry is realized, and the call success rate among multiple services is ensured. At times of retries, the number of retries may be determined by incrementing the version number of the targeted traffic message. The target service message in the message memory in the processing failure state and with the version number exceeding a certain value may be cleaned regularly, for example, the version number exceeds 010, and a corresponding warning prompt may be sent, so that the current system may perform troubleshooting on the target service message that fails to retry for many times, which is not described herein again.
Certainly, after the target external interface is called, the processing result still cannot be obtained within a certain time, and in order to ensure that the target service message can be processed in time, the following manner provided by the embodiment of the present invention may be adopted: and under the condition that the time length between the calling time of calling the target external interface and the current time exceeds the preset time length, determining that the second state of the target service message is a processing failure state. The preset time duration may be set according to the interactive response requirement of the service system, for example, set to 10 seconds.
In order to ensure the speed and efficiency of inquiring the target service message, the processed target service message can be archived and backed up in time regularly. For example, in a prescription processing system, processed targeted business messages may be archived in a message archiver (shown in FIG. 2) and, after successful storage, deleted from the message store accordingly.
In an embodiment of the present invention, according to the second period, a plurality of to-be-archived service messages in a processed state may be acquired; and storing the business message to be archived into a data table, and setting archiving time for the business message to be archived.
In the recipe processing system, the data structure of the filing table of the message archiver may be as shown in table 2:
TABLE 2
Figure BDA0003647337580000121
It is understood that the service message in table 1 can be stored in table 2, and the archiving time is set, and after the storage is successful, the service message is deleted from table 1.
A specific archiving process can be shown in fig. 5, which includes the following steps:
step S501: a timing task is started.
For example, it may be set to be performed once per day.
Step S502: a message archiving task is initiated.
Step S503: the processed service message is queried.
The plurality of service messages in the processed state are queried from the message memory.
Step S504: and writing the service message into an archive table.
Step S505: deleting the archived business message.
After confirming that the archiving is successful, the archived business message is deleted from the message store.
In the prescription processing system, when the external service system is required to be called by a service, a service message can be generated according to a service request and service data for calling the external service system, and then a message memory is called for storage; processing the unprocessed (in a pending state or a processing failure state) service message in the message memory by the message processor; and after the message processor successfully processes, the business message is archived and recycled by using the message archiver.
According to the data processing method provided by the embodiment of the invention, the corresponding target external interface can be called according to the state of the target service message to process the service data, the processing result returned by processing the service data through the external service system is used for modifying the state of the target service message, and the target service data is processed again; therefore, when the same service data is processed among a plurality of service systems, whether the service data is modified and synchronized can be determined according to the state and the processing result of the same service message, so that the data consistency among the plurality of service systems is ensured, and the accuracy and the reliability of data processing of the distributed system are improved.
As shown in fig. 6, an embodiment of the present invention provides a data processing apparatus 600, including: an acquisition module 601, a storage module 602 and a processing module 603; wherein the content of the first and second substances,
the obtaining module 601 is configured to obtain a plurality of service processing requests; the service processing requests indicate a plurality of external interface identifiers and service data;
the storage module 602 is configured to generate a plurality of service messages respectively corresponding to the plurality of service processing requests, and store the plurality of service messages in a first state;
the processing module 603 is configured to invoke a target external interface according to target service data and a target external interface identifier corresponding to a target service message in a first state in stored service messages, so that a processing system corresponding to the target external interface processes the target service data; and responding to a processing result returned by the processing system, updating the target service message from a first state to a second state, and processing the target service data according to the processing result.
In an embodiment of the present invention, the storage module 602 is configured to, for each service processing request: and generating a service message according to the external interface identifier, the service data, the service identifier, the service number, the message type, the request identifier, the request message body, the processing state, the version number and the creation time indicated by the service processing request.
In an embodiment of the present invention, the processing module 603 is configured to determine protocol types corresponding to a plurality of service processing requests respectively; generating the plurality of service messages according to the protocol type; and according to the protocol types, concurrently calling the target external interfaces corresponding to the plurality of target service messages corresponding to different protocol types.
In an embodiment of the present invention, the processing module 603 is configured to, when the processing result is a processing failure, determine, according to a first cycle, a target service message in the processing failure state from the plurality of service messages, and recall a target external interface of the target service message in the processing failure state, where the second state is the processing failure state.
In an embodiment of the present invention, the processing module 603 is configured to further include a processed state, increment a version number of the target service message after the target external interface is called, and update the processing time.
In an embodiment of the present invention, the processing module 603 is configured to obtain, according to the second period, a plurality of to-be-archived service messages in a processed state; and storing the business message to be archived into a data table, and setting archiving time for the business message to be archived.
In an embodiment of the present invention, the processing module 603 is configured to determine that the second state of the target service message is a processing failure state when a duration between a calling time of calling the target external interface and a current time exceeds a preset duration.
In one embodiment of the invention, the processing module 603 is used for application to a recipe processing system; the service processing request is a prescription processing request.
According to the data processing device provided by the embodiment of the invention, the corresponding target external interface can be called according to the state of the target service message to process the service data, the processing result returned by processing the service data through the external service system is used for modifying the state of the target service message, and the target service data is processed again; therefore, when the same service data is processed among a plurality of service systems, whether the service data is modified and synchronized can be determined according to the state and the processing result of the same service message, so that the data consistency among the plurality of service systems is ensured, and the accuracy and the reliability of data processing of the distributed system are improved.
Fig. 7 shows an exemplary system architecture 700 of a data processing method or a data processing apparatus to which embodiments of the present invention may be applied.
As shown in fig. 7, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 serves to provide a medium for communication links between the terminal devices 701, 702, 703 and the server 705. Network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may interact with a server 705 via a network 704 using terminal devices 701,702, 703 to receive or send messages or the like. The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting information browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 705 may be a server that provides various services, such as a background management server that provides support for business processing requests made by users using the terminal devices 701, 702, and 703. The background management server can analyze and process the received data such as the service processing request and the like, and feed back the processing result to the terminal equipment.
It should be noted that the data processing method provided by the embodiment of the present invention is generally executed by the server 705, and accordingly, the data processing apparatus is generally disposed in the server 705.
It should be understood that the number of terminal devices, networks, and servers in fig. 7 are merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 8, shown is a block diagram of a computer system 800 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU)801 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that the computer program read out therefrom is mounted on the storage section 808 as necessary.
In particular, according to embodiments of the present disclosure, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program executes the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 801.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises an acquisition module, a storage module and a processing module. The names of these modules do not in some cases form a limitation on the module itself, and for example, the acquiring module may also be described as a "module acquiring a service processing request".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: acquiring a plurality of service processing requests; the service processing requests indicate a plurality of external interface identifiers and service data; generating a plurality of service messages respectively corresponding to the plurality of service processing requests, and storing the plurality of service messages in a first state; calling a target external interface according to target service data and a target external interface identifier corresponding to a target service message in a first state in stored service messages so as to enable a processing system corresponding to the target external interface to process the target service data; and responding to a processing result returned by the processing system, updating the target service message from a first state to a second state, and processing the target service data according to the processing result.
According to the technical scheme of the embodiment of the invention, the corresponding target external interface can be called to process the service data according to the state of the target service message, and the processing result returned by processing the service data through the external service system is used for modifying the state of the target service message and processing the target service data again; therefore, when the same service data is processed among a plurality of service systems, whether the service data is modified and synchronized can be determined according to the state and the processing result of the same service message, so that the data consistency among the plurality of service systems is ensured, and the accuracy and the reliability of data processing of the distributed system are improved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A data processing method, comprising:
acquiring a plurality of service processing requests; the service processing requests indicate a plurality of external interface identifiers and service data;
generating a plurality of service messages respectively corresponding to the service processing requests, and storing the service messages in a first state;
calling a target external interface according to target service data and a target external interface identifier corresponding to a target service message in a first state in stored service messages so as to enable a processing system corresponding to the target external interface to process the target service data;
and responding to a processing result returned by the processing system, updating the target service message from a first state to a second state, and processing the target service data according to the processing result.
2. The method of claim 1, wherein said invoking a target external interface comprises:
respectively determining protocol types corresponding to the service processing requests;
generating the plurality of service messages according to the protocol type;
and according to the protocol types, concurrently calling the target external interfaces corresponding to the plurality of target service messages corresponding to different protocol types.
3. The method of claim 1, wherein the generating a plurality of service messages corresponding to the plurality of service processing requests, respectively, and storing the plurality of service messages in a first state, further comprises:
for each service processing request:
and generating a service message according to the external interface identifier, the service data, the service identifier, the service number, the message type, the request identifier, the request message body, the processing state, the version number, the creation time and the processing time indicated by the service processing request.
4. The method according to claim 1, wherein in a case where the processing result is a processing failure, the second state is a processing failure state, and further comprising:
and according to the first period, determining the target service message in the processing failure state from the plurality of service messages, and recalling the target external interface of the target service message in the processing failure state.
5. The method of claim 4, wherein the second state further comprises a processed state, and after invoking the target external interface, further comprising:
and increasing the version number of the target service message and updating the processing time.
6. The method of claim 5, further comprising:
acquiring a plurality of to-be-archived service messages in a processed state according to a second period;
and storing the business message to be archived into a data table, and setting archiving time for the business message to be archived.
7. The method of claim 5, further comprising:
in the case where the time period between the calling time to call the target external interface and the present time exceeds a preset time period,
and determining that the second state of the target service message is a processing failure state.
8. The method according to any one of claims 1 to 7,
applied to prescription processing systems;
the service processing request is a prescription processing request.
9. A data processing apparatus, characterized by comprising: the device comprises an acquisition module, a storage module and a processing module; wherein the content of the first and second substances,
the acquisition module is used for acquiring a plurality of service processing requests; the service processing requests indicate a plurality of external interface identifiers and service data;
the storage module is used for generating a plurality of service messages respectively corresponding to the service processing requests and storing the service messages in a first state;
the processing module is used for calling a target external interface according to target service data corresponding to a target service message in a first state in the stored service messages and a target external interface identifier so as to enable a processing system corresponding to the target external interface to process the target service data; and responding to a processing result returned by the processing system, updating the target service message from a first state to a second state, and processing the target service data according to the processing result.
10. An electronic device, comprising:
one or more processors;
a storage device to store one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
11. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-8.
CN202210534759.2A 2022-05-17 2022-05-17 Data processing method and device Pending CN114979187A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210534759.2A CN114979187A (en) 2022-05-17 2022-05-17 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210534759.2A CN114979187A (en) 2022-05-17 2022-05-17 Data processing method and device

Publications (1)

Publication Number Publication Date
CN114979187A true CN114979187A (en) 2022-08-30

Family

ID=82982717

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210534759.2A Pending CN114979187A (en) 2022-05-17 2022-05-17 Data processing method and device

Country Status (1)

Country Link
CN (1) CN114979187A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110041006A1 (en) * 2009-08-12 2011-02-17 New Technology/Enterprise Limited Distributed transaction processing
CN108280150A (en) * 2018-01-05 2018-07-13 宝付网络科技(上海)有限公司 A kind of distribution asynchronous service distribution method and system
CN110049113A (en) * 2019-04-02 2019-07-23 中国联合网络通信集团有限公司 Service message processing method and device
US20210074415A1 (en) * 2018-05-16 2021-03-11 Shanghai Svm Medical Technology Co., Ltd. Medical cloud platform data sharing system and method based on third-party business
CN113177052A (en) * 2021-04-30 2021-07-27 中国建设银行股份有限公司 Method and device for processing service data consistency of distributed system
WO2021217986A1 (en) * 2020-04-30 2021-11-04 平安科技(深圳)有限公司 Distributed message transmission method and apparatus, computer device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110041006A1 (en) * 2009-08-12 2011-02-17 New Technology/Enterprise Limited Distributed transaction processing
CN108280150A (en) * 2018-01-05 2018-07-13 宝付网络科技(上海)有限公司 A kind of distribution asynchronous service distribution method and system
US20210074415A1 (en) * 2018-05-16 2021-03-11 Shanghai Svm Medical Technology Co., Ltd. Medical cloud platform data sharing system and method based on third-party business
CN110049113A (en) * 2019-04-02 2019-07-23 中国联合网络通信集团有限公司 Service message processing method and device
WO2021217986A1 (en) * 2020-04-30 2021-11-04 平安科技(深圳)有限公司 Distributed message transmission method and apparatus, computer device and storage medium
CN113177052A (en) * 2021-04-30 2021-07-27 中国建设银行股份有限公司 Method and device for processing service data consistency of distributed system

Similar Documents

Publication Publication Date Title
CN109995801B (en) Message transmission method and device
CN111277639B (en) Method and device for maintaining data consistency
CN111897633A (en) Task processing method and device
CN111478781B (en) Message broadcasting method and device
CN111460129A (en) Method and device for generating identification, electronic equipment and storage medium
CN110389976B (en) Multi-interface data scheduling method and device
CN107818027B (en) Method and device for switching main name node and standby name node and distributed system
CN106657195B (en) Task processing method and relay device
CN112084254A (en) Data synchronization method and system
CN114979187A (en) Data processing method and device
CN113779122B (en) Method and device for exporting data
CN108833147B (en) Configuration information updating method and device
CN113760487A (en) Service processing method and device
CN113743630A (en) Method and device for executing intelligent call reservation
CN112732728A (en) Data synchronization method and system
CN113766437B (en) Short message sending method and device
CN112883103A (en) Method and device for data transfer between clusters
CN113779048A (en) Data processing method and device
CN113760482A (en) Task processing method, device and system
CN112306984A (en) Data source routing method and device
CN113157405A (en) Method and device for retrying breakpoint of business process
CN113761001A (en) Cross-system data synchronization method and device
CN114756307A (en) Service request processing method and device
CN116737662A (en) Method, device, electronic equipment and storage medium for processing business data
CN113138975A (en) Data migration method and device

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