Disclosure of Invention
The embodiment of the application provides an image generation method, an information acquisition device and electronic equipment, which are used for solving the technical problem of low security of an electronic card in the prior art.
In a first aspect, an embodiment of the present application provides an image generating method, including: in response to receiving the electronic card order, creating an activation code and key pair, wherein the activation code is used for activating the electronic card indicated by the electronic card order; encrypting the activation code by using a public key in the key pair to generate an encrypted character string; creating a target string comprising the public key and the encrypted string; and converting the target character string into a two-dimensional code, and generating an image of the electronic card displaying the two-dimensional code.
In some embodiments, after creating the activation code and key pair, the method further comprises: the use state of the activation code is set to an unused state.
In some embodiments, after generating the image of the electronic card displaying the two-dimensional code, the method further comprises: and responding to the private key acquisition request sent by the terminal equipment, acquiring the private key in the key pair, and returning the private key to the terminal equipment, wherein the private key acquisition request comprises the public key.
In some embodiments, the electronic card order is recorded with a user identifier, and the image of the electronic card is also displayed with the user identifier; and after returning the private key to the terminal device, the method further comprises: determining the use state of an activation code in response to receiving an activation request sent by a terminal device, wherein the activation request comprises a user identification and the activation code; in response to determining that the use state of the activation code is an unused state, the electronic card is activated with the activation code and the use state of the activation code is set to the used state.
In some embodiments, after determining the usage status of the electronic card, the method further comprises: and in response to determining that the use state of the activation code is the used state, returning first prompt information for indicating that the activation code is used to the terminal equipment.
In some embodiments, after determining that the usage status of the activation code is an unused status in response to determining that the activation code is in the unused status, the method further comprises: returning second prompt information to the terminal equipment, wherein the second prompt information is used for prompting a user to send feedback information; and in response to receiving the feedback information sent by the terminal equipment, updating the image of the electronic card, and sending use information to the order placing user of the electronic card, wherein the use information is used for indicating that the electronic card is activated, the use information comprises an updated image of the electronic card, and the feedback information is presented in the updated image.
In a second aspect, an embodiment of the present application provides an information acquisition method, including: scanning a two-dimensional code presented in an image of the electronic card to obtain a target character string, wherein the two-dimensional code is obtained by converting the target character string, the target character string comprises a public key and an encrypted character string, the encrypted character string is obtained by encrypting an activation code of the electronic card by the public key, and the activation code is used for activating the electronic card; extracting a public key and an encrypted character string from a target character string, sending a private key acquisition request containing the public key to a server, and receiving a private key returned by the server; and decrypting the encrypted character string by using the private key to obtain the activation code.
In some embodiments, the image also presents a user identification; and, after obtaining the activation code, the method further comprises: and sending an activation request containing the user identifier and the activation code to the server, and receiving an activation result returned by the server, wherein the activation result comprises first prompt information or second prompt information, the first prompt information is used for indicating that the activation code is used, and the second prompt information is used for prompting the user to send feedback information.
In some embodiments, when the activation result includes the second hint information, the method further includes: acquiring feedback information input by a user; and sending feedback information to the server.
In a third aspect, an embodiment of the present application provides an image generating apparatus, including: a first creation unit configured to create an activation code and a key pair in response to receiving an electronic card order, wherein the activation code is used for activating an electronic card indicated by the electronic card order; an encryption unit configured to encrypt the activation code using a public key of the key pair, generating an encrypted character string; a second creation unit configured to create a target character string including a public key and an encrypted character string; and the generating unit is configured to convert the target character string into a two-dimensional code and generate an image of the electronic card displayed with the two-dimensional code.
In some embodiments, the apparatus further comprises: and a first setting unit configured to set a use state of the activation code to an unused state.
In some embodiments, the apparatus further comprises: the first return unit is configured to acquire a private key in the key pair and return the private key to the terminal equipment in response to receiving a private key acquisition request sent by the terminal equipment, wherein the private key acquisition request comprises a public key.
In some embodiments, the electronic card order is recorded with a user identifier, and the image of the electronic card is also displayed with the user identifier; the apparatus further comprises: a determining unit configured to determine a use state of an activation code in response to receiving an activation request sent by a terminal device, wherein the activation request includes a user identification and the activation code; and a second setting unit configured to activate the electronic card with the activation code and set the use state of the activation code to the used state in response to determining that the use state of the activation code is the unused state.
In some embodiments, the apparatus further comprises: and a second return unit configured to return, to the terminal device, first hint information indicating that the activation code has been used, in response to determining that the use state of the activation code is the used state.
In some embodiments, the apparatus further comprises: the third return unit is configured to return second prompt information to the terminal equipment, wherein the second prompt information is used for prompting a user to send feedback information; and the updating unit is configured to respond to the feedback information sent by the terminal equipment, update the image of the electronic card and send use information to the order placing user of the electronic card, wherein the use information is used for indicating that the electronic card is activated, the use information comprises an updated image of the electronic card, and the feedback information is presented in the updated image.
In a fourth aspect, an embodiment of the present application provides an information acquisition apparatus, including: the electronic card comprises a scanning unit and an electronic card, wherein the scanning unit is configured to scan a two-dimensional code presented in an image of the electronic card to obtain a target character string, the two-dimensional code is obtained by converting the target character string, the target character string comprises a public key and an encryption character string, the encryption character string is obtained by encrypting an activation code of the electronic card by the public key, and the activation code is used for activating the electronic card; a first sending unit configured to extract a public key and an encrypted character string from a target character string, send a private key acquisition request containing the public key to a server, and receive a private key returned by the server; and the decryption unit is configured to decrypt the encrypted character string by using the private key to obtain the activation code.
In some embodiments, the image also presents a user identification; and, the apparatus further comprises: the second sending unit is configured to send an activation request containing a user identifier and an activation code to the server and receive an activation result returned by the server, wherein the activation result comprises first prompt information or second prompt information, the first prompt information is used for indicating that the activation code is used, and the second prompt information is used for prompting the user to send feedback information.
In some embodiments, when the activation result includes the second hint information, the apparatus further includes: an acquisition unit configured to acquire feedback information input by a user; and a third transmitting unit configured to transmit feedback information to the server.
In a fifth aspect, an embodiment of the present application provides an electronic device, where the electronic device is installed with a live broadcast application and a browser, and the terminal device includes: one or more processors; and a storage device having one or more programs stored thereon, which when executed by the one or more processors, cause the one or more processors to implement the method as in any of the embodiments of the first and second aspects described above.
In a sixth aspect, embodiments of the present application provide a computer readable medium having stored thereon a computer program which when executed by a processor implements a method as in any of the embodiments of the first and second aspects described above.
According to the image generation method, the information acquisition method, the device and the electronic equipment provided by the embodiment of the application, the activation code is encrypted, and the encrypted character string is displayed in the image of the electronic card in the form of the two-dimensional code. Therefore, the exposure of the activation code by the plain code can be effectively avoided, and the safety of the electronic card is improved.
Detailed Description
The application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be noted that, for convenience of description, only the portions related to the present application are shown in the drawings.
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
Referring to FIG. 1, a flow 100 of one embodiment of an image generation method according to the present application is shown. The image generation method may be applied to a server. The method comprises the following steps:
in response to receiving the electronic card order, an activation code and key pair is created, step 101.
In this embodiment, the execution subject of the image generation method may create an activation code and key pair in response to receiving an electronic card order. The electronic card order may be automatically generated by a user who purchases the electronic card (referred to herein as an order subscriber) after successful payment for the purchased electronic card.
Here, the electronic card order may be recorded with various information of the electronic card purchased by the order-placing user. For example, it may include, but is not limited to, the name of the electronic card, the card number, the category (e.g., electronic membership card, electronic equity card, electronic gift card, etc.), and so forth. In addition, the electronic card order can also record information such as order generation time, user identification of the ordering user, user head portrait and the like.
The electronic card is a virtual card. In contrast to physical cards, electronic cards are typically capable of being presented in the form of images. The electronic card may have the same function as the physical card. In general, existing electronic cards may include electronic membership cards, electronic equity cards, electronic gift cards, and the like. Compared with the physical card, the electronic card can save the manufacturing cost of the physical card, does not need to be carried by a user, and is convenient for the user to use.
Here, the activation code may be used to activate the electronic card indicated by the electronic card order. Each electronic card has an activation code and different electronic cards have different activation codes. In practice, the activation code may be a string of various characters (e.g., numbers, letters, symbols, etc.). Here, the creation of the activation code may be performed by randomly generating a character string of a specified length, or the like.
Here, the key pair may be created by various existing asymmetric cryptographic algorithms. For example, an RSA algorithm, MD5 (Message Digest Algorithm ), DES (Data Encryption Standard, data encryption standard) encryption algorithm, or the like may be employed.
In practice, the key pair may comprise a public key and a private key. Typically, the public key is the public part of the key pair and the private key is the non-public part. The public key may be used to encrypt various types of data (e.g., strings, digital signatures, etc.). After encrypting data with a public key, the data must be decrypted by a private key.
It should be noted that, after the key pair is created, the public key and the private key in the key pair may be stored correspondingly. Here, the key pair may be stored in the execution body or may be stored in another electronic device, and is not limited thereto.
Step 102, encrypting the activation code by using the public key in the key pair to generate an encrypted character string.
In this embodiment, the execution body may encrypt the activation code by using the public key of the key pair to generate an encrypted string by using the cryptographic algorithm (for example, RSA algorithm). In practice, after encrypting one string with a public key, another string will be generated, which is different from the string before encryption.
As an example, the activation code is the string "123456789" and the public key created is "MFwDQYJKOHvcNAQEBBQADSwSAJBAKDjjgB 8cCsYEmDwzMloRI+3p0 pphVlIyd 3MorVSyGJ4V/3C0Q1D43i4 MiiPrM/Y+nE1qB 8rp3bo IzEr8 kxYYcCAwEAAQ=". Wherein the public key can be generated by RSA algorithm. At this time, after encrypting the activation code using the public key, the following encrypted string "boTOebFdUJLnp0ld9 dculpa 7ce6HyeKeg Yem +dk05 vsdehtjmamaagp 2a26uYGwN5vES +fmknpgx// n7+8 edyq=".
Step 103, creating a target character string comprising the public key and the encrypted character string.
In this embodiment, after generating the encrypted string, the execution body may create a target string including the public key and the encrypted string. The target string may be a string of various forms, for example, a web site. In practice, the web address is typically represented by a uniform resource locator (Uniform Resource Locator, URL).
Continuing with the example above, the generated target string may be:
"https:// vip. Iqiyi. Com/luoxyzhi_ljkey = MFwwDQYJKoZIhvcNAQEBB QADSwAwSAJBAKDJjgB8 cCsYEmDwzMloRI+3p0pphVlIyd3 MorVSyGJ4V/3C0Q1D43i4 MiiPrM/Y+nE1qB8qB8kxYcCAweaAQ= code = botoebFdUJLnp0ld9 dMmulpA 7ce6HyeKeg Yem +dK05vSdTJmAAGp 2a26uYGwN5vES +fKNpGx// n7+8EDyyQ=". The character string includes the public key and the encrypted character string.
In some optional implementations of this embodiment, the target string may further include a user identifier of the subscriber. Wherein the user identification can be used to indicate and distinguish users. The user identification may be a user name, account name, etc. Here, the user identification may be obtained from the electronic card order.
Step 104, converting the target character string into a two-dimensional code, and generating an image of the electronic card displaying the two-dimensional code.
In this embodiment, the execution subject may convert the target character string into a two-dimensional code using various existing two-dimensional code generation tools or two-dimensional code generation algorithms, and generate an image of the electronic card on which the two-dimensional code is displayed.
Here, the image of the electronic card may be generated using an existing card template. The card template can comprise an arrangement area of the two-dimensional code. The execution body may scale the two-dimensional code and draw the two-dimensional code in the arrangement area, so as to generate an image of the electronic card on which the two-dimensional code is displayed.
The image of the electronic card may include other information in the electronic card order in addition to the two-dimensional code, which is not limited herein. For example, an avatar of the order subscriber, a subscriber identification, a card number of the electronic card, a name of the electronic card, an order subscriber hungry, etc. may be included.
As an example, reference may be made to fig. 2. Fig. 2 is a schematic diagram of an image of an electronic card of the present application. The generated two-dimensional code is displayed in the image of the electronic card in the schematic diagram.
In practice, after the image of the electronic card is generated, the execution subject may send the image of the electronic card to the order placing user of the electronic card order. After receiving the image of the electronic card, the ordering user can scan the two-dimensional code, and can forward or give the image to other users so that the other users enjoy the rights and interests of the electronic card.
According to the method provided by the embodiment of the application, after receiving the electronic card order, the activation code and the key pair are created, so that the activation code can be encrypted by using the public key in the key pair. Then, a target character string is created based on the public key and an encrypted character string obtained by encrypting the activation code, and the target character string is converted into a two-dimensional code, thereby generating an image of the electronic card on which the two-dimensional code is displayed. Therefore, the exposure of the activation code by the plain code can be effectively avoided, the design aesthetic feeling of the image of the electronic card is improved, and the safety of the electronic card is improved. In addition, the electronic card is presented by using a picture mode, so that convenience can be provided for circulation of the electronic card.
With further reference to fig. 3, a flow 300 of yet another embodiment of an image generation method is shown. The image generation method may be applied to a server. The flow 300 of the image generation method comprises the steps of:
in response to receiving the electronic card order, an activation code and key pair is created, step 301.
In this embodiment, the execution subject of the image generation method may create an activation code and key pair in response to receiving an electronic card order. The activation code may be used to activate the electronic card indicated by the electronic card order. The electronic card order may be recorded with a user identifier, a name of the electronic card, a card number, and category information.
Step 302, the use state of the activation code is set to an unused state.
In this embodiment, the execution body may set the use state of the activation code to the unused state. In practice, the usage status of the activation code may include an unused status and a used status. When the electronic card is not activated, the use state of the activation code is an unused state. After the electronic card has been activated, the use state of the activation code is the used state.
Step 303, encrypting the activation code by using the public key in the key pair, and generating an encrypted character string.
In this embodiment, the execution body may encrypt the activation code by using the public key in the key pair by using the cryptographic algorithm, and generate an encrypted string. In practice, after encrypting one string with a public key, another string will be generated, which is different from the string before encryption.
Step 304, a target string is created that contains the public key and the encrypted string.
In this embodiment, after generating the encrypted string, the execution body may create a target string including the public key and the encrypted string. In practice, the strings are typically represented by uniform resource locators. Here, the target character string may further include a user identifier of the subscriber. The user identification may be obtained from the electronic card order.
Step 305, converting the target character string into a two-dimensional code, and generating an image of the electronic card displaying the two-dimensional code.
In this embodiment, the execution subject may convert the target character string into a two-dimensional code using various existing two-dimensional code generation tools or two-dimensional code generation algorithms, and generate an image of the electronic card on which the two-dimensional code is displayed. In addition, the image of the electronic card may include information such as a user identifier of the subscriber, a card number of the electronic card, and a name of the electronic card, in addition to the two-dimensional code.
In practice, after the image of the electronic card is generated, the execution subject may send the image of the electronic card to the order placing user of the electronic card order. After receiving the image of the electronic card, the ordering user can scan the two-dimensional code, and can forward or give the image to other users so that the other users enjoy the rights and interests of the electronic card.
It should be noted that the operations of the step 301, the step 303 and the step 305 are substantially the same as the operations of the step 101 and the step 104, and will not be described herein.
Step 306, in response to receiving the private key obtaining request sent by the terminal device, obtaining the private key in the key pair, and returning the private key to the terminal device.
In this embodiment, in response to receiving a private key obtaining request including the public key sent by the terminal device, the executing body may obtain the private key in the key pair according to the public key, and return the private key to the terminal device.
It should be noted that the terminal device may be any device used by a user. For example, the user may be the above-described order user, or may be other users than the above-described order user.
The terminal device may be installed with a target application (e.g., a client application supporting use of the electronic card, etc.). The user can scan the two-dimensional code in the image of the electronic card through the target application. In practice, after the terminal device scans the two-dimensional code, the two-dimensional code can be identified to obtain the target character string. After the target character string is obtained, the terminal device may extract the public key and the encrypted character string from the target character string. Further, a private key acquisition request containing the public key may be sent.
It should be noted that, after the execution body returns the private key to the terminal device, the terminal device may decrypt the encrypted string using the private key. Thus, the above-described activation code can be obtained.
In step 307, the usage status of the activation code is determined in response to receiving an activation request sent by the terminal device, wherein the activation request includes the user identification and the activation code.
In this embodiment, in response to receiving an activation request sent by the terminal device, the execution body may determine a use state of the activation code. Wherein, the activation request comprises a user identification and an activation code.
It should be noted that, when creating the activation code of the electronic card order, the executing body may create an identifier for the activation code at the same time, so as to indicate the use state of the activation code. For example, when the activation code is created, the flag may be set to "0" for indicating that the use state of the activation code is unused. After the electronic card is activated, an update of the identification may be made, for example, setting the identification to "1" to indicate that the activation code has been used.
In this embodiment, since the activation request includes an activation code, the executing body may determine the usage status indicated by the identifier by searching for the identifier of the activation code. Here, when the usage status of the activation code is the used status, step 308 may be performed. When the use state of the activation code is an unused state, steps 309-311 may be performed.
In step 308, in response to determining that the usage status of the activation code is used, a first prompt message for indicating that the activation code has been used is returned to the terminal device.
In this embodiment, in response to determining that the use state of the activation code is the used state, the execution body may return the first prompt information to the terminal device. The first prompt information may be used to indicate that the activation code is used. As an example, the prompt message may contain a string "your activation code has been used".
In response to determining that the active code is in an unused state, the electronic card is activated with the active code and the active code is set to an in-use state 309.
In this embodiment, in response to determining that the use state of the activation code is an unused state, the execution body may activate the electronic card with the activation code and set the use state of the activation code to the used state. After being set to a used state, the electronic card can be used. At this time, after the other users scan the two-dimensional code in the image of the electronic card again, the user is prompted that the activation code of the electronic card is used.
Here, activating the electronic card with the activation code may be regarded as the benefit provided by activating the electronic card. As an example, if the electronic card is an electronic membership card, after the electronic card is activated, the user may be provided with the membership rights associated with the electronic card. As yet another example, if the electronic card is an electronic gift card, after activating the electronic card, the user may use the gift card to make a purchase.
And step 310, returning a second prompt message to the terminal equipment.
In this embodiment, in response to determining that the use state of the activation code is an unused state, the execution body may return the second prompt information to the terminal device. The second prompt information may be used to prompt the user to send feedback information. For example, the second prompt may include a string "may you be happy and happy with you get the electronic card rights-! Please fill in your thank you's words below.
In practice, after the terminal device presents the second prompt information, the user may input feedback information in the corresponding position according to the prompt. The feedback information may then be sent to the server.
And 311, updating the image of the electronic card in response to receiving the feedback information sent by the terminal equipment, and sending the use information to the order placing user of the electronic card order.
In this embodiment, the execution body may update the image of the electronic card in response to receiving feedback information sent by the terminal device. As an example, the feedback information may be drawn in an image of the electronic card, so that the subscriber may be informed of the feedback of the user of the electronic card. As yet another example, the two-dimensional code in the original image is no longer useful because the electronic card has been activated, and thus, the information such as the two-dimensional code in the original image may be deleted to update the original image.
As an example, reference may be made to fig. 4. Fig. 4 is a schematic diagram of an updated image of an electronic card of the present application. In the image of the electronic card in the diagram, the feedback information "you are too beautiful, thank you-! ".
After updating the image of the electronic code, the execution subject may send the usage information to the order placing user of the electronic card order. Wherein the use message may be used to indicate that the electronic card has been activated. The usage information may include updated images of the electronic card. Therefore, the order placing user of the electronic card order can know whether the electronic card is activated or not, and can know feedback of the user.
As can be seen from fig. 3, in comparison with the embodiment corresponding to fig. 1, the flow 300 of the image generation method in this embodiment involves an operation of activating the electronic card after the image of the electronic card is generated. Therefore, according to the scheme, the user does not need to manually input the activation code to activate the electronic card, and the flexibility and the rapidity of activating the electronic card are improved.
With further reference to fig. 5, a flow 500 of yet another embodiment of an information acquisition method is shown. The information acquisition method can be applied to a terminal device. The flow 500 of the information acquisition method includes the steps of:
step 501, scanning a two-dimensional code presented in an image of an electronic card to obtain a target character string.
In this embodiment, the execution subject of the information acquisition method may scan the two-dimensional code presented in the image of the electronic card to obtain the target character string. The two-dimensional code is obtained by converting the target character string. In practice, the execution body may be installed with an application suitable for the electronic card, which has two-dimensional code scanning and recognition functions. And scanning and identifying the two-dimensional code through the application to obtain the target character string corresponding to the two-dimensional code. As an example, when the electronic card is a member activation card of the video platform, the two-dimensional code may be scanned and identified by the application of the video platform, so as to obtain a target character string corresponding to the two-dimensional code.
Here, the target character string includes a public key and an encrypted character string. The encryption character string is obtained by encrypting the activation code of the electronic card by the public key. The activation code may be used to activate the electronic card.
Optionally, other information may be presented in the image in addition to the two-dimensional code. For example, a user identification may be presented. The user identification may be a user identification of the user who purchased the electronic card (which may be referred to as the order subscriber).
Step 502, extracting the public key and the encrypted character string from the target character string, sending a private key acquisition request containing the public key to the server, and receiving the private key returned by the server.
In this embodiment, the execution body may extract the public key and the encrypted string from the target string, send a private key obtaining request including the public key to a server, and receive a private key returned by the server. The server may store a private key corresponding to the public key. The private key may decrypt content encrypted with the public key.
Specifically, the execution subject may search for a number of characters before and after the public key in a character string matching manner, so that the public key may be located and extracted. For example, a string "key=", and a string "& code=", is usually provided before the public key. The execution body may find the character strings "key=" and "& code=" from the target character string, and determine the contents before the two as the public key.
It should be noted that the principle of extracting the encrypted string is basically the same as that of extracting the public key, and will not be described here again.
In step 503, the encrypted character string is decrypted by using the private key to obtain the activation code.
In this embodiment, since the encrypted string is generated by encrypting the activation code of the electronic card using the public key, the executing body may decrypt the encrypted string using the private key based on a corresponding cryptographic algorithm (e.g., RSA algorithm), thereby obtaining the activation code of the electronic card.
In some optional implementations of this embodiment, after the activation code is obtained, the execution body may send an activation request including the user identifier and the activation code to the server, and receive an activation result returned by the server. The activation result may include a first prompt message or a second prompt message. The first hint information may be used to indicate that the activation code has been used. The second prompting message may be used to prompt the user to send feedback information.
In some optional implementations of this embodiment, when the activation result includes the second prompt information, the executing body may further acquire feedback information input by the user. The feedback information may then be sent to the server. In practice, after receiving the feedback information, the server may update the image of the electronic card and send usage information to the order placing user of the electronic card. Wherein the usage message is used for indicating that the electronic card is activated, and the usage information includes an updated image of the electronic card, and the feedback information is displayed in the updated image.
According to the method provided by the embodiment of the application, the terminal equipment obtains the target character string by scanning the two-dimensional code presented in the image of the electronic card, so that the public key and the encrypted character string can be extracted from the target character string. Then, a private key acquisition request containing the public key may be sent to the server, and the private key returned by the server may be received, so that the encrypted string may be decrypted by using the private key, and the activation code may be obtained. Therefore, the activation code of the electronic card can be obtained and activated directly by scanning the two-dimensional code, so that the exposure of the activation code to the plain code can be effectively avoided, the safety of the electronic card is improved, and meanwhile, the flexibility and the rapidity of the activation of the electronic card are improved.
With further reference to fig. 6, fig. 6 is a schematic diagram of an interaction procedure of each device in the information acquisition method of the present application.
As shown in fig. 6, the terminal device may first scan the two-dimensional code presented in the image of the electronic card to obtain the target character string. Thereafter, the public key and the encrypted string may be extracted from the target string. Wherein, the image also presents the user identification.
The terminal device may then send a private key acquisition request containing the public key to the server.
The server may then return the private key to the terminal device.
The terminal device may then decrypt the encrypted string using the private key to obtain the activation code.
The terminal device may then send an activation request containing the user identification and the activation code to the server.
The server may then return the activation result to the terminal device. The activation result includes a first prompt message or a second prompt message, where the first prompt message is used to indicate that the activation code is used, and the second prompt message is used to prompt the user to send feedback information.
When the activation result includes the second prompt information, the terminal device may acquire feedback information input by the user, and send the feedback information to the server.
Then, after receiving the feedback information, the terminal device can update the image of the electronic card and send the use information to the order placing user of the electronic card order.
Therefore, the activation code of the electronic card can be obtained and activated in a mode that the terminal equipment scans the two-dimensional code, so that the exposure of the activation code to the plain code can be effectively avoided, the safety of the electronic card is improved, and meanwhile, the flexibility and the rapidity of the activation of the electronic card are improved.
With further reference to fig. 7, as an implementation of the method shown in the above figures, the present application provides an embodiment of an image generating apparatus, which corresponds to the method embodiment shown in fig. 1, and which is particularly applicable to a server.
As shown in fig. 7, an image generating apparatus 700 according to the present embodiment includes: a first creating unit 701 configured to create an activation code and a key pair in response to receiving an electronic card order, wherein the activation code is used to activate an electronic card indicated by the electronic card order; an encryption unit 702 configured to encrypt the activation code by using a public key in the key pair, and generate an encrypted character string; a second creation unit 703 configured to create a target character string including the public key and the encrypted character string; and a generating unit 704 configured to convert the target character string into a two-dimensional code and generate an image of the electronic card on which the two-dimensional code is displayed.
In some alternative implementations of the present embodiment, the apparatus may further include a first setting unit (not shown in the drawings). Wherein the first setting unit may be configured to set the use state of the activation code to an unused state.
In some alternative implementations of the present embodiment, the apparatus may further include a first return unit (not shown). The first return unit is configured to obtain a private key in the key pair in response to receiving a private key obtaining request sent by the terminal device, and return the private key to the terminal device, where the private key obtaining request includes the public key.
In some optional implementations of this embodiment, a user identifier is recorded in the electronic card order, and the user identifier is also displayed in the image of the electronic card. The apparatus may further comprise a determination unit and a second return unit (not shown in the figure). The determining unit is configured to determine a use state of the activation code in response to receiving an activation request sent by the terminal device, wherein the activation request includes the user identifier and the activation code; and a second return unit configured to return, to the terminal device, first prompt information indicating that the activation code has been used, in response to determining that the use state of the activation code is a used state.
In some alternative implementations of the present embodiment, the apparatus may further include a second setting unit (not shown in the drawings). Wherein the second setting unit may be configured to activate the electronic card with the activation code and set the use state of the activation code to the used state in response to determining that the use state of the activation code is the unused state.
In some alternative implementations of the present embodiment, the apparatus further includes a third return unit and an update unit (not shown in the figures). The third returning unit is configured to return second prompt information to the terminal device, where the second prompt information is used to prompt a user to send feedback information; and the updating unit is configured to respond to the feedback information sent by the terminal equipment, update the image of the electronic card and send use information to the order placing user of the electronic card, wherein the use information is used for indicating that the electronic card is activated, and the use information comprises an updated image of the electronic card, and the feedback information is displayed in the updated image.
The device provided in the above embodiment of the present application creates the activation code and the key pair after the first creation unit 701 receives the electronic card order, so that the encryption unit 702 can encrypt the activation code using the public key of the key pair. Then, the second creation unit 703 creates a target character string based on the public key and the encrypted character string obtained by encrypting the activation code, so that the generation unit 704 can convert the target character string into a two-dimensional code, and generate an image of the electronic card on which the two-dimensional code is displayed. Therefore, the exposure of the activation code by the plain code can be effectively avoided, the design aesthetic feeling of the image of the electronic card is improved, and the safety of the electronic card is improved. In addition, the electronic card is presented by using a picture mode, so that convenience can be provided for circulation of the electronic card.
With further reference to fig. 8, as an implementation of the method shown in the above figures, the present application provides an embodiment of an image generating apparatus, which corresponds to the method embodiment shown in fig. 5, and which is particularly applicable to a terminal device.
As shown in fig. 8, an image generating apparatus 800 according to the present embodiment includes: a scanning unit 801 configured to scan a two-dimensional code presented in an image of an electronic card to obtain a target character string, where the two-dimensional code is converted from the target character string, the target character string includes a public key and an encrypted character string, the encrypted character string is obtained by encrypting an activation code of the electronic card by the public key, the activation code is used to activate the electronic card, and a user identifier is also presented in the image; a first sending unit 802 configured to extract the public key and the encrypted string from the target string, send a private key acquisition request including the public key to a server, and receive a private key returned by the server; and a decryption unit 803 configured to decrypt the encrypted character string by using the private key, thereby obtaining the activation code.
In some alternative implementations of the present embodiment, the apparatus may further include a second transmitting unit (not shown in the figures). And the second sending unit is configured to send an activation request containing the user identifier and the activation code to the server and receive an activation result returned by the server, wherein the activation result comprises first prompt information or second prompt information, the first prompt information is used for indicating that the activation code is used, and the second prompt information is used for prompting a user to send feedback information.
In some optional implementations of this embodiment, when the activation result includes the second prompt information, the apparatus may further include an obtaining unit and a third sending unit (not shown in the figure). Wherein the acquiring unit may be configured to acquire feedback information input by a user. The third transmitting unit may be configured to transmit the feedback information to the server.
Referring now to FIG. 9, there is illustrated a schematic diagram of a computer system 900 suitable for use in implementing an electronic device of an embodiment of the present application. Fig. 9 shows only an example, and should not be construed as limiting the functionality and scope of use of the embodiments of the application.
As shown in fig. 9, the computer system 900 includes a Central Processing Unit (CPU) 901, which can execute various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 902 or a program loaded from a storage section 908 into a Random Access Memory (RAM) 903. In the RAM 903, various programs and data necessary for the operation of the system 900 are also stored. The CPU 901, ROM 902, and RAM 903 are connected to each other through a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904.
The following components are connected to the I/O interface 905: an input section 906, an output section 907, a storage section 908, and a communication section 909. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as needed. A removable medium 911 such as a semiconductor memory or the like is installed on the drive 910 as needed so that a computer program read out therefrom is installed into the storage section 908 as needed.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from the network via the communication portion 909 and/or installed from the removable medium 911. The above-described functions defined in the method of the present application are performed when the computer program is executed by a Central Processing Unit (CPU) 901. The computer readable medium according to the present application may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present application may be implemented in software or in hardware. The described units may also be provided in a processor, for example, described as: a processor includes a first creation unit, an encryption unit, a second creation and generation unit. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
As another aspect, the present application also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be present alone without being fitted into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: in response to receiving the electronic card order, creating an activation code and key pair; encrypting the activation code by using a public key in the key pair to generate an encrypted character string; creating a target string comprising the public key and the encrypted string; and converting the target character string into a two-dimensional code, and generating an image of the electronic card displaying the two-dimensional code.
Alternatively, the one or more programs, when executed by the apparatus, cause the apparatus to: scanning a two-dimensional code presented in an image of the electronic card to obtain a target character string; extracting the public key and the encrypted character string from the target character string, sending a private key acquisition request containing the public key to a server, and receiving a private key returned by the server; and decrypting the encrypted character string by using the private key to obtain the activation code.
The above description is only illustrative of the preferred embodiments of the present application and of the principles of the technology employed. It will be appreciated by persons skilled in the art that the scope of the application referred to in the present application is not limited to the specific combinations of the technical features described above, but also covers other technical features formed by any combination of the technical features described above or their equivalents without departing from the inventive concept described above. Such as the above-mentioned features and the technical features disclosed in the present application (but not limited to) having similar functions are replaced with each other.