Content verification method and device, electronic equipment and storage medium

By generating encrypted tokens on the front end and transmitting them to the back end for verification, the problem of redundant resource consumption in front-end and back-end rule parsing in WAF is solved, front-end and back-end collaborative verification is realized, server load is reduced and security and user experience are improved.

CN121508968APending Publication Date: 2026-02-10CHINA MOBILE (XIONGAN) ICT CO LTD +3
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511673564.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-14
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Traditional Web Application Firewalls (WAFs) consume CPU resources repeatedly when the front-end and back-end execute rule parsing and filtering logic independently. This leads to a surge in server load in high-concurrency scenarios, and it is difficult to guarantee the consistency of rules between the front-end and back-end, resulting in the risk of false positives and false negatives, which affects user experience and security.

Method used

By pre-validating the input content on the front end, generating an encrypted token, and sending it to the back end for verification, collaborative verification between the front end and the back end is achieved, ensuring consistency of verification and reducing server load.

Benefits of technology

This enables front-end pre-validation of input content, reducing server load, improving network security and user experience, and ensuring consistency between front-end and back-end validation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121508968A_ABST
    Figure CN121508968A_ABST
Patent Text Reader

Abstract

The invention discloses a content verification method and device, electronic equipment and a storage medium. According to the specific implementation scheme, the method comprises the steps of determining input content in response to input operation of an input page; verifying the input content through an effective rule set to obtain a front-end verification result; under the condition that the front-end verification result is successful verification, obtaining an encryption token based on the input content and the effective rule set; and sending the input content and the encryption token to the back end, wherein the encryption token is used for enabling the back end to verify the input content. The input content is verified through the effective rule set, verification consistency is guaranteed, pre-verification of the front end on the input content is achieved, the obtained encryption token serves as a credible certificate to be transmitted to the rear end, cooperative verification of the front end and the rear end is achieved, the load of a server is reduced, and network safety is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network security technology, and in particular to a content verification method, apparatus, electronic device, and storage medium. Background Technology

[0002] Web Application Firewalls (WAFs) are an important means of protecting web applications. They can effectively identify and defend against various website attacks, such as SQL injection, cross-site scripting, file inclusion attacks, and directory traversal attacks, which often target vulnerabilities in web applications. Because WAFs match and judge based on predefined rules, false positives and false negatives are possible. False positives may cause legitimate requests to be incorrectly blocked, while false negatives may allow malicious requests to successfully bypass the WAF. Attackers may also employ various methods to bypass WAF detection and protection. For example, they might encode, obfuscate, or segment requests to evade WAF rule matching.

[0003] Traditional input security validation schemes require the front-end and back-end to independently execute complete rule parsing and filtering logic. Input content needs to be repeatedly parsed and matched by both sides, leading to redundant consumption of CPU / computing resources. In high-concurrency scenarios, server load surges, request response times increase, and system throughput is limited. Furthermore, when the front-end and back-end perform rule parsing, rule consistency must be ensured. Rule consistency relies on manual synchronization or periodic fetching, which can easily lead to a window where "the front-end has updated the rules, but the back-end hasn't synchronized." This can result in security vulnerabilities such as "front-end blocking, back-end allowing," or business misjudgments such as "front-end allowing, back-end blocking," impacting both user experience and security. Summary of the Invention

[0004] This invention provides a content verification method, apparatus, electronic device, and storage medium to achieve collaborative verification between the front end and the back end, ensure verification consistency, and reduce resource consumption.

[0005] According to one aspect of the present invention, a content verification method is provided, applied to a front-end, the method comprising:

[0006] In response to an input operation on the input page, the input content is determined, wherein the input page includes a page mounted on the front end;

[0007] The input content is validated using a set of valid rules to obtain the front-end validation result;

[0008] If the front-end verification result is successful, an encryption token is obtained based on the input content and the valid rule set. The encryption token is a trusted credential generated by the front-end for the input content.

[0009] The input content and the encryption token are sent to the backend, and the encryption token is used to enable the backend to verify the input content.

[0010] According to another aspect of the present invention, a content verification method is provided, applied to a backend, the method comprising:

[0011] Receive input content and encryption token sent from the front end;

[0012] The encryption token is verified to obtain a backend verification result, which indicates whether the input content is secure.

[0013] If the backend verification result is successful, the final result corresponding to the encryption token in the input content is determined, and the final result includes the result used by the frontend.

[0014] According to another aspect of the present invention, a content verification device is provided, applied to a front end, comprising:

[0015] The first determining module is used to determine the input content in response to the input operation of the input page, wherein the input page includes the page mounted on the front end;

[0016] The verification module is used to verify the input content using a valid set of rules to obtain the front-end verification result;

[0017] The generation module is used to obtain an encryption token based on the input content and the valid rule set when the front-end verification result is successful. The encryption token is a trusted credential generated by the front-end for the input content.

[0018] A sending module is used to send the input content and the encryption token to the backend, wherein the encryption token is used to enable the backend to verify the input content.

[0019] According to another aspect of the present invention, a content verification device is provided, applied to a backend, comprising:

[0020] The receiving module is used to receive input content and encryption tokens sent by the front end;

[0021] The verification module is used to verify the encryption token and obtain a backend verification result, which indicates whether the input content is secure.

[0022] The second determining module is used to determine the final result corresponding to the encryption token in the input content when the backend verification result is successful. The final result includes the result used by the frontend.

[0023] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0024] At least one processor; and

[0025] A memory communicatively connected to the at least one processor; wherein,

[0026] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the content verification method described in any embodiment of the present invention.

[0027] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the content verification method described in any embodiment of the present invention.

[0028] The technical solution of this invention, in response to an input operation on an input page, determines the input content; validates the input content using a valid rule set to obtain a front-end validation result; if the front-end validation result is successful, an encryption token is obtained based on the input content and the valid rule set; the input content and the encryption token are sent to the back-end, whereby the encryption token enables the back-end to verify the input content. Validating the input content using a valid rule set ensures validation consistency, achieving pre-validation of the input content by the front-end, and transmitting the obtained encryption token as a trusted credential to the back-end enables collaborative validation between the front-end and back-end, reducing server load and improving network security.

[0029] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0030] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0031] Figure 1 This is a flowchart of a content verification method applied to the front end according to Embodiment 1 of the present invention;

[0032] Figure 2 This is a flowchart of a front-end verification method provided according to Embodiment 2 of the present invention;

[0033] Figure 3 This is a flowchart of a content verification method applied to the backend according to Embodiment 3 of the present invention;

[0034] Figure 4 This is a flowchart of a backend verification method provided in Embodiment 4 of the present invention;

[0035] Figure 5 This is a schematic diagram of a content verification device applied to a front end according to Embodiment 5 of the present invention;

[0036] Figure 6 This is a schematic diagram of a content verification device applied to the backend according to Embodiment Six of the present invention;

[0037] Figure 7 This is a block diagram of an electronic device provided according to Embodiment Seven of the present invention. Detailed Implementation

[0038] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0039] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0040] Example 1

[0041] Figure 1This is a flowchart of a content verification method applied to a front-end according to Embodiment 1 of the present invention. This embodiment is applicable to situations where verification is performed on the front end. The method can be executed by a content verification device, which can be implemented in hardware and / or software. The content verification device can be configured in an electronic device, which may include a front end. Figure 1 As shown, the method includes:

[0042] S110. In response to the input operation on the input page, determine the input content.

[0043] The input page includes the page mounted on the front end.

[0044] In this embodiment, the input page can be understood as a page used for input operations. The input page can be mounted on the front end and can respond to the user's input operations. The input content can be understood as the content entered by the user on the input page.

[0045] Specifically, users can input data on the input page, and the front-end can respond to this input to determine the input content. The input content can include tags, attributes, special characters, etc. The input content may contain malicious content, such as cross-site scripting (XSS) code, tags, attributes, and text information that do not conform to rules, or even content that does not comply with business rules.

[0046] S120. The input content is validated using a valid set of rules to obtain the front-end validation result.

[0047] In this embodiment, the valid rule set can be understood as the rule set stored in the front-end's local cache. The valid rule set can be the rule set called by the front-end, and the rules in the valid rule set can be the set valid rules. The front-end validation result can be understood as the front-end's validation result of the input content. The front-end validation result can indicate whether the input content passes the front-end's validation.

