Image resource verification method and device, electronic device and storage medium
By pre-processing image resources and caching sub-resources for verification, the method reduces CPU load and improves verification efficiency, solving the issue of high CPU usage in existing image verification systems.
Patent Information
- Application Number
- CN202111555081.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-17
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2041-12-17
AI Technical Summary
Existing image resource verification methods consume excessive CPU resources due to frequent image processing, leading to low verification performance.
Pre-process image resources by acquiring and configuring them based on identifiers, storing sub-resources in a cache, and displaying them on terminals to determine verification results, reducing real-time image processing during high request volumes.
Reduces CPU resource occupation and enhances verification efficiency by pre-processing image resources, addressing the issue of low verification performance.
Smart Images

Figure CN114238924B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computers, and in particular to an image resource verification method and device, an electronic device, and a storage medium. Background Art
[0002] In the current related technologies, when verification is performed through image resources, drawing tools are usually used in real time to cut and draw according to the image resources to generate image resources for verification. For example, in the image verification code service, the verification code middle platform has a strategy for generating a base map for the sliding verification code type. Each time verification is performed, a picture is randomly selected from the gallery in real time, the picture is processed using a drawing tool class, and the processed picture is returned to the front end as the base map, so that the slider and base map can be displayed on the front end for the user to slide to realize verification.
[0003] When the number of verification service requests is large, the frequent use of drawing tools to process images will occupy a large amount of CPU resources, affect online service performance, and lead to technical problems such as low verification performance of image resources.
[0004] Public Content
[0005] The present disclosure provides an image resource verification method and device, an electronic device and a storage medium to at least solve the technical problem of low image resource verification performance in the related art. The technical solution of the present disclosure is as follows:
[0006] According to a first aspect of an embodiment of the present disclosure, a method for verifying an image resource is provided, comprising:
[0007] Acquire a first image resource according to a first image identifier in the first cache, and determine a first configuration parameter, wherein the first configuration parameter and the first image resource correspond to each other based on the first image identifier;
[0008] Perform a target operation on the first image resource according to the first configuration parameter to obtain a first image sub-resource and a second image sub-resource, and store them in a second cache;
[0009] The first image sub-resource and the second image sub-resource in the second cache are sent to the target terminal respectively, wherein the first image sub-resource and the second image sub-resource are used to be displayed on the target terminal to determine the verification result.
[0010] Optionally, before acquiring the first image resource according to the first image identifier in the first cache and determining the first configuration parameter, the method further includes:
[0011] generating a set of image identifiers based on a predetermined set of image resources, and storing the set of image identifiers and the set of image resources in a one-to-one correspondence in a first data table;
[0012] The group of image resources is extracted from the first data table and stored in the first cache.
[0013] Optionally, before acquiring the first image resource according to the first image identifier in the first cache and determining the first configuration parameter, the method further includes:
[0014] In response to the target interactive operation in the background operation interface, the first configuration parameters are configured and stored in the second data table, wherein the first configuration parameters include the first image identifier, the first position parameter of the first image sub-resource and the second position parameter of the second image sub-resource.
[0015] Optionally, the configuring the first configuration parameter in response to the target interactive operation in the background operation interface and storing it in the second data table includes:
[0016] In response to the target interaction operation, determining the first position parameter and the second position parameter, wherein the first position parameter is used to indicate a position in the first image resource where shadow processing needs to be performed, and the first position parameter includes a first horizontal coordinate and a first vertical coordinate of the first image subresource in the first image resource, and the second position parameter is used to indicate an initial position of the slider in the first image resource, and the second position parameter includes a second horizontal coordinate and a second vertical coordinate of the second image subresource in the first image resource;
[0017] The first configuration parameter is generated based on the first image identifier and the first horizontal coordinate, the first vertical coordinate, the second horizontal coordinate and the second vertical coordinate, and is stored in the second data table in an associated manner.
[0018] Optionally, performing a target operation on the first image resource according to the first configuration parameter to obtain a first image sub-resource and a second image sub-resource, and storing them in a second cache includes:
[0019] Perform shadow processing on the first image resource based on the first horizontal coordinate and the first vertical coordinate to obtain the first image sub-resource;
[0020] generating the second image sub-resource based on the second horizontal coordinate and the second vertical coordinate;
[0021] The first image sub-resource and the second image sub-resource are stored in the second cache.
[0022] Optionally, acquiring the first image resource according to the first image identifier in the first cache and determining the first configuration parameter includes:
[0023] Acquiring the first image resource according to the first image identifier through an offline thread at a predetermined period;
[0024] The first configuration parameter is determined according to the first image identifier through the offline thread in the predetermined period.
[0025] Optionally, the displaying the first image sub-resource and the second image sub-resource in the second cache on the target terminal respectively includes:
[0026] In a case where the number of request messages received from the target terminal exceeds a preset threshold, randomly selecting the first image sub-resource and the second image sub-resource from the second cache, wherein the request message is used to request verification based on the first image resource;
[0027] The selected first image sub-resource and the second image sub-resource are displayed on the target terminal respectively.
[0028] According to a second aspect of an embodiment of the present disclosure, there is provided an image resource verification device, comprising:
[0029] an acquisition module, configured to acquire a first image resource according to a first image identifier in a first cache, and determine a first configuration parameter, wherein the first configuration parameter and the first image resource correspond to each other based on the first image identifier;
[0030] an execution module, configured to perform a target operation on the first image resource according to the first configuration parameter, obtain a first image sub-resource and a second image sub-resource, and store them in a second cache;
[0031] A sending module is used to send the first image sub-resource and the second image sub-resource in the second cache to the target terminal respectively, wherein the first image sub-resource and the second image sub-resource are used to be displayed on the target terminal to determine the verification result.
[0032] Optionally, the device is also used for:
[0033] Before acquiring the first image resource according to the first image identifier in the first cache and determining the first configuration parameter, generating a group of image identifiers based on a predetermined group of image resources, and storing the group of image identifiers and the group of image resources in a one-to-one correspondence in a first data table;
[0034] The group of image resources is extracted from the first data table and stored in the first cache.
[0035] Optionally, the device is also used for:
[0036] Before obtaining the first image resource according to the first image identifier in the first cache and determining the first configuration parameters, the first configuration parameters are configured in response to the target interactive operation in the background operation interface and stored in the second data table, wherein the first configuration parameters include the first image identifier, the first position parameter of the first image sub-resource and the second position parameter of the second image sub-resource.
[0037] Optionally, the device is used to configure the first configuration parameter in response to the target interactive operation on the background operation interface in the following manner, and store it in the second data table:
[0038] In response to the target interaction operation, determining the first position parameter and the second position parameter, wherein the first position parameter is used to indicate a position in the first image resource where shadow processing needs to be performed, and the first position parameter includes a first horizontal coordinate and a first vertical coordinate of the first image subresource in the first image resource, and the second position parameter is used to indicate an initial position of the slider in the first image resource, and the second position parameter includes a second horizontal coordinate and a second vertical coordinate of the second image subresource in the first image resource;
[0039] The first configuration parameter is generated based on the first image identifier and the first horizontal coordinate, the first vertical coordinate, the second horizontal coordinate and the second vertical coordinate, and is stored in the second data table in an associated manner.
[0040] Optionally, the apparatus is configured to perform a target operation on the first image resource according to the first configuration parameter in the following manner to obtain a first image sub-resource and a second image sub-resource, and store them in a second cache:
[0041] Perform shadow processing on the first image resource based on the first horizontal coordinate and the first vertical coordinate to obtain the first image sub-resource;
[0042] generating the second image sub-resource based on the second horizontal coordinate and the second vertical coordinate;
[0043] The first image sub-resource and the second image sub-resource are stored in the second cache.
[0044] Optionally, the apparatus is configured to obtain the first image resource according to the first image identifier in the first cache and determine the first configuration parameter in the following manner:
[0045] Acquiring the first image resource according to the first image identifier through an offline thread at a predetermined period;
[0046] The first configuration parameter is determined according to the first image identifier through the offline thread in the predetermined period.
[0047] Optionally, the apparatus is configured to display the first image sub-resource and the second image sub-resource in the second cache on the target terminal respectively in the following manner:
[0048] In a case where the number of request messages received from the target terminal exceeds a preset threshold, randomly selecting the first image sub-resource and the second image sub-resource from the second cache, wherein the request message is used to request verification based on the first image resource;
[0049] The selected first image sub-resource and the second image sub-resource are displayed on the target terminal respectively.
[0050] According to another aspect of an embodiment of the present disclosure, there is provided an electronic device for verifying image resources, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the image resource verification method as described above.
[0051] According to another aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned image resource verification method when running.
[0052] The technical solution provided by the embodiment of the present disclosure brings at least the following beneficial effects: by obtaining a first image identifier, wherein the first image identifier is used to obtain a first image resource from a first cache, a group of image identifiers and a group of image resources are stored in a one-to-one correspondence in the first cache, a group of image resources includes the first image resource, and a group of image identifiers includes the first image identifier, the first image resource is obtained according to the first image identifier, and a first configuration parameter is determined, wherein the first configuration parameter has a corresponding relationship with the first image resource and the first image identifier, a target operation is performed on the first image resource according to the first configuration parameter, a first image sub-resource and a second image sub-resource are obtained, and the first image sub-resource and the second image sub-resource are stored in the second cache, wherein the first image sub-resource and the second image sub-resource are used to be sent to the target The terminal performs verification, and the target operation is used to generate the first image sub-resource and the second image sub-resource respectively according to the position parameter in the first configuration parameter, and the first image sub-resource and the second image sub-resource in the second cache are respectively displayed on the target terminal, so as to obtain the verification result based on the first image sub-resource and the second image sub-resource from the target terminal, thereby achieving the goal of pre-determining the configuration parameters corresponding to the image resource, and then pulling the configuration parameters in advance according to the image identifier to process the image, and in the subsequent verification process, directly pulling the processed image for verification, so as to reduce the CPU resources occupied when there are too many verification requests, and can improve the verification efficiency of verification through image resources, and solve the technical problem of low verification performance of image resources in related technologies.
[0053] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0055] Figure 1 is a schematic diagram of an application environment of an image resource verification method according to an exemplary embodiment;
[0056] Figure 2 is a flow chart of a method for verifying an image resource according to an exemplary embodiment;
[0057] Figure 3 is a schematic diagram of an application scenario of an image resource verification method according to an exemplary embodiment;
[0058] Figure 4 is a schematic diagram of an application scenario of another method for verifying image resources according to an exemplary embodiment;
[0059] Figure 5 is a schematic diagram of an application scenario of another method for verifying image resources according to an exemplary embodiment;
[0060] Figure 6 is a schematic diagram of a second application of a method for verifying an image resource according to an exemplary embodiment;
[0061] Figure 7 is a structural diagram of an image resource verification device according to an exemplary embodiment;
[0062] Figure 8 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0063] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0064] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0065] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following interpretation:
[0066] Slide verification code:
[0067] (1) Concept: A verification code with a gap in the image filled by the user by moving a slider is called a sliding verification code.
[0068] (2) Principle: First, an image is generated, and then a piece is cut off. The cut-off part of the image is displayed on the page. Then, js (JavaScript function) is used to obtain the user's sliding distance, coordinates and other information to the background for verification. As long as the user's moving distance meets the requirements and the moving trajectory behavior detection passes, the verification is considered successful.
[0069] The present invention will be described below in conjunction with embodiments:
[0070] According to one aspect of an embodiment of the present invention, a method for verifying an image resource is provided. Optionally, in this embodiment, the method for verifying an image resource can be applied to: Figure 1 In the hardware environment composed of the server 101 and the user terminal 103 shown in FIG. Figure 1 As shown, the server 101 is connected to the terminal 103 through a network, and can be used to provide services for the user terminal or the client installed on the user terminal. The client can be a video client, an instant messaging client, a browser client, an education client, a game client, etc. A database 105 can be set on the server or independently of the server to provide data storage services for the server 101, for example, an image data storage server. The above network can include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that realize wireless communication. The user terminal 103 can be a terminal configured with an application, and can include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV and other computer devices. The above server can be a single server, or a server cluster composed of multiple servers, or a cloud server. The application 107 using the above image resource verification method is displayed through the user terminal 103 or the client installed on the server 101.
[0071] Combination Figure 1 As shown, the above-mentioned image resource verification method can be implemented on the server 101 through the following steps:
[0072] S1, acquiring a first image resource according to a first image identifier in a first cache on the server 101, and determining a first configuration parameter, wherein the first configuration parameter and the first image resource correspond to each other based on the first image identifier;
[0073] S2, performing a target operation on the first image resource according to the first configuration parameter on the server 101, obtaining a first image sub-resource and a second image sub-resource, and storing them in a second cache;
[0074] S3, sending the first image sub-resource and the second image sub-resource in the second cache to the target terminal respectively on the server 101, wherein the first image sub-resource and the second image sub-resource are used to be displayed on the target terminal to determine the verification result.
[0075] Optionally, in this embodiment, the above-mentioned verification method of the image resource may also be implemented on the terminal device 103 in a similar manner, or may be implemented asynchronously through the server 101 and the user terminal 103 .
[0076] The above is only an example and is not specifically limited in this embodiment.
[0077] Optionally, as an optional implementation, as Figure 2 As shown, the verification method of the above image resource includes:
[0078] S202, acquiring a first image resource according to a first image identifier in the first cache, and determining a first configuration parameter, wherein the first configuration parameter and the first image resource correspond to each other based on the first image identifier;
[0079] S204, performing a target operation on the first image resource according to the first configuration parameter to obtain a first image sub-resource and a second image sub-resource, and storing them in a second cache;
[0080] S206: Send the first image sub-resource and the second image sub-resource in the second cache to the target terminal respectively, wherein the first image sub-resource and the second image sub-resource are used to be displayed on the target terminal to determine the verification result.
[0081] Optionally, in this embodiment, the above-mentioned image resource verification method can be applied to the image verification process of various application scenarios such as medical care, finance, credit reporting, banking, government affairs, energy, education, security, buildings, games, transportation, Internet of Things, industry, etc., and the above-mentioned image resource verification method at least includes a sliding verification method.
[0082] Optionally, in this embodiment, the above-mentioned first image identification may include but is not limited to a parameter value for identifying an image, specifically, may include but is not limited to an image ID, an image index number, etc. The above-mentioned first cache may include but is not limited to a device for storing image resources and image identifications extracted from a database. The above-mentioned first cache stores a one-to-one correspondence between a group of image identifications and a group of image resources, which may include but is not limited to serializing the above-mentioned group of image resources to obtain a group of sequence codes corresponding to the above-mentioned group of image resources, each sequence code in a group of sequence codes is used to represent the image data corresponding to each image resource in the group of image resources. For example, the above-mentioned group of image identifications and a group of image resources may be represented by a key-value pair, wherein the key in the key-value pair is used to represent the above-mentioned image identification, and the value in the key-value pair is used to represent the above-mentioned image resource.
[0083] Optionally, in this embodiment, the first configuration parameter may include but is not limited to a plurality of position parameters, the plurality of position parameters correspond to the first image resource identifier, and different position parameters in the plurality of position parameters represent different image sub-resources.
[0084] For example, the first configuration parameter may specifically include but is not limited to the picture id, the x-coordinate of the upper left corner of the cutout (corresponding to the aforementioned first image sub-resource), the y-coordinate of the upper left corner of the cutout, the x-coordinate of the initial position of the slider (corresponding to the aforementioned second image sub-resource), the y-coordinate of the initial position of the slider, etc.
[0085] Figure 3 is a schematic diagram of an application scenario of an image resource verification method according to an exemplary embodiment. Figure 3 As shown, the first configuration parameters include at least the position parameters of the first image sub-resource in the first image resource and the position parameters of the second image sub-resource in the first image resource. Specifically, they may include but are not limited to the coordinates x1, y1 of the upper left corner of the first image sub-resource in the first image resource, and the coordinates x2, y2 of the upper left corner of the second image sub-resource in the first image resource.
[0086] Optionally, in this embodiment, the correspondence between the first configuration parameter and the first image identifier can be understood as the first configuration parameter can be determined from multiple configuration parameters based on the first image identifier. The first configuration parameter is configuration information generated in the service background operation interface, and can include but is not limited to configuring a one-key generation of a default configuration, and automatically determining different first image sub-resources and second image sub-resources for different image resources by presetting the coordinates of the image sub-resource.
[0087] For example, Figure 4 is a schematic diagram of an application scenario of an image resource verification method according to an exemplary embodiment. Figure 4 As shown, the background operation interface may include but is not limited to an entry 402 for adding image resources, a button 404 for configuring the position parameters of the first image sub-resource in the first configuration parameters, a button 406 for configuring the position parameters of the second image sub-resource in the first configuration parameters, and a button 408 for responding to interactive operations and generating the above-mentioned first configuration parameters.
[0088] S1, adding an image resource through the image resource entry 402, and reading the image identifier of the image resource;
[0089] S2, importing the position parameters of the first image sub-resource through button 404;
[0090] S3, importing the position parameters of the second image sub-resource through button 406;
[0091] S4: In response to the interactive operation, generate the first configuration parameter and store it in a database.
[0092] Optionally, in this embodiment, the target operation performed on the first image resource according to the first configuration parameter may include but is not limited to a cutout operation, a capture operation, and the like.
[0093] Optionally, in this embodiment, the first image sub-resource may include but is not limited to a base image with a shadow generated after performing a cutout operation, and the second image sub-resource may include but is not limited to a slider image generated according to the cutout operation.
[0094] Optionally, in this embodiment, the above-mentioned displaying the first image sub-resource and the second image sub-resource in the second cache on the target terminal respectively may include but is not limited to randomly selecting a first image identifier from a group of image identifiers after receiving a request message for requesting verification sent by the application, and determining the first image resource from a group of image resources according to the selected first image identifier, and determining the first image sub-resource and the second image sub-resource corresponding to the first image resource from the database, and displaying the first image sub-resource and the second image sub-resource on the display interface of the application according to the first configuration parameter; after obtaining the verification operation sent by the application, comparing the positions of the first image sub-resource and the second image sub-resource with the above-mentioned first image resource to obtain the verification result based on the first image sub-resource and the second image sub-resource from the target terminal; when the first image sub-resource and the second image sub-resource can obtain the above-mentioned first image resource after combining, it is determined that the application verification is successful; when the first image sub-resource and the second image sub-resource cannot obtain the above-mentioned first image resource after combining, it is determined that the application verification fails.
[0095] Specifically, for example, Figure 5 is a schematic diagram of an application scenario of an image resource verification method according to an exemplary embodiment. Figure 5 As shown, when the second image sub-resource is moved from (x2, y2) to (x1, y1) by a verification operation (eg, a sliding operation), it is determined that the verification result of the current verification operation is successful. Figure 6 is a schematic diagram of an application scenario of an image resource verification method according to an exemplary embodiment. Figure 6 As shown, when the second image sub-resource is moved from (x2, y2) to (x3, y1) through a verification operation (eg, a sliding operation), it is determined that the verification result of the current verification operation is a verification failure.
[0096] The above is only an example, and this embodiment does not make any specific limitation.
[0097] It should be noted that the above steps S202, S204, and S206 can be pre-executed in accordance with a predetermined period using an offline thread, and the above step S208 can be executed when the number of verification request messages received by the server exceeds a predetermined threshold. In other words, the verification code server will configure a flow control strategy. If the number of requests reaches the flow control threshold, the verification code server will randomly read the first image sub-resource and the second image sub-resource generated by the offline task from the cache and return them to the front end. The front end can display the data containing the above first image sub-resource and the second image sub-resource to the user respectively, which can avoid drawing a large number of images in real time and avoid occupying a large number of CPU resources.
[0098] According to this embodiment, by obtaining a first image identifier, wherein the first image identifier is used to obtain a first image resource from a first cache, a group of image identifiers and a group of image resources are stored in a one-to-one correspondence in the first cache, a group of image resources includes the first image resource, and a group of image identifiers includes the first image identifier, the first image resource is obtained according to the first image identifier, and a first configuration parameter is determined, wherein the first configuration parameter has a corresponding relationship with the first image resource and the first image identifier, a target operation is performed on the first image resource according to the first configuration parameter, a first image sub-resource and a second image sub-resource are obtained, and the sub-resources are stored in a second cache, wherein the first image sub-resource and the second image sub-resource are used to be sent to a target terminal for verification, and the target The operation is used to generate a first image sub-resource and a second image sub-resource respectively according to a position parameter in a first configuration parameter, and display the first image sub-resource and the second image sub-resource in a second cache on a target terminal respectively, so as to obtain a verification result based on the first image sub-resource and the second image sub-resource from the target terminal, thereby achieving a method of predetermining the configuration parameters corresponding to the image resource, and then pre-pulling the configuration parameters according to the image identifier to process the image, and in the subsequent verification process, directly pulling the processed image for verification, so as to reduce the CPU resources occupied when there are too many verification requests, and can improve the verification efficiency of verification through image resources, and solve the technical problem of low verification performance of image resources in related technologies.
[0099] In an exemplary embodiment, before acquiring the first image resource according to the first image identifier in the first cache and determining the first configuration parameter, the method further includes:
[0100] generating a set of image identifiers based on a predetermined set of image resources, and storing the set of image identifiers and the set of image resources in a one-to-one correspondence in a first data table;
[0101] The group of image resources is extracted from the first data table and stored in the first cache.
[0102] Optionally, in this embodiment, the above-mentioned acquisition of a set of image resources may include but is not limited to acquiring the above-mentioned set of image resources for verification from a system preset gallery, and may include but is not limited to storing the acquired set of image resources in a database.
[0103] Optionally, in this embodiment, the generating of a group of image identifiers may include but is not limited to assigning a corresponding digital identifier, such as an image ID, to each image resource according to the acquisition order of each image resource in the group of image resources.
[0104] Optionally, in this embodiment, the first data table may include but is not limited to corresponding each image identifier in a group of image identifiers to an image resource in a group of image resources, and storing them in the first data table in a one-to-one correspondence manner.
[0105] Optionally, in this embodiment, the above-mentioned acquisition of a set of image resources from the first data table and storage in the first cache may include but is not limited to being pre-executed by an offline thread according to a predetermined period. For example, the verification code server will start an offline scheduled task and execute it every 5 minutes. The scheduled task reads all the pictures used online from the first data table and stores the pictures in the cache. The key of the cache is the picture id and the value is the picture data.
[0106] The above is only an example, and this embodiment does not make any specific limitation.
[0107] In an exemplary embodiment, before acquiring the first image resource according to the first image identifier in the first cache and determining the first configuration parameter, the method further includes:
[0108] In response to the target interactive operation in the background operation interface, the first configuration parameters are configured and stored in the second data table, wherein the first configuration parameters include the first image identifier, the first position parameter of the first image sub-resource and the second position parameter of the second image sub-resource.
[0109] Optionally, in this embodiment, the background operation interface may include but is not limited to an interface for a staff member to manually configure the first image resource, such as Figure 4 As shown, a first image resource is added through entry 402, and first configuration parameters are configured through buttons 404 and 406 and stored in the second data table.
[0110] In an exemplary embodiment, the configuration of the first configuration parameter in response to the target interactive operation in the background operation interface and storing the configuration parameter in the second data table include:
[0111] In response to the target interaction operation, determining the first position parameter and the second position parameter, wherein the first position parameter is used to indicate a position in the first image resource where shadow processing needs to be performed, and the first position parameter includes a first horizontal coordinate and a first vertical coordinate of the first image subresource in the first image resource, and the second position parameter is used to indicate an initial position of the slider in the first image resource, and the second position parameter includes a second horizontal coordinate and a second vertical coordinate of the second image subresource in the first image resource;
[0112] The first configuration parameter is generated based on the first image identifier and the first horizontal coordinate, the first vertical coordinate, the second horizontal coordinate and the second vertical coordinate, and is stored in the second data table in an associated manner.
[0113] Optionally, in this embodiment, the first position represents the position where shadow processing needs to be performed, which is configured by the staff through the background operation interface, and the verification operation is completed by moving the slider to the first position. The second position represents the initial position of the slider, which is configured by the staff through the background operation interface, and the slider is initially displayed at this position to facilitate the user to complete the verification operation.
[0114] In an exemplary embodiment, performing a target operation on the first image resource according to the first configuration parameter to obtain a first image sub-resource and a second image sub-resource, and storing them in a second cache, includes:
[0115] Perform shadow processing on the first image resource based on the first horizontal coordinate and the first vertical coordinate to obtain the first image sub-resource;
[0116] generating the second image sub-resource based on the second horizontal coordinate and the second vertical coordinate;
[0117] The first image sub-resource and the second image sub-resource are stored in the second cache.
[0118] Optionally, in this embodiment, the shadow processing performed on the first image resource based on the first horizontal coordinate and the first vertical coordinate may include but is not limited to taking the points corresponding to the first horizontal coordinate and the first vertical coordinate as the upper left corner, upper right corner or center of the first image sub-resource, and then obtaining the first image sub-resource according to the size information configured in the background operation interface, and the generation of the second image sub-resource based on the second horizontal coordinate and the second vertical coordinate may include but is not limited to taking the points corresponding to the second horizontal coordinate and the second vertical coordinate as the upper left corner, upper right corner or center of the second image sub-resource, and then obtaining the second image sub-resource according to the size information configured in the background operation interface.
[0119] Optionally, in this embodiment, the storing of the first image sub-resource and the second image sub-resource in the second cache may be implemented including but not limited to based on a key-value pair, wherein the key is the image identifier and the value is the first image sub-resource and the second image sub-resource.
[0120] In an exemplary embodiment, acquiring the first image resource according to the first image identifier in the first cache and determining the first configuration parameter includes:
[0121] Acquiring the first image resource according to the first image identifier through an offline thread at a predetermined period;
[0122] The first configuration parameter is determined according to the first image identifier through the offline thread in the predetermined period.
[0123] Optionally, in this embodiment, the above-mentioned obtaining the first image resource according to the first image identifier and determining the first configuration parameter may include but is not limited to obtaining the first image resource according to the first image identifier in series or in parallel according to a predetermined period through an offline thread and reading the first configuration parameter according to the first image identifier according to a predetermined period through an offline thread.
[0124] In an exemplary embodiment, the displaying the first image sub-resource and the second image sub-resource in the second cache on the target terminal respectively includes:
[0125] In a case where the number of request messages received from the target terminal exceeds a preset threshold, randomly selecting the first image sub-resource and the second image sub-resource from the second cache, wherein the request message is used to request verification based on the first image resource;
[0126] The selected first image sub-resource and the second image sub-resource are displayed on the target terminal respectively.
[0127] Optionally, in this embodiment, it may include but is not limited to the staff configuring the above-mentioned preset threshold based on prior experience. When the number of request messages received within a predetermined time period exceeds the preset threshold, it is considered that there are too many target terminals that need to be verified. At this time, the first image sub-resource and the second image sub-resource are randomly selected from the second cache, and the selected first image sub-resource and the second image sub-resource are respectively displayed on the target terminal to complete quick verification and improve verification efficiency.
[0128] Figure 7 FIG. 1 is a block diagram of an image resource verification device according to an exemplary embodiment. Figure 7 The device includes an acquisition module 702, an execution module 704 and a sending module 706.
[0129] The acquisition module 702 is configured to acquire a first image resource according to a first image identifier in the first cache, and determine a first configuration parameter, wherein the first configuration parameter and the first image resource correspond to each other based on the first image identifier;
[0130] The execution module 704 is configured to perform a target operation on the first image resource according to the first configuration parameter, obtain a first image sub-resource and a second image sub-resource, and store them in a second cache;
[0131] The sending module 706 is configured to send the first image sub-resource and the second image sub-resource in the second cache to the target terminal respectively, wherein the first image sub-resource and the second image sub-resource are used to be displayed on the target terminal to determine the verification result.
[0132] In an exemplary embodiment, the apparatus is further configured to:
[0133] Before acquiring the first image resource according to the first image identifier in the first cache and determining the first configuration parameter, generating a group of image identifiers based on a predetermined group of image resources, and storing the group of image identifiers and the group of image resources in a one-to-one correspondence in a first data table;
[0134] The group of image resources is extracted from the first data table and stored in the first cache.
[0135] In an exemplary embodiment, the apparatus is further configured to:
[0136] Before obtaining the first image resource according to the first image identifier in the first cache and determining the first configuration parameters, the first configuration parameters are configured in response to the target interactive operation in the background operation interface and stored in the second data table, wherein the first configuration parameters include the first image identifier, the first position parameter of the first image sub-resource and the second position parameter of the second image sub-resource.
[0137] In an exemplary embodiment, the apparatus is used to configure the first configuration parameter in response to the target interactive operation on the background operation interface and store it in the second data table in the following manner:
[0138] In response to the target interaction operation, determining the first position parameter and the second position parameter, wherein the first position parameter is used to indicate a position in the first image resource where shadow processing needs to be performed, and the first position parameter includes a first horizontal coordinate and a first vertical coordinate of the first image subresource in the first image resource, and the second position parameter is used to indicate an initial position of the slider in the first image resource, and the second position parameter includes a second horizontal coordinate and a second vertical coordinate of the second image subresource in the first image resource;
[0139] The first configuration parameter is generated based on the first image identifier and the first horizontal coordinate, the first vertical coordinate, the second horizontal coordinate and the second vertical coordinate, and is stored in the second data table in an associated manner.
[0140] In an exemplary embodiment, the apparatus is used to perform a target operation on the first image resource according to the first configuration parameter in the following manner to obtain a first image sub-resource and a second image sub-resource, and store them in a second cache:
[0141] Perform shadow processing on the first image resource based on the first horizontal coordinate and the first vertical coordinate to obtain the first image sub-resource;
[0142] generating the second image sub-resource based on the second horizontal coordinate and the second vertical coordinate;
[0143] The first image sub-resource and the second image sub-resource are stored in the second cache.
[0144] In an exemplary embodiment, the apparatus is used to obtain a first image resource according to a first image identifier in a first cache and determine a first configuration parameter in the following manner:
[0145] Acquiring the first image resource according to the first image identifier through an offline thread at a predetermined period;
[0146] The first configuration parameter is determined according to the first image identifier through the offline thread in the predetermined period.
[0147] In an exemplary embodiment, the apparatus is configured to display the first image sub-resource and the second image sub-resource in the second cache on the target terminal respectively in the following manner:
[0148] In a case where the number of request messages received from the target terminal exceeds a preset threshold, randomly selecting the first image sub-resource and the second image sub-resource from the second cache, wherein the request message is used to request verification based on the first image resource;
[0149] The selected first image sub-resource and the second image sub-resource are displayed on the target terminal respectively.
[0150] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0151] According to another aspect of the embodiment of the present invention, an electronic device for implementing the above-mentioned image resource verification method is also provided. The electronic device may be Figure 1 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a server as an example. Figure 8 As shown, the electronic device includes a memory 802 and a processor 804. The memory 802 stores a computer program, and the processor 804 is configured to execute the steps in any of the above method embodiments through the computer program.
[0152] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0153] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0154] S1, acquiring a first image resource according to a first image identifier in a first cache, and determining a first configuration parameter, wherein the first configuration parameter and the first image resource correspond to each other based on the first image identifier;
[0155] S2, performing a target operation on the first image resource according to the first configuration parameter to obtain a first image sub-resource and a second image sub-resource, and storing them in a second cache;
[0156] S3, sending the first image sub-resource and the second image sub-resource in the second cache to the target terminal respectively, wherein the first image sub-resource and the second image sub-resource are used to be displayed on the target terminal to determine the verification result.
[0157] Optionally, in this embodiment, the processor may also be configured to perform the following steps through a computer program:
[0158] S1, acquiring a first image resource according to a first image identifier in a first cache, and determining a first configuration parameter, wherein the first configuration parameter and the first image resource correspond to each other based on the first image identifier;
[0159] S2, performing a target operation on the first image resource according to the first configuration parameter to obtain a first image sub-resource and a second image sub-resource, and storing them in a second cache;
[0160] S3, sending the first image sub-resource and the second image sub-resource in the second cache to the target terminal respectively, wherein the first image sub-resource and the second image sub-resource are used to be displayed on the target terminal to determine the verification result.
[0161] Alternatively, a person skilled in the art may understand that: Figure 8 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, and other terminal devices. Figure 8 The electronic device and the electronic equipment described above are not limited in structure. Figure 8 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 8 Different configurations are shown.
[0162] Among them, the memory 802 can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for verifying image resources in the embodiment of the present invention. The processor 804 executes various functional applications and data processing by running the software programs and modules stored in the memory 802, that is, to implement the above-mentioned method for verifying image resources. The memory 802 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 802 may further include a memory remotely located relative to the processor 804, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 802 may be specifically, but not limited to, used to store information such as historical user data. As an example, if Figure 8 As shown, the memory 802 may include, but is not limited to, the first acquisition module 602, the generation module 604, the second acquisition module 606, and the determination module 608 in the image resource verification device. In addition, other module units in the image resource verification device may also be included but are not limited to, which will not be repeated in this example.
[0163] Optionally, the transmission device 806 is used to receive or send data via a network. Specific examples of the network may include wired networks and wireless networks. In one example, the transmission device 806 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 806 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0164] In addition, the electronic device further comprises: a display 808 for displaying user data of the target service; and a connection bus 810 for connecting various module components in the electronic device.
[0165] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. Among them, the nodes may form a peer-to-peer (P2P, Peer To Peer) network, and any form of computing device, such as a server, terminal and other electronic devices, may become a node in the blockchain system by joining the peer-to-peer network.
[0166] In an exemplary embodiment, a computer program product is also provided, including a computer program / instruction, and the computer program / instruction implements the above-mentioned information transmission method when executed by a processor.
[0167] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0168] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A method for verifying an image resource, characterized in that: include: Acquire a first image resource according to a first image identifier in the first cache, and determine a first configuration parameter, wherein the first configuration parameter and the first image resource correspond to each other based on the first image identifier; Perform a target operation on the first image resource according to the first configuration parameter to obtain a first image sub-resource and a second image sub-resource, and store them in a second cache; sending the first image sub-resource and the second image sub-resource in the second cache to a target terminal respectively, wherein the first image sub-resource and the second image sub-resource are used to be displayed on the target terminal to determine a verification result; Before acquiring the first image resource according to the first image identifier in the first cache and determining the first configuration parameter, the method further includes: generating a group of image identifiers based on a predetermined group of image resources, and storing the group of image identifiers and the group of image resources in a first data table in a one-to-one correspondence; extracting the group of image resources from the first data table, and storing them in the first cache; Before acquiring the first image resource according to the first image identifier in the first cache and determining the first configuration parameter, the method further includes: configuring the first configuration parameter in response to the target interactive operation on the background operation interface, and storing it in the second data table, wherein the first configuration parameter includes the first image identifier, the first position parameter of the first image sub-resource and the second position parameter of the second image sub-resource; The first configuration parameter is configured in response to the target interactive operation in the background operation interface, and is stored in the second data table, including: in response to the target interactive operation, the first position parameter and the second position parameter are determined, wherein the first position parameter is used to indicate the position where shadow processing needs to be performed in the first image resource, the first position parameter includes the first horizontal coordinate and the first vertical coordinate of the first image sub-resource in the first image resource, and the second position parameter is used to indicate the initial position of the slider in the first image resource, and the second position parameter includes the second horizontal coordinate and the second vertical coordinate of the second image sub-resource in the first image resource; the first configuration parameter is generated based on the first image identifier and the first horizontal coordinate, the first vertical coordinate, the second horizontal coordinate and the second vertical coordinate, and is stored in the second data table in association.
2. The method according to claim 1, characterized in that The performing a target operation on the first image resource according to the first configuration parameter to obtain a first image sub-resource and a second image sub-resource, and storing them in a second cache, includes: Perform shadow processing on the first image resource based on the first horizontal coordinate and the first vertical coordinate to obtain the first image sub-resource; generating the second image sub-resource based on the second horizontal coordinate and the second vertical coordinate; The first image sub-resource and the second image sub-resource are stored in the second cache.
3. The method according to claim 1, characterized in that The acquiring the first image resource according to the first image identifier in the first cache and determining the first configuration parameter includes: Acquiring the first image resource according to the first image identifier through an offline thread at a predetermined period; The first configuration parameter is determined according to the first image identifier through the offline thread in the predetermined period.
4. The method according to claim 1, characterized in that: The displaying the first image sub-resource and the second image sub-resource in the second cache on the target terminal respectively includes: In a case where the number of request messages received from the target terminal exceeds a preset threshold, randomly selecting the first image sub-resource and the second image sub-resource from the second cache, wherein the request message is used to request verification based on the first image resource; The selected first image sub-resource and the second image sub-resource are displayed on the target terminal respectively.
5. A device for verifying image resources, characterized in that: include: an acquisition module, configured to acquire a first image resource according to a first image identifier in a first cache, and determine a first configuration parameter, wherein the first configuration parameter and the first image resource correspond to each other based on the first image identifier; an execution module, configured to perform a target operation on the first image resource according to the first configuration parameter, obtain a first image sub-resource and a second image sub-resource, and store them in a second cache; a sending module, configured to send the first image sub-resource and the second image sub-resource in the second cache to a target terminal respectively, wherein the first image sub-resource and the second image sub-resource are used to be displayed on the target terminal to determine a verification result; The device is further configured to: before acquiring the first image resource according to the first image identifier in the first cache and determining the first configuration parameter, generate a group of image identifiers based on a predetermined group of image resources, and store the group of image identifiers and the group of image resources in a first data table in a one-to-one correspondence; extract the group of image resources from the first data table, and store them in the first cache; The device is further configured to: before acquiring the first image resource according to the first image identifier in the first cache and determining the first configuration parameter, in response to the target interactive operation on the background operation interface, configure the first configuration parameter and store it in the second data table, wherein the first configuration parameter includes the first image identifier, the first position parameter of the first image sub-resource and the second position parameter of the second image sub-resource; The device is used to configure the first configuration parameter in response to a target interactive operation in a background operation interface and store it in a second data table in the following manner: in response to the target interactive operation, determine the first position parameter and the second position parameter, wherein the first position parameter is used to indicate a position in the first image resource where shadow processing needs to be performed, the first position parameter includes a first horizontal coordinate and a first vertical coordinate of the first image sub-resource in the first image resource, and the second position parameter is used to indicate an initial position of a slider in the first image resource, and the second position parameter includes a second horizontal coordinate and a second vertical coordinate of the second image sub-resource in the first image resource; generate the first configuration parameter based on the first image identifier and the first horizontal coordinate, the first vertical coordinate, the second horizontal coordinate and the second vertical coordinate, and store them in the second data table in association.
6. The device according to claim 5, characterized in that The device is used to perform a target operation on the first image resource according to the first configuration parameter in the following manner to obtain a first image sub-resource and a second image sub-resource, and store them in a second cache: Perform shadow processing on the first image resource based on the first horizontal coordinate and the first vertical coordinate to obtain the first image sub-resource; generating the second image sub-resource based on the second horizontal coordinate and the second vertical coordinate; The first image sub-resource and the second image sub-resource are stored in the second cache.
7. The device according to claim 5, characterized in that The device is used to obtain a first image resource according to a first image identifier in a first cache and determine a first configuration parameter in the following manner: Acquiring the first image resource according to the first image identifier through an offline thread at a predetermined period; The first configuration parameter is determined according to the first image identifier through the offline thread in the predetermined period.
8. The device according to claim 5, characterized in that The device is used to display the first image sub-resource and the second image sub-resource in the second cache on the target terminal respectively in the following manner: In a case where the number of request messages received from the target terminal exceeds a preset threshold, randomly selecting the first image sub-resource and the second image sub-resource from the second cache, wherein the request message is used to request verification based on the first image resource; The selected first image sub-resource and the second image sub-resource are displayed on the target terminal respectively.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the image resource verification method as claimed in any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method for verifying image resources as claimed in any one of claims 1 to 4.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for verifying the image resource according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Verification method and device, electronic device and storage medium
CN109873823A
Sliding block verification method and device, computer equipment and storage medium
CN109902470A
Sliding block verification code verification method and device, storage medium and computer equipment
CN110427746A
Safe login method and device, and medium
CN110765441A
Shared information processing method and device, related equipment and storage medium
CN111414560A
