CN110764932A - Data processing method, system, medium and computing device - Google Patents

Data processing method, system, medium and computing device Download PDF

Info

Publication number
CN110764932A
CN110764932A CN201911011226.0A CN201911011226A CN110764932A CN 110764932 A CN110764932 A CN 110764932A CN 201911011226 A CN201911011226 A CN 201911011226A CN 110764932 A CN110764932 A CN 110764932A
Authority
CN
China
Prior art keywords
party
state
processing
current state
data
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
CN201911011226.0A
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.)
Netease Media Technology Beijing Co Ltd
Original Assignee
Netease Media Technology Beijing 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 Netease Media Technology Beijing Co Ltd filed Critical Netease Media Technology Beijing Co Ltd
Priority to CN201911011226.0A priority Critical patent/CN110764932A/en
Publication of CN110764932A publication Critical patent/CN110764932A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Abstract

An embodiment of the present invention provides a data processing method, including: setting a current state of a first party to a first state; responding to the current state of the first party as a first state, and sending the target data to the second party for processing through the first party; and in the process of processing the target data by the second party, performing data interaction with the second party through the first party, wherein in the process of performing data interaction between the first party and the second party, the current state of the first party is converted into at least one second state from the first state, and the current state is used for representing the processing state of the second party for the target data. According to the method, in the data processing process, the processing state of the data is represented by switching different states, so that the logic control flow in the data processing process is simplified, and the occurrence of abnormity in the data processing process is greatly reduced. Furthermore, embodiments of the present invention provide a data processing system, a medium, and a computing device.

Description

Data processing method, system, medium and computing device
Technical Field
Embodiments of the present invention relate to the field of computers, and more particularly, to a data processing method, system, medium, and computing device.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
In the whole computer field, in the process of processing data, the processing state of the data is generally transmitted through a message system. The existing message system usually transmits messages in a command-driven manner, and a party who needs to transmit messages in the command-driven manner needs to know the processing logic of data and transmit the processing state of the data according to the processing logic.
However, in the course of implementing the inventive concept, the inventors found that at least the following problems existed in the related art: the message transmission in the command-driven manner requires data-based processing logic, and since the data processing logic is usually complex, the message transmission in the command-driven manner is likely to cause an exception in the data processing process.
In view of the above problems in the related art, no effective solution has been proposed at present.
Disclosure of Invention
For the reason of transmitting the message in the command-driven manner, the related art needs a data-based processing logic for transmitting the message in the command-driven manner, and since the data processing logic is usually complex, the problem of an exception occurring in the data processing process is easily caused when the message is transmitted in the command-driven manner.
Therefore, in the related art, it is very annoying to transmit the message in a command-driven manner, which easily causes an exception to occur in the data processing process.
Therefore, an improved data processing method is highly needed, so that in the data processing process, the processing state of the data is represented by switching different states, the logic control flow in the data processing process is simplified, and the occurrence of an exception in the data processing process is greatly reduced.
In this context, embodiments of the present invention are intended to provide a data processing method, system, medium, and computing device.
In a first aspect of embodiments of the present invention, there is provided a data processing method, including: the method comprises the steps of setting the current state of a first party to be a first state, responding to the fact that the current state of the first party is the first state, sending target data to a second party through the first party for processing, and carrying out data interaction with the second party through the first party in the process that the target data are processed by the second party, wherein the current state of the first party is converted into at least one second state from the first state in the process that the first party and the second party carry out data interaction, and the current state is used for representing the processing state of the second party for the target data.
In one embodiment of the invention, the at least one second state comprises a waiting state and an ending state, and the converting the current state of the first party from the first state to the at least one second state comprises: when the current state of the first party is the first state, receiving first feedback data from the second party through the first party, wherein the first feedback data is feedback of the second party on receiving the target data, and responding to the first party receiving the first feedback data to convert the current state of the first party from the first state into the waiting state. When the current state of the first party is the waiting state, receiving a first processing result from the second party through the first party, wherein the first processing result is a result of the second party processing the target data, and responding to the first party receiving the first processing result, and converting the current state of the first party from the waiting state to the ending state.
In another embodiment of the present invention, the at least one second state comprises an end state; the converting the current state of the first party from the first state to at least one second state comprises: when the current state of the first party is the first state, receiving a second processing result from the second party through the first party, wherein the second processing result is a result of the second party processing the target data, and responding to the second processing result received by the first party, and converting the current state of the first party from the first state to the end state.
In another embodiment of the present invention, the at least one second state further comprises a wait state; when the current state of the first party is the first state, receiving, by the first party, a second processing result from a second party includes: when the current state of the first party is the first state, receiving second feedback data from the second party through the first party, wherein the second feedback data is feedback that the target data is received by the second party, and responding to the second feedback data received by the first party, and converting the current state of the first party from the first state to the waiting state. And when the current state of the first party is a process state, receiving the second processing result from the second party through the first party, wherein the process state is a conversion process for converting the first state into the waiting state, and in response to the first party receiving the second processing result, converting the current state of the first party from the process state into the end state.
In another embodiment of the present invention, the method further comprises: when the current state of the first party is the first state, if the first party does not receive the first feedback data from the second party, sending inquiry information to the second party through the first party at intervals of a first preset time period, and if the times of sending the inquiry information through the first party reaches a first preset time, determining that the second party fails to process the target data.
In another embodiment of the present invention, the method further comprises: if the first party does not receive the second processing result from the second party when the current state of the first party is the waiting state or the process state, sending determination information to the second party by the first party every second preset time period, the determination information being used for determining whether the second party successfully processes the target data, if the first party receives the processing success information from the second party, the current state of the first party is converted from the waiting state to the ending state, if the first party receives in-process information from the second party, the current state of the first party remains in the wait state or the process state, and if the number of times of sending the determination information by the first party reaches a second preset number of times, determining that the second party fails to process the target data.
In another embodiment of the present invention, the determining that the second party fails to process the target data if the number of times the determination information is sent by the first party reaches a second preset number of times includes: and if the frequency of sending the determination information through the first party reaches a second preset frequency, determining the current state of the first party, converting the current state of the first party into the first state if the current state of the first party is determined to be the process state, and sending the target data to the second party through the first party again.
In another embodiment of the present invention, before setting the current state of the first party to the first state, the method further comprises: and in response to that the current state of the first party is the third state, receiving indication information from the second party through the first party, wherein the indication information is used for indicating the first party to send the target data to the second party for processing. The setting the current state of the first party to the first state comprises: in response to the first party receiving the indication information, setting a current state of the first party to the first state.
In another embodiment of the present invention, the first party comprises a computing node and the second party comprises a parameter service node configured to store target parameters of a plurality of computing nodes and to receive query requests or update requests for the target parameters by the plurality of computing nodes.
In a second aspect of embodiments of the present invention, there is provided a data processing system comprising: the device comprises a first setting module, a first sending module and an interaction module. The first setting module is configured to set a current state of a first party to a first state, the first sending module is configured to send target data to a second party for processing through the first party in response to that the current state of the first party is the first state, the interaction module is configured to perform data interaction with the second party through the first party in a process of processing the target data by the second party, wherein in a process of performing data interaction with the second party by the first party, the current state of the first party is converted from the first state to at least one second state, and the current state is used for representing a processing state of the second party for the target data.
In one embodiment of the invention, the at least one second state comprises a waiting state and an ending state, and the converting the current state of the first party from the first state to the at least one second state comprises: when the current state of the first party is the first state, receiving first feedback data from the second party through the first party, wherein the first feedback data is feedback of the second party on receiving the target data, and responding to the first party receiving the first feedback data to convert the current state of the first party from the first state into the waiting state. When the current state of the first party is the waiting state, receiving a first processing result from the second party through the first party, wherein the first processing result is a result of the second party processing the target data, and responding to the first party receiving the first processing result, and converting the current state of the first party from the waiting state to the ending state.
In another embodiment of the present invention, the at least one second state comprises an end state, and the converting the current state of the first party from the first state to the at least one second state comprises: when the current state of the first party is the first state, receiving a second processing result from the second party through the first party, wherein the second processing result is a result of the second party processing the target data, and responding to the second processing result received by the first party, and converting the current state of the first party from the first state to the end state.
In another embodiment of the present invention, the at least one second state further includes a waiting state, and when the current state of the first party is the first state, receiving, by the first party, a second processing result from a second party includes: when the current state of the first party is the first state, receiving second feedback data from the second party through the first party, wherein the second feedback data is feedback of the target data received by the second party; and in response to the first party receiving the second feedback data, converting the current state of the first party from the first state to the waiting state, and when the current state of the first party is a process state, receiving, by the first party, the second processing result from the second party, wherein the process state is a conversion process from the first state to the waiting state, and in response to the first party receiving the second processing result, converting the current state of the first party from the process state to the end state.
In another embodiment of the present invention, the system further comprises: the device comprises a second sending module and a first determining module. The second sending module is configured to send inquiry information to the second party through the first party every first preset time period if the first party does not receive the first feedback data from the second party when the current state of the first party is the first state. The first determining module is used for determining that the second party fails to process the target data if the number of times of sending the inquiry information by the first party reaches a first preset number of times.
In another embodiment of the present invention, the system further comprises: the device comprises a third sending module, a conversion module, a holding module and a second determining module. The third sending module is configured to, when the current state of the first party is the waiting state or the process state, send, by the first party, determination information to the second party every second preset time period if the first party does not receive the second processing result from the second party, where the determination information is used to determine whether the second party successfully processes the target data. The conversion module is used for converting the current state of the first party from the waiting state to the ending state if the first party receives the processing success information from the second party. The holding module is configured to hold a current state of the first party as the waiting state or the process state if the first party receives the information being processed from the second party. The second determining module is configured to determine that the second party fails to process the target data if the number of times that the first party sends the determination information reaches a second preset number of times.
In another embodiment of the present invention, the determining that the second party fails to process the target data if the number of times the determination information is sent by the first party reaches a second preset number of times includes: and if the frequency of sending the determination information through the first party reaches a second preset frequency, determining the current state of the first party, converting the current state of the first party into the first state if the current state of the first party is determined to be the process state, and sending the target data to the second party through the first party again.
In another embodiment of the present invention, the system further comprises: the device comprises a second setting module and a receiving module. The second setting module is used for setting the current state of the first party to be a third state. The receiving module is configured to receive, by the first party, indication information from the second party in response to that the current state of the first party is the third state, where the indication information is used to indicate that the first party sends the target data to the second party for processing. The setting the current state of the first party to the first state comprises: in response to the first party receiving the indication information, setting a current state of the first party to the first state.
In another embodiment of the present invention, the first party comprises a computing node and the second party comprises a parameter service node configured to store target parameters of a plurality of computing nodes and to receive query requests or update requests for the target parameters by the plurality of computing nodes.
In a third aspect of embodiments of the present invention, there is provided a computer readable storage medium having stored thereon executable instructions which, when executed by a processing unit, cause the processing unit to perform a method as any one of the above.
In a fourth aspect of embodiments of the present invention, there is provided a computing device comprising: a processing unit; and a storage unit storing computer-executable instructions that, when executed by the processing unit, perform the method of any of the above.
The method, the system, the medium and the computing equipment can carry out message transmission so as to represent the processing state of the data by switching different states in the data processing process, simplify the logic control flow in the data processing process and greatly reduce the occurrence of abnormity in the data processing process.
Drawings
The above and other objects, features and advantages of exemplary embodiments of the present invention will become readily apparent from the following detailed description read in conjunction with the accompanying drawings. Several embodiments of the invention are illustrated by way of example, and not by way of limitation, in the figures of the accompanying drawings and in which:
FIG. 1 schematically illustrates an exemplary system architecture of a data processing method and system thereof according to an embodiment of the present invention;
FIG. 2 schematically shows a flow diagram of a data processing method according to an embodiment of the invention;
FIG. 3 schematically shows a flow chart of a data processing method according to another embodiment of the invention;
FIG. 4 schematically shows a program product for implementing data processing according to an embodiment of the present invention;
FIG. 5 schematically shows a block diagram of a data processing system according to an embodiment of the present invention;
FIG. 6 schematically shows a block diagram of a data processing system according to another embodiment of the present invention;
FIG. 7 depicts a computing device for implementing data processing in accordance with an embodiment of the present invention.
In the drawings, the same or corresponding reference numerals indicate the same or corresponding parts.
Detailed Description
The principles and spirit of the present invention will be described with reference to a number of exemplary embodiments. It is understood that these embodiments are given solely for the purpose of enabling those skilled in the art to better understand and to practice the invention, and are not intended to limit the scope of the invention in any way. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
As will be appreciated by one skilled in the art, embodiments of the present invention may be embodied as a system, apparatus, device, method, or computer program product. Thus, the present invention may be embodied in the form of: entirely hardware, entirely software (including firmware, resident software, micro-code, etc.), or a combination of hardware and software.
According to the embodiment of the invention, a method, a system, a medium and a computing device for data processing are provided.
In this document, it is to be understood that any number of elements in the figures are provided by way of illustration and not limitation, and any nomenclature is used for differentiation only and not in any limiting sense.
The principles and spirit of the present invention are explained in detail below with reference to several representative embodiments of the invention.
Summary of The Invention
The inventor finds that in the related art, the message is transmitted in a command-driven manner, which requires data-based processing logic, and since the data processing logic is generally complex, the message is transmitted in a command-driven manner, which easily causes an exception to the data processing process. In addition, in the data processing method provided by the embodiment of the invention, the processing state of the data is represented by switching different states in the data processing process, so that the logic control flow in the data processing process is simplified, and the occurrence of abnormity in the data processing process is greatly reduced.
Having described the general principles of the invention, various non-limiting embodiments of the invention are described in detail below.
Application scene overview
First, an exemplary system architecture of a data processing method and a system thereof according to an embodiment of the present invention is described in detail with reference to fig. 1.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, and so forth.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the data processing method provided by the embodiment of the present invention may be generally executed by the server 105. Accordingly, embodiments of the present invention provide a data processing system that may be generally disposed within server 105. The data processing method provided by the embodiment of the present invention may also be executed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Correspondingly, the data processing system provided by the embodiment of the present invention may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Exemplary method
A data processing method according to an exemplary embodiment of the present invention is described below with reference to fig. 2 and 3 in conjunction with the system architecture of fig. 1. It should be noted that the above-described system architecture is only shown for the convenience of understanding the spirit and principles of the present invention, and the embodiments of the present invention are not limited in any way in this respect. Rather, embodiments of the present invention may be applied to any scenario where applicable.
Fig. 2 schematically shows a flow chart of a data processing method according to an embodiment of the invention.
As shown in fig. 2, the method includes operations S210 to S230.
In operation S210, a current state of the first party is set to a first state.
In operation S220, in response to the current state of the first party being the first state, the target data is transmitted to the second party by the first party for processing.
According to an embodiment of the invention, a data processing system, for example, includes a first party and a second party. The first party includes, for example, a computing node, and the second party includes, for example, a parameter service node configured to store target parameters of a plurality of computing nodes and receive query requests or update requests of the plurality of computing nodes for the target parameters.
For example, each first party (computing node) sends its own target data (target parameter) to a second party (parameter service node) for processing, the second party (parameter service node) processes the target parameter from each first party (computing node) to obtain an updated parameter, the second party may serve as a service party to receive a query request of each first party (computing node) for the updated parameter, or the second party may serve as a service party to receive an update request of each first party (computing node), and the update request is, for example, a request of the first party to update its own parameter based on the updated parameter.
Wherein the first party is for example provided with a finite state machine mathematical model. Before the first party sends the target data to the second party for processing, the finite state machine in the first party sets the current state of the first party to be a first state, for example, a sending state, and the first party sends the target data to the second party in the first state.
A Finite-State Machine (FSM) is also called a Finite-State automaton, which is called a State Machine for short, and represents a mathematical model of Finite states and behaviors such as transitions and switching among the states.
In operation S230, in the process of processing the target data by the second party, data interaction is performed between the first party and the second party by the first party, wherein in the process of data interaction between the first party and the second party, a current state of the first party is converted from a first state to at least one second state, and the current state is used to represent a processing state of the second party with respect to the target data.
That is, in the process of processing the target data by the second party, the first party and the second party keep data interaction at any time, so that the second party can conveniently inform the first party of the processing state of the data. When the first party receives a processing state from the second party regarding the target data, the finite state machine in the first party may switch the current state of the first party in real time. For example, during the process of processing the target data by the second party, the second party feeds back different processing states of the target data to the first party in real time. The finite state machine switches the current state of the first party from a first state to a different second state based on different processing states received from the second party with respect to the target data. It can be understood that the embodiment of the invention realizes message transmission by state switching, and a party transmitting the message does not need to know the processing logic of the data, thereby avoiding the complex processing logic of the party transmitting the message, reducing the complexity of message transmission in the data processing process, and greatly reducing the occurrence of abnormity in the data processing process.
According to an embodiment of the present invention, the converting the current state of the first party from the first state to the at least one second state includes, for example, but is not limited to, the following two implementations.
The first implementation mode comprises the following steps:
in a first implementation, the at least one second state includes, for example, a wait state and an end state. Wherein converting the current state of the first party from the first state to the at least one second state comprises: the finite state machine converts the current state of the first party from the first state (sending state) into a waiting state, and then converts the current state from the waiting state into an ending state.
For example, when the current state of the first party is a first state, first feedback data from the second party is received by the first party, wherein the first feedback data is feedback of the second party on receiving the target data, for example, and the current state of the first party is converted from the first state to a waiting state in response to the first party receiving the first feedback data. That is, after the second party receives the target data from the first party, the second party sends the first feedback data to the first party to inform the first party of the result of receiving the target data. After the first party receives the first feedback data, the finite state machine in the first party can convert the current state of the first party from the first state to a waiting state, so that the first party can wait for the second party to process the target data in the waiting state.
When the current state of the first party is the waiting state, for example, a first processing result from the second party may be received by the first party, where the first processing result is a result of the second party processing the target data, and in response to the first party receiving the first processing result, the current state of the first party is converted from the waiting state to the end state. That is, after the second party processes the target data to obtain the first processing result, the second party may send the first processing result to the first party. And after the first party receives the first processing result, the finite state machine converts the current state of the first party from the waiting state to the ending state, and the ending of the data processing process is represented. For example, when the first party is a computing node and the second party is a parameter service node, after the parameter service node processes the target parameters from each computing node to obtain updated global parameters, the first processing result may be, for example, a partial parameter required by the corresponding computing node in the updated global parameters, and the partial parameter may be, for example, a parameter used to update the corresponding computing node itself, or the first processing result may also be processing completion information, and after receiving the processing completion information, the first party may actively access the second party to obtain the updated global parameters.
In addition, when the current state of the first party is the first state, if the first party does not receive the first feedback data from the second party, query information for querying whether the second party receives the target data may be sent to the second party by the first party every a first preset time period. That is, when the current state of the first party is the first state, if the first party has not received the first feedback data from the second party after a period of time, the first party may drive the heartbeat mechanism to drive the heartbeat of the first party to send the query information to the second party, and when the next heartbeat arrives, if the second party has no response, the heartbeat is driven again to send the query information to the second party again.
If the number of times of sending the query information by the first party reaches a first preset number of times, it may be determined that the second party fails to process the target data because the first party stays in the first state for too long. If the first party inquires information from the second party, the feedback of the second party is the first feedback data, the finite state machine can convert the current state of the first party from the first state to the waiting state.
Alternatively, if the current state of the first party is the waiting state, the finite state machine may drive the heartbeat of the first party at regular intervals to send result query information to the second party to query whether the second party has finished processing the target data. If the number of times of sending the result query information by the first party reaches a certain preset number of times, it may be determined that the second party fails to process the target data. If the first party feeds back the first processing result to the first party after the first party inquires information about the second party result, the finite state machine may convert the current state of the first party from the waiting state to the ending state.
The second implementation mode comprises the following steps:
in a second implementation, the at least one second state comprises, for example, an end state. Wherein converting the current state of the first party from the first state to the at least one second state comprises: the finite state machine transitions the current state of the first party from the first state (the send state) to the end state.
For example, when the current state of the first party is the first state, a second processing result from the second party is received by the first party, wherein the second processing result is a result of the second party processing the target data, and the second processing result is, for example, the same as or similar to the first processing result. That is, if the current state of the first party is the first state, and the first party does not receive the second feedback data from the second party, but directly receives the second processing result of the second party, the current state of the first party can be directly converted from the first state to the end state. The second feedback data is, for example, feedback that the second party receives the target data, and the second feedback data is, for example, the same as or similar to the first feedback data.
Alternatively, the at least one second state may also comprise, for example, a wait state. For example, if the first party has received the second feedback data and received the second processing result before successfully transitioning from the first state to the wait state, the transition from the first state to the end state may be made.
Specifically, when the current state of the first party is the first state, the first party receives second feedback data from the second party, and in response to the first party receiving the second feedback data, the current state of the first party is converted from the first state to a waiting state, wherein the state converted from the first state to the waiting state but not converted successfully is the process state. In other words, the process state is a transition process from the first state to the waiting state, and the process state is a state that is transitioned from the first state to the waiting state but is not yet transitioned successfully.
According to the embodiment of the invention, when the current state of the first party is the process state, the first party receives the second processing result from the second party, and after the first party receives the second processing result from the second party, the finite state machine can convert the current state of the first party from the process state to the end state.
According to the embodiment of the invention, when the current state of the first party is the waiting state or the process state, if the first party does not receive the second processing result from the second party, the determination information is sent to the second party by the first party at intervals of the second preset time period, and the determination information is used for determining whether the second party successfully processes the target data. That is, if the first party has not received the second processing result from the second party after a period of time, the first party may drive the heartbeat mechanism to drive the heartbeat of the first party to transmit the determination information to the second party to determine whether the second party has successfully processed the target data, and upon arrival of the next heartbeat, if the second party is unresponsive, the heartbeat is driven again to transmit the determination information to the second party again. The second preset time period may be the same as or different from the first preset time period, for example.
And if the first party receives the processing success information from the second party, converting the current state of the first party from a waiting state or a process state into an end state. If the first party receives the in-process information from the second party, the current state of the first party is kept in a waiting state or a process state, and the second party continues to wait for processing the target data. If the number of times of sending the determination information by the first party reaches a second preset number of times, it may be determined that the second party fails to process the target data because the first party stays in the waiting state or the process state for an excessively long time.
If the number of times of sending the determination information by the first party reaches a second preset number of times, the current state of the first party can be further determined, and if the current state of the first party is determined to be the process state, the first party can return to the first state, that is, the current state of the first party can be converted from the process state to the first state, and the target data can be sent to the second party again by the first party.
According to the embodiment of the present invention, the first feedback data, the second feedback data, the first processing result, and the second processing result may all be ACK (acknowledge) data, for example, the ACK data may be an acknowledgement character, for example. In data communication, the confirmation character is, for example, a transmission control character sent by the receiver to the sender, which indicates that the data sent by the sender is received without error. For example, in the TCP/IP protocol, if the receiver successfully receives the data, the receiver may reply with, for example, an ACK data, which has, for example, a fixed format and a fixed length.
According to the embodiment of the invention, the data interaction process between the first party and the second party can realize message transmission in a state switching mode without the need that the party transmitting the message knows the processing logic of the data, so that the complex processing logic of the party transmitting the message is avoided, the complexity of message transmission in the data processing process is reduced, and the occurrence of abnormity in the data processing process is greatly reduced.
Fig. 3 schematically shows a flow chart of a data processing method according to another embodiment of the invention.
As shown in fig. 3, the method includes operations S210 to S230 and operations S310 to S320. Operations S210 to S230 are the same as or similar to the operations described above with reference to fig. 2, and are not described again here. Before the current state of the first party is set to the first state, operations S310 to S320 are further included.
In operation S310, the current state of the first party is set to a third state.
For example, before the first party and the second party start data interaction, the finite state machine first sets the current state of the first party to a third state, which is, for example, a start state.
In operation S320, in response to that the current state of the first party is the third state, receiving, by the first party, indication information from the second party, where the indication information is used to indicate that the first party sends the target data to the second party for processing. That is, in the third state (start state) of the first party, the indication information of the second party may be received, and the current state of the first party is set to the first state in response to the indication information, so that the first party sends the target data to the second party for processing in the first state.
Exemplary Medium
Having described the method of an exemplary embodiment of the present invention, a computer-readable storage medium of an exemplary embodiment of the present invention is described next with reference to fig. 4. A computer-readable storage medium stores computer-executable instructions that, when executed by a processing unit, are configured to implement the data processing method of any of the above-described method embodiments.
In some possible embodiments, aspects of the present invention may also be implemented in the form of a program product comprising program code for causing a computing device to perform the steps in the data processing method according to various exemplary embodiments of the present invention described in the above section "exemplary method" of this specification, when the program product is run on the computing device, for example, the computing device may perform operation S210 as shown in fig. 2: setting a current state of a first party to a first state; operation S220: responding to the current state of the first party as a first state, and sending the target data to the second party for processing through the first party; operation S230: and in the process of processing the target data by the second party, performing data interaction with the second party through the first party, wherein in the process of performing data interaction between the first party and the second party, the current state of the first party is converted into at least one second state from the first state, and the current state is used for representing the processing state of the second party for the target data.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A 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 (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, 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.
As shown in fig. 4, a program product 40 for implementing data processing according to an embodiment of the present invention is depicted, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a computing device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a 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.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. 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 thereof. A readable signal medium may also be any readable medium that is not a 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 readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user computing device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Exemplary devices
Having described the media of an exemplary embodiment of the present invention, a data processing system of an exemplary embodiment of the present invention is next described with reference to FIG. 5.
FIG. 5 schematically shows a block diagram of a data processing system according to an embodiment of the present invention.
As shown in fig. 5, the data processing system 500 may include a first setup module 510, a first sending module 520, and an interaction module 530.
The first setting module 510, for example, performs operation S210 described above with reference to fig. 2, sets the current state of the first party to the first state.
The first sending module 520, for example, executes operation S220 described above with reference to fig. 2, and sends the target data to the second party for processing by the first party in response to the current state of the first party being the first state.
The interaction module 530, for example, performs operation S230 described above with reference to fig. 2, and performs data interaction with the second party through the first party during the processing of the target data by the second party, wherein during the data interaction between the first party and the second party, a current state of the first party is converted from a first state to at least one second state, where the current state is used to represent a processing state of the second party with respect to the target data.
In one embodiment of the invention, the at least one second state comprises a waiting state and an ending state, and the converting the current state of the first party from the first state to the at least one second state comprises: and when the current state of the first party is a first state, receiving first feedback data from the second party through the first party, wherein the first feedback data is feedback of the second party on receiving the target data, and responding to the first party receiving the first feedback data and converting the current state of the first party from the first state into a waiting state. And when the current state of the first party is a waiting state, receiving a first processing result from the second party through the first party, wherein the first processing result is a result of processing the target data by the second party, and responding to the first party receiving the first processing result to convert the current state of the first party from the waiting state to an end state.
In another embodiment of the present invention, the at least one second state comprises an end state, and the transitioning the current state of the first party from the first state to the at least one second state comprises: and when the current state of the first party is the first state, receiving a second processing result from the second party through the first party, wherein the second processing result is a result of processing the target data by the second party, and responding to the second processing result received by the first party, and converting the current state of the first party from the first state to the end state.
In another embodiment of the present invention, the at least one second state further includes a waiting state, and when the current state of the first party is the first state, receiving, by the first party, the second processing result from the second party includes: when the current state of the first party is a first state, receiving second feedback data from the second party through the first party, wherein the second feedback data is feedback of target data received by the second party; and when the current state of the first party is a process state, receiving a second processing result from the second party through the first party, wherein the process state is a conversion process from the first state to the waiting state, and responding to the first party receiving the second processing result, converting the current state of the first party from the process state to an end state.
In another embodiment of the present invention, the system further comprises: the device comprises a second sending module and a first determining module. The second sending module is used for sending inquiry information to the second party through the first party every a first preset time period if the first party does not receive first feedback data from the second party when the current state of the first party is the first state. The first determining module is used for determining that the second party fails to process the target data if the number of times of sending the inquiry information by the first party reaches a first preset number of times.
In another embodiment of the present invention, the system further comprises: the device comprises a third sending module, a conversion module, a holding module and a second determining module. The third sending module is configured to, when the current state of the first party is the waiting state or the process state, send, by the first party, determination information to the second party every second preset time period if the first party does not receive the second processing result from the second party, where the determination information is used to determine whether the second party successfully processes the target data. The conversion module is used for converting the current state of the first party from a waiting state to an ending state if the first party receives the processing success information from the second party. The holding module is used for holding the current state of the first party into a waiting state or a process state if the first party receives the information being processed from the second party. The second determining module is used for determining that the second party fails to process the target data if the number of times of sending the determining information by the first party reaches a second preset number of times.
In another embodiment of the present invention, if the number of times the determination information is transmitted by the first party reaches a second preset number of times, determining that the second party fails to process the target data includes: and if the frequency of sending the determination information through the first party reaches a second preset frequency, determining the current state of the first party, converting the current state of the first party into the first state and sending the target data to the second party through the first party if the current state of the first party is determined to be the process state.
In another embodiment of the present invention, the first party comprises a compute node and the second party comprises a parameter service node, the parameter service node configured to store target parameters of a plurality of compute nodes and to receive query requests or update requests for the target parameters by the plurality of compute nodes.
FIG. 6 schematically shows a block diagram of a data processing system according to another embodiment of the present invention.
As shown in fig. 6, the data processing system 600 further includes a second setting module 610 and a receiving module 620 on the basis of the embodiment illustrated in fig. 5.
The second setting module 610, for example, performs operation S310 described above with reference to fig. 3, sets the current state of the first party to the third state.
The receiving module 620, for example, performs operation S320 described above with reference to fig. 3, and receives, by the first party, indication information from the second party in response to that the current state of the first party is the third state, where the indication information is used to indicate that the first party sends the target data to the second party for processing.
In another embodiment of the present invention, setting the current state of the first party to the first state comprises: and in response to the first party receiving the indication information, setting the current state of the first party to be the first state.
Since each functional module of the data processing system 500 or 600 of the exemplary embodiment of the present invention corresponds to the step of the exemplary embodiment of the data processing method described above, it is not described herein again.
Exemplary computing device
Having described the methods, media, and apparatus of exemplary embodiments of the invention, a computing device implementing the data processing methods of the invention of exemplary embodiments of the invention is described next with reference to FIG. 7.
The embodiment of the invention also provides the computing equipment. As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
In some possible embodiments, a computing device according to the present invention may include at least one processing unit, and at least one memory unit. Wherein the storage unit stores program code which, when executed by the processing unit, causes the processing unit to perform the steps in the data processing method according to various exemplary embodiments of the present invention described in the above section "exemplary method" of the present specification. For example, the processing unit may perform operation S210 as shown in fig. 2: setting a current state of a first party to a first state; operation S220: responding to the current state of the first party as a first state, and sending the target data to the second party for processing through the first party; operation S230: and in the process of processing the target data by the second party, performing data interaction with the second party through the first party, wherein in the process of performing data interaction between the first party and the second party, the current state of the first party is converted into at least one second state from the first state, and the current state is used for representing the processing state of the second party for the target data.
A computing device 70 for implementing data processing according to this embodiment of the invention is described below with reference to fig. 7. The computing device 70 shown in FIG. 7 is only one example and should not be taken to limit the scope of use and functionality of embodiments of the present invention.
As shown in fig. 7, computing device 70 is embodied in the form of a general purpose computing device. Components of computing device 70 may include, but are not limited to: the at least one processing unit 701, the at least one memory unit 702, and a bus 703 that couples various system components including the memory unit 702 and the processing unit 701.
The bus 703 includes a data bus, an address bus, and a control bus.
The storage unit 702 can include readable media in the form of volatile memory, such as Random Access Memory (RAM)7021 and/or cache memory 7022, and can further include Read Only Memory (ROM) 7023.
Storage unit 702 may also include a program/utility 7025 having a set (at least one) of program modules 7024, such program modules 7024 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Computing device 70 may also communicate with one or more external devices 704 (e.g., keyboard, pointing device, bluetooth device, etc.), which may be through an input/output (I/0) interface 705. Moreover, computing device 70 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) through network adapter 706. As shown, network adapter 706 communicates with the other modules of computing device 70 via bus 703. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with computing device 70, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
It should be noted that although in the above detailed description several units/modules or sub-units/sub-modules of the apparatus are mentioned, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module according to embodiments of the invention. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
Moreover, while the operations of the method of the invention are depicted in the drawings in a particular order, this does not require or imply that the operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
While the spirit and principles of the invention have been described with reference to several particular embodiments, it is to be understood that the invention is not limited to the particular embodiments disclosed, nor is the division of the aspects, which is for convenience only as the features in these aspects may not be combined to benefit from the present disclosure. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (10)

1. A method of data processing, comprising:
setting a current state of a first party to a first state;
responding to the current state of the first party as a first state, and sending target data to a second party for processing through the first party; and
performing data interaction with the second party through the first party in the process of processing the target data by the second party,
and in the process of data interaction between the first party and the second party, converting the current state of the first party from the first state to at least one second state, wherein the current state is used for representing the processing state of the second party for the target data.
2. The method of claim 1, wherein the at least one second state comprises a wait state and an end state; the converting the current state of the first party from the first state to at least one second state comprises:
when the current state of the first party is the first state, receiving first feedback data from the second party through the first party, wherein the first feedback data is feedback of the second party on receiving the target data; in response to the first party receiving the first feedback data, converting the current state of the first party from the first state to the waiting state;
when the current state of the first party is the waiting state, receiving a first processing result from the second party through the first party, wherein the first processing result is a result of the second party processing the target data; and responding to the first party receiving the first processing result, and converting the current state of the first party from the waiting state to the ending state.
3. The method of claim 1, wherein the at least one second state comprises an end state; the converting the current state of the first party from the first state to at least one second state comprises:
when the current state of the first party is the first state, receiving a second processing result from the second party through the first party, wherein the second processing result is a result of the second party processing the target data; and
and responding to the first party receiving the second processing result, and converting the current state of the first party from the first state to the end state.
4. The method of claim 3, wherein the at least one second state further comprises a wait state; when the current state of the first party is the first state, receiving, by the first party, a second processing result from a second party includes:
when the current state of the first party is the first state, receiving second feedback data from the second party through the first party, wherein the second feedback data is feedback of the target data received by the second party; in response to the first party receiving the second feedback data, converting the current state of the first party from the first state to the waiting state;
when the current state of the first party is a process state, receiving the second processing result from the second party through the first party, wherein the process state is a conversion process of converting from the first state to the waiting state; and responding to the first party receiving the second processing result, and converting the current state of the first party from the process state to the end state.
5. The method of claim 2, further comprising:
when the current state of the first party is the first state, if the first party does not receive the first feedback data from the second party, sending inquiry information to the second party through the first party at intervals of a first preset time period; and
and if the number of times of sending the inquiry information by the first party reaches a first preset number of times, determining that the second party fails to process the target data.
6. The method of claim 4, further comprising:
when the current state of the first party is the waiting state or the process state, if the first party does not receive the second processing result from the second party, sending determination information to the second party through the first party every second preset time period, wherein the determination information is used for determining whether the second party successfully processes the target data;
if the first party receives the processing success information from the second party, the current state of the first party is converted into the end state from the waiting state or the process state;
if the first party receives the in-process information from the second party, the current state of the first party is kept in the waiting state or the process state; and
and if the number of times of sending the determination information by the first party reaches a second preset number of times, determining that the second party fails to process the target data.
7. The method of claim 6, wherein the determining that the second party failed to process the target data if the number of times the determination information is transmitted by the first party reaches a second preset number of times comprises:
if the number of times of sending the determination information by the first party reaches a second preset number of times, determining the current state of the first party; and
and if the current state of the first party is determined to be the process state, converting the current state of the first party into the first state, and retransmitting the target data to the second party through the first party.
8. A data processing system comprising:
the first setting module is used for setting the current state of the first party to be a first state;
the first sending module is used for responding to the fact that the current state of the first party is a first state, and sending the target data to a second party for processing through the first party; and
an interaction module, which performs data interaction with the second party through the first party in the process of processing the target data by the second party,
and in the process of data interaction between the first party and the second party, converting the current state of the first party from the first state to at least one second state, wherein the current state is used for representing the processing state of the second party for the target data.
9. A computer-readable storage medium having stored thereon executable instructions that, when executed by a processing unit, cause the processing unit to perform the method of any one of claims 1-7.
10. A computing device, comprising:
a processing unit; and
a storage unit having stored thereon executable instructions that, when executed by the processing unit, cause the processing unit to perform the method of any of claims 1-7.
CN201911011226.0A 2019-10-22 2019-10-22 Data processing method, system, medium and computing device Pending CN110764932A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911011226.0A CN110764932A (en) 2019-10-22 2019-10-22 Data processing method, system, medium and computing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911011226.0A CN110764932A (en) 2019-10-22 2019-10-22 Data processing method, system, medium and computing device

Publications (1)

Publication Number Publication Date
CN110764932A true CN110764932A (en) 2020-02-07

Family

ID=69333074

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911011226.0A Pending CN110764932A (en) 2019-10-22 2019-10-22 Data processing method, system, medium and computing device

Country Status (1)

Country Link
CN (1) CN110764932A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111723044A (en) * 2020-06-18 2020-09-29 北京字节跳动网络技术有限公司 Data processing system, state transition method, data intersection method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1558637A (en) * 2004-01-19 2004-12-29 深圳市思杰科技有限公司 A method for improving end-to-end QoS of mobile application system
EP1717715A1 (en) * 2005-04-25 2006-11-02 Hewlett-Packard Development Company, L.P. State machine-driven interactive system and associated methods
CN103019695A (en) * 2012-11-22 2013-04-03 用友软件股份有限公司 Data object and state control logical separation system and method
CN106227584A (en) * 2016-07-28 2016-12-14 武汉聚风天下科技有限公司 A kind of event-driven method based on state machine and system
CN109634764A (en) * 2018-12-20 2019-04-16 百度在线网络技术(北京)有限公司 Work-flow control method, apparatus, equipment, storage medium and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1558637A (en) * 2004-01-19 2004-12-29 深圳市思杰科技有限公司 A method for improving end-to-end QoS of mobile application system
EP1717715A1 (en) * 2005-04-25 2006-11-02 Hewlett-Packard Development Company, L.P. State machine-driven interactive system and associated methods
CN103019695A (en) * 2012-11-22 2013-04-03 用友软件股份有限公司 Data object and state control logical separation system and method
CN106227584A (en) * 2016-07-28 2016-12-14 武汉聚风天下科技有限公司 A kind of event-driven method based on state machine and system
CN109634764A (en) * 2018-12-20 2019-04-16 百度在线网络技术(北京)有限公司 Work-flow control method, apparatus, equipment, storage medium and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111723044A (en) * 2020-06-18 2020-09-29 北京字节跳动网络技术有限公司 Data processing system, state transition method, data intersection method and device