[0048] Specifically, after the input content is determined on the front end, it is validated based on the valid rule set cached locally on the front end. This can be done by first parsing the tags, attributes, special characters, etc., contained in the input content, and then validating the parsed content. If the input content does not contain any parts that do not conform to the rules indicated by the valid rule set, the front end can determine the validation result as successful; otherwise, the front end will determine the validation result as failed.

[0049] For example, a valid rule set may include cross-site scripting (XSS) filtering rules, business compliance rules, and other rules. Validation based on a valid rule set may involve marking portions of the input content that do not conform to the rules contained in the valid rule set. These non-conforming portions may include malicious scripts, illegal keywords, etc.

[0050] S130. If the front-end verification result is successful, an encryption token is obtained based on the input content and the valid rule set.

[0051] The encryption token is a trusted credential generated by the front end for the input content.

[0052] In this embodiment, the encryption token can be understood as a trusted credential that has been pre-verified by the front end. The encryption token is a token mechanism used for secure transmission and can be a lightweight data exchange format.

[0053] Specifically, if the front-end validation result is successful, it means that the front-end has passed the pre-validation of the input content. Therefore, the trusted credential indicating the pre-validation of the front-end, i.e. the encryption token, can be transmitted to the back-end for further validation.

[0054] This embodiment can encapsulate the metadata and timestamps of the input content, the identifiers corresponding to the valid rule sets, and the keys shared by the front end and the back end through an encryption algorithm to obtain an encryption token.

[0055] S140. Send the input content and the encryption token to the backend.

[0056] The encryption token is used to enable the backend to verify the input content.

[0057] Specifically, after obtaining the encryption token, it can be sent to the backend along with the input content determined by the input operation in response to the input page. Upon receiving the input content, the backend can first verify the encryption token, thereby performing backend verification of the input content.

[0058] The technical solution of this invention, in response to an input operation on an input page, determines the input content; validates the input content using a valid rule set to obtain a front-end validation result; if the front-end validation result is successful, an encryption token is obtained based on the input content and the valid rule set; the input content and the encryption token are sent to the back-end, whereby the encryption token enables the back-end to verify the input content. Validating the input content using a valid rule set ensures validation consistency, achieving pre-validation of the input content by the front-end, and transmitting the obtained encryption token as a trusted credential to the back-end enables collaborative validation between the front-end and back-end, reducing server load and improving network security.

[0059] Based on the above embodiments, modified embodiments of the above embodiments are proposed. It should be noted that, in order to keep the description brief, only the differences from the above embodiments are described in the modified embodiments.

[0060] In one embodiment, obtaining the encrypted token based on the input content and the valid rule set includes:

[0061] Determine the original input hash of the input content, wherein the original input hash includes the metadata of the input content;

[0062] Determine the front-end signature, wherein the front-end signature includes the key stored on the front end;

[0063] Determine the first rule version number corresponding to the valid rule set, where the first rule version number is the unique identifier of the valid rule set;

[0064] The original input hash, the first rule version number, the front-end signature, and the timestamp corresponding to the input content are encapsulated to obtain an encrypted token.

[0065] In this embodiment, the original input hash can be understood as metadata including information such as the title of the input content. The front-end signature can include the key used by the front-end, and the front-end signature can be stored in the front-end. The first rule version number can be understood as the version number of the valid rule set, and the first rule version number can be used to uniquely identify the valid rule set.

[0066] Specifically, the metadata corresponding to information such as the title of the input content is extracted, and this metadata is used as the original input hash. The key stored on the front end is determined; this key is shared between the front end and the candidates, and the front-end signature stored on the front end can be obtained based on this key. When the front end retrieves a valid rule set, the first rule version number, which uniquely identifies the valid rule set, is determined. The time from determining the input content to the current moment is determined as the timestamp corresponding to the input content. The original input hash, the first rule version number, the front-end signature, and the timestamp are encapsulated using an encryption algorithm to obtain an encryption token.

[0067] In one embodiment, after validating the input content using a valid rule set to obtain the front-end validation result, the method further includes:

[0068] If the front-end validation result is a validation failure, the input content is updated.

[0069] For example, when the input contains parts that do not conform to the rules indicated by the valid rule set, the front-end validation result is determined as validation failure, indicating that the input content has not passed the front-end validation. At this time, the non-conforming parts can be displayed to the user on the front end, instructing the user to re-enter the input on the input page to update the input content, and then the updated input content can be validated again on the front end.

