CN114760116B - Verification method, verification device, electronic equipment and storage medium - Google Patents

Verification method, verification device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114760116B
CN114760116B CN202210333542.5A CN202210333542A CN114760116B CN 114760116 B CN114760116 B CN 114760116B CN 202210333542 A CN202210333542 A CN 202210333542A CN 114760116 B CN114760116 B CN 114760116B
Authority
CN
China
Prior art keywords
verification
picture
queue
distributed cache
local
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210333542.5A
Other languages
Chinese (zh)
Other versions
CN114760116A (en
Inventor
杜杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202210333542.5A priority Critical patent/CN114760116B/en
Publication of CN114760116A publication Critical patent/CN114760116A/en
Application granted granted Critical
Publication of CN114760116B publication Critical patent/CN114760116B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/36User authentication by graphic or iconic representation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The embodiment of the invention relates to a verification method, a verification device, electronic equipment and a storage medium, which comprise the following steps: acquiring an original picture, and processing the original picture to obtain a verification picture; distributing the verification pictures to two or more distributed cache systems, and respectively writing the storage addresses of the verification pictures in the distributed cache systems into corresponding local queues; when receiving a verification request from a client, determining the verification request flow at the current moment; determining a target queue from two or more local queues according to the verification request flow; and sending the storage address positioned at the head of the queue in the target queue to the client so that the client downloads the verification picture according to the received storage address to perform verification. Thus, high concurrency problems that may occur with a single storage system when a large number of clients download verification pictures at the same time can be avoided.

Description

Verification method, verification device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of network application, in particular to a verification method, a verification device, electronic equipment and a storage medium.
Background
At present, in order to prevent the occurrence of a blackout user, an internet company wakes up a verification center frequently, and when the user logs in an APP (Application), the authenticity of the user can be verified by a sliding verification mode. Here, the slide verification method means: and the user moves the missing part in the verification picture to the corresponding position through the drag operation, so that a complete picture is obtained.
In the prior art, the verification center uploads the verification picture to cloud storage (e.g., OSS (Operation Support Systems, operation support system)). When the verification center receives a verification request sent by the client, a verification picture is downloaded from the cloud storage and sent to the client.
As can be seen from the above description, in the prior art, each time the verification center receives a verification request sent by a client, a verification picture is downloaded from the cloud storage, which easily causes a technical problem that the cloud storage faces high concurrency when a large number of clients send verification requests at the same time.
Disclosure of Invention
In view of this, in order to solve the above-mentioned technical problem that cloud storage will face high concurrency when a large number of clients send verification requests at the same time, embodiments of the present invention provide a verification method, device, electronic apparatus, and storage medium.
In a first aspect, an embodiment of the present invention provides a verification method, including:
acquiring an original picture, and processing the original picture to obtain a verification picture;
distributing the verification pictures to two or more distributed cache systems, and respectively writing the storage addresses of the verification pictures in the distributed cache systems into corresponding local queues;
when a verification request from a client is received, determining a verification request flow value at the current moment;
determining a target queue from two or more of the local queues according to the validation request flow value;
and sending the storage address positioned at the head of the queue in the target queue to the client so that the client downloads the verification picture according to the received storage address to perform verification.
In one possible implementation, the distributing the verification picture to two or more distributed cache systems includes:
distributing the verification picture to the following two distributed cache systems: a CDN distributed cache system and a remote dictionary service Redis distributed cache system;
the determining a target queue from two or more local queues according to the verification request flow value comprises:
Comparing the verification request flow value with a preset verification request flow threshold value;
if the verification request flow value is larger than the verification request flow threshold value, determining a local queue corresponding to the CDN distributed cache system as a target queue;
and if the verification request flow value is smaller than or equal to the verification request flow threshold value, determining a local queue corresponding to the Redis distributed cache system as a target queue.
In one possible implementation manner, the obtaining an original picture, processing the original picture to obtain a verification picture includes:
acquiring two or more original picture sets, wherein the original picture sets comprise a plurality of original pictures, and different original picture sets correspond to different verification scenes;
and processing each original picture in the original picture set aiming at each original picture set to obtain a verification picture set, wherein the verification picture set comprises a plurality of verification pictures.
In one possible implementation manner, writing the storage addresses of the verification pictures in the distributed cache systems into corresponding local queues respectively includes:
For each verification picture set, a local queue is newly built in each local queue group, and one local queue group corresponds to one distributed cache system;
writing the storage addresses of a plurality of verification pictures in the verification picture set in each distributed cache system into local queues corresponding to the verification picture set in each local queue group respectively;
the determining a target queue from two or more of the local queues includes:
determining a target queue group from two or more local queue groups according to the verification request flow value;
determining a target verification scene corresponding to the verification request;
and determining a local queue corresponding to the target verification scene in the target queue group as a target queue.
In one possible implementation manner, for each of the verification picture sets, writing storage addresses of a plurality of verification pictures in the verification picture set in a local queue group corresponding to each of the distributed cache systems, where the local queue group corresponds to the verification picture set includes:
determining the priority of each verification picture in the verification picture set aiming at each verification picture set;
Sequencing a plurality of verification pictures in the verification picture set according to the order of the priority from high to low;
and writing the storage addresses corresponding to the verification pictures in the sequencing result into the local queues corresponding to the verification picture sets in sequence according to the sequence from front to back.
In one possible implementation, after the sending the storage address located at the head of the queue in the target queue to the client, the method further includes:
the sent memory address is inserted into the tail of the target queue.
In one possible implementation manner, the processing the original picture to obtain a verification picture includes:
when a preset timing task is started, the original picture is sent to a preset picture production service through Kafka information, so that the picture production service is called to process the original picture, and a verification picture is obtained.
In one possible implementation manner, before the processing the original picture to obtain the verification picture, the method further includes:
checking the obtained original picture according to a preset checking rule;
and after the verification is passed, continuing to execute the step of processing the original picture to obtain a verification picture.
In a second aspect, an embodiment of the present invention provides an authentication apparatus, including:
the processing module is used for acquiring an original picture, processing the original picture and obtaining a verification picture;
the distribution module is used for distributing the verification pictures to two or more distributed cache systems and writing the storage addresses of the verification pictures in the distributed cache systems into corresponding local queues respectively;
the first determining module is used for determining a verification request flow value at the current moment when a verification request from the client is received;
a second determining module, configured to determine a target queue from two or more local queues according to the verification request flow value;
and the sending module is used for sending the storage address positioned at the head of the queue in the target queue to the client so that the client downloads the verification picture according to the received storage address for verification.
In one possible implementation, the distribution module includes:
the first distributing sub-module is used for distributing the verification picture to the following two distributed cache systems: a CDN distributed cache system and a remote dictionary service Redis distributed cache system;
The second determining module is specifically configured to:
comparing the verification request flow value with a preset verification request flow threshold value;
if the verification request flow value is larger than the verification request flow threshold value, determining a local queue corresponding to the CDN distributed cache system as a target queue;
and if the verification request flow value is smaller than or equal to the verification request flow threshold value, determining a local queue corresponding to the Redis distributed cache system as a target queue.
In one possible embodiment, the processing module includes:
the acquisition sub-module is used for acquiring two or more original picture sets, wherein the original picture sets comprise a plurality of original pictures, and different original picture sets correspond to different verification scenes;
and the processing sub-module is used for processing each original picture in the original picture set aiming at each original picture set to obtain a verification picture set, wherein the verification picture set comprises a plurality of verification pictures.
In one possible implementation, the distribution module includes:
a new building sub-module, configured to, for each verification picture set, newly build a local queue in each local queue group, where one local queue group corresponds to one distributed cache system;
The writing sub-module is used for writing the storage addresses of the plurality of verification pictures in the verification picture set in each distributed cache system into local queues corresponding to the verification picture set in each local queue group respectively;
the second determining module is specifically configured to:
determining a target queue group from two or more local queue groups according to the verification request flow value;
determining a target verification scene corresponding to the verification request;
and determining a local queue corresponding to the target verification scene in the target queue group as a target queue.
In one possible implementation, the writing submodule is specifically configured to:
determining the priority of each verification picture in the verification picture set aiming at each verification picture set;
sequencing a plurality of verification pictures in the verification picture set according to the order of the priority from high to low;
and writing the storage addresses corresponding to the verification pictures in the sequencing result into the local queues corresponding to the verification picture sets in sequence according to the sequence from front to back.
In one possible embodiment, the apparatus further comprises:
and the inserting module is used for inserting the sent storage address into the tail of the target queue.
In one possible embodiment, the processing module includes:
and the calling sub-module is used for sending the original picture to a preset picture production service through a Kafka message when a preset timing task is started so as to call the picture production service to process the original picture and obtain a verification picture.
In one possible embodiment, the apparatus further comprises:
the verification module is used for verifying the obtained original picture according to a preset verification rule;
and the execution module is used for continuing to execute the step of processing the original picture after the verification is passed, so as to obtain the verification picture.
In a third aspect, an embodiment of the present invention provides an electronic device, including: a processor and a memory, the processor being configured to execute a verification program stored in the memory to implement the verification method of any one of the first aspects.
In a fourth aspect, an embodiment of the present invention provides a storage medium, where one or more programs are stored, where the one or more programs are executable by one or more processors to implement the verification method according to any one of the first aspects.
According to the technical scheme provided by the embodiment of the invention, the original picture is processed to obtain the verification picture, then the verification picture is distributed to two or more distributed cache systems, and the storage addresses of the verification picture in each distributed cache system are respectively written into the corresponding local queues; when receiving a verification request from a client, determining the verification request flow at the current moment; and determining a target queue from two or more local queues according to the verification request flow, and sending a storage address positioned at the head of the queue in the target queue to the client so that the client downloads a verification picture according to the received storage address to perform verification. Since the verification pictures are not stored in a single storage system but in two or more distributed cache systems, when the verification center receives the verification request of the client, one distributed cache system can be determined from the two distributed cache systems, so that the client downloads the verification pictures from the distributed cache systems. In this way, high concurrency problems that may occur with a single storage system when a large number of clients download verification pictures at the same time can be avoided.
Drawings
FIG. 1 is a schematic diagram of a system architecture according to an embodiment of the present invention;
FIG. 2 is a flowchart of an embodiment of a verification method according to an embodiment of the present invention;
FIG. 3 is a flowchart of another embodiment of a verification method according to an embodiment of the present invention;
FIG. 4 is a flowchart of an embodiment of a further verification method provided by an embodiment of the present invention;
FIG. 5 is a flowchart of an embodiment of a further verification method according to an embodiment of the present invention;
FIG. 6 is a block diagram of an embodiment of a verification device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
First, an exemplary description is made of a system architecture related to a verification method provided by an embodiment of the present invention:
Referring to fig. 1, a schematic system architecture is shown in an embodiment of the present invention.
The system architecture shown in fig. 1 includes: client 101, verification center 102, two or more distributed cache systems, only distributed cache system 103 and distributed cache system 104 are illustrated in fig. 1. Wherein, the client 101, the verification center 102, the distributed cache system 103, and the distributed cache system 104 are connected through network communication.
The client 101 may be a hardware device or software that supports a network connection to provide various network services. When the client 101 is hardware, it may be a variety of electronic devices supporting a display screen, including but not limited to a smart phone, tablet, laptop, desktop, etc., only the client 101 is illustrated in fig. 1 as a desktop computer. When the client 101 is software, it can be installed in the above-listed electronic device.
Verification center 102 may be implemented as a stand-alone server or as a cluster of servers.
The distributed cache system 103 and the distributed cache system 104 may be two disparate distributed cache systems. For example, the distributed cache system 103 is a CDN (Content Delivery Network ) distributed cache system, and the distributed cache system 104 is a dis (Remote Dictionary Server, remote dictionary service) distributed cache system.
The verification method provided by the invention is further explained with reference to the drawings in the following by using specific embodiments, and the embodiments do not limit the embodiments of the invention.
Referring to fig. 2, a flowchart of an embodiment of a verification method is provided in an embodiment of the present invention. As one example, the flow illustrated in fig. 2 may be applied to a verification center, such as verification center 102 in fig. 1. As shown in fig. 2, the process may include the steps of:
step 201, an original picture is obtained, and the original picture is processed to obtain a verification picture.
In the system architecture shown in fig. 1, a user may upload an original picture to the verification center 102 through a management background of the verification center 102, and after the verification center 102 obtains the original picture, a preset picture production service may be invoked to process the original picture to obtain the verification picture. The processing of the original picture may include, but is not limited to, the following processing operations: matting, compression, watermarking, and the like.
In an embodiment, the verification center 102 may further be provided with a timing task, where the timing task is used to scan the stored original picture at a fixed time (where the verification center 102 may first store the original picture after acquiring the original picture), and send the scanned original picture to the picture production service through Kafka (a high throughput distributed publish-subscribe messaging system) message, so as to invoke the picture production service to asynchronously process the original picture, so as to obtain the verification picture.
The stored original picture is scanned at fixed time and processed asynchronously by adopting a mode of combining a fixed-time task and a Kafka message to obtain a verification picture, and the original picture can be processed at fixed time on the premise of not affecting a main thread.
In an embodiment, after the original picture is obtained, the verification center 102 may determine a total verification request flow value corresponding to all verification requests received in a preset time period, then compare the total verification request flow value with a preset verification request flow threshold (for example, 10G), and if the total verification request flow value is greater than the verification request flow threshold, call the picture production server to perform asynchronous processing on the original picture to obtain the verification picture, where the asynchronous processing does not block the current original picture processing thread, but allows subsequent operations until other original picture processing threads complete the original picture processing, and call back to notify the thread to start performing the original picture processing task of the thread, that is, after the current original picture processing is completed, continue to process the next original picture.
If the total verification request flow value is smaller than or equal to the verification request flow threshold value, the picture production server is called to carry out synchronous processing on the original pictures to obtain verification pictures, and the synchronous processing can be carried out on a plurality of original picture processing threads at the same time, namely, a plurality of original pictures are processed at the same time. The preset time period may be a time period before the time when the original picture is acquired, for example, within 3 minutes before the original picture is acquired, which is not limited in the embodiment of the present invention.
In addition, in an embodiment, after the verification center 102 obtains the original picture, the verification center may first verify the obtained original picture according to a preset verification rule, and after the verification is passed, invoke the picture production service to process the original picture, so as to obtain the verification picture. Such checks may include, but are not limited to, the following: the original picture is checked for size, resolution, format, bit depth, size, etc.
Step 202, distributing the verification pictures to two or more distributed cache systems, and writing the storage addresses of the verification pictures in the distributed cache systems into corresponding local queues respectively.
As can be seen from the description of step 202, in the embodiment of the present invention, the verification center 102 does not merely upload the verification picture to a single storage system, but distributes the verification picture to two or more distributed cache systems. For example, in the system architecture shown in fig. 1, the verification center 102 distributes verification pictures to the distributed cache system 103 and the distributed cache system 104.
Meanwhile, in the embodiment of the present invention, a local queue is provided on the verification center 102 corresponding to each distributed cache system, and is used for storing the storage address of the verification picture in the distributed cache system. For example, in the system architecture shown in fig. 1, the verification center 102 is provided with two local queues, which respectively correspond to the distributed cache system 103 and the distributed cache system 104, and are used for storing storage addresses of the verification pictures in the distributed cache system 103 and the distributed cache system 104, respectively.
Based on this, in step 202, after the verification center 102 distributes the verification picture to two or more distributed cache systems, the storage addresses of the verification picture in the two or more distributed cache systems are written into the corresponding local queues, respectively.
Step 203, when receiving the verification request from the client, determining the verification request flow value at the current moment.
Step 204, determining a target queue from the two or more local queues according to the verification request flow value.
Step 205, the storage address at the head of the queue in the target queue is sent to the client, so that the client downloads the verification picture according to the received storage address for verification.
The following collectively describes steps 203 to 205:
as can be seen from the descriptions of steps 203 to 205, in the embodiment of the present invention, the verification center 102 downloads the verification picture from a fixed storage system each time it receives the verification request from the client, but determines one local queue from two or more local queues as the target queue, that is, determines one distributed cache system from two or more distributed cache systems, so that the client downloads the verification picture from the distributed cache system. Therefore, the technical problem that a single storage system has high concurrency when a large number of clients download verification pictures at the same time can be avoided.
In an embodiment, in a case where the two or more distributed cache systems include a CDN distributed cache system and a Redis distributed cache system, determining the specific implementation of the target queue from the two or more local queues may include: and determining a verification request flow value at the current moment, and determining a target queue from two or more local queues according to the verification request flow value.
In the embodiment of the present invention, the CDN distributed cache system may be configured to, in a verification scenario, when a request for obtaining a verification picture sent by a client is received, carry a storage address of the verification picture in the picture verification request, determine a server closest to the client from the CDN distributed cache system, and send the verification picture corresponding to the storage address in the server to the client. The Redis distributed cache system can be used for directly sending the verification picture corresponding to the storage address stored in the server to the client when receiving the verification picture acquisition request sent by the client under the verification scene.
Specifically, verification center 102 may determine a verification request flow value at a current time based on the Sentinel component, and compare the verification request flow value at the current time to a preset verification request flow threshold (e.g., 1000M). If the verification request flow value is greater than the preset verification request flow threshold, the current concurrency is higher, and the CDN distributed cache system can better cope with a high concurrency scenario, so that a local queue corresponding to the CND distributed cache system (hereinafter referred to as a CDN local queue) can be determined as a target queue; if the verification request flow value is smaller than or equal to the preset verification request flow threshold, the current concurrency is lower, and the Redis distributed cache system is enough to cope with a lower concurrency scene and has lower cost, so that a local queue corresponding to the Redis distributed cache system (hereinafter referred to as a Redis local queue) can be determined as a target queue.
Then, the verification center 102 sends the storage address at the head of the queue in the target queue to the client 101, and the client 101 can download the verification picture from the corresponding distributed cache system according to the received storage address for verification.
According to the technical scheme provided by the embodiment of the invention, the original picture is processed to obtain the verification picture, then the verification picture is distributed to two or more distributed cache systems, and the storage addresses of the verification picture in each distributed cache system are respectively written into the corresponding local queues; when receiving a verification request from a client, determining the verification request flow at the current moment; and determining a target queue from two or more local queues according to the verification request flow, and sending a storage address positioned at the head of the queue in the target queue to the client so that the client downloads a verification picture according to the received storage address to perform verification. Since the verification pictures are not stored in a single storage system but in two or more distributed cache systems, when the verification center receives the verification request of the client, one distributed cache system can be determined from the two distributed cache systems, so that the client downloads the verification pictures from the distributed cache systems. In this way, high concurrency problems that may occur with a single storage system when a large number of clients download verification pictures at the same time can be avoided.
In addition, since the verification pictures are stored in the distributed cache system, the distributed cache system is not limited by regions, and after the client receives the storage address of the verification pictures, the verification pictures can be obtained from the node closest to the client in the distributed cache system, so that the performance problems of delayed downloading of the verification pictures and the like caused by region limitation of cloud storage in the prior art are solved.
Referring to fig. 3, a flowchart of an embodiment of another verification method is provided in an embodiment of the present invention.
The flow shown in fig. 3 may include the following steps based on the flow shown in fig. 2:
step 301, two or more original picture sets are obtained, wherein the original picture sets comprise a plurality of original pictures, and different original picture sets correspond to different verification scenes.
Step 302, processing each original picture in the original picture set to obtain a verification picture set, wherein the verification picture set comprises a plurality of verification pictures.
The following collectively describes steps 301 and 302:
in the embodiment of the invention, when a user uploads an original picture, the original picture can be uploaded in the form of a picture set, each picture set can comprise a plurality of original pictures, and different picture sets can correspond to different verification scenes.
After acquiring two or more original picture sets, the verification center 102 processes each original picture in the original picture set for each original picture set, so as to obtain verification pictures corresponding to all original pictures in the original picture set, and according to the verification pictures, a verification picture set can be obtained, wherein the verification picture set can comprise a plurality of verification pictures.
Step 303, for each verification picture set, a local queue is newly built in each local queue group, where a local queue group corresponds to a distributed cache system.
As can be seen from the description of step 202, in the embodiment of the present invention, the verification center 102 does not merely upload the verification picture to a single storage system, but distributes the verification picture to two or more distributed cache systems. For example, in the system architecture shown in fig. 1, the verification center 102 distributes verification pictures to the distributed cache system 103 and the distributed cache system 104.
Meanwhile, in the embodiment of the present invention, a local queue group is provided on the verification center 102 corresponding to each distributed cache system, and each local queue group may be provided with a plurality of local queues, and each local queue may correspond to a verification picture set and be used for storing the storage address of the verification picture in each verification picture set in each distributed cache system.
For example, in the system architecture shown in fig. 1, the verification center 102 is provided with two local queue groups, where the two local queue groups correspond to the distributed cache system 103 and the distributed cache system 104, and each local queue group may be provided with a plurality of local queues, and each local queue may correspond to a verification picture set and is used to store storage addresses of verification pictures in the distributed cache system 103 and the distributed cache system 104, respectively.
Based on this, in step 303, for each verification picture set, the verification center 102 may create a local queue corresponding to the verification picture set in each local queue group.
For example, assume that a user uploads three original picture sets, and the verification scenes corresponding to the three original picture sets are respectively: a login scene, a real-name authentication scene and a rendering scene. The three original picture sets are processed by the verification center 102 as described above to obtain three verification picture sets. Continuing to assume that the two or more than two distributed cache systems include a CDN distributed cache system and a dis distributed cache system, and assuming that the CDN distributed cache system and the dis distributed cache system respectively correspond to a CDN local queue group and a dis local queue group, three local queues can be newly built in the CDN local queue group and the dis local queue group for the three verification photo sets respectively, so as to obtain a local queue detail table shown in the following table 1:
TABLE 1
Step 304, distributing a plurality of verification pictures in the verification picture set to two or more distributed cache systems, and writing the storage addresses of the verification pictures in each distributed cache system into local queues corresponding to the verification picture set in each local queue group respectively.
As can be seen from the description of step 303, a local queue group is provided in the verification center 102 corresponding to each distributed cache system, and a plurality of local queues may be provided in each local queue group, and each local queue may correspond to a verification picture set for storing the storage addresses of the verification pictures in each verification picture set in each distributed cache system.
Based on this, in step 304, after the verification center 102 distributes the plurality of verification pictures in the verification picture set to two or more distributed cache systems, the storage addresses of the verification pictures in each distributed cache system are written into the local queues corresponding to the verification picture set in each local queue group, respectively.
For example, in step 303, after processing the three original picture sets to obtain the verification picture sets, the verification pictures in the three verification picture sets may be distributed to the CDN distributed cache system and the Redis distributed cache system, respectively.
And then, the storage addresses of the verification pictures in the three verification picture sets in the CDN distributed cache system and the Redis distributed cache system are respectively written into three local queues in the CDN queue group and the Redis queue group, namely, the storage addresses of the verification pictures in the verification picture set in the login scene, the real name authentication scene and the implementation scene in the CDN distributed cache system are respectively written into the login scene local queue, the real name authentication scene local queue and the implementation scene local queue in the CDN local queue group, and the storage addresses of the login scene, the real name authentication scene and the verification pictures in the implementation scene set in the Redis distributed cache system are respectively written into the login scene local queue, the real name authentication scene local queue and the implementation scene local queue in the Redis local queue group.
In one embodiment, after obtaining the storage addresses of the plurality of verification pictures in the verification picture set in each distributed cache system, the verification center 102 may write the storage addresses into the local queues corresponding to the verification picture set in each local queue group in the following manner: firstly, determining the priority of each verification picture in each verification picture set, then sequencing a plurality of verification pictures in the verification picture set according to the sequence of the priority from high to low, and finally, sequentially writing the storage addresses corresponding to the verification pictures in the sequencing result into the local queues corresponding to the verification picture sets according to the sequence from front to back.
Optionally, the time stamps of the verification pictures in the verification picture set are acquired, and the time stamps are arranged in the order from small to large, and the smaller the time stamp is, the higher the priority of the verification picture is.
Optionally, the content of each verification picture in the verification picture set is acquired, and the priority of each verification picture is determined according to the content of the verification picture.
For example, the verification center 102 may assume that the lighter the background color of each verification picture, the higher the priority by acquiring the background color of each verification picture, the picture subject, and the text portion of the picture, assuming weights of the above three portions are W1, W2, and W3, respectively; the closer the picture subject of each verification picture is to a preset subject (for example, introduction of a certain product of a company), the higher the priority is; the fewer the text portions of each verification picture, the higher the priority. Continuing to assume that the priorities of the background color, the picture theme and the text part of each verification picture obtained by the method are P1, P2 and P3 respectively, and obtaining the priority P of each verification picture by carrying out weighted calculation according to the following formula (I).
P= p1×w1+p2×w2+p3×w3 formula (one)
Since the verification center 102 writes the storage addresses of the verification pictures in the distributed cache systems into the local queues corresponding to the verification picture sets in the local queue groups, the display strategy of the verification pictures can be more flexible according to the priority of the verification pictures in each verification picture set.
Step 305, when receiving the verification request from the client, determining the verification request flow value at the current moment.
Step 306, determining a target queue group from the two or more local queue groups according to the validation request flow value.
The following collectively describes steps 305 and 306:
as can be seen from the descriptions of step 305 and step 306, in the embodiment of the present invention, the verification center 102 downloads the verification picture from a fixed storage system each time it receives the verification request from the client, but determines one local queue group from two or more local queue groups as the target queue group, that is, determines one distributed cache system from two or more distributed cache systems, so that the client downloads the verification picture from the distributed cache system. Therefore, the technical problem that a single storage system has high concurrency when a large number of clients download verification pictures at the same time can be avoided.
In an embodiment, in the case where the two or more distributed cache systems include a CDN distributed cache system and a Redis distributed cache system, when receiving a verification request from a client, the verification center 102 may determine a verification request flow value at a current time, and determine a target queue group from two or more local queue groups according to the verification request flow value.
Specifically, verification center 102 may determine a verification request flow value at a current time based on the Sentinel component, and compare the verification request flow value at the current time to a preset verification request flow threshold (e.g., 1000M). If the verification request flow value is greater than the preset verification request flow threshold, the current concurrency is higher, and the CDN distributed cache system can better cope with a high concurrency scenario, so that a local queue group corresponding to the CND distributed cache system (hereinafter referred to as a CDN local queue group) can be determined as a target queue group; if the verification request flow value is smaller than or equal to the preset verification request flow threshold, the current concurrency is low, and the Redis distributed cache system is sufficient to cope with a low concurrency scene and has low cost, so that a local queue group corresponding to the Redis distributed cache system (hereinafter referred to as a Redis local queue) can be determined as a target queue group.
Step 307, determining a target verification scene corresponding to the verification request.
And 308, determining a local queue corresponding to the target verification scene in the target queue group as a target queue.
And 309, transmitting the storage address at the head of the queue in the target queue to the client, so that the client downloads the verification picture according to the received storage address for verification.
Step 310, inserting the transmitted storage address into the tail of the target queue.
The following is a unified description of steps 307 to 310:
it should be noted that, the verification request sent by the client 101 may carry a parameter related to a verification scenario, the verification center 102 may determine, according to the parameter, a target verification scenario corresponding to the verification request, and may determine, according to the target verification scenario, a local queue corresponding to the target verification scenario as a target queue.
For example, when the CDN queue group is determined to be the target queue group and the target verification scenario is the login scenario, the local queue named login in the CDN queue group is determined to be the target queue based on the example in step 303.
Then, the verification center 102 sends the storage address at the head of the queue in the target queue to the client 101, so that the client 101 downloads the verification picture according to the received storage address for verification.
After that, in order to make each verification picture recyclable, after the verification center 102 transmits the storage address located at the head of the queue in the target queue to the client 101, the verification center 102 may insert the transmitted storage address into the tail of the target queue.
According to the technical scheme provided by the embodiment of the invention, the verification picture set can be obtained by acquiring two or more original picture sets and processing each original picture in each original picture set; and for each verification picture set, a local queue is newly built in a local queue group corresponding to each distributed cache system, and the storage addresses of a plurality of verification pictures in the verification picture set in each distributed cache system are respectively written into the local queues corresponding to the verification picture sets in each local queue group. When a verification request from a client is received, determining a target verification scene corresponding to the verification request according to the verification request, and sending a storage address at the head of a queue in a local queue corresponding to the target verification scene in the target queue group to the client so that the client downloads a verification picture according to the storage address. In this process, since the original pictures are uploaded to the verification center in the form of picture sets, after obtaining the verification picture sets, a corresponding local queue is set for each verification picture set. When receiving the verification request from the client, the verification center can acquire a storage address from a local queue corresponding to the verification scene according to the verification request and send the storage address to the client, so that the client can acquire verification pictures corresponding to the verification scene in different verification scenes, and the verification pictures can be flexibly displayed according to a customized strategy.
Referring to fig. 4, a flowchart of an embodiment of a further verification method is provided for an embodiment of the present invention.
As shown in fig. 4, the flow may include the following:
in the embodiment of the invention, in order to realize the isolation of the service, the concept of a picture set is introduced, such as: logging in scene picture sets, moving picture sets, scene picture sets, and the like.
In actual operation, first, a user creates a picture set data table, and basic information such as a service, a name, an area (overseas/overseas) and the like related to a picture set is inserted into the picture set data table. Thereafter, the plurality of original pictures are uploaded in the new picture set. At this time, in order to adapt to different clients and models, the verification center can flexibly control and verify the size, resolution, format, bit depth, size and other contents of the original picture. The original picture may be uploaded to a storage system (e.g., OSS cloud storage) after verification is acceptable. Meanwhile, the verification center can create a meta information table, wherein the meta information table stores record information of each picture processing, and the meta information table comprises record names, picture set names, picture width and height, version information and the like.
Then, when the original picture is produced (the production refers to the process of obtaining the verification picture by processing the original picture), each picture production task can generate a version number, the rule of the version number is generated according to the timestamp, and the generated version number is updated to the version number field in the meta-information table. Thereafter, the verification center may create a meta-information detail data table, mainly comprising: key, version number, state and storage type (CDN/Redis). When the verification pictures are respectively stored in different distributed cache systems, different meta-information detail records, such as meta-information detail records of local queues corresponding to the CDN distributed cache system and the Redis distributed cache system, can be created in the data table.
The verification center then creates a timed task comprising: the meta information table is scanned at regular time according to the names of the picture sets, and useless picture sets are cleaned at regular time (in the verification picture set, the picture sets exceeding the preset time period can be regarded as useless picture sets), and the timing time can be every 5 minutes, 10 minutes, and the like, which is not limited in the embodiment of the invention.
According to the scanning result of the timing task and the meta-information detail table, aiming at the CDN distributed cache system and the Redis distributed cache system, the verification center respectively sends out two independent Kafka messages.
The picture production service of different regional clusters (e.g., beijing, shanghai, and Wuhan clusters, etc.) turns on the picture production logic after hearing the two Kafka messages, including but not limited to the following production processes: traversing all original picture addresses in a picture set library, and respectively performing logic such as matting, compression, watermarking and the like on the original pictures corresponding to the original picture addresses. And finally obtaining a verification picture set corresponding to the original picture set.
And then, the verification center respectively uploads the obtained verification picture sets to the CDN distributed cache system and the Redis distributed cache system, updates the status fields corresponding to the CDN distributed cache system and the Redis distributed cache system in the meta-information detail table into a successful status, respectively creates CDN local queue groups and Redis local queue groups, wherein each local queue group comprises a plurality of local queues corresponding to the verification picture sets, and the local queues are used for storing storage addresses of the verification picture sets in the CDN distributed cache system and the Redis distributed cache system respectively.
Finally, when the verification center receives the verification request sent by the client, the verification picture in the verification picture set may be obtained according to the flowchart shown in fig. 5, as shown in fig. 5, which is an embodiment flowchart of a further verification method provided in the embodiment of the present invention. As shown, the flow includes the following:
when the verification center receives a verification request from a client, determining a verification request flow value at the current moment, and when the verification request flow value is larger than a preset verification request flow threshold, indicating that the current concurrency is higher, wherein the CDN distributed cache system can better cope with a high concurrency scene, so that a storage address of a verification picture can be obtained from a CDN local queue group; when the verification request flow value is smaller than or equal to the preset verification request flow threshold value, the current concurrency is lower, and the Redis distributed cache system is enough to cope with a lower concurrency scene and has lower cost, so that the storage address of the verification picture can be obtained from the Redis local queue group.
When the storage address of the verification picture is obtained from the Redis local queue group, the local queues corresponding to the verification scene in the verification request in the Redis local queue group can be divided into: unused queues and used queues. When the storage address of the verification picture is not obtained from the used queue, the storage address of the verification picture is obtained from the unused queue; and if the storage address of the verification picture is acquired from the unused queue, the storage address is put into a Redis local queue, and the tail of the local queue corresponding to the verification scene in the verification request. If the storage address of any verification picture is not obtained in the Redis local queue group, the verification center obtains the storage address of the verification picture from the local queue corresponding to the verification scene in the verification request in the CDN local queue group, and sends the obtained storage address of the verification picture to the client, so that the client obtains the verification picture according to the storage address and performs verification.
According to the technical scheme provided by the embodiment of the invention, by introducing the concept of the picture set, when a user uploads an original picture, the original picture set is uploaded in the form of the picture set, and a related data table is established; then, the verification center acquires two or more original picture sets, and processes each original picture in each original picture set to obtain a verification picture set; and for each verification picture set, a local queue is newly built in a local queue group corresponding to each distributed cache system, and the storage addresses of a plurality of verification pictures in the verification picture set in each distributed cache system are respectively written into the local queues corresponding to the verification picture sets in each local queue group. When the verification center receives the verification request from the client, a target queue group can be determined from two or more local queue groups, then a target verification scene corresponding to the verification request is determined, and a storage address at the head of a queue in the local queue corresponding to the target verification scene in the target queue group is sent to the client. In this process, since the original picture is uploaded to the authentication center in the form of a picture set, when an authentication request from a client is received, a storage address of the authentication picture can be acquired from a local queue corresponding to an authentication scene in the authentication request. The client can acquire verification pictures corresponding to the verification scenes in different verification scenes, so that the verification pictures can be flexibly displayed according to the customized strategies.
Meanwhile, when the verification center receives a verification request from the client, a verification request flow value at the current moment can be determined, a target queue group is determined from two or more local queue groups according to the verification request flow value, a local queue corresponding to the target verification scene in the target queue group is determined as a target queue, and a storage address at the head of the queue in the target queue is sent to the client. In this process, since the verification center can determine the target queue group from two or more distributed storage systems according to the verification request flow value at the current time, the storage address of the verification picture is obtained, instead of storing the verification picture from a single storage system. In this way, high concurrency problems that may occur with a single storage system when a large number of clients download verification pictures at the same time can be avoided.
Fig. 6 is a block diagram of an embodiment of a verification apparatus according to an embodiment of the present invention, as shown in fig. 6, where the apparatus includes:
the processing module 61 is configured to obtain an original picture, and process the original picture to obtain a verification picture;
the distributing module 62 is configured to distribute the verification picture to two or more distributed cache systems, and write the storage addresses of the verification picture in each of the distributed cache systems into corresponding local queues respectively;
A first determining module 63, configured to determine, when receiving a verification request from a client, a verification request flow value at a current time;
a second determining module 64, configured to determine a target queue from two or more local queues according to the verification request flow value;
and the sending module 65 is configured to send a storage address located at the head of the queue in the target queue to the client, so that the client downloads the verification picture according to the received storage address for verification.
In one possible implementation, the distribution module 62 includes (not shown in the figures):
the first distributing sub-module is used for distributing the verification picture to the following two distributed cache systems: a CDN distributed cache system and a remote dictionary service Redis distributed cache system;
the second determining module 64 is specifically configured to:
comparing the verification request flow value with a preset verification request flow threshold value;
if the verification request flow value is larger than the verification request flow threshold value, determining a local queue corresponding to the CDN distributed cache system as a target queue;
and if the verification request flow value is smaller than or equal to the verification request flow threshold value, determining a local queue corresponding to the Redis distributed cache system as a target queue.
In one possible implementation, the processing module 61 comprises (not shown in the figures):
the acquisition sub-module is used for acquiring two or more original picture sets, wherein the original picture sets comprise a plurality of original pictures, and different original picture sets correspond to different verification scenes;
and the processing sub-module is used for processing each original picture in the original picture set aiming at each original picture set to obtain a verification picture set, wherein the verification picture set comprises a plurality of verification pictures.
In one possible implementation, the distribution module 62 includes (not shown in the figures):
a new building sub-module, configured to, for each verification picture set, newly build a local queue in each local queue group, where one local queue group corresponds to one distributed cache system;
the writing sub-module is used for writing the storage addresses of the plurality of verification pictures in the verification picture set in each distributed cache system into local queues corresponding to the verification picture set in each local queue group respectively;
the second determining module 64 is specifically configured to:
determining a target queue group from two or more local queue groups according to the verification request flow value;
Determining a target verification scene corresponding to the verification request;
and determining a local queue corresponding to the target verification scene in the target queue group as a target queue.
In one possible implementation, the writing submodule is specifically configured to:
determining the priority of each verification picture in the verification picture set aiming at each verification picture set;
sequencing a plurality of verification pictures in the verification picture set according to the order of the priority from high to low;
and writing the storage addresses corresponding to the verification pictures in the sequencing result into the local queues corresponding to the verification picture sets in sequence according to the sequence from front to back.
In one possible embodiment, the apparatus further comprises (not shown in the figures):
and the inserting module is used for inserting the sent storage address into the tail of the target queue.
In one possible implementation, the processing module 61 comprises (not shown in the figures):
and the calling sub-module is used for sending the original picture to a preset picture production service through a Kafka message when a preset timing task is started so as to call the picture production service to process the original picture and obtain a verification picture.
In one possible embodiment, the apparatus further comprises (not shown in the figures):
the verification module is used for verifying the obtained original picture according to a preset verification rule;
and the execution module is used for continuing to execute the step of processing the original picture after the verification is passed, so as to obtain the verification picture.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and an electronic device 700 shown in fig. 7 includes: at least one processor 701, memory 702, at least one network interface 704, and other user interfaces 703. The various components in the electronic device 700 are coupled together by a bus system 705. It is appreciated that the bus system 705 is used to enable connected communications between these components. The bus system 705 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration, the various buses are labeled as bus system 705 in fig. 7.
The user interface 703 may include, among other things, a display, a keyboard, or a pointing device (e.g., a mouse, a trackball, a touch pad, or a touch screen, etc.).
It is to be appreciated that memory 702 in embodiments of the invention may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be a Read-only memory (ROM), a programmable Read-only memory (ProgrammableROM, PROM), an erasable programmable Read-only memory (ErasablePROM, EPROM), an electrically erasable programmable Read-only memory (ElectricallyEPROM, EEPROM), or a flash memory, among others. The volatile memory may be a random access memory (RandomAccessMemory, RAM) that acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), dynamic random access memory (DynamicRAM, DRAM), synchronous dynamic random access memory (SynchronousDRAM, SDRAM), double data rate synchronous dynamic random access memory (ddr SDRAM), enhanced Synchronous Dynamic Random Access Memory (ESDRAM), synchronous link dynamic random access memory (SynchlinkDRAM, SLDRAM), and direct memory bus random access memory (DirectRambusRAM, DRRAM). The memory 702 described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
In some implementations, the memory 702 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 7021 and application programs 7022.
The operating system 7021 contains various system programs, such as a framework layer, a core library layer, a driver layer, and the like, for implementing various basic services and processing hardware-based tasks. The application programs 7022 include various application programs such as a media player (MediaPlayer), a Browser (Browser), and the like for realizing various application services. A program for implementing the method of the embodiment of the present invention may be contained in the application program 7022.
In the embodiment of the present invention, the processor 701 is configured to execute the method steps provided by the method embodiments by calling a program or an instruction stored in the memory 702, specifically, a program or an instruction stored in the application program 7022, for example, including:
acquiring an original picture, and processing the original picture to obtain a verification picture;
distributing the verification pictures to two or more distributed cache systems, and respectively writing the storage addresses of the verification pictures in the distributed cache systems into corresponding local queues;
When a verification request from a client is received, determining a verification request flow value at the current moment;
determining a target queue from two or more of the local queues according to the validation request flow value;
and sending the storage address positioned at the head of the queue in the target queue to the client so that the client downloads the verification picture according to the received storage address to perform verification.
The method disclosed in the above embodiment of the present invention may be applied to the processor 701 or implemented by the processor 701. The processor 701 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 701 or by instructions in the form of software. The processor 701 may be a general purpose processor, a digital signal processor (DigitalSignalProcessor, DSP), an application specific integrated circuit (application specific IntegratedCircuit, ASIC), an off-the-shelf programmable gate array (FieldProgrammableGateArray, FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The disclosed methods, steps, and logic blocks in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software elements in a decoding processor. The software elements may be located in a random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory 702, and the processor 701 reads information in the memory 702 and performs the steps of the method in combination with its hardware.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For a hardware implementation, the processing units may be implemented within one or more application specific integrated circuits (ApplicationSpecificIntegratedCircuits, ASIC), digital signal processors (DigitalSignalProcessing, DSP), digital signal processing devices (dspev), programmable logic devices (ProgrammableLogicDevice, PLD), field programmable gate arrays (Field-ProgrammableGateArray, FPGA), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented by means of units that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
The electronic device provided in this embodiment may be an electronic device as shown in fig. 7, and may perform all steps of the verification method as shown in fig. 2-4, so as to achieve the technical effects of the verification method as shown in fig. 2-4, and the detailed description with reference to fig. 2-4 is omitted herein for brevity.
The embodiment of the invention also provides a storage medium (computer readable storage medium). The storage medium here stores one or more programs. Wherein the storage medium may comprise volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid state disk; the memory may also comprise a combination of the above types of memories.
When one or more programs in the storage medium are executable by one or more processors, the verification method performed on the electronic device side is implemented as described above.
The processor is configured to execute an authentication program stored in the memory to implement the following steps of an authentication method executed on the electronic device side:
acquiring an original picture, and processing the original picture to obtain a verification picture;
distributing the verification pictures to two or more distributed cache systems, and respectively writing the storage addresses of the verification pictures in the distributed cache systems into corresponding local queues;
when a verification request from a client is received, determining a verification request flow value at the current moment;
Determining a target queue from two or more of the local queues according to the validation request flow value;
and sending the storage address positioned at the head of the queue in the target queue to the client so that the client downloads the verification picture according to the received storage address to perform verification.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of function in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The foregoing description of the embodiments has been provided for the purpose of illustrating the general principles of the invention, and is not meant to limit the scope of the invention, but to limit the invention to the particular embodiments, and any modifications, equivalents, improvements, etc. that fall within the spirit and principles of the invention are intended to be included within the scope of the invention.

Claims (9)

1. A method of authentication, the method comprising:
acquiring an original picture, processing the original picture to obtain a verification picture, including: acquiring two or more original picture sets, wherein the original picture sets comprise a plurality of original pictures, and different original picture sets correspond to different verification scenes; processing each original picture in the original picture set aiming at each original picture set to obtain a verification picture set, wherein the verification picture set comprises a plurality of verification pictures;
distributing the verification pictures to two or more distributed cache systems, and writing the storage addresses of the verification pictures in the distributed cache systems into corresponding local queues respectively, wherein the distributed cache systems comprise: for each verification picture set, a local queue is newly built in each local queue group, and one local queue group corresponds to one distributed cache system; writing the storage addresses of a plurality of verification pictures in the verification picture set in each distributed cache system into local queues corresponding to the verification picture set in each local queue group respectively;
When a verification request from a client is received, determining a verification request flow value at the current moment;
determining a target queue from two or more of the local queues according to the validation request flow value, comprising: determining a target queue group from two or more local queue groups according to the verification request flow value; determining a target verification scene corresponding to the verification request; determining a local queue corresponding to the target verification scene in the target queue group as a target queue;
and sending the storage address positioned at the head of the queue in the target queue to the client so that the client downloads the verification picture according to the received storage address to perform verification.
2. The method of claim 1, wherein the distributing the verification picture to two or more distributed caching systems comprises:
distributing the verification picture to the following two distributed cache systems: a CDN distributed cache system and a remote dictionary service Redis distributed cache system;
the determining a target queue from two or more local queues according to the verification request flow value comprises:
Comparing the verification request flow value with a preset verification request flow threshold value;
if the verification request flow value is larger than the verification request flow threshold value, determining a local queue corresponding to the CDN distributed cache system as a target queue;
and if the verification request flow value is smaller than or equal to the verification request flow threshold value, determining a local queue corresponding to the Redis distributed cache system as a target queue.
3. The method according to claim 1, wherein writing, for each of the verification picture sets, storage addresses of a plurality of verification pictures in the verification picture set in each of the distributed cache systems into local queue groups corresponding to each of the distributed cache systems, respectively, the local queues corresponding to the verification picture sets includes:
determining the priority of each verification picture in the verification picture set aiming at each verification picture set;
sequencing a plurality of verification pictures in the verification picture set according to the order of the priority from high to low;
and writing the storage addresses corresponding to the verification pictures in the sequencing result into the local queues corresponding to the verification picture sets in sequence according to the sequence from front to back.
4. The method of claim 1, wherein after said sending the storage address at the head of the queue in the target queue to the client, the method further comprises:
the sent memory address is inserted into the tail of the target queue.
5. The method of claim 1, wherein processing the original picture to obtain a verification picture comprises:
when a preset timing task is started, the original picture is sent to a preset picture production service through Kafka information, so that the picture production service is called to process the original picture, and a verification picture is obtained.
6. The method of claim 1, wherein prior to said processing the original picture to obtain a verification picture, the method further comprises:
checking the obtained original picture according to a preset checking rule;
and after the verification is passed, continuing to execute the step of processing the original picture to obtain a verification picture.
7. A verification device, the device comprising:
the processing module is used for acquiring an original picture, processing the original picture to obtain a verification picture, and comprises the following steps: acquiring two or more original picture sets, wherein the original picture sets comprise a plurality of original pictures, and different original picture sets correspond to different verification scenes; processing each original picture in the original picture set aiming at each original picture set to obtain a verification picture set, wherein the verification picture set comprises a plurality of verification pictures;
The distribution module is configured to distribute the verification picture to two or more distributed cache systems, and write the storage addresses of the verification picture in each distributed cache system into corresponding local queues, where the distribution module includes: for each verification picture set, a local queue is newly built in each local queue group, and one local queue group corresponds to one distributed cache system; writing the storage addresses of a plurality of verification pictures in the verification picture set in each distributed cache system into local queues corresponding to the verification picture set in each local queue group respectively;
the first determining module is used for determining a verification request flow value at the current moment when a verification request from the client is received;
a second determining module, configured to determine a target queue from two or more local queues according to the verification request flow value, including: determining a target queue group from two or more local queue groups according to the verification request flow value; determining a target verification scene corresponding to the verification request; determining a local queue corresponding to the target verification scene in the target queue group as a target queue;
And the sending module is used for sending the storage address positioned at the head of the queue in the target queue to the client so that the client downloads the verification picture according to the received storage address for verification.
8. An electronic device, comprising: a processor and a memory, the processor being configured to execute a verification program stored in the memory to implement the verification method of any one of claims 1 to 6.
9. A storage medium storing one or more programs executable by one or more processors to implement the authentication method of any one of claims 1-6.
CN202210333542.5A 2022-03-30 2022-03-30 Verification method, verification device, electronic equipment and storage medium Active CN114760116B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210333542.5A CN114760116B (en) 2022-03-30 2022-03-30 Verification method, verification device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210333542.5A CN114760116B (en) 2022-03-30 2022-03-30 Verification method, verification device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114760116A CN114760116A (en) 2022-07-15
CN114760116B true CN114760116B (en) 2024-04-12

Family

ID=82328616

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210333542.5A Active CN114760116B (en) 2022-03-30 2022-03-30 Verification method, verification device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114760116B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104092702A (en) * 2014-07-22 2014-10-08 北京京东尚科信息技术有限公司 Network security verification method and system for distributed system
WO2016179894A1 (en) * 2015-05-12 2016-11-17 网宿科技股份有限公司 Cdn-based content management system
CN109995866A (en) * 2019-04-03 2019-07-09 深圳市网心科技有限公司 Distributed document method of calibration, device, computer installation and storage medium
WO2019242638A1 (en) * 2018-06-20 2019-12-26 华为技术有限公司 Load balancing method and device
CN111262892A (en) * 2018-11-30 2020-06-09 北京图森智途科技有限公司 Multi-ROS service discovery system
CN111865920A (en) * 2020-06-18 2020-10-30 多加网络科技(北京)有限公司 Gateway authentication and identity authentication platform and method thereof
CN112711730A (en) * 2021-01-21 2021-04-27 上海观察者信息技术有限公司 Data caching method and device, storage medium and electronic equipment
CN112748879A (en) * 2020-12-30 2021-05-04 中科曙光国际信息产业有限公司 Data acquisition method, system, device, computer equipment and storage medium
CN112764948A (en) * 2021-01-22 2021-05-07 土巴兔集团股份有限公司 Data transmission method, data transmission device, computer device, and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102006163B (en) * 2009-09-01 2014-04-23 阿里巴巴集团控股有限公司 User authentication method, device and server

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104092702A (en) * 2014-07-22 2014-10-08 北京京东尚科信息技术有限公司 Network security verification method and system for distributed system
WO2016179894A1 (en) * 2015-05-12 2016-11-17 网宿科技股份有限公司 Cdn-based content management system
WO2019242638A1 (en) * 2018-06-20 2019-12-26 华为技术有限公司 Load balancing method and device
CN111262892A (en) * 2018-11-30 2020-06-09 北京图森智途科技有限公司 Multi-ROS service discovery system
CN109995866A (en) * 2019-04-03 2019-07-09 深圳市网心科技有限公司 Distributed document method of calibration, device, computer installation and storage medium
CN111865920A (en) * 2020-06-18 2020-10-30 多加网络科技(北京)有限公司 Gateway authentication and identity authentication platform and method thereof
CN112748879A (en) * 2020-12-30 2021-05-04 中科曙光国际信息产业有限公司 Data acquisition method, system, device, computer equipment and storage medium
CN112711730A (en) * 2021-01-21 2021-04-27 上海观察者信息技术有限公司 Data caching method and device, storage medium and electronic equipment
CN112764948A (en) * 2021-01-22 2021-05-07 土巴兔集团股份有限公司 Data transmission method, data transmission device, computer device, and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于缓存的分布式统一身份认证优化机制研究;杨冬菊;冯凯;;计算机科学(第03期);全文 *
面向分布式缓存系统的无线资源管理:动机、挑战与方法;王莉;冯志勇;张平;;电信科学(第03期);全文 *

Also Published As

Publication number Publication date
CN114760116A (en) 2022-07-15

Similar Documents

Publication Publication Date Title
CN101656751B (en) Method and system for accelerating file uploading and downloading
US9560165B2 (en) BT offline data download system and method, and computer storage medium
CN108512814B (en) Media data processing method, device and system
US9906626B2 (en) Resource demand-based network page generation
CN112118315A (en) Data processing system, method, device, electronic equipment and storage medium
CN113452774B (en) Message pushing method, device, equipment and storage medium
US9836516B2 (en) Parallel scanners for log based replication
WO2022095528A1 (en) Video playback method and apparatus, device, and readable storage medium
CN110196843B (en) File distribution method based on container cluster and container cluster
CN111031135B (en) Message transmission method and device and electronic equipment
CN112286723A (en) Computer room disaster recovery control method, terminal and storage medium
CN110781149A (en) Method, device, equipment and storage medium for managing live broadcast room information
CN111694791A (en) Data access method and device in distributed basic framework
CN109040263B (en) Service processing method and device based on distributed system
US9313273B2 (en) Pull-configured distribution of imagery
CN110225399B (en) Streaming media processing method and device, computer equipment and storage medium
CN114760116B (en) Verification method, verification device, electronic equipment and storage medium
CN111327680A (en) Authentication data synchronization method, device, system, computer equipment and storage medium
CN111475315A (en) Server and subscription notification push control and execution method
CN117331576A (en) Application pre-download method, device, computer and storage medium
CN111090818A (en) Resource management method, resource management system, server, and computer storage medium
CN104580276B (en) Information-pushing method, device, system and information access device
CN113726838B (en) File transmission method, device, equipment and storage medium
CN116107710A (en) Method, apparatus, device and medium for processing offline rendering tasks
US20220365959A1 (en) Multimedia file storage and access method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant