Information processing system, method, device, equipment and medium
By using the number management mechanism and message middleware in the information processing system, the problems of information loss, out of order or repeated reception during online information release are solved, and the sequence and accurate information transmission is achieved.
Patent Information
- Application Number
- CN202111324264.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-10
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-11-10
AI Technical Summary
The prior art is prone to problems such as loss of information, out of order of information or repeated reception of information when information is published online, especially when the network is in poor condition or message middleware failure.
Ensure sequential transmission of information by using a numbering management mechanism between the sending client and the receiving client. When sending the client to generate a larger number, when receiving the client to judge processing information, it only processes information with the same number and discards or resends information with inconsistent numbers. At the same time, message middleware is used for storage and regular synchronization to ensure accurate reception of information.
It effectively avoids the problems of information loss, out of order or repeated information reception, and ensures that information can be received in order under poor network conditions.
Smart Images

Figure CN114020495B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to an information processing system, method, device, equipment and medium. Background Art
[0002] With the development of society, more and more users are publishing their opinions online. However, when publishing opinions online, it is often the case that the receiving client does not receive the information sent by the sending client, or the order in which the receiving client receives the information is different from the order in which the sending client sends the information, or the receiving client receives a certain information sent by the sending client repeatedly. In other words, information is often lost, out of order, or received repeatedly.
[0003] The prior art proposes to use message middleware to ensure that the receiving client can accurately and orderly receive each message sent by the sending client, that is, to ensure information synchronization through message middleware. However, when ensuring information synchronization through message middleware, if the current network condition is poor, the time when the sending client publishes different messages online is close, or the message middleware crashes, storage anomalies, etc., information loss, disordered information, or repeated information reception may still occur. Summary of the invention
[0004] The embodiments of the present invention provide an information processing system, method, apparatus, device and medium to solve the problems of information loss, information disorder or repeated information reception that are easy to occur in the prior art.
[0005] In a first aspect, an embodiment of the present invention provides an information processing system, the system comprising: a sending client and a receiving client;
[0006] The sending client is used to receive the target information, generate a second number larger than the first number according to the first number of the information sent last time, and send a first instruction carrying the target information, the first number and the second number to the receiving client;
[0007] The receiving client is used to receive the first instruction, obtain the first number and the second number carried in the first instruction; determine whether the second number is greater than the third number of the information processed by the receiving client last time, and whether the first number is equal to the third number. If so, process the target information carried in the first instruction; if not, do not process the target information.
[0008] Furthermore, the receiving client is further configured to, when processing the target information, use the second number to update the third number of the last processed information saved by the receiving client.
[0009] Furthermore, the receiving client is further configured to determine whether the third number is not less than the second number if the target information is not processed, and if so, discard the first instruction.
[0010] Furthermore, the receiving client is further configured to determine whether the first number is greater than the third number if the target information is not processed, and if so, send a second instruction carrying the second number and the third number to the sending client;
[0011] The sending client is further used to obtain the second number and the third number carried in the second instruction, determine information whose corresponding number is greater than the third number and not greater than the second number according to the pre-stored correspondence between the number and the information, and send the determined information to the receiving client;
[0012] The receiving client is further used to receive and sequentially process the information sent by the sending client, and use the second number to update the third number of the last processed information stored.
[0013] Furthermore, the system also includes message middleware;
[0014] The sending client is specifically used to send a first instruction carrying the target information, the first number, the second number and the target identifier of the target account corresponding to the sending client to be logged in to the message middleware;
[0015] The message middleware is used to receive the first instruction, obtain the target identifier carried in the first instruction, and save the first instruction in a target storage location corresponding to the target identifier according to a pre-saved correspondence between the identifier and the storage location;
[0016] The receiving client is specifically configured to obtain the instructions stored in the target storage location of the message middleware according to the pre-stored instructions sent by the target account to be obtained, and at a preset time interval.
[0017] In a second aspect, an embodiment of the present invention further provides an information processing method, which is applied to a sending client, and the method includes:
[0018] Receive target information, and generate a second number greater than the first number according to the first number of the information sent last time;
[0019] A first instruction carrying the target information, the first number and the second number is sent to a receiving client; so that the receiving client can determine whether to process the target information carried in the first instruction based on the third number of the information processed by the receiving client last time and the first number and the second number carried in the first instruction.
[0020] Furthermore, the method further comprises:
[0021] Receive a second instruction sent by the client, and obtain a second number and a third number carried in the second instruction;
[0022] According to the pre-stored correspondence between the number and the information, target information whose corresponding number is greater than the third number and not greater than the second number is determined, and the target information is sent to the receiving client.
[0023] Further, sending the first instruction carrying the target information, the first number and the second number to the receiving client includes:
[0024] A first instruction carrying the target information, the first number, the second number and the target identifier of the target account corresponding to the sending client is sent to the message middleware; so that the message middleware obtains the target identifier carried in the first instruction, and saves the first instruction in the target storage location corresponding to the target identifier according to the pre-saved correspondence between the identifier and the storage location.
[0025] In a third aspect, an embodiment of the present invention further provides an information processing method, the method comprising:
[0026] Receive a first instruction sent by a sending client, and obtain a first number and a second number carried in the first instruction; wherein the first number is the number of the information sent by the sending client last time, and the second number is a number generated by the sending client according to the first number and larger than the first number;
[0027] Determine whether the second number is greater than the third number of the information processed by the receiving client last time, and whether the first number is equal to the third number. If so, process the target information carried in the first instruction; if not, do not process the target information.
[0028] Furthermore, the method further comprises:
[0029] If the target information is processed, the second number is used to update the third number of the last processed information saved by the receiving client.
[0030] Furthermore, the method further comprises:
[0031] If the target information is not processed, it is determined whether the third number is not less than the second number, and if so, the first instruction is discarded.
[0032] Furthermore, the method further comprises:
[0033] If the target information is not processed, it is determined whether the first number is greater than the third number, and if so, a second instruction carrying the second number and the third number is sent to the sending client; so that the sending client obtains the second number and the third number carried in the second instruction, determines the information whose corresponding number is greater than the third number and not greater than the second number according to the pre-stored correspondence between the number and the information, and sends the determined information to the receiving client;
[0034] The information sent by the sending client is received and processed in sequence, and the third number of the last processed information stored is updated using the second number.
[0035] Further, the receiving a first instruction sent by the sending client includes:
[0036] According to the pre-saved instructions sent by the target account to be obtained, the instructions stored in the target storage location of the message middleware are obtained at a preset time interval.
[0037] Furthermore, the target storage location is obtained by:
[0038] According to a pre-saved target account of the instruction to be obtained and a pre-saved correspondence between an identifier and a storage location, a storage location corresponding to the target identifier of the target account is determined as the target storage location.
[0039] In a fourth aspect, an embodiment of the present invention further provides an information processing device, the device comprising:
[0040] A receiving and generating module, used for receiving target information, and generating a second number greater than the first number according to the first number of the information sent last time;
[0041] The first processing module is used to send a first instruction carrying the target information, the first number and the second number to a receiving client.
[0042] Furthermore, the first processing module is also used to receive a second instruction sent by the receiving client, obtain the second number and the third number carried in the second instruction, determine the target information whose corresponding number is greater than the third number and not greater than the second number according to the pre-saved correspondence between the number and the information, and send the target information to the receiving client.
[0043] Furthermore, the first processing module is specifically used to send a first instruction carrying the target information, the first number, the second number and the target identifier of the target account corresponding to the sending client to the message middleware; so that the message middleware obtains the target identifier carried in the first instruction, and saves the first instruction in the target storage location corresponding to the target identifier according to the pre-saved correspondence between the identifier and the storage location.
[0044] In a fifth aspect, an embodiment of the present invention further provides an information processing device, the device comprising:
[0045] a receiving and obtaining module, configured to receive a first instruction sent by a sending client, and obtain a first number and a second number carried in the first instruction; wherein the first number is the number of the information sent by the sending client last time, and the second number is a number generated by the sending client according to the first number and larger than the first number;
[0046] The second processing module is used to determine whether the second number is greater than the third number of the information processed by the receiving client last time, and whether the first number is equal to the third number. If so, the target information carried in the first instruction is processed; if not, the target information is not processed.
[0047] Furthermore, the second processing module is further configured to, if processing the target information, use the second number to update the third number of the last processed information saved by the receiving client.
[0048] Furthermore, the second processing module is further configured to determine whether the third number is not less than the second number if the target information is not processed, and if so, discard the first instruction.
[0049] Further, the second processing module is further configured to determine whether the first number is greater than the third number if the target information is not processed, and if so, send a second instruction carrying the second number and the third number to the sending client; so that the sending client obtains the second number and the third number carried in the second instruction, determines information whose corresponding number is greater than the third number and not greater than the second number according to a pre-stored correspondence between the number and the information, and sends the determined information to the receiving client;
[0050] The second processing module is further used to receive and sequentially process the information sent by the sending client, and use the second number to update the third number of the last processed information saved.
[0051] Furthermore, the receiving and obtaining module is specifically configured to obtain the instructions stored in the target storage location of the message middleware according to the pre-stored instructions sent by the target account to be obtained at the target storage location of the message middleware at a preset time interval.
[0052] Furthermore, the receiving and obtaining module is further used to determine the storage location corresponding to the target identifier of the target account as the target storage location based on the pre-saved target account of the instruction to be obtained and the pre-saved correspondence between the identifier and the storage location.
[0053] In a sixth aspect, an embodiment of the present invention further provides an electronic device, which includes at least a processor and a memory, and the processor is used to perform the above-mentioned information processing steps when executing a computer program stored in the memory.
[0054] In a seventh aspect, an embodiment of the present invention further provides a computer-readable storage medium storing a computer program, which performs the above-mentioned information processing steps when executed by a processor.
[0055] In the embodiment of the present invention, the first number is the number of the information last sent by the sending client, the second number is the number of the information sent this time which is larger than the first number and generated by the sending client according to the first number, and the third number is the number of the information processed by the receiving client last time, that is, the third number is the number of the information received last time among the information received in sequence. Only when the second number is greater than the third number and the first number is equal to the third number, the target information is processed. Therefore, in the embodiment of the present invention, it can be ensured that the processed information is the information received in sequence, thereby effectively avoiding the problems of information loss, information disorder or information being received repeatedly. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 A schematic diagram of the structure of an information processing system provided by an embodiment of the present invention;
[0058] Figure 2 A detailed process diagram of information processing provided by an embodiment of the present invention;
[0059] Figure 3 A schematic diagram of a process of an information processing method provided by an embodiment of the present invention;
[0060] Figure 4 A schematic diagram of a process of an information processing method provided by an embodiment of the present invention;
[0061] Figure 5 A schematic diagram of the structure of an information processing device provided by an embodiment of the present invention;
[0062] Figure 6 A schematic diagram of the structure of an information processing device provided by an embodiment of the present invention;
[0063] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0064] The present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0065] In an embodiment of the present invention, after receiving the target information, the sending client generates a second number greater than the first number based on the first number of the information sent last time, determines that the number of the target information is the second number, and sends a first instruction carrying the first number of the information sent last time, the target information, and the second number of the target information to the receiving client. After receiving the first instruction, the receiving client obtains the first number of the information sent last time by the sending client and the second number of the target information carried in the first instruction, and determines whether the first number is greater than the third number of the information processed last time saved by the receiving client, and whether the second number is equal to the third number. If so, the target information carried in the first instruction is processed, and if not, the target information is not processed, thereby ensuring that the processed information is the information received in order.
[0066] Embodiment 1:
[0067] Figure 1 A schematic diagram of the structure of an information processing system provided by an embodiment of the present invention, the information processing system comprises: a sending client 101 and a receiving client 102;
[0068] The sending client 101 is used to receive target information, generate a second number greater than the first number according to the first number of the information sent last time, and send a first instruction carrying the target information, the first number and the second number to the receiving client;
[0069] The receiving client 102 is used to receive the first instruction, obtain the first number and the second number carried in the first instruction; determine whether the second number is greater than the third number of the information processed by the receiving client last time, and whether the first number is equal to the third number. If so, process the target information carried in the first instruction; if not, do not process the target information.
[0070] In an embodiment of the present invention, in order to ensure the order of the information sent, after receiving the target information, the sending client obtains the first number of the information sent last time that is saved by the sending client, and generates a second number that is larger than the first number based on the first number, and the second number is the number of the target information. After the second number is generated, the first number of the information sent last time, the second number of the target information, and the target information are carried in a first instruction, and the first instruction is sent to the receiving client. If the sending client has not sent information before, it can be determined that the first number of the information sent last time is 0. In the embodiment of the present application, the first number is the number corresponding to the information sent last time, and for the sake of distinction, it is referred to as the first number.
[0071] After receiving the first instruction, the receiving client determines whether the target information carried in the first instruction is the information that should be received in sequence. Specifically, the receiving client obtains the first number of the information last sent by the sending client and the second number of the target information carried in the first instruction, and obtains the third number of the last processed information saved by the receiving client, wherein the third number is the number of the last information received by the receiving client in sequence.
[0072] In the embodiment of the present invention, it is determined whether the first number is greater than the third number and whether the second number is equal to the third number. If the second number is greater than the third number and the first number is equal to the third number, it means that the target information received this time is information received in a normal order, and the target information is processed; wherein, processing the target information may be displaying the target information. If the second number is less than the third number or the first number is not equal to the third number, it means that the target information received this time is not information that should be received in a normal order, that is, information loss, information disorder or information is received repeatedly, and therefore the target information is not processed.
[0073] In an embodiment of the present invention, the second number is a number larger than the first number generated based on the first number of the information sent last time. In order to accurately identify the order in which the information is received, the second number is the number after the first number is incremented, generally incremented by 1. The method for generating the second number based on the first number can be to use the incremental register (incr) of redis to realize the increment of the number and generate a second number larger than the first number. Since redis is single-threaded and incr is an atomic self-increment operation, it can be guaranteed that the generated number is not repeated. The structure of the first instruction sent by the sending client can be shown in Table 1:
[0074] ID Second Number prevID First Number message Target Information
[0075] Table 1
[0076] As can be seen from Table 1, the first instruction can use "ID", "prevID" and "message" to distinguish the first number, the second number and the target information carried in the first instruction.
[0077] In the embodiment of the present invention, the first number is the number of the information last sent by the sending client, the second number is the number of the information sent this time which is larger than the first number and generated by the sending client according to the first number, and the third number is the number of the information processed by the receiving client last time, that is, the third number is the number of the information received last time among the information received in sequence. Only when the second number is greater than the third number and the first number is equal to the third number, the target information is processed. Therefore, in the embodiment of the present invention, it can be ensured that the processed information is the information received in sequence, thereby effectively avoiding the problems of information loss, information disorder or information being received repeatedly.
[0078] Embodiment 2:
[0079] In order to ensure that the information processed by the receiving client is information received in sequence, on the basis of the above embodiment, in an embodiment of the present invention, the receiving client 102 is also used to use the second number to update the third number of the last processed information saved by the receiving client when processing the target information.
[0080] In an embodiment of the present invention, if the receiving client processes the target information carried in the first instruction, it means that the target information is information received in sequence. Then, for the information to be received and processed by the receiving client next time, the target information is the information processed last time. Therefore, the second number is used to update the third number of the last processed information saved by the receiving client, so that the receiving client can judge whether the information received later is the information that should be received in sequence based on the second number.
[0081] In order to enable the receiving client to accurately process the received information, on the basis of the above embodiments, in an embodiment of the present invention, the receiving client 102 is also used to determine whether the third number is not less than the second number if the target information is not processed, and if so, discard the first instruction.
[0082] In an embodiment of the present invention, if the target information carried in the first instruction is not processed, it means that the target information is not received in order, which means that there is a problem of information loss, information disorder or repeated information reception. Therefore, it is determined whether the third number of the last processed information saved by the receiving client is not less than the second number of the target information received this time. If the third number is not less than the second number, that is, if the third number is greater than the second number or the third number is equal to the second number, it means that the receiving client has received the target information corresponding to the second number, that is, the information has been received repeatedly, so the first instruction carrying the target information is discarded.
[0083] Embodiment 3:
[0084] In order to avoid information loss or information disorder, based on the above embodiments, in the embodiment of the present invention, the receiving client 102 is further used to determine whether the first number is greater than the third number if the target information is not processed, and if so, send a second instruction carrying the second number and the third number to the sending client;
[0085] The sending client 101 is further used to obtain the second number and the third number carried in the second instruction, determine the information whose corresponding number is greater than the third number and not greater than the second number according to the pre-stored correspondence between the number and the information, and send the determined information to the receiving client;
[0086] The receiving client 102 is further configured to receive and sequentially process the information sent by the sending client, and use the second number to update the third number of the last processed information stored.
[0087] In the embodiment of the present invention, if the receiving client does not process the target information carried in the first instruction, it means that there is a problem of information loss, information disorder or repeated information reception. Therefore, by judging whether the first number is greater than the third number, it is determined whether there is a problem of information loss or information disorder. If the first number is greater than the third number, it means that there is information loss before the target information, or there is a problem of information disorder between the information processed by the receiving client last time and the target information, so the receiving client obtains the information between the target information and the information processed last time.
[0088] The process of the receiving client acquiring information between the target information and the information processed last time is as follows: a second instruction carrying the range of numbers of the information to be acquired is sent to the sending client. Since the information to be acquired is information between the target information and the information processed last time, and the number of the target information is the second number, and the number of the information processed last time is the third number, the receiving client sends the second instruction carrying the second number and the third number to the sending client. After receiving the second instruction, the sending client determines the information whose corresponding number is greater than the third number and not greater than the second number according to the correspondence between the pre-saved information and the number. The information whose corresponding number is greater than the third number and not greater than the second number is the information between the information processed last time by the receiving client and the target information. The sending client sends the acquired information to the receiving client. After receiving the information sent by the sending client, the receiving client processes the received information.
[0089] In order to enable the receiving client to process the received information in sequence, the sending client can also send the number corresponding to each piece of information to the receiving client when sending the determined information. When the receiving client receives each piece of information and the corresponding number, it processes the corresponding information in sequence according to the number of each piece of information.
[0090] Specifically, in an embodiment of the present invention, the sending client is provided with a microservice interface. In the event of information loss or information disorder, the receiving client directly sends the second instruction to the sending client through the microservice interface of the sending client, and the sending client sends the acquired information to the receiving client through the microservice interface, thereby acquiring the information in normal order from the lost information or the disordered information.
[0091] According to the above description, in the embodiment of the present invention, when information is lost, out of order or received repeatedly, it can be automatically processed without human intervention, so the order of the processed information can be guaranteed and the uniqueness of the processed information can be guaranteed.
[0092] Embodiment 4:
[0093] In order to accurately send the first instruction to the receiving client, based on the above embodiments, in the embodiment of the present invention, the system further includes a message middleware 103;
[0094] The sending client 101 is specifically used to send a first instruction carrying the target information, the first number, the second number and the target identifier of the target account corresponding to the sending client to log in to the message middleware;
[0095] The message middleware 102 is used to receive the first instruction, obtain the target identifier carried in the first instruction, and save the first instruction in a target storage location corresponding to the target identifier according to a pre-saved correspondence between the identifier and the storage location;
[0096] The receiving client 103 is specifically configured to obtain the instructions stored in the target storage location of the message middleware according to the pre-stored instructions sent by the target account to be obtained, and at a preset time interval.
[0097] In order to enable the receiving client to receive the information sent by the sending client in sequence, in an embodiment of the present invention, the first instruction to be sent by the sending client is sent to the receiving client through the message middleware. Specifically, since the accounts subscribed to the sending instructions by the accounts logged in by different receiving clients are not the same, the first instruction also carries the account identifier of the account logged in by the sending client. That is to say, the sending client carries the target information, the second number of the target information, the first number of the information sent last time by the sending client, and the account identifier of the account logged in by the sending client in the first instruction, and sends the first instruction to the message middleware.
[0098] After receiving the first instruction, the message middleware obtains the account identifier carried in the first instruction, and stores the first instruction in the storage location corresponding to the account identifier. Specifically, the message middleware pre-stores the correspondence between the identifier and the storage location. After receiving the first instruction, the message middleware obtains the account identifier carried in the first instruction, determines the storage location corresponding to the account identifier as the target storage location, and stores the first instruction in the target storage location.
[0099] The receiving client saves information about which account sends the instruction to be obtained, and for the target account corresponding to the instruction to be obtained, the target storage location of the instruction sent by the target account in the message middleware is pre-saved. The receiving client obtains the instruction saved in the target storage location at a preset time interval.
[0100] In order to accurately determine the target storage location for storing the first instruction in the message middleware, on the basis of the above embodiments, in an embodiment of the present invention, the receiving client is specifically used to determine the storage location corresponding to the target identifier of the target account as the target storage location based on the pre-saved target account for the instruction to be obtained and the pre-saved correspondence between the identifier and the storage location.
[0101] In an embodiment of the present invention, the receiving client saves information about which account's instructions need to be obtained, and for each account for which instructions are to be obtained, the identifier of the account is correspondingly saved. The receiving client also saves the correspondence between the identifier and the storage location in the message middleware, determines the target identifier of the target account for the instructions to be obtained, and determines that the storage location corresponding to the target identifier is the target storage location in the message middleware for the instructions sent by the target account for which instructions are to be obtained.
[0102] Embodiment 5:
[0103] Figure 2 A detailed process diagram of information processing provided by an embodiment of the present invention.
[0104] Depend on Figure 2It can be seen that the user operates on the sending client, the sending client receives the target information, and obtains the first number of the information sent last time, generates the second number of the target information based on the first number, carries the first number, the second number and the target information in the first instruction, and sends the first instruction to the message middleware.
[0105] The receiving client obtains the first instruction saved in the message middleware, and obtains the first number and the second number carried in the first instruction. It can first determine whether the third number is not less than the second number. If the third number is not less than the second number, it is considered that the target information carried in the first instruction is duplicate information, and the first instruction is directly discarded; if the third number is less than the second number, it is determined whether the first number is equal to the third number. If the first number is equal to the third number, the target information carried in the first instruction is processed; if the first number is not equal to the third number, it means that information loss or information disorder occurs, and the corresponding target information greater than the second number but not greater than the third number is obtained through the microservice interface of the sending client.
[0106] Embodiment 6:
[0107] Figure 3 A schematic diagram of a process of an information processing method provided by an embodiment of the present invention, the process comprising:
[0108] S301: receiving target information, and generating a second number greater than the first number according to the first number of the information sent last time;
[0109] S302: Send a first instruction carrying the target information, the first number and the second number to a receiving client; so that the receiving client determines whether to process the target information carried in the first instruction based on the third number of the information processed by the receiving client last time and the first number and the second number carried in the first instruction.
[0110] In a possible implementation, the method further includes:
[0111] Receive a second instruction sent by the client, and obtain a second number and a third number carried in the second instruction;
[0112] According to the pre-stored correspondence between the number and the information, target information whose corresponding number is greater than the third number and not greater than the second number is determined, and the target information is sent to the receiving client.
[0113] In a possible implementation manner, sending the first instruction carrying the target information, the first number, and the second number to the receiving client includes:
[0114] A first instruction carrying the target information, the first number, the second number and the target identifier of the target account corresponding to the sending client is sent to the message middleware; so that the message middleware obtains the target identifier carried in the first instruction, and saves the first instruction in the target storage location corresponding to the target identifier according to the pre-saved correspondence between the identifier and the storage location.
[0115] The method is applied to a sending client. The specific process of the sending client executing the information processing method can be referred to the other embodiments above, and the specific content will not be repeated here.
[0116] Figure 4 A schematic diagram of a process of an information processing method provided by an embodiment of the present invention, the process comprising:
[0117] S401: Receive a first instruction sent by a sending client, and obtain a first number and a second number carried in the first instruction; wherein the first number is the number of the information sent by the sending client last time, and the second number is a number generated by the sending client according to the first number and larger than the first number;
[0118] S402: Determine whether the second number is greater than the third number of the information processed by the receiving client last time, and whether the first number is equal to the third number. If so, process the target information carried in the first instruction; if not, do not process the target information.
[0119] In a possible implementation, the method further includes:
[0120] If the target information is processed, the second number is used to update the third number of the last processed information saved by the receiving client.
[0121] In a possible implementation, the method further includes:
[0122] If the target information is not processed, it is determined whether the third number is not less than the second number, and if so, the first instruction is discarded.
[0123] In a possible implementation, the method further includes:
[0124] If the target information is not processed, it is determined whether the first number is greater than the third number, and if so, a second instruction carrying the second number and the third number is sent to the sending client; so that the sending client obtains the second number and the third number carried in the second instruction, determines the information whose corresponding number is greater than the third number and not greater than the second number according to the pre-stored correspondence between the number and the information, and sends the determined information to the receiving client;
[0125] The information sent by the sending client is received and processed in sequence, and the third number of the last processed information stored is updated using the second number.
[0126] In a possible implementation manner, the receiving a first instruction sent by the sending client includes:
[0127] According to the pre-saved instructions sent by the target account to be obtained, the instructions stored in the target storage location of the message middleware are obtained at a preset time interval.
[0128] In a possible implementation, the target storage location is obtained in the following manner:
[0129] According to a pre-saved target account of the instruction to be obtained and a pre-saved correspondence between an identifier and a storage location, a storage location corresponding to the target identifier of the target account is determined as the target storage location.
[0130] The method is applied to a receiving client. The specific process of the receiving client executing the information processing method can be referred to the other embodiments above, and the specific content will not be repeated here.
[0131] Embodiment 7:
[0132] Figure 5 A schematic diagram of the structure of an information processing device provided by an embodiment of the present invention, the device comprising:
[0133] A receiving and generating module 501 is used to receive target information and generate a second number greater than the first number according to the first number of the information sent last time;
[0134] The first processing module 502 is used to send a first instruction carrying the target information, the first number and the second number to a receiving client.
[0135] In a possible implementation, the first processing module 502 is also used to receive a second instruction sent by the receiving client, obtain the second number and the third number carried in the second instruction, determine the target information whose corresponding number is greater than the third number and not greater than the second number according to the pre-saved correspondence between the number and the information, and send the target information to the receiving client.
[0136] In a possible implementation, the first processing module 502 is specifically used to send a first instruction carrying the target information, the first number, the second number and the target identifier of the target account corresponding to the sending client to the message middleware; so that the message middleware obtains the target identifier carried in the first instruction, and saves the first instruction in the target storage location corresponding to the target identifier according to the pre-saved correspondence between the identifier and the storage location.
[0137] Figure 6 A schematic diagram of the structure of an information processing device provided by an embodiment of the present invention, the device comprising:
[0138] The receiving and obtaining module 601 is used to receive a first instruction sent by a sending client, and obtain a first number and a second number carried in the first instruction; wherein the first number is the number of the information sent by the sending client last time, and the second number is a number generated by the sending client according to the first number and larger than the first number;
[0139] The second processing module 602 is used to determine whether the second number is greater than the third number of the information processed by the receiving client last time, and whether the first number is equal to the third number. If so, the target information carried in the first instruction is processed; if not, the target information is not processed.
[0140] In a possible implementation manner, the second processing module 602 is further configured to, if processing the target information, use the second number to update the third number of the last processed information saved by the receiving client.
[0141] In a possible implementation, the second processing module 602 is further configured to, if the target information is not processed, determine whether the third number is not less than the second number, and if so, discard the first instruction.
[0142] In a possible implementation manner, the second processing module 602 is further configured to, if the target information is not processed, determine whether the first number is greater than the third number, and if so, send a second instruction carrying the second number and the third number to the sending client; so that the sending client obtains the second number and the third number carried in the second instruction, determines information whose corresponding number is greater than the third number and not greater than the second number according to a pre-stored correspondence between numbers and information, and sends the determined information to the receiving client;
[0143] The second processing module 602 is further configured to receive and sequentially process the information sent by the sending client, and use the second number to update the third number of the last processed information stored.
[0144] In a possible implementation, the receiving and obtaining module 601 is specifically configured to obtain the instructions stored in the target storage location of the message middleware at a preset time interval according to the pre-stored instructions sent by the target account to be obtained.
[0145] In a possible implementation, the receiving and obtaining module 601 is further used to determine that the storage location corresponding to the target identifier of the target account is the target storage location based on a pre-saved target account of the instruction to be obtained and a pre-saved correspondence between the identifier and the storage location.
[0146] Embodiment 8:
[0147] Figure 7 FIG. 1 is a schematic diagram of the structure of an electronic device provided by the present invention. Based on the above embodiments, the embodiment of the present invention further provides an electronic device, such as Figure 7 As shown, it includes: a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704;
[0148] The memory 703 stores a computer program. When the program is executed by the processor 701, the processor 701 performs the following steps:
[0149] Receive target information, and generate a second number greater than the first number according to the first number of the information sent last time;
[0150] A first instruction carrying the target information, the first number and the second number is sent to a receiving client; so that the receiving client can determine whether to process the target information carried in the first instruction based on the third number of the information processed by the receiving client last time and the first number and the second number carried in the first instruction.
[0151] In a possible implementation, the method further includes:
[0152] Receive a second instruction sent by the client, and obtain a second number and a third number carried in the second instruction;
[0153] According to the pre-stored correspondence between the number and the information, target information whose corresponding number is greater than the third number and not greater than the second number is determined, and the target information is sent to the receiving client.
[0154] In a possible implementation manner, sending the first instruction carrying the target information, the first number, and the second number to the receiving client includes:
[0155] A first instruction carrying the target information, the first number, the second number and the target identifier of the target account corresponding to the sending client is sent to the message middleware; so that the message middleware obtains the target identifier carried in the first instruction, and saves the first instruction in the target storage location corresponding to the target identifier according to the pre-saved correspondence between the identifier and the storage location.
[0156] Based on the above embodiments, an embodiment of the present invention further provides an electronic device, including: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus.
[0157] The memory stores a computer program, and when the program is executed by the processor, the processor performs the following steps:
[0158] Receive a first instruction sent by a sending client, and obtain a first number and a second number carried in the first instruction; wherein the first number is the number of the information sent by the sending client last time, and the second number is a number generated by the sending client according to the first number and larger than the first number;
[0159] Determine whether the second number is greater than the third number of the information processed by the receiving client last time, and whether the first number is equal to the third number. If so, process the target information carried in the first instruction; if not, do not process the target information.
[0160] In a possible implementation, the method further includes:
[0161] If the target information is processed, the second number is used to update the third number of the last processed information saved by the receiving client.
[0162] In a possible implementation, the method further includes:
[0163] If the target information is not processed, it is determined whether the third number is not less than the second number, and if so, the first instruction is discarded.
[0164] In a possible implementation, the method further includes:
[0165] If the target information is not processed, it is determined whether the first number is greater than the third number, and if so, a second instruction carrying the second number and the third number is sent to the sending client; so that the sending client obtains the second number and the third number carried in the second instruction, determines the information whose corresponding number is greater than the third number and not greater than the second number according to the pre-stored correspondence between the number and the information, and sends the determined information to the receiving client;
[0166] The information sent by the sending client is received and processed in sequence, and the third number of the last processed information stored is updated using the second number.
[0167] In a possible implementation manner, the receiving a first instruction sent by the sending client includes:
[0168] According to the pre-saved instructions sent by the target account to be obtained, the instructions stored in the target storage location of the message middleware are obtained at a preset time interval.
[0169] In a possible implementation, the target storage location is obtained in the following manner:
[0170] According to a pre-saved target account of the instruction to be obtained and a pre-saved correspondence between an identifier and a storage location, a storage location corresponding to the target identifier of the target account is determined as the target storage location.
[0171] The communication bus mentioned in the above server can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0172] The communication interface is used for communication between the above electronic device and other devices.
[0173] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0174] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processing processor (Digital Signal Processing, DSP), an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0175] Embodiment 9:
[0176] On the basis of the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by an electronic device, and when the program is run on the electronic device, the electronic device implements the following steps when executing:
[0177] The memory stores a computer program, and when the program is executed by the processor, the processor performs the following steps:
[0178] Receive target information, and generate a second number greater than the first number according to the first number of the information sent last time;
[0179] A first instruction carrying the target information, the first number and the second number is sent to a receiving client; so that the receiving client can determine whether to process the target information carried in the first instruction based on the third number of the information processed by the receiving client last time and the first number and the second number carried in the first instruction.
[0180] In a possible implementation, the method further includes:
[0181] Receive a second instruction sent by the client, and obtain a second number and a third number carried in the second instruction;
[0182] According to the pre-stored correspondence between the number and the information, target information whose corresponding number is greater than the third number and not greater than the second number is determined, and the target information is sent to the receiving client.
[0183] In a possible implementation manner, sending the first instruction carrying the target information, the first number, and the second number to the receiving client includes:
[0184] A first instruction carrying the target information, the first number, the second number and the target identifier of the target account corresponding to the sending client is sent to the message middleware; so that the message middleware obtains the target identifier carried in the first instruction, and saves the first instruction in the target storage location corresponding to the target identifier according to the pre-saved correspondence between the identifier and the storage location.
[0185] On the basis of the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by a processor, and when the program runs on the processor, the processor implements the following steps when executing:
[0186] Receive a first instruction sent by a sending client, and obtain a first number and a second number carried in the first instruction; wherein the first number is the number of the information sent by the sending client last time, and the second number is a number generated by the sending client according to the first number and larger than the first number;
[0187] Determine whether the second number is greater than the third number of the information processed by the receiving client last time, and whether the first number is equal to the third number. If so, process the target information carried in the first instruction; if not, do not process the target information.
[0188] In a possible implementation, the method further includes:
[0189] If the target information is processed, the second number is used to update the third number of the last processed information saved by the receiving client.
[0190] In a possible implementation, the method further includes:
[0191] If the target information is not processed, it is determined whether the third number is not less than the second number, and if so, the first instruction is discarded.
[0192] In a possible implementation, the method further includes:
[0193] If the target information is not processed, it is determined whether the first number is greater than the third number, and if so, a second instruction carrying the second number and the third number is sent to the sending client; so that the sending client obtains the second number and the third number carried in the second instruction, determines the information whose corresponding number is greater than the third number and not greater than the second number according to the pre-stored correspondence between the number and the information, and sends the determined information to the receiving client;
[0194] The information sent by the sending client is received and processed in sequence, and the third number of the last processed information stored is updated using the second number.
[0195] In a possible implementation manner, the receiving a first instruction sent by the sending client includes:
[0196] According to the pre-saved instructions sent by the target account to be obtained, the instructions stored in the target storage location of the message middleware are obtained at a preset time interval.
[0197] In a possible implementation, the target storage location is obtained in the following manner:
[0198] According to a pre-saved target account of the instruction to be obtained and a pre-saved correspondence between an identifier and a storage location, a storage location corresponding to the target identifier of the target account is determined as the target storage location.
[0199] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0200] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0201] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0202] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0203] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. An information processing system, characterized in that: The system comprises: a sending client and a receiving client; The sending client is used to receive the target information, generate a second number larger than the first number according to the first number of the information sent last time, and send a first instruction carrying the target information, the first number and the second number to the receiving client; The receiving client is used to receive the first instruction, obtain the first number and the second number carried in the first instruction; determine whether the second number is greater than the third number of the information processed by the receiving client last time, and whether the first number is equal to the third number, if so, process the target information carried in the first instruction, if not, do not process the target information; The receiving client is further configured to determine whether the first number is greater than the third number if the target information is not processed, and if so, send a second instruction carrying the second number and the third number to the sending client; The sending client is further used to obtain the second number and the third number carried in the second instruction, determine information whose corresponding number is greater than the third number and not greater than the second number according to the pre-stored correspondence between the number and the information, and send the determined information to the receiving client; The receiving client is further used to receive and sequentially process the information sent by the sending client, and use the second number to update the third number of the last processed information stored.
2. The system according to claim 1, characterized in that The receiving client is further configured to use the second number to update the third number of the last processed information stored by the receiving client when processing the target information.
3. The system according to claim 1, characterized in that The receiving client is further configured to determine whether the third number is not less than the second number if the target information is not processed, and if so, discard the first instruction.
4. The system according to any one of claims 1 to 3, characterized in that: The system also includes a message middleware; The sending client is specifically used to send a first instruction carrying the target information, the first number, the second number and the target identifier of the target account corresponding to the sending client to be logged in to the message middleware; The message middleware is used to receive the first instruction, obtain the target identifier carried in the first instruction, and save the first instruction in a target storage location corresponding to the target identifier according to a pre-saved correspondence between the identifier and the storage location; The receiving client is specifically configured to obtain the instructions stored in the target storage location of the message middleware according to the pre-stored instructions sent by the target account to be obtained, and at a preset time interval.
5. The system according to claim 4, characterized in that The receiving client is specifically configured to determine, based on a pre-saved target account of the instruction to be obtained and a pre-saved correspondence between the identifier and the storage location, that the storage location corresponding to the target identifier of the target account is the target storage location.
6. An information processing method, characterized in that: The method is applied to a sending client, and the method comprises: Receive target information, and generate a second number greater than the first number according to the first number of the information sent last time; Sending a first instruction carrying the target information, the first number and the second number to a receiving client; so that the receiving client determines whether to process the target information carried in the first instruction according to the third number of the information processed by the receiving client last time and the first number and the second number carried in the first instruction; Wherein, the method further comprises: Receive a second instruction sent by the client, and obtain a second number and a third number carried in the second instruction; According to the pre-stored correspondence between the number and the information, target information whose corresponding number is greater than the third number and not greater than the second number is determined, and the target information is sent to the receiving client.
7. The method according to claim 6, characterized in that The sending the first instruction carrying the target information, the first number and the second number to the receiving client comprises: A first instruction carrying the target information, the first number, the second number and the target identifier of the target account corresponding to the sending client is sent to the message middleware; so that the message middleware obtains the target identifier carried in the first instruction, and saves the first instruction in the target storage location corresponding to the target identifier according to the pre-saved correspondence between the identifier and the storage location.
8. An information processing method, characterized in that: The method is applied to a receiving client, and the method comprises: Receive a first instruction sent by a sending client, and obtain a first number and a second number carried in the first instruction; wherein the first number is the number of the information sent by the sending client last time, and the second number is a number generated by the sending client according to the first number and larger than the first number; and obtain a third number of the information processed last time saved by the receiving client, wherein the third number is the number of the information received last time among the information received by the receiving client in sequence; Determine whether the second number is greater than the third number, and whether the first number is equal to the third number, if so, process the target information carried in the first instruction, if not, do not process the target information; Wherein, the method further comprises: If the target information is not processed, it is determined whether the first number is greater than the third number, and if so, a second instruction carrying the second number and the third number is sent to the sending client; so that the sending client obtains the second number and the third number carried in the second instruction, determines the information whose corresponding number is greater than the third number and not greater than the second number according to the pre-stored correspondence between the number and the information, and sends the determined information to the receiving client; The information sent by the sending client is received and processed in sequence, and the third number of the last processed information stored is updated using the second number.
9. The method according to claim 8, characterized in that The method further comprises: If the target information is processed, the second number is used to update the third number of the last processed information saved by the receiving client.
10. The method according to claim 8, characterized in that The method further comprises: If the target information is not processed, it is determined whether the third number is not less than the second number, and if so, the first instruction is discarded.
11. The method according to claim 8, characterized in that The receiving and sending a first instruction sent by the client includes: According to the pre-saved target storage location of the message middleware of the instruction sent by the target account to be obtained, the instruction stored in the target storage location is obtained at a preset time interval.
12. The method according to claim 11, characterized in that The target storage location is obtained by: According to a pre-saved target account of the instruction to be obtained and a pre-saved correspondence between an identifier and a storage location, a storage location corresponding to the target identifier of the target account is determined as the target storage location.
13. An information processing device, characterized in that: The device comprises: A receiving and generating module, used for receiving target information, and generating a second number greater than the first number according to the first number of the information sent last time; A first processing module, configured to send a first instruction carrying the target information, the first number and the second number to a receiving client; Among them, the first processing module is also used to receive a second instruction sent by the receiving client, obtain the second number and the third number carried in the second instruction, and determine the target information whose corresponding number is greater than the third number and not greater than the second number according to the pre-saved correspondence between the number and the information, and send the target information to the receiving client.
14. The device according to claim 13, characterized in that The first processing module is specifically used to send a first instruction carrying the target information, the first number, the second number and the target identifier of the target account corresponding to the sending client to the message middleware; so that the message middleware obtains the target identifier carried in the first instruction, and saves the first instruction in the target storage location corresponding to the target identifier according to the pre-saved correspondence between the identifier and the storage location.
15. An information processing device, characterized in that: The device comprises: a receiving and obtaining module, configured to receive a first instruction sent by a sending client, and obtain a first number and a second number carried in the first instruction; wherein the first number is the number of the information sent by the sending client last time, and the second number is a number generated by the sending client according to the first number and larger than the first number; a second processing module, configured to determine whether the second number is greater than the third number of the information processed by the receiving client last time, and whether the first number is equal to the third number, and if so, process the target information carried in the first instruction, and if not, do not process the target information; The second processing module is further configured to determine whether the first number is greater than the third number if the target information is not processed, and if so, to send a second instruction carrying the second number and the third number to the sending client; so that the sending client obtains the second number and the third number carried in the second instruction, determines information whose corresponding number is greater than the third number and not greater than the second number according to a pre-stored correspondence between the number and the information, and sends the determined information to the receiving client; The second processing module is further used to receive and sequentially process the information sent by the sending client, and use the second number to update the third number of the last processed information saved.
16. The device according to claim 15, characterized in that The second processing module is further configured to, if processing the target information, use the second number to update the third number of the last processed information saved by the receiving client.
17. The device according to claim 15, characterized in that The second processing module is further configured to determine whether the third number is not less than the second number if the target information is not processed, and if so, discard the first instruction.
18. The device according to claim 15, characterized in that The receiving and obtaining module is specifically used to obtain the instructions stored in the target storage location of the message middleware according to the pre-stored instructions sent by the target account to be obtained at the target storage location according to the preset time interval.
19. The device according to claim 18, characterized in that The receiving and obtaining module is further used to determine the storage location corresponding to the target identifier of the target account as the target storage location according to the pre-saved target account of the instruction to be obtained and the pre-saved correspondence between the identifier and the storage location.
20. An electronic device, characterized in that: The electronic device comprises at least a processor and a memory, and the processor is configured to execute the steps of the information processing method described in any one of claims 6 to 12 when executing a computer program stored in the memory.
21. A computer-readable storage medium, characterized in that: It stores a computer program, and when the computer program is executed by a processor, the steps of the information processing method described in any one of claims 6 to 12 are executed.