[0070] Example 2

[0071] Figure 2This is a flowchart of a front-end verification method according to Embodiment 2 of the present invention. This embodiment focuses on the method for determining the front-end verification result in the above embodiment. Figure 2 As shown, the method includes:

[0072] S210. In response to the input operation on the input page, determine the input content.

[0073] S220. Retrieve a valid set of rules from the rule management center.

[0074] The rule management center is used to store at least one set of rules.

[0075] In this embodiment, the rule management center can be used to store rule sets. The rule management center can be stored in a database, and the rule sets in the rule management center can be modified or updated in the operation backend of the rule management center.

[0076] Specifically, the front-end can periodically pull the latest valid rule set from the rule management center, and the rule set stored in the front-end's local cache at the moment the input content is determined can be used as the valid rule set.

[0077] S230. Parse the input content to obtain the key elements contained in the input content.

[0078] In this embodiment, key elements can be understood as elements contained in the input content, which can be in the form of text.

[0079] Specifically, the input content is parsed to identify key elements such as tags, attributes, and special characters in the corresponding text.

[0080] S240. Verify the key element using the valid rule set to obtain the front-end verification result.

[0081] For example, based on a locally cached set of valid rules, such as cross-site scripting (XSS) filtering rules and business compliance rules, each key element is validated to determine whether any content in the key element violates the valid rule set. For instance, tags within a key element might contain tags that do not conform to the rules. When none of the key elements of the input content contain any of the non-compliant parts indicated by the valid rule set, the front-end validation result is determined to be successful.

[0082] S250. If the front-end verification result is successful, an encryption token is obtained based on the input content and the valid rule set.

[0083] S260. Send the input content and the encryption token to the backend.

[0084] The technical solution of this invention involves retrieving a valid rule set from a rule management center, which stores at least one rule set; parsing the input content to obtain the key elements contained within the input content; and validating the key elements using the valid rule set to obtain a front-end validation result. Retrieving a valid rule set from the rule management center synchronizes the rule sets used by the front-end and back-end, reducing validation discrepancies. Furthermore, dynamically retrieving the valid rule set enables dynamic validation of the key elements contained in the input content, improving validation flexibility.

[0085] Example 3

[0086] Figure 3 This is a flowchart of a content verification method applied to a backend according to Embodiment 3 of the present invention. This embodiment is applicable to situations where verification is performed on the backend. The method can be executed by a content verification device, which can be implemented in hardware and / or software. The content verification device can be configured in an electronic device, which may include a backend. Figure 3 As shown, the method includes:

[0087] S310: Receive the input content and encryption token sent by the front end.

[0088] Specifically, after obtaining the encryption token, the frontend can send the encryption token along with the input content to the backend. After receiving the input content and encryption token from the frontend, the backend can first verify the encryption token, rather than performing a complete verification of the input content.

[0089] S320. Verify the encrypted token to obtain the backend verification result.

[0090] The backend verification result indicates whether the input content is safe.

[0091] In this embodiment, the backend verification result can be understood as the backend's verification result of the encryption token. The backend verification result can indicate whether the encryption token has passed the backend verification.

[0092] Specifically, after receiving the input content and encryption token from the front end, the back end first verifies the encryption token. This can be done by first determining the original input hash, the first rule version number, the front end signature, and the timestamp that make up the encryption token, and then verifying each of these components to obtain the back end verification result. If all parts of the encryption token pass verification, the back end verification result is considered successful; otherwise, it is considered a failure.

[0093] S330. If the backend verification result is successful, determine the final result in the input content corresponding to the encryption token.

[0094] The final result includes the result used by the front end.

[0095] In this embodiment, the final result can be understood as the result verified by the front-end and back-end, and the final result can be the result related to the encryption token in the input content.

[0096] Specifically, if the backend verification of the encryption token is successful, it means that the backend has verified the encryption token, which in turn means that the backend has verified the input content. Therefore, the final result corresponding to the encryption token in the input content can be determined, and this final result can be fed back to the frontend. The frontend can then execute the operations indicated by the final result that has been verified by both the frontend and backend.

[0097] If the backend verification of the encrypted token fails, the complete backend verification process is triggered. At this time, the backend needs to re-parse the input content and execute rule filtering.

[0098] The technical solution of this invention involves receiving input content and an encryption token sent by a front-end; verifying the encryption token to obtain a back-end verification result; and, if the back-end verification result is successful, determining the final result in the input content corresponding to the encryption token. By verifying the encryption token, collaborative verification between the front-end and back-end is achieved, eliminating redundant calculations between the front-end and back-end and reducing server load.

[0099] Based on the above embodiments, modified embodiments of the above embodiments are proposed. It should be noted that, in order to keep the description brief, only the differences from the above embodiments are described in the modified embodiments.

[0100] In one embodiment, determining the final result based on the input content and the encryption token includes:

[0101] Determine the original input hash in the cryptographic token, the original input hash including metadata of the input content;

[0102] Extract the content corresponding to the original input hash from the input content, and use the extracted content as the final result.

[0103] Specifically, the original input hash that makes up the encryption token is determined. The original input hash includes metadata such as the title of the input content. Based on the content indicated by the original input hash, the backend directly extracts the content indicated by the original input hash from the input content and uses the extracted content as the final result, without needing to perform further parsing and verification of the input content on the backend. The original input hash can indicate information such as the title of the input content; therefore, the content indicated by the title can be extracted from the input content.

[0104] Example 4

[0105] Figure 4 This is a flowchart of a backend verification method according to Embodiment 4 of the present invention. This embodiment focuses on the method for determining the backend verification result in the above embodiments. Figure 4 As shown, the method includes:

[0106] S410: Receives input content and encryption token sent by the front end.

[0107] S420. Determine the first rule version number, front-end signature, and timestamp corresponding to the input content contained in the encryption token.

[0108] Specifically, the process involves determining the first rule version number, the front-end signature, and the timestamp that make up the encryption token. The first rule version number is a unique identifier for the valid rule set used by the front-end to validate the input content. The front-end signature can be a key stored in the front-end. The timestamp is the time from when the front-end determines the input content to when the encryption token is generated.

[0109] S430. Verify the front-end signature based on the back-end key to obtain the first back-end verification result.

[0110] The backend key includes the key stored in the backend.

[0111] In this embodiment, the backend key may include a key used by the backend, and the backend key may be stored in the backend. The first backend verification result can be understood as the backend's verification result of the frontend signature in the encryption token.

[0112] Specifically, the backend key stored in the backend is determined, and the frontend signature in the encryption token is verified using the backend key to obtain the first backend verification result, thereby confirming that the encryption token has not been tampered with.

[0113] For example, a method for verifying the front-end signature in the encrypted token using the back-end key could be to compare whether the front-end key corresponding to the front-end signature is the same as the back-end key. Since the keys stored on the front end and back end are shareable, if the front-end key and the back-end key are the same, it means that the encrypted token has not been tampered with, and the first back-end verification result is successful.

[0114] S440. Determine the second rule version number contained in the backend, and verify the first rule version number based on the second rule version number to obtain the second backend verification result.

[0115] In this embodiment, the second rule version number can be understood as a unique identifier of the rule set currently running in the backend. The second backend verification result can be understood as the backend's verification result of the first rule version number in the encryption token.

[0116] Specifically, determine the rule set currently running in the backend and its unique identifier, namely the second rule version number. Check if the second rule version number is the same as the first rule version number. If they are, the second backend verification result is considered successful; otherwise, the second backend verification result is considered a failure.

[0117] For example, if the second rule version number is the same as the first rule version number, it means that both the front-end and back-end are using the latest rule set stored in the rule management center. If the second rule version number is different from the first rule version number, the possible reasons are, for example, that the front-end has not updated the valid rule set in time. In this case, the back-end will refuse to accept the encryption token at this time and force the front-end to pull the valid rule set from the rule management center again and generate a new encryption token.

[0118] Optionally, determining the second rule version number included in the backend includes:

[0119] Detect rule change events in the rule management center;

[0120] When the rule change event indicates that the rule set stored in the rule management center has changed, the second rule version number is loaded from the rule management center.

[0121] In this embodiment, a rule change event can be understood as an event in which the rule set stored in the rule management center changes.

