CN114979187B - Data processing method and device - Google Patents
Data processing method and device Download PDFInfo
- Publication number
- CN114979187B CN114979187B CN202210534759.2A CN202210534759A CN114979187B CN 114979187 B CN114979187 B CN 114979187B CN 202210534759 A CN202210534759 A CN 202210534759A CN 114979187 B CN114979187 B CN 114979187B
- Authority
- CN
- China
- Prior art keywords
- processing
- service
- 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.)
- Active
Links
- 238000003672 processing method Methods 0.000 title abstract description 16
- 238000012545 processing Methods 0.000 claims abstract description 236
- 238000000034 method Methods 0.000 claims abstract description 47
- 230000008569 process Effects 0.000 claims abstract description 26
- 238000004590 computer program Methods 0.000 claims description 9
- 238000004140 cleaning Methods 0.000 claims 2
- 238000010586 diagram Methods 0.000 description 11
- 238000004891 communication Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 230000001360 synchronised effect Effects 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 4
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000003814 drug Substances 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000026676 system process Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols 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]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multi Processors (AREA)
Abstract
The invention discloses a data processing method and device, and relates to the technical field of computers. One embodiment of the method comprises the following steps: acquiring a plurality of service processing requests; the plurality of 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; according to the target service data corresponding to the target service message in the first state in the stored service message and the target external interface identifier, calling the target external interface 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 information from the first state to the second state, and processing the target service data according to the processing result. The implementation method ensures the consistency of data among the multi-service systems and improves the reliability of the distributed system for processing the data.
Description
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 invocation between systems, and when prescription processing platforms need to push prescription data to a patient, notification systems need to be invoked so that the notification systems send messages to the patient's terminals.
In the process of multi-system call, the systems directly call through interfaces, and data is correspondingly modified according to the call conditions of the systems, so that the problem of inconsistent data among a plurality of systems can be caused.
Disclosure of Invention
In view of this, an embodiment of the present invention provides a data processing method and apparatus, which can call a corresponding target external interface according to a state of a target service message to process service data, and modify the state of the target service message by using a processing result returned by processing the service data by an external service system, 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 is 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 the data processing of the distributed system are further improved.
To achieve the above object, according to a first aspect of an embodiment of the present invention, there is provided a data processing method, including:
Acquiring a plurality of service processing requests; the plurality of 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;
According to target service data corresponding to the target service message in the first state and the target external interface identifier in the stored service message, calling a target external interface 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 business information from the first state to the second state, and processing the target business data according to the processing result.
Optionally, the calling the target external interface includes:
respectively determining the 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, the target external interfaces respectively corresponding to the multi-item label business messages corresponding to different protocol types are called in parallel.
Optionally, 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 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, in the case that 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 a target service message in a processing failure state from the plurality of service messages, and recalling a 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 invoked, further includes:
And incrementing the version number of the target service message, and updating the processing time.
Optionally, the method further comprises:
acquiring a plurality of business messages to be archived in a processed state according to a second period;
And storing the business information to be archived in a data table, and setting archiving time for the business information to be archived.
Optionally, the method further comprises:
in case that the time period between the calling time of calling the target external interface and the current time exceeds the 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 business processing request is a prescription processing request.
According to a second aspect of an embodiment 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 acquisition module is used for acquiring a plurality of service processing requests; the plurality of 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 plurality of service processing requests and storing the plurality of 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 business information from the first state to the second state, and processing the target business data according to the processing result.
According to a third aspect of an embodiment of the present invention, there is provided an electronic apparatus including:
one or more processors;
Storage means for storing one or more programs,
The one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method as provided in any one of the data processing methods of the first aspect above.
According to a fourth aspect of embodiments of the present invention, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method as provided in any of the above-mentioned data processing methods of the 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 is 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 plurality of service systems is ensured, and the accuracy and the reliability of the data processing of the distributed system are further improved.
Further effects of the above-described non-conventional alternatives are 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 of a data processing method according to another embodiment of the present invention;
FIG. 3 is a flow diagram of message storage provided by one embodiment of the present invention;
FIG. 4 is a flow diagram of message processing provided by one embodiment of the present invention;
FIG. 5 is a flow chart of a message archiving method according to one embodiment of the present invention
FIG. 6 is a schematic 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 applied;
Fig. 8 is a schematic diagram of a computer system suitable for use in implementing an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention will now be described with reference to the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding, and are to be considered 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 in the embodiments may be combined with each other without collision.
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 indicates a plurality of external interface identifications and service data.
Step S102: and 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.
Step S103: and calling a target external interface according to target service data corresponding to the target service message in the first state and a target external interface identifier in the stored service message, so that a processing system corresponding to the target external interface processes the target service data.
Step S104: and responding to a processing result returned by the processing system, updating the target business information from the first state to the second state, and processing the target business data according to the processing result.
The service processing request may be a request of 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 service data by calling an external service system.
The present invention may be applied to prescription processing systems; the business process request is a prescription process request when the prescription processing system is applied.
For example, in the prescription processing system, the service processing request may be a request for sending prescription data (service data) issued by a doctor for a patient to the patient in a short message mode, where the prescription processing platform needs to invoke a corresponding interface (external interface) of the notification system to send the prescription data; the business processing request can also send prescription data to the ordering system for processing according to the order of the patient and the instruction of purchasing the medicine, and at the moment, the prescription processing platform needs to call the corresponding interface of the ordering system to order according to the prescription data.
In the prescription 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 prescription processing request indicates the target external interface identification and prescription data.
Step S202: a plurality of prescription messages are generated.
Step S203: a message store is invoked.
A plurality of prescription messages are stored using a message memory.
The message memory provides functions of holding messages, querying messages, updating status, and deleting messages.
Step S204: invoking message processor
The message processor provides the functionality to process prescription messages.
Step S205: the target external interface is invoked.
And calling a target external interface corresponding to the prescription message so that the corresponding external service system processes the prescription data.
Step S206: a message archiver is invoked.
The message archiver provides the ability to archive processed prescription messages.
After acquiring the plurality of service processing requests, a plurality of service messages may be generated according to the following manner provided in one 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 a database, the data structure of which may be as shown in table 1,
TABLE 1
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, the protocol types corresponding to the service processing requests can be respectively determined; and generating the 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 a plurality of communication protocols, and the protocol type may be MQ protocol, HTTP protocol, RPC protocol, etc. The message type may be MQ message, HTTP message, RPC message, sms message, APP push message, etc.
The service identification and the service number indicate the service identification and the number of the current service system; the request identification 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 failure state, and an in-process state; the topic may be the message topic of the MQ message, which may be null for other protocols; the version number may then record a status update record of the service message, and each time the status of the service message is updated, the version number may be incremented once, for example, the status 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, where the first state may be a pending state.
Specifically, the process of generating a service message and storing the service message may be shown in a flow chart of a message storage provided by an embodiment of the present invention, as shown in steps S301 to S305 in fig. 3:
step S301: and acquiring a request for calling an external service system.
I.e. service handling requests.
Step S302: a request protocol is determined.
The message type is determined based on 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, among others.
Step S305: the status of the service message in the data table is updated.
And updating the processing state into a to-be-processed state, and updating the version number and the processing time.
In the prescription processing system, the flow of fig. 3 may be performed by a message store (shown in fig. 2) where the message store may store service messages, query service messages, update service messages, and delete service messages.
Specifically, when the target external interface is invoked, the following manner provided by one embodiment of the present invention may be adopted: and according to the protocol types, the target external interfaces respectively corresponding to the multi-item label business messages corresponding to different protocol types are called in parallel.
In one embodiment of the invention, the operation of invoking the target external interface may be performed by the message processor of FIG. 2, in columns at the prescription processing system. Wherein the message processor may be comprised of a timing task, a message processing task, and a message sender.
The specific flow may be as shown in fig. 4, including steps S401 to S405:
step S401: a timing task is initiated.
For example, it may be set to be performed once per second.
Step S402: the message processing task is started.
Step S403: the query is in an unprocessed target service message.
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 obtained from the message memory can be one or more.
Step S404: depending on the message type, a different message sender is selected.
And determining a corresponding protocol type according to the message type in the target service message. A determination is made of the protocol type to select the corresponding message sender.
Wherein the message sender may be a call thread of a protocol running on a node in the distributed cluster. For example, message sender a corresponds to the MQ protocol, message sender B corresponds to the RPC protocol, and message sender C corresponds to the HTTP protocol.
It will be appreciated that different message senders may be at one cluster node or at different cluster nodes.
Step S405: the target external interface is invoked by the message sender.
In the case that the invocation of the target external interface by the plurality of service messages does not generate service conflict, the plurality of message senders can be executed concurrently to invoke 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 multi-label service message corresponds to the same external service; and the target external interface corresponding to the target service message with the front processing time can be preferentially called according to the processing time of the multi-item target service message.
After the target external interface is invoked, the state of the target service message may be updated from a first state (a pending state) to a second state, where the second state is an in-process 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 situation that the calling time sequence generated by directly calling a plurality of external service systems is uncontrollable can be avoided, and the problem that the calling of the external interface or the service data processing generates conflict can be avoided. Each time the timing task only processes the service information which is not processed (to-be-processed state) at present, thereby ensuring the response speed of service data processing and improving the efficiency of service data processing.
It will be appreciated that after the target external interface is invoked, the processing result of the processing system (i.e., the external service system) may be obtained within a certain period of time. If the processing result is determined to be successful, it can be determined that the service data has been processed successfully, and then the processed and successful service data can be processed in the current service system, for example, the service data modified according to the external service system is synchronously updated in the current service system, so as to ensure the data consistency among a plurality of service systems.
And under the condition that the processing result is successful, updating the target service message to 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.
In the case that 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 that is not processed successfully can be processed again, the following manner provided by one embodiment of the present invention may be adopted: in the case that 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 a target service message in a processing failure state from the plurality of service messages, and recalling a target external interface of the target service message in the processing failure state.
In the prescription processing system, the first period may be a processing period of a timing task in the message processor described above. After the notification system is invoked and prescription data is sent to the notification system, a result of processing failure returned by the notification system is obtained. At this time, the status of the service message calling the notification system may be updated from the in-process status to the processing failure status. When the next first period comes, inquiring the target service information in the information storage in a processing failure state, and processing the target service information again, thereby realizing the purpose of retry and ensuring the success rate of calling among multiple services. At multiple retries, the number of retries may be determined by incrementing the version number of the target traffic message. The target service message in the message memory in the processing failure state and with the version number exceeding a certain value can be cleaned regularly, for example, the version number exceeding 010, and a corresponding warning prompt can be sent, so that the current system can check the target service message in multiple retry failures, which is not described herein.
Of course, after the target external interface is called, the processing result still cannot be obtained within a certain time, so as to ensure that the target service message can be processed in time, the following modes provided by the embodiment of the invention can 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 the second state of the target service message as a processing failure state. The preset duration may be set according to the interactive response requirement of the service system, for example, 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 regularly in time. For example, in a prescription processing system, the processed target business message may be archived in a message archiver (shown in fig. 2) and, after successful storage, deleted from the message store accordingly.
In one embodiment of the present invention, a plurality of service messages to be archived in a processed state may be acquired according to a second period; and storing the business information to be archived in a data table, and setting archiving time for the business information to be archived.
Wherein, in the prescription processing system, the data structure of the archiving table of the message archiver may be as shown in table 2:
TABLE 2
It will be appreciated that the service messages in table 1 may be stored with those in table 2, and the archiving time set, and after successful storage, the service messages are deleted from table 1.
The specific archiving process can be as shown in fig. 5, and includes the following steps:
Step S501: a timing task is initiated.
For example, it may be set to be performed once daily.
Step S502: a message archiving task is initiated.
Step S503: querying the processed service message.
A plurality of service messages in a processed state are queried from a message memory.
Step S504: the service message is written to the archive table.
Step S505: the archived service messages are deleted.
After confirming that the archiving is successful, the archived service message is deleted from the message store.
In the prescription processing system, when the service needs to call an external service system, 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, by the message processor, the service message in the message memory that is not processed (in a pending state or a processing failure state); after the message processor processes successfully, the business message is archived and recycled by 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, and the processing result returned by the service data processed by 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 is 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 the data processing of the distributed system are further 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 acquiring module 601 is configured to acquire a plurality of service processing requests; the plurality of 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 corresponding to the plurality of service processing requests respectively, 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 corresponding to a target service message in a first state and a target external interface identifier in the 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 business information from the first state to the second state, and processing the target business data according to the processing result.
In one embodiment of the present invention, the storage module 602 is configured to process, for each service 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 one embodiment of the present invention, the processing module 603 is configured to determine a protocol type corresponding to each of the plurality of service processing requests; generating the plurality of service messages according to the protocol type; and according to the protocol types, the target external interfaces respectively corresponding to the multi-item label business messages corresponding to different protocol types are called in parallel.
In one embodiment of the present invention, the processing module 603 is configured to determine, when the processing result is that the processing fails, the second state is a processing failure state, determine, according to a first period, 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.
In one embodiment of the present invention, the processing module 603 is configured to increment the version number of the target service message after invoking the target external interface and update the processing time, where the second state further includes a processed state.
In one embodiment of the present invention, the processing module 603 is configured to obtain, according to the second period, a plurality of service messages to be archived in a processed state; and storing the business information to be archived in a data table, and setting archiving time for the business information to be archived.
In one 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 when the target external interface is called and a current time exceeds a preset duration.
In one embodiment of the present invention, the processing module 603 is configured to be applied to a prescription processing system; the business 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, and the processing result returned by the service data processed by 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 is 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 the data processing of the distributed system are further improved.
Fig. 7 shows an exemplary system architecture 700 of a data processing method or a data processing apparatus to which embodiments of the invention may be applied.
As shown in fig. 7, a system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 is the medium used to provide communication links between the terminal devices 701, 702, 703 and the server 705. The network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
A user may interact with the server 705 via the network 704 using the 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 smartphones, tablets, laptop and desktop computers, and the like.
The server 705 may be a server providing various services, such as a background management server providing support for service processing requests made by users using the terminal devices 701, 702, 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 in 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 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 8, there is illustrated a schematic diagram of a computer system 800 suitable for use in implementing an embodiment of the present invention. The terminal device shown in fig. 8 is only an example, and should not impose any limitation on the functions and the scope of use of the embodiment 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 according to 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 required for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to the bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, mouse, etc.; an output portion 807 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 808 including a hard disk or 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. The drive 810 is also connected to the I/O interface 805 as needed. 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 needed so that a computer program read out therefrom is mounted into the storage section 808 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts 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 shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 809, and/or installed from the removable media 811. The above-described functions defined in the system of the present invention are performed when the computer program is executed by a Central Processing Unit (CPU) 801.
The computer readable medium shown in the present invention may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 context of this document, 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, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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 flowcharts 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 which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules involved in the embodiments of the present invention may be implemented in software or in hardware. The described modules may also be provided in a processor, for example, as: a processor comprises an acquisition module, a storage module and a processing module. The names of these modules do not in any way limit the module itself, and the acquisition module may also be described as a "module that acquires a service processing request", for example.
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 present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to include: acquiring a plurality of service processing requests; the plurality of 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; according to target service data corresponding to the target service message in the first state and the target external interface identifier in the stored service message, calling a target external interface 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 business information from the first state to the second state, and processing the target business 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 according to the state of the target service message to process the service data, and the processing result returned by the service data processed by 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 is 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 the data processing of the distributed system are further improved.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives can occur depending upon design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.
Claims (10)
1. A method of data processing, comprising:
Acquiring a plurality of service processing requests; the plurality of 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; the first state is a state to be processed;
According to target service data corresponding to the target service message in the first state and the target external interface identifier in the stored service message, calling a target external interface so that a processing system corresponding to the target external interface processes the target service data;
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 the case that the processing result is a processing failure, the second state is a processing failure state, and further includes: determining a target service message in a processing failure state from the plurality of service messages according to a first period, and recalling a target external interface of the target service message in the processing failure state; increasing the version number of the target service message and updating the processing time; and cleaning the target service message which is in a processing failure state and has the version number exceeding a certain value in the message memory at regular intervals.
2. The method of claim 1, wherein the invoking the target external interface comprises:
respectively determining the 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, the target external interfaces respectively corresponding to the multi-item label business messages corresponding to different protocol types are called in parallel.
3. The method of claim 1, wherein 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 of claim 1, wherein the second state further comprises a processed state, and wherein after invoking the target external interface, if the processing result is that the processing is successful, further comprising:
And incrementing the version number of the target service message, and updating the processing time.
5. The method as recited in claim 4, further comprising:
acquiring a plurality of business messages to be archived in a processed state according to a second period;
And storing the business information to be archived in a data table, and setting archiving time for the business information to be archived.
6. The method as recited in claim 4, further comprising:
in case that the time period between the calling time of calling the target external interface and the current time exceeds the preset time period,
And determining the second state of the target service message as a processing failure state.
7. The method according to any one of claims 1 to 6, wherein,
Applied to a prescription processing system;
the business processing request is a prescription processing request.
8. A data processing apparatus, comprising: the device comprises an acquisition module, a storage module and a processing module; wherein,
The acquisition module is used for acquiring a plurality of service processing requests; the plurality of 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 plurality of service processing requests and storing the plurality of 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; 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 the case that the processing result is a processing failure, the second state is a processing failure state, and further includes: determining a target service message in a processing failure state from the plurality of service messages according to a first period, and recalling a target external interface of the target service message in the processing failure state; increasing the version number of the target service message and updating the processing time; and cleaning the target service message which is in a processing failure state and has the version number exceeding a certain value in the message memory at regular intervals.
9. An electronic device, comprising:
one or more processors;
Storage means for storing one or more programs,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-7.
10. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210534759.2A CN114979187B (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 CN114979187B (en) | 2022-05-17 | 2022-05-17 | Data processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114979187A CN114979187A (en) | 2022-08-30 |
CN114979187B true CN114979187B (en) | 2024-05-17 |
Family
ID=82982717
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210534759.2A Active CN114979187B (en) | 2022-05-17 | 2022-05-17 | Data processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114979187B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
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 |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2472620B (en) * | 2009-08-12 | 2016-05-18 | Cloudtran Inc | Distributed transaction processing |
CN108648786B (en) * | 2018-05-16 | 2021-01-08 | 上海术木医疗科技有限公司 | Medical cloud platform data sharing system and method based on third-party service |
-
2022
- 2022-05-17 CN CN202210534759.2A patent/CN114979187B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
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 |
Also Published As
Publication number | Publication date |
---|---|
CN114979187A (en) | 2022-08-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109995801B (en) | Message transmission method and device | |
CN113157405A (en) | Method and device for retrying breakpoint of business process | |
CN112596920A (en) | Message processing method and device, electronic equipment and storage medium | |
CN112926068A (en) | Authority management method, management server, service server and readable storage medium | |
CN113761001A (en) | A cross-system data synchronization method and device | |
CN107818027B (en) | Method and device for switching main name node and standby name node and distributed system | |
CN114979187B (en) | Data processing method and device | |
CN113127561B (en) | Method and device for generating service single number, electronic equipment and storage medium | |
CN112925628A (en) | Service management method and device | |
CN113703933A (en) | Task processing method and device | |
CN113365231A (en) | Method and device for sending short message | |
CN112732728A (en) | Data synchronization method and system | |
CN113760482A (en) | Task processing method, device and system | |
CN117333170A (en) | Service processing method, device, electronic equipment and storage medium | |
CN108833147B (en) | Configuration information updating method and device | |
CN116737662A (en) | Method, device, electronic equipment and storage medium for processing business data | |
CN112948430B (en) | Date data query method and device | |
CN114253520B (en) | Interface code generation method and device | |
CN113760487B (en) | Service processing method and device | |
CN112688982B (en) | User request processing method and device | |
CN113766437B (en) | Short message sending method and device | |
CN113296982A (en) | Interface calling method and device | |
CN111930696A (en) | File transmission processing method and system based on small program | |
CN113743630A (en) | Method and device for executing intelligent call reservation | |
CN113760177A (en) | Data reporting 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |