CN111597057A - Data processing method, device and computer readable storage medium - Google Patents

Data processing method, device and computer readable storage medium Download PDF

Info

Publication number
CN111597057A
CN111597057A CN202010270735.1A CN202010270735A CN111597057A CN 111597057 A CN111597057 A CN 111597057A CN 202010270735 A CN202010270735 A CN 202010270735A CN 111597057 A CN111597057 A CN 111597057A
Authority
CN
China
Prior art keywords
packet
service
service command
identity
command packet
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.)
Granted
Application number
CN202010270735.1A
Other languages
Chinese (zh)
Other versions
CN111597057B (en
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.)
Visionvera Information Technology Co Ltd
Original Assignee
Visionvera Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Visionvera Information Technology Co Ltd filed Critical Visionvera Information Technology Co Ltd
Priority to CN202010270735.1A priority Critical patent/CN111597057B/en
Publication of CN111597057A publication Critical patent/CN111597057A/en
Application granted granted Critical
Publication of CN111597057B publication Critical patent/CN111597057B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/541Client-server
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Abstract

The invention provides a data processing method, a data processing device and a computer readable storage medium, wherein the method comprises the following steps: receiving at least one service parameter input by a user, determining a service command packet corresponding to each service parameter according to the at least one service parameter, wherein one service command packet carries a unique identity, sending each service command packet to a server, receiving an original response packet returned by the server and corresponding to each service command packet, wherein the original response packet and the service command packet corresponding to each other carry the same identity, and determining a complete response packet corresponding to each service command packet according to the identity carried by each original response packet, the total number of packet fragments and the current fragment number.

Description

Data processing method, device and computer readable storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data processing method and apparatus, and a computer-readable storage medium.
Background
In the existing data processing system, when a user initiates a service request, the same user is prone to continuously initiate the same service request for multiple times, at this time, a server receives multiple service requests of the same user and generates multiple response data respectively for the multiple service requests, at this time, if the multiple response data are too large, the multiple response data need to be respectively subjected to fragmentation processing and then sent to the data processing system, and after being received by the data processing system, the multiple original response packets contained in the multiple response data are combined to obtain a complete response packet, so that complete response data are obtained.
However, the existing original response packet merging mode uses the service identifier as a merging basis, so that after the data processing system receives the original response packet returned by the server, merging of the original response packet based on the service identifier is inaccurate, and service exception is easily caused.
Disclosure of Invention
In view of the above, embodiments of the present invention are proposed in order to provide a data processing method, apparatus and computer-readable storage medium that overcome or at least partially solve the above problems.
In order to solve the above problem, an embodiment of the present invention discloses a data processing method, which is applied to a data processing system, wherein the data processing system is in communication connection with a server, and the method includes:
receiving at least one service parameter input by a user;
determining a service command packet corresponding to each service parameter according to at least one service parameter, wherein one service command packet carries a unique identity;
sending each service command packet to the server;
receiving original response packets which are returned by the server and respectively correspond to the service command packets, wherein the original response packets and the service command packets which correspond to each other carry the same identity;
and determining the complete response packet corresponding to each service command packet according to the identity carried by each original response packet, the total number of packet fragments and the current fragment number.
Optionally, the service parameter includes a service identifier and service data, and determining, according to at least one of the service parameters, a service command packet corresponding to each of the service parameters includes:
assigning values to the service identifications to generate identity identifications corresponding to the service identifications, wherein each identity identification has uniqueness;
and according to the identity identification and a preset encapsulation rule, encapsulating each service data to generate a service command packet corresponding to each service parameter.
Optionally, before determining, according to the identity, the total number of packet fragments, and the current fragment number carried by each original response packet, a complete response packet corresponding to each service command packet, the method further includes:
judging whether the complete response packet corresponding to each service command packet is fragmented according to the total number of packet fragments carried by each original response packet;
the determining, according to the identity, the total number of packet fragments, and the current fragment number carried by each original response packet, a complete response packet corresponding to each service command packet includes:
under the condition that the complete response packet corresponding to the service command packet is fragmented, taking an original response packet corresponding to the service command packet as the complete response packet corresponding to the service command packet;
and under the condition that the data packet corresponding to the service command packet is not fragmented, sequencing and combining all original response packets according to all the original response packets corresponding to the same identity and the current fragmentation numbers of all the original response packets to obtain a complete response packet corresponding to the service command packet.
Optionally, before sequencing and combining all the original response packets according to all the original response packets corresponding to the same identity and the current fragment number of each original response packet to obtain a complete response packet corresponding to the service command packet, the method further includes:
under the condition that the complete response packet corresponding to the service command packet is processed by fragmentation, establishing an association relation between the identity of the service command packet and a response packet storage queue;
storing all original response packets corresponding to the identity into the response packet storage queue;
judging whether the number of the original response packets in the response packet storage queue is equal to the total number of the packet fragments;
and under the condition that the number of the original response packets in the response packet storage queue is equal to the total number of the packet fragments, taking the original response packets in the response packet storage queue as all the original response packets corresponding to the same identity.
Optionally, after sending each service command packet to the server, the method further includes:
judging whether a complete response packet corresponding to the service command packet can be locally acquired or not according to the identity of the service command packet;
under the condition that the complete response packet is not acquired, acquiring response timeout time corresponding to the service command packet;
judging whether the response timeout time is greater than a preset timeout duration or not;
and returning to the step when the response timeout time is less than the preset timeout duration: and judging whether a complete response packet corresponding to the service command packet can be locally acquired or not according to the identity of the service command packet until the response timeout time is longer than the preset timeout duration or until the complete response packet corresponding to the service command packet is locally acquired according to the identity of the service command packet.
The embodiment of the invention also discloses a data processing device, which is applied to a data processing system, wherein the data processing system is in communication connection with a server, and the device comprises:
the first receiving module is used for receiving at least one service parameter input by a user;
the first determining module is used for determining a service command packet corresponding to each service parameter according to at least one service parameter, wherein one service command packet carries a unique identity;
the sending module is used for sending each service command packet to the server;
a second receiving module, configured to receive original response packets, which are returned by the server and correspond to the service command packets, where the original response packets and the service command packets corresponding to each other carry the same identity;
and the second determining module is used for determining the complete response packet corresponding to each service command packet according to the identity, the packet fragmentation total number and the current fragmentation number carried by each original response packet.
Optionally, the service parameter includes a service identifier and service data, and the first determining module includes:
the first generation submodule is used for assigning values to the service identifications and generating identity identifications corresponding to the service identifications, and each identity identification has uniqueness;
and the second generation submodule is used for packaging each service data according to the identity and a preset packaging rule to generate a service command packet corresponding to each service parameter.
Optionally, the apparatus further comprises:
the first judging module is used for judging whether the complete response packet corresponding to each service command packet is fragmented according to the packet fragmentation total number carried by each original response packet;
the second determining module includes:
a first obtaining sub-module, configured to, when a complete response packet corresponding to the service command packet has been fragmented, use an original response packet corresponding to the service command packet as a complete response packet corresponding to the service command packet;
and the second obtaining submodule is used for sequencing and combining all the original response packets according to the current fragment numbers of all the original response packets and all the original response packets corresponding to the same identity identification under the condition that the data packets corresponding to the service command packet are not subjected to fragment processing, so as to obtain the complete response packet corresponding to the service command packet.
Optionally, the apparatus further comprises:
the creating module is used for creating the incidence relation between the identity of the business command packet and the response packet storage queue under the condition that the complete response packet corresponding to the business command packet is processed by fragmentation;
the storage module is used for storing all original response packets corresponding to the identity into the response packet storage queue;
the second judgment module is used for judging whether the number of the original response packets in the response packet storage queue is equal to the total number of the packet fragments;
and a third determining module, configured to use the original response packets in the response packet storage queue as all original response packets corresponding to the same identity identifier when the number of original response packets in the response packet storage queue is equal to the total number of packet fragments.
Optionally, the apparatus further comprises:
the third judging module is used for judging whether a complete response packet corresponding to the service command packet can be locally obtained or not according to the identity of the service command packet;
the acquisition module is used for acquiring response timeout time corresponding to the service command packet under the condition that the complete response packet is not acquired;
the fourth judging module is used for judging whether the response timeout time is greater than the preset timeout duration;
a returning module, configured to return to the step when the response timeout time is less than the preset timeout duration: and judging whether a complete response packet corresponding to the service command packet can be locally acquired or not according to the identity of the service command packet until the response timeout time is longer than the preset timeout duration or until the complete response packet corresponding to the service command packet is locally acquired according to the identity of the service command packet.
The embodiment of the invention also discloses a data processing device, which comprises:
one or more processors; and
one or more computer-readable media having instructions stored thereon that, when executed by the one or more processors, cause the apparatus to perform a data processing method according to any one of the embodiments of the invention.
The embodiment of the invention also discloses a computer readable storage medium, which stores a computer program to enable a processor to execute the data processing method according to the embodiment of the invention.
The embodiment of the invention has the following advantages:
in the data processing method provided by the embodiment of the invention, by receiving at least one service parameter input by a user, determining a service command packet corresponding to each service parameter according to the at least one service parameter, wherein one service command packet carries a unique identity, sending each service command packet to a server, receiving an original response packet returned by the server and corresponding to each service command packet respectively, wherein the original response packet and the service command packet corresponding to each other carry the same identity, and determining a complete response packet corresponding to each service command packet respectively according to the identity, the total number of packet fragments and the current fragment number carried by each original response packet, and then obtain the complete response packet corresponding to the service command packet according to the identity carried by each original response packet, the total number of packet fragments and the current fragment number.
Drawings
FIG. 1 is a flow chart illustrating steps of a data processing method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating steps of another data processing method according to an embodiment of the present invention;
FIG. 3 is a block diagram illustrating portions of a data processing system according to an embodiment of the present invention;
FIG. 4 is a functional block diagram of portions of a data processing system according to one embodiment of the present invention;
fig. 5 is a block diagram of a data processing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
When a user initiates a service request, if two identical service requests are continuously initiated, that is, an original response packet corresponding to a first service request is not received completely, a second service request is sent again, at this time, service identifiers carried by the two service requests are identical, and the existing original response packet merging mode is based on the service identifiers, so that a data processing system faces a plurality of original response packets corresponding to the two received service requests, when the original response packets are merged, the original response packets corresponding to the two service requests cannot be correctly distinguished according to the service identifiers, a merging error condition is easily caused, that is, the original response packet of the second service request is mistakenly merged as the original response packet of the first service request, and abnormal data is generated, thereby causing service abnormality.
Referring to fig. 1, fig. 1 is a flowchart illustrating steps of a data processing method according to an embodiment of the present invention, where the method may be applied to a data processing system, and the data processing system is communicatively connected to a server, and specifically includes the following steps:
step S11, receiving at least one service parameter input by the user.
In this embodiment, the data processing system may be a system developed based on a server, and the data processing system may be connected to the server through a TCP socket, and may log in to the server using an account registered in the server, and then may obtain response data generated by the server. In addition, the data processing system can receive the service parameters input by the user, so as to process the service of the user.
The service parameter may include a service identifier and service data, where the service identifier is used to uniquely identify a type of a service request initiated by a user, and for example, the service identifier may identify that a service initiated by the user is a download service, a conference service, or a video playing service; the service data is operation data for the service request, and may be an object for which the user performs the operation, for example, a download object for a download service, a participant for a conference service or a play object for a video play service, and the like.
The type of the service request of the user may be various service requests in the network, such as a file download service, a conference service, a video playing service, and the like, and the service of the user is not specifically limited in this embodiment.
Taking the user service identifier as the file downloading service as an example, the user may have misoperation during operation, and clicks the same downloading key twice in a short time, at this time, the data processing system can receive two service parameters input by the user, because the two downloading services are the same downloading key which is clicked, the service identifiers corresponding to the two service parameters are the same, or when the user downloads the services, the first downloading service selects the 1 st and the 2 nd file downloading, a second download service, which selects the 3 rd and 4 th file downloads, is then initiated, at which point the data processing system may receive two service parameters entered by the user and, as such, since the two downloading services are the same downloading key clicked, the service identifiers corresponding to the two service parameters are also the same.
Step S12, determining, according to at least one of the service parameters, a service command packet corresponding to each of the service parameters, where one of the service command packets carries a unique identity.
In this embodiment, after receiving the service parameters, the data processing system can process each service parameter, and generate a service command packet corresponding to each service parameter, respectively, where each service command packet carries a unique identity. The service command packet is a data packet which is used by the server for analyzing and executing and generating a complete response packet.
In an embodiment, the step S22 may specifically include the following steps:
step S121, assigning values to the service identifications to generate identification corresponding to the service identifications, wherein each identification has uniqueness.
Step S122, according to the identity and a preset encapsulation rule, encapsulating each service data, and generating a service command packet corresponding to each service parameter.
In this embodiment, after receiving the service parameters, the data processing system may obtain the service identifiers in the service parameters, assign different values to each service identifier, and obtain the service identifiers after assignment, which are the identity identifiers corresponding to the service identifiers.
In an embodiment, when the data processing system assigns different values to each service identifier, the data processing system may specifically assign the values by using a rule of numerical value accumulation, and the assignment process does not delete the original service identifier. Illustratively, the data processing system receives 3 service identifiers A, A, B in sequence, assigns a value of 1 to the received first service identifier a, assigns a value of 2 to the received second service identifier a, and assigns a value of 3 to the received third service identifier B, where the assigned service identifiers are a1, a2, and B3, respectively. In the embodiment, assignment is performed through a numerical value accumulation rule, so that each service identifier can be guaranteed to have uniqueness, an original service identifier cannot be deleted in the assignment process, and a server can conveniently identify the type of a service request.
After each service identifier is assigned, service data belonging to the same service parameter can be encapsulated according to the identity identifier and a preset encapsulation rule to generate a service command packet corresponding to each service parameter, and any suitable prior art can be referred to for the specific encapsulation process of the data packet, which is not described herein again.
In one embodiment, the identity identifier may be encapsulated in the outermost layer of the service command packet according to a preset encapsulation rule, so that the server or the data processing system may analyze the data packet to obtain the identity identifier quickly without analyzing to the inner layer of the service command packet.
Step S13, sending each service command packet to the server.
In this embodiment, the data processing system may create a packet sending queue locally, and after the data processing system generates the service command packet, the data processing system may place the service command packet into the packet sending queue to wait for sending the service command packet in the packet sending queue.
Step S14, receiving original response packets corresponding to the service command packets returned by the server, where the original response packets and the service command packets corresponding to each other carry the same identity.
In this embodiment, the original response packet refers to a response packet in an original state received by the data processing system, that is, a response packet that has not been subjected to merging processing by the data processing system.
After receiving each service command packet sent by the data processing system, the server can analyze each service command packet, obtain the identity and the service data corresponding to each service command packet, perform corresponding processing, generate the response data corresponding to each service command packet, package each response data according to the preset packaging rule, and send each response data to the data processing system. The server can obtain the identity and the service data corresponding to each service command packet, so that the server can add the corresponding identity to the response packet when encapsulating the response packet, and thus, the original response packet generated by the server correspondingly and the service command packet received by the server can carry the same identity.
For example, still taking the download task as an example, after receiving the service command packet, the server can parse the service command packet to obtain the identity (the download command and the assignment value) and the download object, obtain the download data corresponding to the download object from the database, serve as the response data, package the identity (the download command and the assignment value) and the response data into an original response packet, and send the original response packet to the data processing system.
And step S15, determining the complete response packet corresponding to each service command packet according to the identity carried by each original response packet, the total number of packet fragments and the current fragment number.
In this embodiment, because the server sends the packet size limit, there are two possible situations for the server to generate the response data according to the service command packet, where one situation is that the response data exceeds the packet size limit, and at this time, the response data needs to be divided into multiple packets to be sent, that is, the server performs fragmentation processing on the generated response data, generates multiple fragmentation packets, and sends the multiple fragmentation packets to the data processing system; alternatively, the response data does not exceed the packet size limit, and the response data is transmitted directly in one response packet without fragmentation. In either case, the server will carry the id, the total number of packet fragments, and the current fragment number when encapsulating the data. If the server does not need fragment processing when packaging the response data, the total number of the packaged response packets corresponding to the identity is 1, and the current fragment number is 1; if fragmentation processing is needed when the server encapsulates the response data, the number of data packets into which the response data is divided during encapsulation is the total number of packet fragments of the response packet corresponding to the identity, and in addition, the current fragment number of the response packet corresponding to the identity is also determined according to the actual encapsulation sequence.
After receiving the original response packets returned by the server, the data processing system can analyze each original response packet to obtain the identity information, the total number of the packet fragments and the current fragment number carried by each original response packet, and obtain the complete response packets corresponding to each service command packet according to the identity information, the total number of the packet fragments and the current fragment number carried by each original response packet.
In this embodiment, by receiving at least one service parameter input by a user, determining a service command packet corresponding to each service parameter according to the at least one service parameter, where one service command packet carries a unique identity, sending each service command packet to a server, receiving an original response packet corresponding to each service command packet returned by the server, where the original response packet and the service command packet corresponding to each other carry the same identity, and determining a complete response packet corresponding to each service command packet according to the identity carried by each original response packet, the total number of packet fragments, and the current fragment number The total number of the packet fragments and the current fragment number obtain a complete response packet corresponding to the service command packet.
With reference to the foregoing embodiment, considering that some response data will be fragmented when the server returns the complete response packet, and some response data will not be fragmented, so as to accurately obtain the complete response packet corresponding to the service command packet, referring to fig. 2, fig. 2 is another data processing method provided in an embodiment of the present application, as shown in fig. 2, before step S15, the data processing method of the present application may further include the following steps:
and step S104, judging whether the complete response packet corresponding to each service command packet is fragmented according to the total number of the packet fragments carried by each original response packet.
Accordingly, the step S15 may specifically include the following steps:
step S151, in a case that the complete response packet corresponding to the service command packet has been fragmented, taking the original response packet corresponding to the service command packet as the complete response packet corresponding to the service command packet.
Step S152, when the data packet corresponding to the service command packet is not fragmented, according to all original response packets corresponding to the same identity, and according to the current fragmentation number of each original response packet, sequencing and combining the original response packets, so as to obtain a complete response packet corresponding to the service command packet.
In this embodiment, the data processing system may determine whether the complete response packet corresponding to each service command packet has been fragmented according to the total number of packet fragments carried by each original response packet.
For example, if the total number of packet fragments carried by the original response packet is 1, it indicates that the complete response packet corresponding to the service command packet identified by the identity in the original response packet is not fragmented, and if the total number of packet fragments carried by the original response packet is not 1, it indicates that the original response packet is fragmented.
If the complete response packet corresponding to the service command packet is not processed in a fragmentation mode, the original response packet does not need to be combined, and the original response packet can be directly used as the complete response packet corresponding to the service command packet; if the complete response packet corresponding to the service command packet has been fragmented, the original response packets need to be merged. Specifically, it is required that the data processing system receives all original response packets corresponding to the same identity, the data in all the original response packets form the response data of the service command packet, then the original response packets are sorted according to the current fragment number of each original response packet, and finally the sorted original response packets are merged to finally obtain the complete response packet corresponding to the service command packet.
In this embodiment, by determining whether the complete response packet corresponding to each service command packet has been fragmented, the complete response packet corresponding to each service command packet can be conveniently and accurately obtained.
In an embodiment, after obtaining the complete response packet corresponding to the service command packet, the complete response packet may be temporarily stored locally in a key-value pair manner, specifically, the identity is used as a key, and the complete response packet is used as a value.
In an embodiment, in order to facilitate management of each original response packet received by the data processing system, before step S152, the data processing method of the present application may further include the following steps:
step S1041, establishing an association relationship between the identity of the service command packet and a response packet storage queue when the complete response packet corresponding to the service command packet has been fragmented.
Step S1042, store all original response packets corresponding to the identity into the response packet storage queue.
Step S1043, determining whether the number of original response packets in the response packet storage queue is equal to the total number of packet fragments.
Step S1044, in a case that the number of original response packets in the response packet storage queue is equal to the total number of packet fragments, using the original response packets in the response packet storage queue as all original response packets corresponding to the same identity.
In this embodiment, if the data processing system determines that a complete response packet corresponding to a service command packet has been processed in a fragmented manner, at this time, the data processing system may create a response packet storage queue, and establish an association relationship between an identity of the service command packet and the response packet storage queue, so as to store an original response packet corresponding to each service command packet.
After storing the corresponding original data packets according to the identifiers, the data processing system may determine whether the number of original response packets corresponding to each identifier in the response packet storage queue is equal to the total number of packet fragments, and if the number of original response packets in the response packet storage queue is equal to the total number of packet fragments, it indicates that all the original data packets corresponding to the identifier have been received, at this time, all the original response packets corresponding to the identifier in the response packet storage queue may be used as all the original response packets corresponding to the same identifier, and then the above step S152 is continuously performed.
In the embodiment, each original response packet is stored by establishing the association relationship between the identity of the service command packet and the response packet storage queue, so that each original response packet is managed conveniently, the total number of the original response packets corresponding to each identity is counted conveniently, whether the original response packets of the same identity are received or not is judged, and the obtaining efficiency of the complete response packet is improved.
In an embodiment, considering that a data processing system may establish multiple TCP socket connections with a server to provide access to multiple users, at this time, multiple users may send service parameters to the data processing system at the same time, in some extreme cases, for example, two users send two service parameters back and forth at very close time intervals, which may cause the data processing system to assign the same value to a service identifier included in the service parameters, and at this time, according to an identity, a complete response packet corresponding to a service command packet cannot be obtained accurately, therefore, when receiving an original response packet returned by the server, the data processing system may further record connection information of the TCP socket connection corresponding to the original response packet, and may obtain a user identifier using the TCP socket connection from connection information of the tcpsket connection, the data processing system can then determine a complete response packet based on the identity and the user identification.
In addition, in consideration of that there may be a certain normal delay in the actual process of acquiring the complete response packet according to the service command packet and that a certain time is required for sending the complete data packet, in order to improve the accuracy of acquiring the complete response packet by the data processing system, after step S13, the data processing method according to the embodiment of the present application may further include the following steps:
step S131, according to the identity of the service command packet, judging whether a complete response packet corresponding to the service command packet can be locally obtained.
Step S132, when the complete response packet is not obtained, obtaining a response timeout time corresponding to the service command packet.
Step S133, determining whether the response timeout time is greater than a preset timeout duration.
Step S134, when the response timeout time is less than the preset timeout duration, returning to the step: and judging whether a complete response packet corresponding to the service command packet can be locally acquired or not according to the identity of the service command packet until the response timeout time is longer than the preset timeout duration or until the complete response packet corresponding to the service command packet is locally acquired according to the identity of the service command packet.
In this embodiment, the response timeout time refers to a time that each service command packet starts to be calculated from a time when the data processing system issues the response command packet. Illustratively, the service command packet corresponding to the service identifier a1 is sent at a time of 12 hours 58 minutes 00 seconds, and the current time is 12 hours 58 minutes 01 seconds, so that the response timeout time of the service command packet at the current time is 1 second.
The preset timeout duration refers to a preset duration for allowing the service command packet to return under the condition of considering the normal delay, that is, the service command packet can be normally received within the preset timeout duration. The preset timeout duration can be set according to the service type, and can also be set according to the current network condition.
After obtaining the complete response packet corresponding to the service command packet, the data processing system temporarily stores the complete response packet locally, so that after sending each service command packet to the server, the data processing system can search whether the corresponding complete response packet is temporarily stored locally according to the identity of each service command packet in real time, if the complete response packet corresponding to a certain service command packet is obtained, the data processing system can perform related service processing, if the complete response packet corresponding to a certain service command packet is not obtained, the data processing system firstly obtains the response timeout time corresponding to the service command packet and judges whether the response timeout time corresponding to the service command packet is less than the preset timeout duration, if the response timeout time is less than the preset timeout duration, the data processing system repeatedly judges whether the complete response packet corresponding to the service command packet can be obtained locally or not again, until the response timeout time is longer than the preset timeout duration or a complete response packet corresponding to the service command packet is locally acquired. If the response timeout time is longer than the preset timeout duration, the complete response packet corresponding to the service command packet is still not obtained, the data processing system can generate an exception prompt to report that the service command packet is abnormal, so that the user can conveniently process the exception.
Referring to fig. 3, fig. 3 is a block diagram of structures of various parts of a data processing system according to an embodiment of the present invention, and as shown in fig. 3, the data processing system may specifically include a user interaction module, a service command packet encapsulation module, a service command packet sending module, a service result information receiving module, and a data storage module.
Referring to fig. 4, fig. 4 is a functional block diagram of portions of a data processing system according to an embodiment of the present invention, and as shown in fig. 4, functions of the portions are specifically as follows:
1. a user initiates a service at a user interaction module, and the user interaction module transmits service parameters into a service command packet packaging module;
2. the business command packet packaging module packages the business parameters, sets preset timeout duration, the identity identifier and the user identifier, generates a business command packet, sends the business command packet to a packet sending queue of the business command packet sending module, and simultaneously returns the identity identifier and the user identifier to the user interaction module;
3. the service command packet sending module acquires a service command packet in the packet sending queue, sends the service command packet to the server, starts to calculate response timeout time at the same time, and stores the response timeout time in a key-value pair mode (the identity identifier and the user identifier are keys, and the response timeout time is a value);
4. the service result information receiving module starts a thread to receive original response packets corresponding to the service command packet returned by the server in real time, analyzes each original response packet and obtains an identity, a packet fragmentation total number and a current fragmentation number;
5. the service result information receiving module judges whether the complete response packet corresponding to each service command packet is fragmented, if not, the original response packet corresponding to the service command packet is directly used as the complete response packet and stored in the data storage module in a key-value pair mode (the identity identifier and the user identifier are keys, and the complete data packet is a value), and if the complete response packet is fragmented, the original response packet corresponding to the same identity identifier is stored in the key-value pair mode (the identity identifier and the user identifier are keys, the aggregate is a value, and the original response packet is stored in the aggregate);
6. the service result information receiving module judges whether the total number of the original response packets corresponding to the same identity stored in the key value pair is equal to the total number of the packet fragments corresponding to the identity or not, if so, all the original response packets stored in the key value pair are sequenced and merged to obtain a complete response packet, the complete response packet is stored in the data storage module in a key value pair mode (the identity and the user identity are keys, and the complete data packet is a value), and if not, the step 4 is returned;
7. after the user interaction module receives the identity and the user identification returned by the service command packet packaging module, a complete response packet corresponding to the identity and the user identification is obtained from the data storage module according to the identity and the user identification, if the complete response packet is not obtained, response timeout time is obtained from the service command packet sending module according to the identity and the user identification, whether the response timeout time is longer than preset timeout duration is judged, if the response timeout time is longer than the preset timeout duration, the data processing system conducts exception handling, if the response timeout time is shorter than the preset timeout duration, the user interaction module obtains the complete response packet corresponding to the identity and the user identification from the data storage module according to the identity and the user identification again until the response timeout time is longer than the preset timeout duration. During the period, if the complete response packet is acquired, the service is completed according to the related data processing.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Based on the same technical concept, please refer to fig. 5, fig. 5 shows a data processing apparatus 50 according to an embodiment of the present invention, which is applied to a data processing system, the data processing system is communicatively connected to a server, and the apparatus includes:
a first receiving module 51, configured to receive at least one service parameter input by a user;
a first determining module 52, configured to determine, according to at least one of the service parameters, a service command packet corresponding to each of the service parameters, where one of the service command packets carries a unique identity;
a sending module 53, configured to send each service command packet to the server;
a second receiving module 54, configured to receive original response packets, which are returned by the server and correspond to the service command packets, where the original response packets and the service command packets corresponding to each other carry the same identity;
and a second determining module 55, configured to determine, according to the identity, the total number of packet fragments, and the current fragment number carried in each original response packet, a complete response packet corresponding to each service command packet.
Optionally, the service parameter includes a service identifier and service data, and the first determining module includes:
the first generation submodule is used for assigning values to the service identifications and generating identity identifications corresponding to the service identifications, and each identity identification has uniqueness;
and the second generation submodule is used for packaging each service data according to the identity and a preset packaging rule to generate a service command packet corresponding to each service parameter.
Optionally, the apparatus further comprises:
the first judging module is used for judging whether the complete response packet corresponding to each service command packet is fragmented according to the packet fragmentation total number carried by each original response packet;
the second determining module includes:
a first obtaining sub-module, configured to, when a complete response packet corresponding to the service command packet has been fragmented, use an original response packet corresponding to the service command packet as a complete response packet corresponding to the service command packet;
and the second obtaining submodule is used for sequencing and combining all the original response packets according to the current fragment numbers of all the original response packets and all the original response packets corresponding to the same identity identification under the condition that the data packets corresponding to the service command packet are not subjected to fragment processing, so as to obtain the complete response packet corresponding to the service command packet.
Optionally, the apparatus further comprises:
the creating module is used for creating the incidence relation between the identity of the business command packet and the response packet storage queue under the condition that the complete response packet corresponding to the business command packet is processed by fragmentation;
the storage module is used for storing all original response packets corresponding to the identity into the response packet storage queue;
the second judgment module is used for judging whether the number of the original response packets in the response packet storage queue is equal to the total number of the packet fragments;
and a third determining module, configured to use the original response packets in the response packet storage queue as all original response packets corresponding to the same identity identifier when the number of original response packets in the response packet storage queue is equal to the total number of packet fragments.
Optionally, the apparatus further comprises:
the third judging module is used for judging whether a complete response packet corresponding to the service command packet can be locally obtained or not according to the identity of the service command packet;
the acquisition module is used for acquiring response timeout time corresponding to the service command packet under the condition that the complete response packet is not acquired;
the fourth judging module is used for judging whether the response timeout time is greater than the preset timeout duration;
a returning module, configured to return to the step when the response timeout time is less than the preset timeout duration: and judging whether a complete response packet corresponding to the service command packet can be locally acquired or not according to the identity of the service command packet until the response timeout time is longer than the preset timeout duration or until the complete response packet corresponding to the service command packet is locally acquired according to the identity of the service command packet. .
An embodiment of the present invention further provides a data processing apparatus, including:
one or more processors; and
one or more computer-readable media having instructions stored thereon which, when executed by the one or more processors, cause the apparatus to perform a data processing method according to any one of the embodiments of the invention.
Embodiments of the present invention further provide a computer-readable storage medium, which stores a computer program to enable a processor to execute the data processing method according to the embodiments of the present invention.
For the embodiment of the data processing device, since it is basically similar to the embodiment of the data processing method, the description is relatively simple, and for relevant points, reference may be made to part of the description of the embodiment of the data processing method.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The data processing method, the data processing apparatus and the computer-readable storage medium provided by the present invention are described in detail above, and specific examples are applied herein to illustrate the principles and embodiments of the present invention, and the description of the above embodiments is only used to help understand the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A data processing method applied to a data processing system, wherein the data processing system is in communication connection with a server, the method comprising:
receiving at least one service parameter input by a user;
determining a service command packet corresponding to each service parameter according to at least one service parameter, wherein one service command packet carries a unique identity;
sending each service command packet to the server;
receiving original response packets which are returned by the server and respectively correspond to the service command packets, wherein the original response packets and the service command packets which correspond to each other carry the same identity;
and determining the complete response packet corresponding to each service command packet according to the identity carried by each original response packet, the total number of packet fragments and the current fragment number.
2. The method of claim 1, wherein the service parameters include service identifiers and service data, and determining the service command packet corresponding to each service parameter according to at least one of the service parameters comprises:
assigning values to the service identifications to generate identity identifications corresponding to the service identifications, wherein each identity identification has uniqueness;
and according to the identity identification and a preset encapsulation rule, encapsulating each service data to generate a service command packet corresponding to each service parameter.
3. The method according to claim 1, wherein before determining the complete response packet corresponding to each service command packet according to the identity, the total number of packet fragments, and the current fragment number carried by each original response packet, the method further comprises:
judging whether the complete response packet corresponding to each service command packet is fragmented according to the total number of packet fragments carried by each original response packet;
the determining, according to the identity, the total number of packet fragments, and the current fragment number carried by each original response packet, a complete response packet corresponding to each service command packet includes:
under the condition that the complete response packet corresponding to the service command packet is fragmented, taking an original response packet corresponding to the service command packet as the complete response packet corresponding to the service command packet;
and under the condition that the data packet corresponding to the service command packet is not fragmented, sequencing and combining all original response packets according to all the original response packets corresponding to the same identity and the current fragmentation numbers of all the original response packets to obtain a complete response packet corresponding to the service command packet.
4. The method according to claim 3, wherein before all original response packets corresponding to the same identity are sorted and combined according to the current fragment number of each original response packet to obtain a complete response packet corresponding to the service command packet, the method further comprises:
under the condition that the complete response packet corresponding to the service command packet is processed by fragmentation, establishing an association relation between the identity of the service command packet and a response packet storage queue;
storing all original response packets corresponding to the identity into the response packet storage queue;
judging whether the number of the original response packets in the response packet storage queue is equal to the total number of the packet fragments;
and under the condition that the number of the original response packets in the response packet storage queue is equal to the total number of the packet fragments, taking the original response packets in the response packet storage queue as all the original response packets corresponding to the same identity.
5. The method of claim 1, wherein after sending each of the service command packets to the server, the method further comprises:
judging whether a complete response packet corresponding to the service command packet can be locally acquired or not according to the identity of the service command packet;
under the condition that the complete response packet is not acquired, acquiring response timeout time corresponding to the service command packet;
judging whether the response timeout time is greater than a preset timeout duration or not;
and returning to the step when the response timeout time is less than the preset timeout duration: and judging whether a complete response packet corresponding to the service command packet can be locally acquired or not according to the identity of the service command packet until the response timeout time is longer than the preset timeout duration or until the complete response packet corresponding to the service command packet is locally acquired according to the identity of the service command packet.
6. A data processing apparatus for use in a data processing system, the data processing system communicatively coupled to a server, the apparatus comprising:
the first receiving module is used for receiving at least one service parameter input by a user;
the first determining module is used for determining a service command packet corresponding to each service parameter according to at least one service parameter, wherein one service command packet carries a unique identity;
the sending module is used for sending each service command packet to the server;
a second receiving module, configured to receive original response packets, which are returned by the server and correspond to the service command packets, where the original response packets and the service command packets corresponding to each other carry the same identity;
and the second determining module is used for determining the complete response packet corresponding to each service command packet according to the identity, the packet fragmentation total number and the current fragmentation number carried by each original response packet.
7. The apparatus of claim 6, wherein the service parameters comprise service identification and service data, and wherein the first determining module comprises:
the first generation submodule is used for assigning values to the service identifications and generating identity identifications corresponding to the service identifications, and each identity identification has uniqueness;
and the second generation submodule is used for packaging each service data according to the identity and a preset packaging rule to generate a service command packet corresponding to each service parameter.
8. The apparatus of claim 6, further comprising:
the first judging module is used for judging whether the complete response packet corresponding to each service command packet is fragmented according to the packet fragmentation total number carried by each original response packet;
the second determining module includes:
a first obtaining sub-module, configured to, when a complete response packet corresponding to the service command packet has been fragmented, use an original response packet corresponding to the service command packet as a complete response packet corresponding to the service command packet;
and the second obtaining submodule is used for sequencing and combining all the original response packets according to the current fragment numbers of all the original response packets and all the original response packets corresponding to the same identity identification under the condition that the data packets corresponding to the service command packet are not subjected to fragment processing, so as to obtain the complete response packet corresponding to the service command packet.
9. A data processing apparatus, comprising:
one or more processors; and
one or more computer-readable instructions stored thereon that, when executed by the one or more processors, cause the apparatus to perform the data processing method of any of claims 1 to 5.
10. A computer-readable storage medium, characterized in that it stores a computer program causing a processor to execute the data processing method according to any one of claims 1 to 5.
CN202010270735.1A 2020-04-08 2020-04-08 Data processing method, device and computer readable storage medium Active CN111597057B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010270735.1A CN111597057B (en) 2020-04-08 2020-04-08 Data processing method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010270735.1A CN111597057B (en) 2020-04-08 2020-04-08 Data processing method, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111597057A true CN111597057A (en) 2020-08-28
CN111597057B CN111597057B (en) 2023-05-02

Family

ID=72187405

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010270735.1A Active CN111597057B (en) 2020-04-08 2020-04-08 Data processing method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111597057B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988812A (en) * 2021-03-10 2021-06-18 京东数字科技控股股份有限公司 Inventory data processing method, device, equipment and storage medium
CN113422754A (en) * 2021-04-01 2021-09-21 阿里巴巴新加坡控股有限公司 Data processing method and device, electronic equipment and computer readable storage medium
CN114401298A (en) * 2021-12-16 2022-04-26 荣耀终端有限公司 Data transmission method, equipment and system
WO2022110681A1 (en) * 2020-11-24 2022-06-02 海宁奕斯伟集成电路设计有限公司 Returning method and returning control apparatus for command response information, and electronic device
US11960895B2 (en) 2020-11-24 2024-04-16 Haining Eswin Ic Design Co., Ltd. Method and control device for returning of command response information, and electronic device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100268758A1 (en) * 2009-04-20 2010-10-21 International Business Machines Corporation Processing a plurality of requests simultaneously in a web application
WO2017041398A1 (en) * 2015-09-08 2017-03-16 安一恒通(北京)科技有限公司 Data transmission method and device
CN106936867A (en) * 2015-12-29 2017-07-07 阿里巴巴集团控股有限公司 The response method and device of a kind of service request
CN106973074A (en) * 2016-01-13 2017-07-21 腾讯科技(深圳)有限公司 A kind of data processing method, apparatus and system
CN107342983A (en) * 2017-06-09 2017-11-10 深圳震有科技股份有限公司 A kind of transactional handles the method and system of the efficient UDP communications of more subpackages
CN107463576A (en) * 2016-06-03 2017-12-12 上海点融信息科技有限责任公司 Data processing method and equipment
CN110381030A (en) * 2019-06-20 2019-10-25 视联动力信息技术股份有限公司 A kind of processing method and processing device of synchronization request

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100268758A1 (en) * 2009-04-20 2010-10-21 International Business Machines Corporation Processing a plurality of requests simultaneously in a web application
WO2017041398A1 (en) * 2015-09-08 2017-03-16 安一恒通(北京)科技有限公司 Data transmission method and device
CN106936867A (en) * 2015-12-29 2017-07-07 阿里巴巴集团控股有限公司 The response method and device of a kind of service request
CN106973074A (en) * 2016-01-13 2017-07-21 腾讯科技(深圳)有限公司 A kind of data processing method, apparatus and system
CN107463576A (en) * 2016-06-03 2017-12-12 上海点融信息科技有限责任公司 Data processing method and equipment
CN107342983A (en) * 2017-06-09 2017-11-10 深圳震有科技股份有限公司 A kind of transactional handles the method and system of the efficient UDP communications of more subpackages
CN110381030A (en) * 2019-06-20 2019-10-25 视联动力信息技术股份有限公司 A kind of processing method and processing device of synchronization request

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022110681A1 (en) * 2020-11-24 2022-06-02 海宁奕斯伟集成电路设计有限公司 Returning method and returning control apparatus for command response information, and electronic device
US11960895B2 (en) 2020-11-24 2024-04-16 Haining Eswin Ic Design Co., Ltd. Method and control device for returning of command response information, and electronic device
CN112988812A (en) * 2021-03-10 2021-06-18 京东数字科技控股股份有限公司 Inventory data processing method, device, equipment and storage medium
CN112988812B (en) * 2021-03-10 2024-02-06 京东科技控股股份有限公司 Inventory data processing method, device, equipment and storage medium
CN113422754A (en) * 2021-04-01 2021-09-21 阿里巴巴新加坡控股有限公司 Data processing method and device, electronic equipment and computer readable storage medium
CN114401298A (en) * 2021-12-16 2022-04-26 荣耀终端有限公司 Data transmission method, equipment and system

Also Published As

Publication number Publication date
CN111597057B (en) 2023-05-02

Similar Documents

Publication Publication Date Title
CN111597057B (en) Data processing method, device and computer readable storage medium
CN107122258B (en) Method and equipment for checking state code of test interface
US20170373939A1 (en) Data uploading method, apparatus, and system
CN110289983B (en) Load balancing application creation method and device, computer equipment and storage medium
CN109815256A (en) A kind of data processing method, device, electronic equipment and storage medium
CN109039724B (en) Log uploading method and device
KR20100101170A (en) Method and system for content categorization
CN111078551A (en) Full link testing method, device and system and computer readable storage medium
CN108804399B (en) Form verification method and device
CN114328029B (en) Backup method and device of application resources, electronic equipment and storage medium
CN115168031A (en) Fog calculation system, method, electronic equipment and storage medium
US20210067824A1 (en) Video stream check method and system, computer device and storage medium
CN110543428A (en) Application system testing method and device
CN109522202B (en) Software testing method and device
CN115396501B (en) Information processing method and device, electronic equipment and readable storage medium
CN108234658B (en) Method and device for sensing health condition of server cluster and server
CN115004666A (en) Registration method, device, equipment and storage medium of Internet of things equipment
CN110930163B (en) Method, system and storage medium for implementing house source entrusting business
CN112506896B (en) Data deleting method and device and electronic equipment
CN111475783B (en) Data detection method, system and equipment
CN111506846A (en) Web page generation method and device, electronic equipment and storage medium
CN114222002B (en) Service request processing method and device, storage medium and electronic equipment
CN114297058B (en) Test method and device
CN115473799B (en) System and method for automatically deploying micro-service application of virtual machine
CN114500348B (en) CDN gateway testing method and system

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