[0122] Specifically, the backend monitors rule change events in the rule management center in real time. When it receives a rule change event indicating that the rule set stored in the rule management center has changed, the backend dynamically loads the second rule version number corresponding to the most recent rule set to ensure that the rules used by the backend and the frontend are consistent.

[0123] S450, Determine whether the timestamp is within the set time range of the third backend verification result.

[0124] In this embodiment, the third backend verification result can be understood as the backend's verification result of the timestamp in the encrypted token.

[0125] Specifically, for the timestamp in the encrypted token, if the timestamp is within the set time range, it means that the third-party backend verification result is successful; otherwise, the third-party backend verification result is unsuccessful.

[0126] S460. If the first backend verification result, the second backend verification result, and the third backend verification result are all successful, the backend verification result is determined to be successful.

[0127] Specifically, if the first, second, and third backend verification results are all successful, it means that the first rule version number, frontend signature, and timestamp in the encrypted token have all been successfully verified by the backend, and the backend verification result can be determined as successful.

[0128] S470. If the backend verification result is successful, determine the final result in the input content corresponding to the encryption token.

[0129] The technical solution of this invention involves determining a first rule version number, a front-end signature, and a timestamp corresponding to the input content contained in the encryption token; verifying the front-end signature based on the back-end key to obtain a first back-end verification result; determining a second rule version number contained in the back-end, and verifying the first rule version number based on the second rule version number to obtain a second back-end verification result; determining whether the timestamp is within a set time range for a third back-end verification result; and determining that the back-end verification result is successful if the first, second, and third back-end verification results are all successful. By verifying the encryption token, collaborative verification between the front-end and back-end is achieved. Verification of the first and second rule version numbers ensures consistency between the rule sets of the front-end and back-end, thereby improving network security.

[0130] Example 5

[0131] Figure 5 This is a schematic diagram of a content verification device applied to a front end according to Embodiment 5 of the present invention. Figure 5 As shown, the device includes:

[0132] The first determining module 510 is used to determine the input content in response to the input operation of the input page, wherein the input page includes a page mounted on the front end;

[0133] The verification module 520 is used to verify the input content through a valid rule set to obtain the front-end verification result;

[0134] The generation module 530 is used to obtain an encryption token based on the input content and the valid rule set when the front-end verification result is successful. The encryption token is a trusted credential generated by the front-end for the input content.

[0135] The sending module 540 is used to send the input content and the encryption token to the backend, wherein the encryption token is used to enable the backend to verify the input content.

[0136] The content verification device provided in this embodiment of the invention, in response to an input operation on an input page, determines the input content through a first determining module; verifies the input content using a valid rule set through a verification module to obtain a front-end verification result; if the front-end verification result is successful, an encryption token is obtained by a generating module based on the input content and the valid rule set; and the input content and the encryption token are sent to the back-end through a sending module, whereby the encryption token is used by the back-end to verify the input content. Through the cooperation between the modules, the valid rule set verifies the input content, ensuring verification consistency and realizing front-end pre-verification of the input content. The obtained encryption token is transmitted to the back-end as a trusted credential, achieving collaborative verification between the front-end and back-end, reducing server load, and improving network security.

[0137] In one embodiment, the verification module 520 is specifically used for:

[0138] Retrieve a valid set of rules from the rule management center, which is used to store at least one set of rules.

[0139] Parse the input content to obtain the key elements contained in the input content;

[0140] The key elements are validated using the effective rule set to obtain the front-end validation result.

[0141] In one embodiment, the generation module 530 is specifically used for:

[0142] Determine the original input hash of the input content, wherein the original input hash includes the metadata of the input content;

[0143] Determine the front-end signature, wherein the front-end signature includes the key stored on the front end;

[0144] Determine the first rule version number corresponding to the valid rule set, where the first rule version number is the unique identifier of the valid rule set;

[0145] The original input hash, the first rule version number, the front-end signature, and the timestamp corresponding to the input content are encapsulated to obtain an encrypted token.

[0146] In one embodiment, the content verification device further includes an updating module, specifically used for:

[0147] If the front-end validation result is a validation failure, the input content is updated.

[0148] The content verification device provided in this embodiment of the invention can execute the content verification method provided in any embodiment of the invention. Through the cooperation and collaborative work between the modules, the front-end verifies the content and has the corresponding functional modules and beneficial effects of the execution method.

[0149] Example 6

[0150] Figure 6 This is a schematic diagram of a content verification device applied to the backend according to Embodiment Six of the present invention. Figure 6 As shown, the device includes:

[0151] The receiving module 610 is used to receive input content and encryption tokens sent by the front end;

[0152] The verification module 620 is used to verify the encryption token and obtain a backend verification result, wherein the backend verification result indicates whether the input content is secure.

[0153] The second determining module 630 is used to determine the final result corresponding to the encryption token in the input content when the backend verification result is successful. The final result includes the result used by the frontend.

[0154] The content verification device provided in this embodiment of the invention receives input content and an encryption token sent by the front end through a receiving module; verifies the encryption token through a verification module to obtain a back-end verification result; and, if the back-end verification result is successful, determines the final result in the input content corresponding to the encryption token through a second determining module. Through the cooperation between the modules, the encryption token is verified, achieving collaborative verification between the front end and the back end, eliminating redundant calculations between the front end and the back end, and reducing server load.

[0155] In one embodiment, the verification module 620 includes:

[0156] The first determining unit is used to determine the first rule version number, front-end signature, and timestamp corresponding to the input content contained in the encryption token;

[0157] The verification unit is used to verify the front-end signature based on the back-end key to obtain a first back-end verification result, wherein the back-end key includes the key stored in the back-end.

[0158] The second determining unit is used to determine the second rule version number contained in the backend, and to verify the first rule version number based on the second rule version number to obtain the second backend verification result;

[0159] The third determining unit is used to determine whether the timestamp is within the set time range of the third backend verification result;

[0160] The fourth determining unit is used to determine that the backend verification result is successful when the first backend verification result, the second backend verification result, and the third backend verification result are all successful.

[0161] In one embodiment, the second determining unit is specifically used for:

[0162] Detect rule change events in the rule management center;

[0163] When the rule change event indicates that the rule set stored in the rule management center has changed, the second rule version number is loaded from the rule management center.

[0164] In one embodiment, the second determining module 630 is specifically used for:

[0165] Determine the original input hash in the cryptographic token, the original input hash including metadata of the input content;

[0166] Extract the content corresponding to the original input hash from the input content, and use the extracted content as the final result.

[0167] The content verification device provided in this embodiment of the invention can execute the content verification method provided in any embodiment of the invention. Through the cooperation and collaborative work between the modules, the backend verification of the content is completed, which has the corresponding functional modules and beneficial effects of the execution method.

[0168] Example 7

[0169] According to embodiments of the present invention, the present invention also provides an electronic device and a computer-readable storage medium.

[0170] Figure 7 This is a block diagram of an electronic device according to Embodiment Seven of the present invention, which implements the content verification method described in the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0171] likeFigure 7 As shown, the electronic device 410 includes at least one processor 411 and a memory, such as a read-only memory (ROM) 412 or a random access memory (RAM) 413, communicatively connected to the at least one processor 411. The memory stores computer programs executable by the at least one processor. The processor 411 can perform various appropriate actions and processes based on the computer program stored in the ROM 412 or loaded from storage unit 418 into the RAM 413. The RAM 413 may also store various programs and data required for the operation of the electronic device 410. The processor 411, ROM 412, and RAM 413 are interconnected via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.

[0172] Multiple components in the electronic device are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, optical disk, etc.; and a communication unit 419, such as a network card, modem, wireless transceiver, etc. The communication unit 419 allows the electronic device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0173] Processor 411 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 411 performs the various methods and processes described above, such as content verification methods.

[0174] In some embodiments, the content verification method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 410 via ROM 412 and / or communication unit 419. When the computer program is loaded into RAM 413 and executed by processor 411, one or more steps of the content verification method described above may be performed. Alternatively, in other embodiments, processor 411 may be configured to perform the content verification method by any other suitable means (e.g., by means of firmware).

[0175] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0176] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0177] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0178] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0179] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0180] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0181] The technical solution of this invention provides a content verification method, apparatus, electronic device, and storage medium. In response to an input operation on an input page, input content is determined; the input content is verified using a valid rule set to obtain a front-end verification result; if the front-end verification result is successful, an encryption token is obtained based on the input content and the valid rule set; the input content and the encryption token are sent to the back-end, whereby the encryption token enables the back-end to verify the input content. Verifying the input content using a valid rule set ensures verification consistency, achieving pre-verification of the input content by the front-end, and transmitting the obtained encryption token as a trusted credential to the back-end enables collaborative verification between the front-end and back-end, reducing server load and improving network security.

[0182] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and no limitation is imposed herein.

[0183] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A content verification method, characterized in that, Applied to the front end, the method includes: In response to an input operation on the input page, the input content is determined, wherein the input page includes a page mounted on the front end; The input content is validated using a set of valid rules to obtain the front-end validation result; If the front-end verification result is successful, an encryption token is obtained based on the input content and the valid rule set. The encryption token is a trusted credential generated by the front-end for the input content. The input content and the encryption token are sent to the backend, and the encryption token is used to enable the backend to verify the input content.

2. The method according to claim 1, characterized in that, The step of validating the input content using a valid rule set to obtain the front-end validation result includes: Retrieve a valid set of rules from the rule management center, which is used to store at least one set of rules. Parse the input content to obtain the key elements contained in the input content; The key elements are validated using the effective rule set to obtain the front-end validation result.

3. The method according to claim 1, characterized in that, The process of obtaining an encrypted token based on the input content and the valid rule set includes: Determine the original input hash of the input content, wherein the original input hash includes the metadata of the input content; Determine the front-end signature, wherein the front-end signature includes the key stored on the front end; Determine the first rule version number corresponding to the valid rule set, where the first rule version number is the unique identifier of the valid rule set; The original input hash, the first rule version number, the front-end signature, and the timestamp corresponding to the input content are encapsulated to obtain an encrypted token.

4. The method according to any one of claims 1-3, characterized in that, After validating the input content using a valid rule set to obtain the front-end validation result, the process further includes: If the front-end validation result is a validation failure, the input content is updated.

5. A content verification method, characterized in that, Applied to the backend, the method includes: Receive input content and encryption token sent from the front end; The encryption token is verified to obtain a backend verification result, which indicates whether the input content is secure. If the backend verification result is successful, the final result corresponding to the encryption token in the input content is determined, and the final result includes the result used by the frontend.

6. The method according to claim 5, characterized in that, The verification of the encrypted token to obtain the backend verification result includes: Determine the first rule version number, front-end signature, and timestamp corresponding to the input content contained in the encryption token; The front-end signature is verified based on the back-end key to obtain a first back-end verification result, wherein the back-end key includes the key stored in the back-end. Determine the second rule version number contained in the backend, and verify the first rule version number based on the second rule version number to obtain the second backend verification result; The third backend verification result determines whether the timestamp is within the set time range; If the first backend verification result, the second backend verification result, and the third backend verification result are all successful, then the backend verification result is determined to be successful.

7. The method according to claim 6, characterized in that, Determining the second rule version number contained in the backend includes: Detect rule change events in the rule management center; When the rule change event indicates that the rule set stored in the rule management center has changed, the second rule version number is loaded from the rule management center.

8. The method according to claim 5, characterized in that, The process of determining the final result based on the input content and the encryption token includes: Determine the original input hash in the cryptographic token, the original input hash including metadata of the input content; Extract the content corresponding to the original input hash from the input content, and use the extracted content as the final result.

9. A content verification device, characterized in that, Applied to front-end, including: The first determining module is used to determine the input content in response to the input operation of the input page, wherein the input page includes the page mounted on the front end; The verification module is used to verify the input content using a valid set of rules to obtain the front-end verification result; The generation module is used to obtain an encryption token based on the input content and the valid rule set when the front-end verification result is successful. The encryption token is a trusted credential generated by the front-end for the input content. A sending module is used to send the input content and the encryption token to the backend, wherein the encryption token is used to enable the backend to verify the input content.

10. A content verification device, characterized in that, Applied to the backend, including: The receiving module is used to receive input content and encryption tokens sent by the front end; The verification module is used to verify the encryption token and obtain a backend verification result, which indicates whether the input content is secure. The second determining module is used to determine the final result corresponding to the encryption token in the input content when the backend verification result is successful. The final result includes the result used by the frontend.

11. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the content verification method according to any one of claims 1-8.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the content verification method of any one of claims 1-8.