Combined message sequence verification method, device and storage medium
By combining the linear iteration method with verification rules, the problem of insufficient adaptability of the combined message sequence verification method in the existing technology is solved, the verification requirements suitable for a variety of interaction scenarios are realized, and the computing resource occupation and complexity are reduced.
Patent Information
- Application Number
- CN202110856007.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-28
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-07-28
AI Technical Summary
The existing combined message sequence verification method is only applicable to the scenario of a single verification rule and cannot adapt to the data interaction scenario where the verification rules change between interaction scenarios and within the interaction scenario, resulting in insufficient adaptability.
Using a linear iteration method, by obtaining the verification rules between the message sequence to be verified and the preset combined message sequence, combined with the verification rules between messages in the current iteration sequence, the current verification results are determined, and the verification of the message sequence to be verified is updated based on the results. As a result, it is suitable for a variety of interaction scenarios.
It achieves wider adaptability, can meet the verification needs of various data interaction scenarios, reduces computing resource occupation and complexity, and improves verification efficiency.
Smart Images

Figure CN113553202B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing technology, and in particular to a method, device and storage medium for verifying a combined message sequence. Background Art
[0002] In systems based on the browser / server (B / S) and client / server (C / S) architectures, there is usually data interaction between the device under test and the peripheral device. In the existing data interaction process, the device under test sends a message to the peripheral device, and the third-party device can intercept the message and match the message with the message in the preset message sequence, and then determine whether the verification of the data interaction is passed based on the matching result.
[0003] As data interaction scenarios become increasingly diverse, preset message sequences are gradually evolving into combined message sequences. Different message sequences can correspond to different interaction scenarios, which means that multiple message sequences need to be matched with messages intercepted by third-party devices. However, the existing verification method for combined message sequences is only applicable to scenarios with a single verification rule, and is not applicable when the verification rules between interaction scenarios are different from the verification rules within each interaction scenario. Therefore, it is urgent to propose a more adaptable verification method for combined message sequences to meet the verification needs of existing data interaction scenarios. Summary of the invention
[0004] The present application provides a verification method, device and storage medium for a combined message sequence. Compared with the prior art, the solution has wider adaptability and can meet the verification requirements of existing data interaction scenarios.
[0005] In order to achieve the above objectives, this application adopts the following technical solutions:
[0006] In a first aspect, the present application provides a method for verifying a combined message sequence, comprising: obtaining verification rules between a message sequence to be verified, a preset combined message sequence, and verification rules between messages in each message sequence in the preset combined message sequence; starting with the first message of the first sequence in the preset combined message sequence to perform message matching with the message sequence to be verified, and linearly iterating the preset combined message sequence; in the process of linear iteration, determining a current verification result based on the relationship between the verification rules between messages in the current iteration sequence and the verification rules between the preset combined message sequences, the previous verification result, and the matching result of the message matching, and determining a verification result of the message sequence to be verified based on the current verification result.
[0007] In the technical solution provided by the present application, when verifying the acquired message sequence to be verified, the message matching process of the preset combined message sequence and the message sequence to be verified is iterated in a linear iteration manner. In the iterative process, the relationship between the verification rules between the messages in the current iteration sequence and the verification rules between the preset combined message sequences is fully considered, and the current verification result is determined based on the relationship and the previous verification result and the matching result of the message matching, and then the verification result of the message sequence to be verified is determined based on the current verification result. It can be seen that the technical solution provided by the present application can be applied to data interaction scenarios where the verification rules change, so the adaptability of the solution is wider than that of the prior art and can meet the verification requirements of existing data interaction scenarios.
[0008] Optionally, in a possible design, the above-mentioned “verification rules” may include: a first logic verification and a second logic verification; the first logic verification is an “AND” logic verification, and the second logic verification is an “OR” logic verification; or, the second logic verification is an “AND” logic verification, and the first logic verification is an “OR” logic verification.
[0009] Optionally, in another possible design method, when the verification rule between the preset combined message sequences is the first logical verification, the above-mentioned "determining the current verification result based on the relationship between the verification rule between the messages in the current iteration sequence and the verification rule between the preset combined message sequences, the previous verification result and the matching result of the message matching" may include: determining whether the verification rule between the messages in the current iteration sequence is the first logical verification; if the verification rule between the messages in the current iteration sequence is the first logical verification, performing the first logical verification on the matching result of the current message of the current iteration sequence and the previous verification result to obtain the current verification result; if the verification rule between the messages in the current iteration sequence is the second logical verification, temporarily storing the previous verification result, and performing the second logical verification on the matching result of the message in the current iteration sequence to obtain the verification result, and then performing the first logical verification on the verification result obtained according to the second logical verification and the temporarily stored previous verification result to obtain the current verification result.
[0010] Optionally, in another possible design, the above-mentioned "determining the verification result of the message sequence to be verified based on the current verification result" may include: determining whether the iteration condition is met; if it is determined that the iteration condition is met, determining the current verification result as the verification result of the message sequence to be verified; if it is determined that the iteration condition is not met, updating the previous verification result with the current verification result, and continuing linear iteration after the update to obtain a new current verification result until the iteration condition is met.
[0011] Optionally, in another possible design, the above-mentioned “determining whether the iteration condition is met” includes: determining that the iteration condition is met when it is determined that the iteration time reaches a preset duration, or the current iteration sequence is the last sequence.
[0012] Optionally, in another possible design, when the verification rule between the preset combined message sequences is "AND" logic verification, the above-mentioned "determining whether the iteration condition is met" includes: when it is determined that the current verification result is verification failure, determining that the iteration condition is met.
[0013] Optionally, in another possible design, when the verification rule between the preset combined message sequences is an "or" logic verification, the above-mentioned "determining whether the iteration condition is met" includes: when it is determined that the current verification result is verification passed, determining that the iteration condition is met.
[0014] In a second aspect, the present application provides a verification device for a combined message sequence, including an acquisition module, an iteration module, and a determination module;
[0015] Specifically, the acquisition module is used to acquire the verification rules between the message sequence to be verified, the preset combined message sequence, and the verification rules between the messages in each message sequence in the preset combined message sequence;
[0016] An iteration module, used to start with the first message of the first sequence in the preset combined message sequence to match the message sequence to be verified acquired by the acquisition module, and linearly iterate the preset combined message sequence;
[0017] The determination module is used to determine the current verification result during the linear iteration process of the iteration module according to the relationship between the verification rules between the messages in the current iteration sequence and the verification rules between the preset combined message sequences, the previous verification result and the matching result of the message matching, and determine the verification result of the message sequence to be verified based on the current verification result.
[0018] Optionally, in a possible design, the above-mentioned “verification rules” may include: a first logic verification and a second logic verification.
[0019] Optionally, in another possible design method, when the verification rule between the preset combined message sequences is the first logical verification, the determination module is specifically used to: determine whether the verification rule between the messages in the current iteration sequence is the first logical verification; if the verification rule between the messages in the current iteration sequence is the first logical verification, then the matching result of the current message of the current iteration sequence is subjected to the first logical verification with the previous verification result to obtain the current verification result; if the verification rule between the messages in the current iteration sequence is the second logical verification, then the previous verification result is temporarily stored, and the matching result of the message in the current iteration sequence is subjected to the second logical verification to obtain the verification result, and then the verification result obtained according to the second logical verification is subjected to the first logical verification with the temporarily stored previous verification result to obtain the current verification result.
[0020] Optionally, in another possible design, the determination module is specifically used to: determine whether the iteration condition is met; if it is determined that the iteration condition is met, determine the current verification result as the verification result of the message sequence to be verified; if it is determined that the iteration condition is not met, update the previous verification result with the current verification result, and continue linear iteration after the update to obtain a new current verification result until the iteration condition is met.
[0021] Optionally, in another possible design, the determination module is specifically used to: determine that the iteration condition is met when it is determined that the iteration time reaches a preset duration, or the current iteration sequence is the last sequence.
[0022] Optionally, in another possible design, when the verification rule between the preset combined message sequences is "AND" logic verification, the determination module is specifically used to: when it is determined that the current verification result is verification failure, determine that the iteration condition is met.
[0023] Optionally, in another possible design, when the verification rule between the preset combined message sequences is an "or" logic verification, the determination module is specifically used to: when it is determined that the current verification result is verification passed, determine that the iteration condition is met.
[0024] In a third aspect, the present application provides a verification device for a combined message sequence, comprising a memory, a processor, a bus and a communication interface; the memory is used to store computer execution instructions, and the processor is connected to the memory through a bus; when the verification device for the combined message sequence is running, the processor executes the computer execution instructions stored in the memory, so that the verification device for the combined message sequence performs the verification method for the combined message sequence provided in the first aspect above.
[0025] Optionally, the verification device for the combined message sequence may further include a transceiver, which is used to execute the steps of sending and receiving data, signaling or information under the control of the processor of the verification device for the combined message sequence, for example, obtaining the verification rules between the message sequence to be verified, the preset combined message sequence, and the verification rules between the messages in each message sequence in the preset combined message sequence.
[0026] Further optionally, the verification device of the combined message sequence may be a physical machine for implementing the verification of the combined message sequence, or may be a part of the device in the physical machine, for example, may be a chip system in the physical machine. The chip system is used to support the verification device of the combined message sequence to implement the functions involved in the first aspect, and the chip system includes a chip, and may also include other discrete devices or circuit structures.
[0027] In a fourth aspect, the present application provides a computer-readable storage medium, in which instructions are stored. When a computer executes the instructions, the computer executes the verification method for the combined message sequence provided in the first aspect.
[0028] In a fifth aspect, the present application provides a computer program product, which includes computer instructions. When the computer instructions are executed on a computer, the computer executes the verification method of the combined message sequence provided in the first aspect.
[0029] It should be noted that the above-mentioned computer instructions may be stored in whole or in part on a computer-readable storage medium. The computer-readable storage medium may be packaged together with the processor of the verification device of the combined message sequence, or may be packaged separately from the processor of the verification device of the combined message sequence, and this application does not limit this.
[0030] The description of the second, third, fourth and fifth aspects of the present application can refer to the detailed description of the first aspect; and the beneficial effects of the description of the second, third, fourth and fifth aspects can refer to the beneficial effect analysis of the first aspect, which will not be repeated here.
[0031] In this application, the name of the verification device for the combined message sequence does not limit the device or functional module itself. In actual implementation, these devices or functional modules may appear with other names. As long as the functions of each device or functional module are similar to those of this application, they fall within the scope of the claims of this application and their equivalent technologies.
[0032] These and other aspects of the present application will become more apparent from the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1A flowchart of a combined message sequence verification method provided in an embodiment of the present application;
[0034] Figure 2 A flowchart of another combined message sequence verification method provided in an embodiment of the present application;
[0035] Figure 3 A flowchart of another combined message sequence verification method provided in an embodiment of the present application;
[0036] Figure 4 A schematic diagram of the structure of a verification device for a combined message sequence provided in an embodiment of the present application;
[0037] Figure 5 A schematic diagram of the structure of another combined message sequence verification device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The verification method, device and storage medium of the combined message sequence provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0039] The terms "first" and "second" and the like in the specification and drawings of this application are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.
[0040] In addition, the terms "including" and "having" and any variations thereof mentioned in the description of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0041] It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0042] In the description of the present application, unless otherwise specified, “plurality” means two or more.
[0043] In systems with B / S and C / S architectures, there is usually data interaction between the device under test and the peripheral device. In the existing data interaction process, the device under test sends a message to the peripheral device, and the third-party device can intercept the message and match the message with the message in the preset message sequence, and then determine whether the verification of the data interaction is passed based on the matching result.
[0044] As data interaction scenarios become increasingly diverse, preset message sequences are gradually evolving into combined message sequences. Different message sequences can correspond to different interaction scenarios, which means that multiple message sequences need to be matched with messages intercepted by third-party devices. However, the existing verification method for combined message sequences is only applicable to scenarios with a single verification rule, and is not applicable when the verification rules between interaction scenarios are different from the verification rules within each interaction scenario. Therefore, it is urgent to propose a more adaptable verification method for combined message sequences to meet the verification needs of existing data interaction scenarios.
[0045] In response to the problems existing in the above-mentioned prior art, the embodiments of the present application provide a verification method, device and storage medium for a combined message sequence. Compared with the prior art, this solution has wider adaptability and can meet the verification requirements of existing data interaction scenarios.
[0046] The verification method of the combined message sequence provided in the embodiment of the present application can be applied to the verification device of the combined message sequence. The verification device of the combined message sequence can be a physical machine (such as a server) or a virtual machine (VM) deployed on a physical machine. The verification device of the combined message sequence can obtain the message sequence to be verified and determine the verification result of the message sequence to be verified.
[0047] The verification method of the combined message sequence provided by this application is described in detail below.
[0048] Reference Figure 1 , the verification method of the combined message sequence provided in the embodiment of the present application includes S101-S103:
[0049] S101. A verification device for a combined message sequence obtains a message sequence to be verified, verification rules between preset combined message sequences, and verification rules between messages in each message sequence in the preset combined message sequence.
[0050] The message sequence to be verified may be a message sequence intercepted by a verification device for combining message sequences during data interaction between the device under test and the peripheral device, and the message sequence is composed of multiple messages.
[0051] Optionally, in a possible implementation, the verification device for the combined message sequence intercepts data once every preset period, and the verification device for the combined message sequence may determine the data intercepted within a preset period as a message sequence to be verified.
[0052] Among them, the preset period can be a duration determined in advance by humans, and the embodiments of the present application do not limit this. Exemplarily, when the device under test and the peripheral device perform data interaction, the message sequence composed of the data intercepted in the first cycle by the verification device of the combined message sequence can be sequence 1 (M11, M12, M13, ..., M1i), the message sequence composed of the data intercepted in the second cycle can be sequence 2 (M21, M22, M23, ..., M1j), and the message sequence composed of the data intercepted in the third cycle can be (M31, M32, M33, ..., M3k). Among them, i, j and k can all be any integers, that is, the number of messages in the message sequence corresponding to each cycle can be different.
[0053] Optionally, the verification rule may include a first logic verification and a second logic verification; wherein the first logic verification is an “AND” logic verification and the second logic verification is an “OR” logic verification; or, the second logic verification is an “AND” logic verification and the first logic verification is an “OR” logic verification.
[0054] Among them, the "AND" logic verification between the preset combined message sequences is that when the verification result of each message sequence in the preset combined message sequence is correct, the matching verification result between the preset combined message sequence and the message sequence to be verified is correct, and the "OR" logic verification between the preset combined message sequences is that when the verification result of any message sequence in the preset combined message sequence is correct, the matching verification result between the preset combined message sequence and the message sequence to be verified is correct.
[0055] The "AND" logic verification between the messages in each message sequence in the preset combined message sequence is that when all the messages in the message sequence are matched successfully, the matching verification result between the message sequence and the message sequence to be verified is correct. The "OR" logic verification between the messages in each message sequence in the preset combined message sequence is that when any one of the messages in the message sequence is matched successfully, the matching verification result between the message sequence and the message sequence to be verified is correct.
[0056] It should be noted that, only when it is determined that the matching verification result between the preset combined message sequence and the message sequence to be verified is correct, can the verification result of the message sequence to be verified be determined to be correct.
[0057] Exemplarily, if the preset combined message sequence includes sequence 1 (N11, N12, N13, ..., N1i), sequence 2 (N21, N22, N23, ..., N1j) and sequence 3 (N31, N32, N33, ..., N3k). The message sequence to be verified is sequence 4 (M11, M12, M13, ..., M1s). Among them, i, j, s and k can all be any integers. If the verification rule between the messages in sequence 1 is "and" logic verification, when all the messages in N11, N12, N13, ..., N1i can successfully match the messages in sequence 4, the matching verification result between sequence 1 and the message sequence to be verified is correct. If the verification rule between the messages in sequence 1 is "or" logic verification, when any one of the messages in N11, N12, N13, ..., N1i can successfully match the messages in sequence 4, the matching verification result between sequence 1 and the message sequence to be verified is correct. If the verification rule between the preset combined message sequences is "AND" logic verification, then when the matching verification results between sequence 1, sequence 2 and sequence 3 and the message sequence to be verified are all correct, the final verification result for the message sequence to be verified is correct; if the verification rule between the preset combined message sequences is "OR" logic verification, then when the matching verification result between any one of sequence 1, sequence 2 and sequence 3 and the message sequence to be verified is correct, the final verification result for the message sequence to be verified is correct.
[0058] It should be noted that, for message N11 in sequence 1, if N11 can successfully match any one of M11, M12, M13, ..., M1s, it means that N11 successfully matches the message in sequence 4. In addition, N11 can successfully match any one of M11, M12, M13, ..., M1s, that is, the matching of N11 with the messages in M11, M12, M13, ..., M1s satisfies the preset attribute matching rules. The preset attribute matching rules are matching logics set in advance by humans, including "yes" verification logic and "no" verification logic. Similarly, the matching logic between messages in the embodiments of the present application can be matched according to the above logic.
[0059] S102: The verification device of the combined message sequence starts with the first message of the first sequence in the preset combined message sequence to match the message sequence to be verified, and linearly iterates the preset combined message sequence.
[0060] In a possible implementation, a verification device for a combined message sequence stores a preset combined message sequence, verification rules between preset combined message sequences set according to the requirements of the application scenario, and verification rules between messages in each message sequence in the preset combined message sequence. When the verification device for a combined message sequence intercepts a message sequence during data interaction between the device under test and the peripheral device, it can start with the first message of the first sequence in the preset combined message sequence, match messages with messages in the message sequence to be verified, and linearly iterate the preset combined message sequence.
[0061] Exemplarily, if the message sequence to be verified is sequence 1 (M11, M12, M13, ..., M1i), and the first sequence in the preset combined message sequence is (N11, N12, N13, ..., N1j), then the order of message matching in the iteration process is to match N11 with each message in M11, M12, M13, ..., M1i in turn, and then match N12 with each message in M11, M12, M13, ..., M1i in turn, and iterate until N1j is matched with each message in M11, M12, M13, ..., M1i; then, the second sequence in the preset combined message sequence (N11, N12, N13, ..., N1k) is matched with M11, M12, M13, ..., M1i according to the above method, and similarly, the preset combined message sequence is linearly iterated. Wherein, i, j, s and k can all be any integers.
[0062] S103. During the linear iteration process, the verification device of the combined message sequence determines the current verification result according to the relationship between the verification rules between the messages in the current iteration sequence and the verification rules between the preset combined message sequences, the previous verification result and the matching result of the message matching, and determines the verification result of the message sequence to be verified according to the current verification result.
[0063] It can be understood that in the verification method of the combined message sequence provided in the embodiment of the present application, the verification result of the combined message sequence to be verified is determined in an iterative process, that is, step S103 and step S102 can be executed simultaneously.
[0064] Optionally, in a possible implementation, when the verification rule between the preset combined message sequences is the first logical verification, it can be determined first whether the verification rule between the messages in the current iteration sequence is the first logical verification; then, if the verification rule between the messages in the current iteration sequence is the first logical verification, the matching result of the current message of the current iteration sequence is subjected to the first logical verification with the previous verification result to obtain the current verification result; if the verification rule between the messages in the current iteration sequence is the second logical verification, the previous verification result is temporarily stored, and the matching result of the message in the current iteration sequence is subjected to the second logical verification to obtain the verification result, and then the verification result obtained according to the second logical verification is subjected to the first logical verification with the temporarily stored previous verification result to obtain the current verification result.
[0065] Optionally, in a possible implementation, during the iteration process, each time after the current verification result is obtained, it can be determined whether the iteration condition is met; then, if it is determined that the iteration condition is met, the current verification result is determined as the verification result of the message sequence to be verified; if it is determined that the iteration condition is not met, the previous verification result is updated with the current verification result, and after the update, linear iteration is continued to obtain a new current verification result until the iteration condition is met.
[0066] Optionally, in a possible implementation, when it is determined that the iteration time reaches a preset duration, it is determined that the iteration condition is met.
[0067] Among them, the preset duration can be a duration determined in advance by humans, and the embodiments of the present application are not limited to this.
[0068] Optionally, in another possible implementation, in another possible implementation, if during the iteration process the current iteration sequence is the last sequence in a preset combined message sequence, it can be determined that the iteration condition is met.
[0069] Exemplarily, take the iteration condition of determining whether the current iteration sequence is the last sequence as an example. If the preset combined message sequence includes sequence 1 (N11, N12, N13), sequence 2 (N21, N22, N23) and sequence 3 (N31, N32), the message sequence to be verified is sequence 4 (M11, M12, M13, ..., M1s). Among them, s can be any integer. If the verification rule between messages in sequence 1 is "and" logic verification, the verification rule between messages in sequence 2 is "or" logic verification, and the verification rule between messages in sequence 3 is "and" logic verification. Then, when the verification rule between the preset combined message sequences is "AND" logic verification, N11 can be first matched with sequence 4 (M11, M12, M13, ..., M1s). If the match is successful, the current verification result is determined as passed. If the match is unsuccessful, the current verification result is determined as failed. At this time, the iteration condition is not met, and the verification result of N11 and sequence 4 (M11, M12, M13, ..., M1s) is determined as the previous verification result. Since the verification rule between the messages in sequence 1 is the same as the verification rule between the message sequences, You can continue to iterate, perform "AND" logic verification on the verification result obtained by message matching N12 with sequence 4 (M11, M12, M13, ..., M1s) and the previous verification result to obtain the current verification result. At this time, the iteration condition is still not met, then the current verification result is determined as the previous verification result, and then continue to iterate, perform "AND" logic verification on the verification result obtained by message matching N13 with sequence 4 (M11, M12, M13, ..., M1s) and the previous verification result to obtain the current verification result. At this time, the iteration condition is still not met, but the iteration of sequence 1 is completed.Update the previous verification result with the current verification result and start iterating sequence 2. Since the verification rules between messages in sequence 2 are different from the verification rules between the preset combined message sequences, the previous verification result can be temporarily stored. Then, perform "OR" logic verification on the verification results obtained by matching N21 and N22 with the messages in sequence 4 (M11, M12, M13, ..., M1s) respectively, and perform "OR" logic verification on the result of the logic verification and the result of the message matching of N23 to obtain the verification result. Then, perform "AND" logic verification on the verification result and the previous verification result temporarily stored to obtain the current verification result. At this time, the iteration is not completed. Update the previous verification result with the current verification result and start iterating sequence 3. Verification between messages in sequence 3 If the verification rules between the rule and the preset combined message sequence are the same, then the verification result obtained by message matching N31 with sequence 4 (M11, M12, M13, ..., M1s) can be subjected to an "AND" logic verification with the previous verification result to obtain the current verification result, and the previous verification result is updated with the current verification result, and then the iteration continues, and the verification result obtained by message matching N32 with sequence 4 (M11, M12, M13, ..., M1s) is subjected to an "AND" logic verification with the previous verification result to obtain the current verification result. At this time, the iteration condition is met, and the current verification result obtained for the last time can be determined as the verification result of the preset combined message sequence and sequence 4, that is, the verification result of the message sequence to be verified. Similarly, in the case where the verification rule between the preset combined message sequences is an "OR" logic verification, the above method can be referred to for iteration to obtain the verification result of the message sequence to be verified. It should be noted that the verification result of the message sequence to be verified is independent of the iteration order between sequence 1, sequence 2 and sequence 3, that is, sequence 2 or sequence 3 can be matched with the message sequence to be verified first, and then sequence 1 can be matched with the message sequence to be verified. Moreover, the verification result of the message sequence to be verified is independent of the iteration order within sequence 1, sequence 2 and sequence 3, that is, N12 or N13 can be matched with the message sequence to be verified first, and then N11 can be matched with the message sequence to be verified, and the embodiment of the present application does not limit this.
[0070] Optionally, in order to further improve the efficiency of determining the verification results, when the verification rule between the preset combined message sequences is "AND" logic verification, if the current verification result is determined to be verification failure, it can be determined that the iteration condition is met, and the current verification result can be determined as the verification result of the message sequence to be verified.
[0071] Exemplarily, if the verification rule between the preset combined message sequences is "AND" logic verification. When the current verification result is verification failure, although there are other messages in the sequence that have not been iterated, after the previous verification result is updated with the current verification result, the verification results of other messages are to be "AND" logically verified with the previous verification result. Regardless of the verification results of other messages, the result of the "AND" logical verification with the previous verification result with the result of verification failure must be verification failure. Therefore, in the case where the verification rule between the preset combined message sequences is "AND" logic verification, if it is determined that the current verification result is verification failure, the matching results of other messages have no effect on the final result, so there is no need to match messages for other subsequent messages, which can improve verification efficiency.
[0072] Optionally, in order to further improve the efficiency of determining the verification results, when the verification rule between the preset combined message sequences is an "or" logic verification, if the current verification result is determined to be verified passed, it can be determined that the iteration condition is met, and the current verification result can be determined as the verification result of the message sequence to be verified.
[0073] Exemplarily, the verification rule between the preset combined message sequences is an "OR" logic verification. When the current verification result is that the verification is passed, although there are other messages in the sequence that have not been iterated, after the previous verification result is updated with the current verification result, the verification results of other messages are to be "OR" logically verified with the previous verification result. Regardless of the verification results of other messages, the result of the "OR" logical verification with the previous verification result of the verification result must be a verification pass. Therefore, when the verification rule between the preset combined message sequences is an "OR" logic verification, if the current verification result is determined to be a verification pass, the matching results of other messages have no effect on the final result, so there is no need to match the messages of other subsequent messages, which can improve the verification efficiency.
[0074] In the technical solution provided by the embodiment of the present application, when verifying the acquired message sequence to be verified, the message matching process of the preset combined message sequence and the message sequence to be verified is iterated in a linear iteration manner. In the iterative process, the relationship between the verification rules between the messages in the current iteration sequence and the verification rules between the preset combined message sequence is fully considered, and the current verification result is determined according to the relationship and the previous verification result and the matching result of the message matching, and then the verification result of the message sequence to be verified is determined according to the current verification result. It can be seen that the technical solution provided by the present application can be applied to data interaction scenarios where the verification rules change, so the adaptability of the solution is wider than that of the prior art, and can meet the verification requirements of existing data interaction scenarios. In addition, in the entire iterative process of the embodiment of the present application, since the judgment result of the entire iteration is linear, the linear judgment result is constantly updated, so the linear result occupies one resource, and the temporary storage result occupies one resource, then the resource occupancy is at most 2, so the technical solution provided by the embodiment of the present application can realize the efficient simplification of the verification logic of the combined message sequence under limited computing resources, and the computing logic complexity is low, and the memory resource occupancy is small.
[0075] Based on the above description, when the verification rule between the preset combined message sequences is the first logic verification, such as Figure 2 As shown, Figure 1 Step S103 in can be replaced by S1031-S1034:
[0076] S1031. The verification device of the combined message sequence determines whether the verification rule between messages in the current iteration sequence is the first logic verification during the linear iteration process.
[0077] S1032: If the verification rule between messages in the current iteration sequence is the first logic verification, the verification device of the combined message sequence performs the first logic verification on the matching result of the current message of the current iteration sequence and the previous verification result to obtain the current verification result.
[0078] S1033. If the verification rule between messages in the current iteration sequence is the second logic verification, the verification device of the combined message sequence temporarily stores the previous verification result, and obtains the verification result according to the second logic verification for the matching result of the message in the current iteration sequence, and then performs the first logic verification on the verification result obtained according to the second logic verification and the temporarily stored previous verification result to obtain the current verification result.
[0079] S1034. The verification device for the combined message sequence determines the verification result of the message sequence to be verified according to the current verification result.
[0080] It is understandable that the embodiment of the present application does not limit the order between steps S1032-S1034, and step S1034 can be executed after step S1032 or after step S1033.
[0081] Optional, such as Figure 3 As shown, the embodiment of the present application further provides a verification method for a combined message sequence, in which the verification rule between message sequences is a first logic verification, including S301-S308:
[0082] S301. A verification device for a combined message sequence obtains a message sequence to be verified, verification rules between preset combined message sequences, and verification rules between messages in each message sequence in the preset combined message sequence.
[0083] S302: The verification device of the combined message sequence starts with the first message of the first sequence in the preset combined message sequence to match the message sequence to be verified, and linearly iterates the preset combined message sequence.
[0084] S303: The verification device of the combined message sequence determines whether the verification rule between messages in the current iteration sequence is the first logic verification.
[0085] If the verification rule between messages in the current iteration sequence is the first logic verification, step S304 is executed; if the verification rule between messages in the current iteration sequence is the second logic verification, step S305 is executed.
[0086] S304. The verification device of the combined message sequence performs a first logic verification on the matching result of the current message of the current iterative sequence and the previous verification result to obtain a current verification result.
[0087] S305. The verification device of the combined message sequence temporarily stores the previous verification result, and obtains the verification result according to the second logic verification of the matching result of the message in the current iteration sequence, and then performs the first logic verification on the verification result obtained according to the second logic verification and the temporarily stored previous verification result to obtain the current verification result.
[0088] S306 is executed after both step S305 and step S304.
[0089] S306. The verification device of the combined message sequence determines whether an iteration condition is met.
[0090] If it is determined that the iteration condition is met, step S307 is executed; if it is determined that the iteration condition is not met, step S308 is executed.
[0091] S307: The verification device for the combined message sequence determines the current verification result as the verification result for the message sequence to be verified.
[0092] S308. The verification device of the combined message sequence updates the previous verification result with the current verification result.
[0093] After step S308, the next sequence of the current iteration sequence is taken as the new current iteration sequence, and the process returns to step S303.
[0094] In order to more clearly illustrate the characteristics of the combined message sequence verification method provided in the embodiment of the present application, such as wide adaptability, low complexity and small memory resource usage, and to ensure the accuracy of the verification results of the method, a specific embodiment is used for detailed verification below.
[0095] Specifically, for the matching of a single message, the preset attribute matching rules of the existing message matching logic may include two types. The first type is that the current message in the current iteration sequence is the same as the message in the message sequence to be verified, and the matching is successful, that is, the matching logic is a "yes" verification logic; the second type is that the current message is not the same as the message in the message sequence to be verified, and the matching is successful, that is, the matching logic is a "no" verification logic. Regardless of the message matching logic, there are only two matching results, that is, the matching is successful and the matching is unsuccessful. There are currently two operations after matching a single message, one is termination judgment, and the other is continuation judgment. If the matching result of a single message is represented by an atomic expression, the two matching results of the first message matching logic can be represented by two atomic expressions x and y, respectively, where x = termination-correct result, y = continuation-failed result; then the two matching results of the second message matching logic can be represented by two atomic expressions m and n, where m = continuation-correct result, n = termination-failed result. Then, for the data interaction scenario of multiple message sequences, the matching results of a single message have four atomic expressions x, y, m and n.
[0096] For the interaction between any two devices, a preset combined message sequence can be preset, and each sequence in the preset combined message sequence can correspond to any interaction scenario between the two devices. There are two types of matching logic within any message sequence. The first is "and" logic verification, that is, if each message in the message sequence successfully matches the message in the intercepted message sequence, the message sequence is verified; the second is "or" logic verification, that is, if any message in the message sequence successfully matches the message in the intercepted message sequence, the message sequence is verified. Since there are multiple interaction scenarios between any two devices, there are also multiple interactions of the above verification logic. Exemplarily, for example, there are Nx interaction scenarios between any two devices, that is, to verify the combination of Nx message sequences, if the number of messages in each message sequence is Ny on average, if a storage area is pre-allocated for the matching results of each message, the number of resources required for calculation is Nx*Ny. In addition, in actual applications, not only two devices are interacting with data, so the occupied resources will only be more. In the entire iteration process of the technical solution provided in the embodiment of the present application, the resource occupancy is at most 2, so the memory resource occupancy in the technical solution provided in the embodiment of the present application is relatively small.
[0097] For the four atomic expressions x, y, m and n of the matching results of a single piece of information, if an "and" logic verification is performed, the results shown in Table 1 can be obtained:
[0098] Table 1
[0099]
[0100]
[0101] It can be seen from Table 1 that the result of the "AND" logic verification between any two messages is still x, y, m and n.
[0102] For the four atomic expressions x, y, m and n of the matching results of a single piece of information, if an "or" logic verification is performed, the results shown in Table 2 can be obtained:
[0103] Table 2
[0104]
[0105]
[0106] It can be seen from Table 2 that the result of the "OR" logic verification between any two messages is still x, y, m and n.
[0107] Since the result of "OR" logic verification or "AND" logic verification between any two messages among x, y, m and n is still x, y, m and n, the logic verification between any two messages satisfies the commutative law of operation, and the logic verification for more than three messages satisfies the associative law of operation. Then, for the verification between messages in multiple message sequences, the verification order is irrelevant. For example, logical verification is performed inside sequence 1 (M11, M12, M13, ..., M1i), and any replacement of the order of messages does not affect the verification result. Therefore, for the preset combined message sequence, the verification rule between the preset combined message sequences is either "AND" logic verification or "OR" logic verification. If the verification rule between the preset combined message sequences is "AND" logic verification, then for the message series except for the message series whose verification rule between messages in the message sequence is "OR" logic verification, the remaining message sequences can all perform linear operations of "AND" logic verification, and finally calculate with the results of the message series whose verification rule between messages in the message sequence is "OR" logic verification. Similarly, if the verification rule between the preset combined message sequences is "OR" logic verification, then for the message series except for the message series whose verification rule between the messages in the message sequence is "AND" logic verification, the remaining message sequences can all be subjected to linear operations of "OR" logic verification, and finally the results of the message series whose verification rule between the messages in the message sequence is "AND" logic verification can be calculated. In either case, the calculation result of a single message can be used to iterate the calculation results of the subsequent messages until the comprehensive result is finally calculated.
[0108] According to the above analysis, it can be seen that the verification result obtained according to the principle of the verification method of the combined message sequence provided by the present application can ensure the accuracy of the verification result of the method.
[0109] like Figure 4 As shown, an embodiment of the present application further provides a verification device for a combined message sequence, and the verification device for a combined message sequence includes: an acquisition module 11, an iteration module 12 and a determination module 13.
[0110] The acquisition module 11 executes S101 in the above method embodiment, the iteration module 12 executes S102 in the above method embodiment, and the determination module 13 executes S103 in the above method embodiment.
[0111] Specifically, the acquisition module 11 is used to acquire the verification rules between the message sequence to be verified, the preset combined message sequence, and the verification rules between the messages in each message sequence in the preset combined message sequence;
[0112] An iterative module 12 is used to perform message matching starting from the first message of the first sequence in the preset combined message sequence with the message sequence to be verified acquired by the acquisition module 11, and linearly iterate the preset combined message sequence;
[0113] The determination module 13 is used to determine the current verification result during the linear iteration process of the iteration module 12, according to the relationship between the verification rules between the messages in the current iteration sequence and the verification rules between the preset combined message sequences, the previous verification result and the matching result of the message matching, and determine the verification result of the message sequence to be verified based on the current verification result.
[0114] Optionally, in a possible implementation, the above-mentioned "verification rules" may include: a first logic verification and a second logic verification; the first logic verification is an "AND" logic verification, and the second logic verification is an "OR" logic verification; or, the second logic verification is an "AND" logic verification, and the first logic verification is an "OR" logic verification.
[0115] Optionally, in another possible implementation, when the verification rule between the preset combined message sequences is the first logic verification, the determination module 13 is specifically configured to:
[0116] Determine whether the validation rule between messages in the current iteration sequence is the first logic validation;
[0117] If the verification rule between messages in the current iteration sequence is the first logic verification, the matching result of the current message in the current iteration sequence is subjected to the first logic verification with the previous verification result to obtain the current verification result;
[0118] If the verification rule between messages in the current iteration sequence is the second logic verification, the previous verification result is temporarily stored, and the matching results of the messages in the current iteration sequence are verified according to the second logic verification to obtain the verification result. Then, the verification result obtained according to the second logic verification is combined with the previous stored verification result for the first logic verification to obtain the current verification result.
[0119] Optionally, in another possible implementation, the determination module 13 is specifically used to: determine whether the iteration condition is met; if it is determined that the iteration condition is met, determine the current verification result as the verification result of the message sequence to be verified; if it is determined that the iteration condition is not met, update the previous verification result with the current verification result, and continue linear iteration after the update to obtain a new current verification result until the iteration condition is met.
[0120] Optionally, in another possible implementation, the determination module 13 is specifically configured to: determine that the iteration condition is met when it is determined that the iteration time reaches a preset duration or the current iteration sequence is the last sequence.
[0121] Optionally, in another possible implementation, when the verification rule between the preset combined message sequences is an “AND” logic verification, the determination module 13 is specifically used to: when it is determined that the current verification result is a verification failure, determine that the iteration condition is met.
[0122] Optionally, in another possible implementation, when the verification rule between the preset combined message sequences is an "or" logic verification, the determination module 13 is specifically used to: when it is determined that the current verification result is verification passed, determine that the iteration condition is met.
[0123] Optionally, the verification device for the combined message sequence may further include a storage module, and the storage module is used to store program codes of the verification device for the combined message sequence, etc.
[0124] like Figure 5 As shown, an embodiment of the present application also provides a verification device for a combined message sequence, including a memory 41, a processor 42 (42-1 and 42-2), a bus 43 and a communication interface 44; the memory 41 is used to store computer execution instructions, and the processor 42 is connected to the memory 41 through the bus 43; when the verification device for the combined message sequence is running, the processor 42 executes the computer execution instructions stored in the memory 41, so that the verification device for the combined message sequence executes the verification method for the combined message sequence provided in the above embodiment.
[0125] In a specific implementation, as an embodiment, the processor 42 may include one or more central processing units (CPUs), such as Figure 5 As an embodiment, the verification device of the combined message sequence may include multiple processors 42, such as Figure 5 42-1 and processor 42-2 are shown in FIG. Each CPU in these processors 42 may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor 42 here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0126] The memory 41 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 41 may exist independently and be connected to the processor 42 via a bus 43. The memory 41 may also be integrated with the processor 42.
[0127] In a specific implementation, the memory 41 is used to store the data in the present application and the computer execution instructions corresponding to the software program for executing the present application. The processor 42 can combine various functions of the message sequence verification device by running or executing the software program stored in the memory 41 and calling the data stored in the memory 41.
[0128] The communication interface 44 uses any transceiver or other device for communicating with other devices or communication networks, such as a control system, a radio access network (RAN), a wireless local area network (WLAN), etc. The communication interface 44 may include a receiving unit to implement a receiving function, and a sending unit to implement a sending function.
[0129] The bus 43 may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. The bus 43 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0130] As an example, combining Figure 4 , the function of the acquisition module in the verification device of the combined message sequence is the same as Figure 5 The receiving unit in the combined message sequence verification device implements the same function as the determining module in the combined message sequence verification device. Figure 5 The functions implemented by the processor in the combined message sequence verification device are the same as those implemented by the storage module in the combined message sequence verification device. Figure 5 The memory in implements the same function.
[0131] The explanation of the relevant contents in this embodiment can be referred to the above method embodiment, which will not be repeated here.
[0132] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0133] An embodiment of the present application also provides a computer-readable storage medium, in which instructions are stored. When a computer executes the instructions, the computer executes the verification method of the combined message sequence provided in the above embodiment.
[0134] Among them, the computer-readable storage medium, for example, can be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, RAM, ROM, an erasable programmable read only memory (EPROM), a register, a hard disk, an optical fiber, a CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the above, or any other form of computer-readable storage medium known in the art. An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application-specific integrated circuit (ASIC). In an embodiment of the present application, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, device or device.
[0135] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for verifying a combined message sequence, characterized in that: include: Obtaining verification rules between a message sequence to be verified, a preset combined message sequence, and verification rules between messages in each message sequence in the preset combined message sequence; Starting with the first message of the first sequence in the preset combined message sequence, message matching is performed with the message sequence to be verified, and linearly iterating the preset combined message sequence; In the linear iteration process, according to the relationship between the verification rules between the messages in the current iteration sequence and the verification rules between the preset combined message sequences, the previous verification result and the matching result of the message matching, the current verification result is determined, and according to the current verification result, the verification result of the message sequence to be verified is determined; The verification rules include a first logic verification and a second logic verification; The first logic verification is an "AND" logic verification, and the second logic verification is an "OR" logic verification; or, the second logic verification is an "AND" logic verification, and the first logic verification is an "OR" logic verification; In a case where the verification rule between the preset combined message sequences is the first logical verification, determining the current verification result according to the relationship between the verification rule between the messages in the current iteration sequence and the verification rule between the preset combined message sequences, the previous verification result, and the matching result of the message matching includes: Determine whether the verification rule between messages in the current iteration sequence is the first logic verification; If the verification rule between messages in the current iteration sequence is the first logic verification, performing the first logic verification on the matching result of the current message of the current iteration sequence and the previous verification result to obtain the current verification result; If the verification rule between messages in the current iteration sequence is the second logical verification, the previous verification result is temporarily stored, and the matching results of the messages in the current iteration sequence are verified according to the second logical verification to obtain the verification result, and then the verification result obtained according to the second logical verification is combined with the temporarily stored previous verification result for the first logical verification to obtain the current verification result.
2. The method according to claim 1, characterized in that The step of determining the verification result of the message sequence to be verified according to the current verification result includes: Determine whether the iteration condition is met; When it is determined that the iteration condition is met, the current verification result is determined as the verification result of the message sequence to be verified; when it is determined that the iteration condition is not met, the previous verification result is updated with the current verification result, and the linear iteration is continued after the update to obtain a new current verification result until the iteration condition is met.
3. The method according to claim 2, characterized in that The step of determining whether an iteration condition is met includes: When it is determined that the iteration time reaches a preset time length, or the current iteration sequence is the last sequence, it is determined that the iteration condition is met.
4. The method according to claim 2, characterized in that: In the case where the verification rule between the preset combined message sequences is an "AND" logic verification, the determining whether the iteration condition is met includes: When it is determined that the current verification result is verification failure, it is determined that the iteration condition is met.
5. The method according to claim 2, characterized in that: In the case where the verification rule between the preset combined message sequences is an "OR" logic verification, the determining whether the iteration condition is met includes: When it is determined that the current verification result is verification passed, it is determined that the iteration condition is met.
6. A verification device for a combined message sequence, characterized in that: It includes a memory, a processor, a bus and a communication interface; the memory is used to store computer-executable instructions, and the processor is connected to the memory via the bus; When the verification device for the combined message sequence is running, the processor executes the computer-executable instructions stored in the memory, so that the verification device for the combined message sequence executes the verification method for the combined message sequence as described in any one of claims 1-5.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when a computer executes the instructions, the computer executes the combined message sequence verification method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Network information verification method and apparatus
CN103888254A
Information verification method, device and system
CN105791246A