Similar Documents

Publication Publication Date Title
CN108961033B (en) Multi-service system interaction method and device, storage medium and electronic terminal
US10142425B2 (en) Session reliability for a redirected USB device
CN111177112A (en) Database blocking method and device based on operation and maintenance management system and electronic equipment
CN110620806B (en) Information generation method and device
US20210314414A1 (en) Facilitating inter-proxy communication via an existing protocol
CN110324384B (en) Data pushing method and device
CN107818027B (en) Method and device for switching main name node and standby name node and distributed system
CN110764932A (en) Data processing method, system, medium and computing device
CN110324432B (en) Data processing method, device and medium applied to terminal and computing equipment
CN114449040B (en) Configuration issuing method and device based on cloud platform
CN113220433B (en) Agent program operation management method and system
CN114125732A (en) Message processing method and device, storage medium and electronic equipment
CN112714420A (en) Network access method and device of wifi hotspot providing equipment and electronic equipment
CN110048991B (en) Method and device for realizing signal interaction reliability
CN112153754A (en) Point-to-point connection method and device, electronic equipment and storage medium
CN112148324A (en) Method, apparatus and computer-readable storage medium for upgrading electronic device
JP2021087162A (en) Server, information processing system, and control method
CN114979308B (en) Message processing method and device
CN114448703B (en) Request processing method, request processing device, electronic equipment and storage medium
CN112087510B (en) Request processing method, device, electronic equipment and medium
CN110011767B (en) Method and apparatus for TCP connection backup
CN115378896B (en) Message display method and device, electronic equipment and storage medium
CN117170941B (en) Data backup method, device, electronic equipment and storage medium
US11777878B1 (en) Message routing based on unavailability
US11941432B2 (en) Processing system, processing method, higher-level system, lower-level system, higher-level program, and lower-level program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200207