Riding code generation method and device, electronic equipment and storage medium
By saving multiple ride code certificates on electronic devices and determining whether to generate ride codes based on the validity period of the certificate and the network status of the device, the problem of expired certificates and poor network environment caused by users not using the ride APP for a long time is solved, and the function of generating ride codes is realized while the network is disconnected is improved, which improves the user experience.
Patent Information
- Application Number
- CN202411873017.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-11
AI Technical Summary
In the prior art, when a user has not used the ride APP for a long time, the ride code certificate expires and cannot generate the ride code. The mobile network environment in the subway station is poor, making it difficult for the user equipment to connect to the backend server to obtain the new certificate, resulting in the inability to generate the code to ride the car.
By saving the first passenger code certificate and the second passenger code certificate on the electronic device, it is determined whether the passenger code is generated based on the validity period of the first passenger code certificate and the disconnection of the electronic device. If the first passenger code certificate expires and the equipment is disconnected from the network, the second passenger code certificate is used to generate the passenger code.
When the first passenger code certificate expires and the electronic equipment is disconnected from the network, it is possible to generate a passenger code based on the second passenger code certificate, which improves the user's riding experience.
Smart Images

Figure CN119808815A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of public transportation technology, and specifically to a method, device, electronic device and storage medium for generating a boarding code. Background Art
[0002] When we take the subway, we can use the boarding code as a ticket carrier to ride. Usually, the boarding code consists of two parts of data, the user's local device data and the boarding code certificate obtained by the user's local device from the background server when connected to the Internet.
[0003] Currently, the boarding code supports offline generation. Users can open the boarding APP to generate the boarding code for boarding even without network. However, the boarding code certificate has a validity period limit and will expire about 3 to 4 days after the boarding code certificate is issued. When the user has not used the boarding APP for a long time, the boarding code certificate has expired and the boarding code cannot be generated. In addition, due to the poor mobile network environment in the subway station, the user's local device may not be able to connect to the background server normally to obtain a new boarding code certificate, resulting in the inability to generate a code for boarding. Summary of the invention
[0004] In order to solve the technical problem in the prior art that when a user has not used the ride APP for a long time, the ride code certificate has expired and the ride code cannot be generated, and due to the poor mobile network environment in the subway station, the user's local device is easily unable to connect to the background server normally to obtain a new ride code certificate, resulting in an inability to generate a code for riding, the embodiments of the present invention provide a ride code generation method, device, electronic device and storage medium.
[0005] In a first aspect, an embodiment of the present invention provides a method for generating a boarding code, which is applied to an electronic device side, comprising:
[0006] The electronic device acquires target operation information, where the target operation information is used to instruct the generation of a boarding code;
[0007] In response to the target operation information, a boarding code is generated based on the validity period of the first boarding code certificate saved on the electronic device, the offline working condition of the electronic device and the second boarding code certificate saved on the electronic device, the validity period of the first boarding code certificate is less than the validity period of the second boarding code certificate.
[0008] In a possible implementation, in response to the target operation information, generating a boarding code according to the validity period of the first boarding code certificate stored on the electronic device, the disconnected working condition of the electronic device, and the second boarding code certificate stored on the electronic device includes:
[0009] In response to the target operation information, determining whether the validity period of the first boarding code certificate is invalid;
[0010] If the validity period of the first boarding code certificate has expired, determining whether the network disconnection condition of the electronic device has occurred;
[0011] If the electronic device is disconnected from the Internet, a boarding code is generated based on the second boarding code certificate.
[0012] In a possible implementation, the step of generating a boarding code according to the second boarding code certificate includes:
[0013] Determine whether the number of times the boarding code generated according to the second boarding code certificate is generated within a first preset time range is greater than a preset frequency threshold;
[0014] If it is less than or equal to the preset frequency threshold, the boarding code is generated according to the second boarding code certificate; otherwise, the boarding code is not generated.
[0015] In a possible implementation, the method further includes:
[0016] When the second boarding code certificate expires, determining whether the number of times the second boarding code certificate is obtained within a second preset time range is greater than a preset number threshold, and the second preset time range is less than the validity period of the second boarding code certificate;
[0017] If it is less than or equal to the preset number threshold, a download message is generated, and the download message is used to send it to the server, so that the server sends a second boarding code certificate to the electronic device;
[0018] Obtain the second boarding code certificate.
[0019] In a possible implementation, the method further includes:
[0020] In the case where the validity period of the first boarding code certificate is determined to be valid, if it is determined that the remaining time of the first boarding code certificate is greater than a first preset threshold of the validity period of the first boarding code certificate, a first prompt information is generated, and the first prompt information is used to prompt the user that the boarding code status is normal;
[0021] When it is determined that the validity period of the first boarding code certificate is valid, if it is determined that the remaining time of the first boarding code certificate is greater than the second preset threshold of the validity period of the first boarding code certificate, a second prompt message and an update button are generated, and the second prompt message is used to prompt the user of the boarding code status warning, and the update button is used for the user to update the first boarding code certificate, and the second preset threshold is less than the first preset threshold.
[0022] In a possible implementation, the method further includes:
[0023] When the boarding code is generated based on the second boarding code certificate, a third prompt information is generated, and the third prompt information is used to prompt the user that the boarding code status is urgent, and that the boarding code has been switched to be generated using the second boarding code certificate, and is used to prompt the user the number of times the boarding code can be used.
[0024] In a possible implementation, the method further includes:
[0025] If the number of times the boarding code is generated within the first preset time range is greater than the preset frequency threshold, a fourth prompt message is generated. The fourth prompt message is used to prompt the user that the code generation failed and to prompt the user that the electronic device needs to reconnect to the network to generate the boarding code.
[0026] In a second aspect, an embodiment of the present invention provides a device for generating a boarding code, which is applied to an electronic device, and includes:
[0027] An acquisition unit, used for acquiring target operation information, wherein the target operation information is used for instructing to generate a boarding code;
[0028] A generation unit is used to generate a boarding code in response to the target operation information based on the validity period of a first boarding code certificate stored on the electronic device, the offline working condition of the electronic device and the second boarding code certificate stored on the electronic device, wherein the validity period of the first boarding code certificate is less than the validity period of the second boarding code certificate.
[0029] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0030] A memory and a processor, wherein the processor and the memory communicate with each other via a bus; the memory stores program instructions executable by the processor, and the processor calls the program instructions to execute the method described in the first aspect and each step in various possible implementations.
[0031] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect and each step in various possible implementations.
[0032] In a fifth aspect, an embodiment of the present invention provides a computer program product comprising instructions, and when the computer program product is run on a computer, each step in the method described in the first aspect and its various possible implementations is executed by the computer.
[0033] The embodiments of the present invention disclose the following technical effects:
[0034] The embodiment of the present invention realizes that when the validity period of the first boarding code certificate has expired, if the electronic device has been disconnected from the Internet, a boarding code can be generated based on the second boarding code certificate, thereby obtaining a better user experience.
[0035] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0037] Figure 1 A schematic diagram of a flow chart of a method for generating a boarding code provided by an embodiment of the present invention;
[0038] Figure 2a A schematic diagram showing first prompt information provided by an embodiment of the present invention;
[0039] Figure 2b A schematic diagram of a boarding code generated according to a first boarding code certificate provided in an embodiment of the present invention;
[0040] Figure 3a A schematic diagram showing second prompt information provided by an embodiment of the present invention;
[0041] Figure 3b Another schematic diagram of a boarding code generated according to the first boarding code certificate provided in an embodiment of the present invention;
[0042] Figure 4a A schematic diagram showing third prompt information provided by an embodiment of the present invention;
[0043] Figure 4b A schematic diagram of a boarding code generated according to a second boarding code certificate provided in an embodiment of the present invention;
[0044] Figure 5 A schematic diagram showing fourth prompt information provided by an embodiment of the present invention;
[0045] Figure 6 A schematic block diagram of a device for generating a boarding code according to an embodiment of the present invention;
[0046] Figure 7 A schematic block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0049] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0050] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if determining" or "if monitoring (stated condition or event)" may be interpreted as "when determining" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0051] At present, the boarding code supports offline generation. Users can also open the boarding APP without network access and generate a boarding code for boarding based on the user's local device data and the boarding code certificate (in order to better distinguish, the boarding code certificate is called the first boarding code certificate). However, the first boarding code certificate has a validity period limit, and it will expire about 3 to 4 days after the first boarding code certificate is issued. When the user has not used the boarding APP for a long time, the first boarding code certificate has expired and the boarding code cannot be generated. Due to the poor mobile network environment in the subway station, the user device may not be able to connect to the background server normally to obtain a new first boarding code certificate, resulting in the inability to generate a code for boarding. It should be noted that the boarding code can be a boarding code for public transportation, such as a boarding code for the subway.
[0052] In view of this, an embodiment of the present invention provides a method for generating a boarding code. Figure 1The present invention provides a flow chart of a method for generating a boarding code, which can be executed by an electronic device. The electronic device, i.e., the aforementioned user local device, may include but is not limited to a mobile phone, a tablet computer, a laptop computer, a personal digital assistant, etc. Figure 1 As shown in , the method may include the following steps:
[0053] Step 101: Obtain target operation information, where the target operation information is used to instruct the generation of a boarding code.
[0054] Step 102: In response to the target operation information, a boarding code is generated according to the validity period of the first boarding code certificate stored on the electronic device, the offline working condition of the electronic device and the second boarding code certificate stored on the electronic device, wherein the validity period of the first boarding code certificate is less than the validity period of the second boarding code certificate.
[0055] The following describes in detail each step in the above process and the effects that can be further produced in combination with the embodiments of the present invention. It should be noted that the "first" and "second" involved in the embodiments of the present invention do not have restrictions on size, order and quantity, and are only used to distinguish them in name. For example, "first boarding code certificate" and "second boarding code certificate" are used to distinguish two different boarding code certificates.
[0056] First, the above step 101, i.e., "obtaining target operation information, where the target operation information is used to indicate the generation of a boarding code" is described in detail in conjunction with an embodiment of the present invention.
[0057] In an embodiment of the present invention, the target operation information is information indicating the generation of a boarding code. In one example, after a user clicks on a boarding APP on an electronic device, the electronic device will obtain the user's click operation, open the boarding APP, and directly generate a boarding code. In another example, after a user clicks on a boarding APP on an electronic device, the electronic device will obtain the user's click operation and open the boarding APP. At this time, the user needs to click on the Generate Boarding Code button on the boarding APP interface to generate the boarding code. The target operation information is the user's click operation on the boarding APP on the electronic device, or the click operation on the Generate Boarding Code button.
[0058] The above step 102, i.e., "in response to target operation information, generating a boarding code according to the validity period of a first boarding code certificate stored on an electronic device, the disconnected working condition of the electronic device and a second boarding code certificate stored on the electronic device, wherein the validity period of the first boarding code certificate is less than the validity period of the second boarding code certificate" is described in detail below in conjunction with an embodiment of the present invention.
[0059] It should be noted that before executing step 102, the first boarding code certificate and the second boarding code certificate have been downloaded to the boarding APP on the electronic device for storage. It is understandable that the first boarding code certificate and the second boarding code certificate can be downloaded to the boarding APP on the electronic device for storage at the same time, for example, when the boarding APP is used for the first time, the first boarding code certificate and the second boarding code certificate are downloaded at the same time; they can also be downloaded separately to the boarding APP on the electronic device for storage, for example, when the first boarding code certificate is detected to be invalid, the first boarding code certificate is downloaded; when the second boarding code certificate is invalid, the second boarding code certificate is downloaded. Since the validity period of the first boarding code certificate and the second boarding code certificate are different, the expiration time is different. When the certificate download is triggered by the expiration, they can be downloaded separately. When the validity period of the first boarding code certificate (for example, 3 days) has expired, the second boarding code certificate will be used to generate the boarding code. Since the validity period of the second boarding code certificate is extremely long, for example, 1 year, the user can use the second boarding code certificate to generate the code for boarding as long as he has used the boarding APP within the validity period of the second boarding code certificate. In some embodiments, when the validity period (e.g., 3 days) of the first boarding code certificate has expired and there are no other available boarding code certificates, the second boarding code certificate will be used to generate the boarding code. Since the validity period of the second boarding code certificate is extremely long, such as 1 year, the user can use the second boarding code certificate to generate a code for boarding as long as he has used the boarding APP within the validity period of the second boarding code certificate. Other available boarding code certificates can be the third boarding code certificate generated by the backup server when the background server used to generate the first boarding code fails. It can be called an emergency certificate, and the boarding code generated by it can be called an emergency code.
[0060] It should also be noted that, in the embodiment of the present invention, the first boarding code certificate is a common certificate, and the second boarding code certificate is an emergency certificate. The validity period of the first boarding code certificate is shorter than the validity period of the second boarding code certificate.
[0061] In an embodiment of the present invention, in response to the target operation information, it is determined whether to generate a boarding code based on the validity period of the first boarding code certificate stored on the electronic device, the network disconnection condition of the electronic device, and the second boarding code certificate stored on the electronic device. Among them, the network disconnection condition of the electronic device is used to characterize the network disconnection condition of the electronic device on which this application is installed, that is, the network disconnection condition between this application and the background server. This application is used to implement the boarding code generation method, such as the aforementioned boarding APP. The network disconnection condition includes but is not limited to two situations. The first situation is that there is no network, and the first boarding code certificate (i.e., ordinary certificate) cannot be obtained from the server. The second situation is that the server fails and there is no response, and the first boarding code certificate (i.e., ordinary certificate) cannot be obtained from the server.
[0062] Specifically, as a possible implementation method, in response to the target operation information, it is determined whether the validity period of the first boarding code certificate has expired; if the validity period of the first boarding code certificate has expired, it is determined whether the network disconnection condition of the electronic device has occurred; if the network disconnection condition of the electronic device has occurred (for example, the electronic device is not connected to the network), the boarding code is generated according to the second boarding code certificate. That is to say, in an embodiment of the present invention, the prerequisite for generating the boarding code is that the validity period of the first boarding code certificate has expired and the network disconnection condition of the electronic device has occurred. Exemplarily, in response to the user's click operation on the boarding APP on the electronic device, if the validity period of the first boarding code certificate has expired and the network disconnection condition of the electronic device has occurred, the boarding code is generated according to the second boarding code certificate. It can be seen that the embodiment of the present invention realizes that when the validity period of the first boarding code certificate has expired, if the network disconnection condition of the electronic device has occurred, the boarding code can be generated according to the second boarding code certificate to obtain a better user experience.
[0063] As a possible implementation method, the specific method of generating a boarding code according to the second boarding code certificate is as follows: determine whether the number of times the boarding code generated according to the second boarding code certificate is generated within the first preset time range is greater than the preset frequency threshold; if it is less than or equal to the preset frequency threshold, generate a boarding code according to the second boarding code certificate. Exemplarily, the preset frequency threshold is 2 times. If the boarding code is generated once within the first preset time range, which is less than the preset frequency threshold of 2 times, the boarding code can be generated again according to the second boarding code certificate. It can be seen that the second boarding code certificate has a lower limit on the number of uses. In one example, only two boarding codes are allowed to be generated according to the second boarding code certificate for entry and exit. The first preset time range can be within the day or other time ranges, but it needs to be less than the validity period of the second boarding code certificate.
[0064] As a possible implementation method, in an embodiment of the present invention, when the second boarding code certificate expires (expiration here means that the number of times the boarding code generated based on the second boarding code certificate is generated within the first preset time range is greater than the preset frequency threshold), it is determined whether the number of times the second boarding code certificate is obtained within the second preset time range is greater than the preset number threshold, and the second preset time range is less than the validity period of the second boarding code certificate; if it is less than or equal to the preset number threshold, download information is generated, and the download information is used to send to the server, so that the server sends the second boarding code certificate to the electronic device; the second boarding code certificate is obtained.
[0065] It should be noted that, in the embodiment of the present invention, the total number of ride codes that can be generated = the number of ride codes that can be generated by a second ride code certificate × the number of second ride code certificates. If a person takes a lot of rides, or even spreads his ride code to many people, but the payment channel bound to this person does not have enough money, it will cause financial losses to the ticketing (such as subway ticketing). Therefore, the number of times the ride code is generated according to the second ride code certificate within the first preset time range is limited to be less than or equal to the preset frequency threshold, and the ride code is generated according to the second ride code certificate. Exemplarily, the preset frequency threshold is M, and M is an integer greater than or equal to 1. That is to say, the number of ride codes that can be generated by a second ride code certificate within the first preset time range is M+1. After that, the second ride code certificate becomes invalid, that is, it is invalidated, and the ride code can no longer be generated according to it. And the number of times the second ride code certificate is obtained within the second preset time range is limited to be less than or equal to the preset number threshold, and the second ride code certificate is obtained. The second preset time range can be within the same day or other time ranges, but it needs to be less than the validity period of the second boarding code certificate. Exemplarily, the preset number threshold is N, where N is an integer greater than or equal to 1. In other words, the number of second boarding code certificates that can be obtained is N+1. Therefore, the total number of boarding codes that can be generated = (M+1)×(N+1).
[0066] As a possible implementation method, in order to provide a better user experience and reduce the frequency of using the second boarding code certificate, the boarding APP adds a detection of the validity period of the first boarding code certificate and a corresponding user prompt. Specifically, when it is determined that the validity period of the first boarding code certificate is valid, if it is determined that the remaining time of the first boarding code certificate is greater than the first preset threshold of the validity period of the first boarding code certificate, a first prompt message is generated, and the first prompt message is used to prompt the user that the boarding code status is normal (such as Figure 2a It should be noted that when it is determined that the remaining time of the first boarding code certificate is greater than the first preset threshold of the validity period of the first boarding code certificate, the boarding code generated according to the first boarding code certificate is as follows: Figure 2b As shown. Figure 2b The right side of the interface shown shows a normal boarding code icon. If the validity period of the first boarding code certificate is determined to be valid, if the remaining time of the first boarding code certificate is determined to be greater than the second preset threshold of the validity period of the first boarding code certificate, a second prompt message and an update button are generated. The second prompt message is used to prompt the user to issue a boarding code status warning (such as Figure 3a As shown in the figure, the update button is used for the user to update the first boarding code certificate, and the second preset threshold is less than the first preset threshold. For example, the first preset threshold is 2 / 3, and the second preset threshold is 1 / 3. It should be noted that when it is judged that the remaining time of the first boarding code certificate is greater than the second preset threshold of the validity period of the first boarding code certificate, the boarding code generated according to the first boarding code certificate is as follows: Figure 3b As shown. Figure 3b The boarding code warning icon is displayed on the right side of the interface shown.
[0067] It should be noted that, when the boarding code is generated according to the second boarding code certificate, the third prompt information is generated, and the third prompt information is used to remind the user that the boarding code status is urgent (such as Figure 4a As shown in FIG. 1 , the second boarding code certificate is used to generate the boarding code, and is used to prompt the user the number of times the boarding code can be used. For example, in the embodiment of the present invention, the number of times the boarding code can be used is 2. It should be noted that the schematic diagram of generating the boarding code according to the second boarding code certificate is as shown in FIG. Figure 4b See Figure 4b ,exist Figure 4b The right side of the interface shows an emergency icon for the boarding code. If the number of times the boarding code is generated within the first preset time range is greater than the preset frequency threshold, the boarding code is not generated, but a fourth prompt message is generated. The fourth prompt message is used to prompt the user that the code generation failed (such as Figure 5 As shown), and is used to prompt the user that the electronic device needs to reconnect to the network to generate a boarding code. For example, if the boarding code needs to be generated for the third time within the first preset time range, which is greater than the preset frequency threshold of 2 times, no boarding code is generated.
[0068] It can be understood that the first prompt information, the second prompt information, the third prompt information and the fourth prompt information can be displayed in the form of a pop-up window.
[0069] From the above content, it can be seen that the embodiment of the present invention realizes that when the validity period of the first boarding code certificate has expired, if the electronic device has been disconnected from the Internet, a boarding code can be generated based on the second boarding code certificate, thereby obtaining a better user experience.
[0070] According to an embodiment of another aspect, a device for generating a boarding code is provided, which is applied to an electronic device side. Figure 6 FIG. 1 is a schematic block diagram of a device for generating a boarding code according to an embodiment of the present invention. Figure 6 As shown, the device 600 may include: an acquisition unit 601 and a generation unit 602. The main functions of each component unit are as follows:
[0071] An acquisition unit 601 is used to acquire target operation information, where the target operation information is used to instruct the generation of a boarding code;
[0072] The generation unit 602 is used to generate a boarding code in response to the target operation information according to the validity period of the first boarding code certificate stored on the electronic device, the offline working condition of the electronic device and the second boarding code certificate stored on the electronic device, wherein the validity period of the first boarding code certificate is less than the validity period of the second boarding code certificate.
[0073] As a possible implementation method, the generation unit 602 is specifically used to respond to the target operation information to determine whether the validity period of the first boarding code certificate has expired; if the validity period of the first boarding code certificate has expired, determine whether the electronic device has been disconnected from the Internet; if the electronic device has been disconnected from the Internet, generate a boarding code based on the second boarding code certificate.
[0074] As a possible implementation method, the generation unit 602 is specifically used to determine whether the number of times the boarding code generated according to the second boarding code certificate is generated within a first preset time range is greater than a preset frequency threshold; if it is less than or equal to the preset frequency threshold, the boarding code is generated according to the second boarding code certificate, otherwise, the boarding code is not generated.
[0075] As a possible implementation method, the acquisition unit 601 is specifically used to determine whether the number of times the second boarding code certificate is obtained within a second preset time range is greater than a preset number threshold when the second boarding code certificate expires, and the second preset time range is less than the validity period of the second boarding code certificate; if it is less than or equal to the preset number threshold, then generate download information, and the download information is used to send it to the server, so that the server sends the second boarding code certificate to the electronic device; and obtain the second boarding code certificate.
[0076] As a possible implementation method, the generation unit 602 is specifically used to generate a first prompt message when it is judged that the validity period of the first boarding code certificate is valid, if it is judged that the remaining time of the first boarding code certificate is greater than the first preset threshold of the validity period, and the first prompt message is used to prompt the user that the boarding code status is normal; when it is judged that the validity period of the first boarding code certificate is valid, if it is judged that the remaining time of the first boarding code certificate is greater than the second preset threshold of the validity period, a second prompt message and an update button are generated, and the second prompt message is used to prompt the user of the boarding code status warning, and the update button is used for the user to update the first boarding code certificate, and the second preset threshold is less than the first preset threshold.
[0077] As a possible implementation method, the generation unit 602 is specifically used to generate a third prompt message when the boarding code is generated according to the second boarding code certificate. The third prompt message is used to prompt the user that the boarding code status is urgent and that the boarding code has been switched to be generated using the second boarding code certificate, and is used to prompt the user the number of times the boarding code can be used.
[0078] As a possible implementation method, the generation unit 602 is specifically used to generate a fourth prompt message if the number of times the boarding code is generated within the first preset time range is greater than a preset frequency threshold. The fourth prompt message is used to prompt the user that the code generation failed and to prompt the user that the electronic device needs to reconnect to the network to generate the boarding code.
[0079] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the unit described as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0080] In addition, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of any one of the methods in the aforementioned method embodiments are implemented.
[0081] And an electronic device, comprising:
[0082] one or more processors; and
[0083] A memory associated with the one or more processors, the memory being used to store program instructions, wherein the program instructions, when read and executed by the one or more processors, execute the steps of the method described in any one of the aforementioned method embodiments.
[0084] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the steps of any one of the methods in the aforementioned method embodiments when executed by a processor.
[0085] in, Figure 7 The architecture of the electronic device is exemplarily shown, which may include a processor 710, a video display adapter 711, a disk drive 712, an input / output interface 713, a network interface 714, and a memory 720. The processor 710, the video display adapter 711, the disk drive 712, the input / output interface 713, the network interface 714, and the memory 720 may be communicatively connected via a communication bus 730.
[0086] The processor 710 may be implemented by a general-purpose CPU, a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is used to execute relevant programs to implement the technical solutions provided by the embodiments of the present invention.
[0087] The memory 720 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 720 can store an operating system 721 for controlling the operation of the electronic device 700, and a basic input and output system (BIOS) 722 for controlling the low-level operation of the electronic device 700. In addition, a web browser 723, a data storage management system 724, and a boarding code generating device 725, etc. can also be stored. The above-mentioned boarding code generating device 725 can be an application program that specifically implements the operations of the aforementioned steps in the embodiment of the present invention. In short, when the technical solution provided by the embodiment of the present invention is implemented by software or firmware, the relevant program code is stored in the memory 720 and is called and executed by the processor 710.
[0088] The input / output interface 713 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. Among them, the input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0089] The network interface 714 is used to connect to a communication module (not shown) to achieve communication interaction between the device and other devices. The communication module can achieve communication through a wired method (such as USB, network cable, etc.) or a wireless method (such as mobile network, WIFI, Bluetooth, etc.).
[0090] The bus 730 comprises a pathway for transmitting information between the various components of the device (eg, the processor 710, the video display adapter 711, the disk drive 712, the input / output interface 713, the network interface 714, and the memory 720).
[0091] It should be noted that, although the above device only shows a processor 710, a video display adapter 711, a disk drive 712, an input / output interface 713, a network interface 714, a memory 720, a bus 730, etc., in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include components necessary for implementing the solution of the present application, and does not necessarily include all the components shown in the figure.
[0092] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the embodiments of the present invention have been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating a boarding code, applied to an electronic device, characterized in that: include: The electronic device acquires target operation information, where the target operation information is used to instruct the generation of a boarding code; In response to the target operation information, a boarding code is generated based on the validity period of the first boarding code certificate saved on the electronic device, the offline working condition of the electronic device and the second boarding code certificate saved on the electronic device, the validity period of the first boarding code certificate is less than the validity period of the second boarding code certificate.
2. The method for generating a boarding code according to claim 1, characterized in that: The method of generating a boarding code in response to the target operation information according to the validity period of the first boarding code certificate stored on the electronic device, the disconnected working condition of the electronic device and the second boarding code certificate stored on the electronic device includes: In response to the target operation information, determining whether the validity period of the first boarding code certificate is invalid; If the validity period of the first boarding code certificate has expired, determining whether the network disconnection condition of the electronic device has occurred; If the electronic device is disconnected from the Internet, a boarding code is generated based on the second boarding code certificate.
3. The method for generating a boarding code according to claim 2, characterized in that: The step of generating a boarding code according to the second boarding code certificate comprises: Determine whether the number of times the boarding code generated according to the second boarding code certificate is generated within a first preset time range is greater than a preset frequency threshold; If it is less than or equal to the preset frequency threshold, the boarding code is generated according to the second boarding code certificate; otherwise, the boarding code is not generated.
4. The method for generating a boarding code according to any one of claims 1 to 3, characterized in that: The method further comprises: When the second boarding code certificate expires, determining whether the number of times the second boarding code certificate is obtained within a second preset time range is greater than a preset number threshold, and the second preset time range is less than the validity period of the second boarding code certificate; If it is less than or equal to the preset number threshold, a download message is generated, and the download message is used to send it to the server, so that the server sends a second boarding code certificate to the electronic device; Obtain the second boarding code certificate.
5. The method according to claim 2 or 3, characterized in that: The method further comprises: In the case where the validity period of the first boarding code certificate is determined to be valid, if it is determined that the remaining time of the first boarding code certificate is greater than a first preset threshold of the validity period of the first boarding code certificate, a first prompt information is generated, and the first prompt information is used to prompt the user that the boarding code status is normal; or When it is determined that the validity period of the first boarding code certificate is valid, if it is determined that the remaining time of the first boarding code certificate is greater than the second preset threshold of the validity period of the first boarding code certificate, a second prompt message and an update button are generated, and the second prompt message is used to prompt the user of the boarding code status warning, and the update button is used for the user to update the first boarding code certificate, and the second preset threshold is less than the first preset threshold.
6. The method according to claim 2 or 3, characterized in that: The method further comprises: When the boarding code is generated based on the second boarding code certificate, a third prompt information is generated, and the third prompt information is used to prompt the user that the boarding code status is urgent, and that the boarding code has been switched to be generated using the second boarding code certificate, and is used to prompt the user the number of times the boarding code can be used.
7. The method according to claim 3, characterized in that The method further comprises: If the number of times the boarding code is generated within the first preset time range is greater than the preset frequency threshold, a fourth prompt message is generated. The fourth prompt message is used to prompt the user that the code generation failed and to prompt the user that the electronic device needs to reconnect to the network to generate the boarding code.
8. A vehicle code generating device, applied to an electronic device, characterized in that: include: An acquisition unit, used for acquiring target operation information, wherein the target operation information is used for instructing to generate a boarding code; A generation unit is used to generate a boarding code in response to the target operation information based on the validity period of a first boarding code certificate stored on the electronic device, the offline working condition of the electronic device and the second boarding code certificate stored on the electronic device, wherein the validity period of the first boarding code certificate is less than the validity period of the second boarding code certificate.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the processor and the memory communicate with each other via a bus; The memory stores program instructions executable by the processor, and the processor can execute the method according to any one of claims 1 to 7 by calling the program instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Subway taking off-line processing system and method based on off-line two-dimensional code ticket-card
CN108234517A
Information identification code generation method and device, electronic equipment and computer storage medium
CN110012048A
Offline two-dimensional code riding method and device
CN110516776A
Public transport riding code generation method and device and electronic equipment
CN111652990A
Code scanning riding method, client, server, electronic equipment and storage medium
CN112184208A