A method for displaying an electronic code and a related device
By dynamically adjusting the start time of the electronic code to take effect, the time-consuming problem of electronic code drawing caused by differences in terminal equipment performance is solved, and the availability of electronic code is improved.
Patent Information
- Application Number
- CN201910107665.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-02-02
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2039-02-02
AI Technical Summary
Due to the performance differences between different terminal devices, the time to draw the electronic code will affect its effective time, resulting in the electronic code being unavailable.
By calculating the start time of the electronic code of different terminal devices, it appears after the original electronic code of the electronic code, thereby reducing the impact of drawing time on the effective time.
It effectively improves the availability of electronic codes and ensures the effective use of electronic codes on different terminal devices.
Smart Images

Figure CN111523626B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communication technology, and in particular to an electronic code display method and related devices. Background Art
[0002] With the rapid development of society, technology is increasingly being applied to people's lives, among which the birth of electronic codes (such as QR codes and barcodes, etc.) is one of the most important applications. Electronic codes can be black and white graphics distributed on a plane according to certain rules using certain geometric figures, which can record original data; information can be automatically processed through the recognition of image input devices or photoelectric scanning devices.
[0003] Nowadays, for the convenience of travel, public transportation provides the function of electronic code boarding. In the solution of using electronic code boarding, the client will automatically draw an electronic code, and the electronic code drawn by the client will be scanned and recognized by the code scanning machine. In order to improve the security of code scanning, the effective time of the electronic code often needs to be set as short as possible. Usually, the effective time of the electronic code can be set to about 60 seconds.
[0004] However, due to the performance differences of different terminal devices, it takes a certain amount of time from the beginning of drawing the electronic code to the complete display of the electronic code, which shortens the effective time of the electronic code. Once the time taken to draw the electronic code exceeds the effective time of the electronic code, the electronic code will become unusable. Summary of the invention
[0005] The embodiment of the present invention provides a method for displaying an electronic code and a related device, which can calculate the corresponding electronic code effective start time according to the performance differences of different terminal devices. The effective start time appears after the original effective time of the electronic code. Therefore, it can greatly reduce the impact of the time consumption of electronic code drawing on the effective time length of the electronic code, which is beneficial to improve the usability of the electronic code.
[0006] One aspect of the present invention provides a method for displaying an electronic code, comprising:
[0007] An electronic code display instruction for obtaining an electronic code;
[0008] receiving an electronic code generation instruction of the electronic code, wherein the electronic code generation instruction is generated after the electronic code display instruction;
[0009] Acquire a first moment and a drawing time according to the electronic code generation instruction, wherein the first moment is the moment when the electronic code generation instruction is received, and the drawing time indicates the duration used for drawing the electronic code;
[0010] generating a second moment according to the first moment and the drawing time, wherein the second moment is after the first moment;
[0011] The electronic code is displayed at the second time, wherein the second time is a starting time when the electronic code becomes effective.
[0012] In one aspect, the present invention provides a client, comprising:
[0013] An acquisition module, used for acquiring an electronic code display instruction of an electronic code;
[0014] A receiving module, used for receiving an electronic code generation instruction of the electronic code, wherein the electronic code generation instruction is generated after the electronic code display instruction;
[0015] The acquisition module is further used to acquire a first moment and a drawing time according to the electronic code generation instruction received by the receiving module, wherein the first moment is the moment when the electronic code generation instruction is received, and the drawing time indicates the duration used for drawing the electronic code;
[0016] A generating module, configured to generate a second moment according to the first moment acquired by the acquiring module and the drawing time, wherein the second moment is after the first moment;
[0017] A display module is used to display the electronic code at the second moment generated by the generation module, wherein the second moment is a starting moment when the electronic code takes effect.
[0018] In a possible implementation, the client further includes a computing module;
[0019] The acquisition module is further used to acquire the total drawing time of N electronic codes before acquiring the electronic code display instruction of the electronic code, wherein N is an integer greater than or equal to 1;
[0020] The calculation module is used to calculate the drawing time according to the total drawing time of the N electronic codes obtained by the acquisition module and the total number of the N electronic codes.
[0021] In a possible implementation, the client further includes a determination module;
[0022] The acquisition module is further used to acquire the historical drawing time of the previous adjacent electronic code of the electronic code before acquiring the electronic code display instruction of the electronic code;
[0023] The determining module is used to determine the historical drawing time obtained by the obtaining module as the drawing time.
[0024] In a possible implementation, the client further includes a determination module;
[0025] The acquisition module is further used to acquire the validity time of the electronic code after acquiring the first moment and the drawing time according to the electronic code generation instruction;
[0026] The determination module is further used to determine a first expiration time of the electronic code according to the validity period of the electronic code.
[0027] In a possible implementation, the client further includes a determination module;
[0028] The acquisition module is further used to acquire the validity time of the electronic code after acquiring the first moment and the drawing time according to the electronic code generation instruction;
[0029] The determination module is further configured to determine a second expiration time of the electronic code according to the validity period of the electronic code and the drawing time.
[0030] In a possible implementation, the receiving module is further configured to receive the deviation time of the electronic code after the obtaining module obtains the electronic code display instruction of the electronic code;
[0031] The generating module is specifically configured to generate the second moment according to the first moment, the drawing time and the deviation time.
[0032] In a possible implementation, the receiving module is used to obtain the deviation time of the electronic code through a short distance communication method.
[0033] One aspect of the present invention provides a terminal device, including: a memory and a processor, wherein the terminal device is used to execute the above-mentioned electronic code display method.
[0034] In one aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, and when the computer-readable storage medium is run on a computer, the computer executes the above-described method.
[0035] It can be seen from the above technical solutions that the embodiments of the present invention have the following advantages:
[0036] In an embodiment of the present invention, a method for displaying an electronic code is provided, wherein a client obtains an electronic code display instruction of an electronic code, and then receives an electronic code generation instruction of the electronic code, wherein the electronic code generation instruction is generated after the electronic code display instruction, and the client obtains a first moment and a drawing time according to the electronic code generation instruction, wherein the first moment is the moment when the electronic code generation instruction is received, and the drawing time indicates the duration used to draw the electronic code, and then the client can generate a second moment according to the first moment and the drawing time, wherein the second moment is after the first moment, and finally the electronic code is displayed at the second moment, wherein the second moment is the effective start moment of the electronic code. Through the above method, the corresponding effective start moment of the electronic code can be calculated respectively according to the performance difference of different terminal devices, and the effective start moment appears after the original effective moment of the electronic code, therefore, the influence of the time consumption of drawing the electronic code on the effective time length of the electronic code can be greatly reduced, thereby facilitating the improvement of the availability of the electronic code. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic diagram of the architecture of an electronic code generation system in an embodiment of the present invention;
[0038] Figure 2 A schematic diagram of a process of generating an electronic code in an embodiment of the present invention;
[0039] Figure 3 A schematic diagram of an embodiment of a method for displaying an electronic code in an embodiment of the present invention;
[0040] Figure 4 A schematic diagram of an embodiment of generating an electronic code in an embodiment of the present invention;
[0041] Figure 5 A schematic diagram of an embodiment of generating an electronic code in an embodiment of the present invention;
[0042] Figure 6 A schematic diagram of an embodiment of generating an electronic code in an embodiment of the present invention;
[0043] Figure 7 A schematic diagram of an embodiment of generating a first electronic code in an embodiment of the present invention;
[0044] Figure 8 A schematic diagram of an embodiment of generating an electronic code in an application scenario of the present invention;
[0045] Fig. 9 A schematic diagram of an embodiment of time alignment between a client and a barcode scanning device in an embodiment of the present invention;
[0046] Fig.10 A schematic diagram of an embodiment of time alignment between a client and a barcode scanning device in an embodiment of the present invention;
[0047] Fig.11 A schematic diagram of an embodiment of time alignment between a client and a barcode scanning device in an embodiment of the present invention;
[0048] Fig.12 This is a schematic diagram of an embodiment of a client in an embodiment of the present invention;
[0049] Fig.13 This is a schematic diagram of an embodiment of a client in an embodiment of the present invention;
[0050] Fig.14 This is a schematic diagram of an embodiment of a client in an embodiment of the present invention;
[0051] Fig.15 It is a structural schematic diagram of a terminal device in an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The embodiment of the present invention provides a method for displaying an electronic code and a related device, which can calculate the corresponding electronic code effective start time according to the performance differences of different terminal devices. The effective start time appears after the original effective time of the electronic code. Therefore, it can greatly reduce the impact of the time consumption of electronic code drawing on the effective time length of the electronic code, which is beneficial to improve the usability of the electronic code.
[0053] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "corresponding to" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0054] It should be understood that the present invention can be applied to the scenario of electronic code recognition. Based on the scenario of electronic code recognition, there are situations where the electronic code is generated online and situations where the electronic code is generated offline. The client in the online state is in a communication state with the server, and the time corresponding to the server can be used as the standard time. When the client sends an instruction to the server, the server sends the effective time of the electronic code to the client according to the time when the instruction is received. The client in the offline state is not in a real-time communication state with the server. At this time, if the client directly generates the electronic code according to the effective time of the electronic code determined in advance by the server. Both may shorten the effective time of the electronic code and make it unavailable.
[0055] It should be understood that the application of electronic codes can be divided into main reading and being read. The read application is to store the electronic code in a terminal device as a voucher for electronic transactions or payments. The main reading application is to use a handheld tool (including a mobile phone) installed with electronic code reading software to read the electronic code on various carriers. Several application scenarios of electronic codes will be introduced below. The electronic code display method provided by the present invention can be applied to the following scenarios, and is not limited to the following application scenarios.
[0056] Scenario 1: Online shopping;
[0057] Different products correspond to different electronic codes. The products retrieved after scanning are authentic and valid, ensuring shopping safety. Users can scan the electronic code to view the specific information of the product. If they need to purchase the product, they can place an order through the terminal payment.
[0058] Scenario 2: Consumption discounts;
[0059] Merchants send electronic coupons or electronic tickets to users' mobile phones via SMS. When users make purchases, they only need to show the electronic code coupon on their mobile phones to the merchants, and scan and verify it through the merchant's reading terminal to get discounts. In addition, merchants can also provide membership cards to users through mini programs. Users only need to scan the merchant's electronic code with their mobile phones to get an electronic membership card stored in WeChat and enjoy discount services.
[0060] Scenario 3: Payment;
[0061] All users can receive the "Pay Me" electronic code for free. Consumers only need to turn on the client's scanning function and take a picture of the electronic code to jump to the payment page. After the payment is successful, the payee will receive a text message and client notification.
[0062] Scene 4: Information reading;
[0063] In the past, the content in newspapers, television and other media was limited to the characteristics of the media, was static, and could not be read in an extended manner. However, the emergence of electronic codes has overturned this boundary and realized cross-media reading. For example, an electronic code is placed next to a piece of news in a newspaper, and readers can read more information about the news after scanning it, such as interview recordings, video recordings, pictures and animations.
[0064] Scenario 5: Managing production;
[0065] Electronic codes are widely used in the manufacturing process. Electronic codes can store more information, so they are more deeply used in the manufacturing process, allowing the quality of production and processing to be monitored throughout the process. At the same time, by monitoring the processing equipment in the production process, the original production line has become a flexible production line that can produce a variety of products and provide a complete data platform for the realization of manufacturing execution system management.
[0066] Scenario 6: Food traceability;
[0067] By loading the production and logistics information of food into the electronic code, food monitoring and traceability can be realized. Consumers only need to scan it with their mobile phones to query all the processes of food from production to sales.
[0068] Scenario 7: Electronic ticketing;
[0069] Train tickets, scenic spot tickets, exhibition tickets, performance tickets, airline tickets, and movie tickets can all be fully digitized through electronic codes. For example, when users purchase tickets online and complete online payment, they can receive an electronic ticket with an electronic code on their mobile phones. Users can print or save it on their mobile phones as admission vouchers. Ticket inspectors only need to read the electronic code through the device to quickly inspect the ticket, greatly reducing ticket consumables and labor costs.
[0070] Scenario 8: Traffic management;
[0071] Electronic codes can be used in traffic management to manage vehicle information, vehicle licenses, driver's licenses, annual insurance, and electronic eyes. For example, by using a vehicle license with an electronic code, the basic information about the vehicle, including the vehicle number, engine number, model, and color, is converted and saved in the electronic code. When checking a vehicle, the traffic police no longer need to call the central station for assistance, but can directly scan the vehicle's electronic code.
[0072] Scene 9: Scan the QR code to take the bus;
[0073] A scanning machine is installed at the gates of bus stations, subway stations, high-speed rail stations and railway stations. Passengers use the electronic code generated on their mobile phones to enter and exit the station, and can pass through the gate within the valid time period of the electronic code.
[0074] The present invention will be specifically introduced by taking a vehicle as an example. For ease of understanding, the present invention proposes a method for displaying an electronic code. The method is applied to Figure 1 The electronic code generation system shown is shown in Figure 1 , Figure 1 This is a schematic diagram of the architecture of the electronic code generation system in an embodiment of the present invention. As shown in the figure, the user enters and exits the station using the client installed on the handheld terminal. The client is used to generate an electronic boarding code. When entering or exiting the station, the user aligns the electronic boarding code displayed on the client with the scanning port of the code scanning machine. The electronic boarding code often carries information of multiple fields, such as the generation time of the electronic boarding code, the validity period of the electronic boarding code, the passenger's entry station location, and the passenger's exit station location. When the code scanning machine is connected to the network, the electronic boarding code is sent to the server, and the server parses the electronic boarding code and verifies the validity of the electronic boarding code based on the parsed fields. In order to achieve rapid verification and release, the code scanning machine does not need to be connected to the background in real time, that is, the code scanning machine can also directly verify the validity of the electronic boarding code locally when it is offline. Under normal circumstances, if the electronic boarding code is valid, the passenger can be released, and if the electronic boarding code is invalid, the passenger is not allowed to pass.
[0075] It should be noted that the client is deployed on a terminal device, wherein the terminal device includes but is not limited to a tablet computer, a laptop computer, a PDA, a mobile phone, and a personal computer (PC), which is not limited here.
[0076] It should be understood that based on Figure 1 The electronic code generation system shown in the figure provides a method for increasing the actual validity period of the electronic boarding code, which solves the problem that the current performance differences of terminal devices cause large differences in the generation time of the electronic boarding code, and ultimately leads to a short actual validity period of the electronic boarding code for terminal devices with poor performance. In order to increase the actual validity period of the electronic boarding code, the present invention provides a solution for dynamically adjusting the validity period of the electronic boarding code based on the terminal device capabilities. For ease of understanding, please refer to Figure 2 , Figure 2 A schematic diagram of a process of generating an electronic code in an embodiment of the present invention is shown in the figure, specifically:
[0077] In step S1, the client begins to enter a QR code drawing state, wherein the QR code may be a form of an electronic boarding code;
[0078] In step S2, it is determined whether there is an average drawing time Tdraw_time_avg of the two-dimensional code. If there is an average drawing time Tdraw_time_avg of the two-dimensional code, the process proceeds to step S3. Otherwise, if there is no average drawing time Tdraw_time_avg of the two-dimensional code, the process jumps to step S4.
[0079] In step S3, if there is an average drawing time Tdraw_time_avg of the two-dimensional code, the time when the two-dimensional code starts to take effect Tvalid_begin_time is updated to the time when the two-dimensional code starts to take effect Tvalid_begin_time + the average drawing time Tdraw_time_avg of the two-dimensional code;
[0080] In step S4, after determining whether there is an average drawing time Tdraw_time_avg of the two-dimensional code, the drawing of the two-dimensional code begins;
[0081] In step S5, after the drawing of the two-dimensional code is completed, the average drawing time Tdraw_time_avg of the two-dimensional code is updated and recorded according to the drawing time Tdraw_time of the two-dimensional code;
[0082] In step S6, it is determined whether the drawing of the two-dimensional code is the first drawing, and whether the drawing time Tdraw_time of the two-dimensional code is greater than the valid time Tvalid_preiod of the two-dimensional code;
[0083] In step S7, if the drawing of the two-dimensional code is the first drawing, and the drawing time Tdraw_time of the two-dimensional code is greater than the valid time length Tvalid_preiod of the two-dimensional code, the two-dimensional code is an invalid two-dimensional code and will not be displayed;
[0084] In step S8, if the drawing of the two-dimensional code is not the first drawing, and the drawing time Tdraw_time of the two-dimensional code is less than or equal to the valid time length Tvalid_preiod of the two-dimensional code, the two-dimensional code will be displayed;
[0085] In step S9, the client completes drawing of the QR code.
[0086] It should be noted that the above average drawing time is only an illustration. In actual applications, it may also be a pre-set drawing time, or the time taken to draw the QR code last time.
[0087] In combination with the above introduction, the following will introduce the display method of the electronic code in the embodiment of the present invention. Figure 3 In one embodiment of the present invention, a method for displaying an electronic code includes:
[0088] 101. Obtaining an electronic code display instruction for an electronic code;
[0089] In this embodiment, the client receives an electronic code display instruction triggered by a user, wherein the electronic code display instruction is used to request the client to display an electronic code.
[0090] It should be noted that the electronic code in the present invention can specifically be an electronic boarding code, which can be in the form of a QR code, a barcode or other electronic forms, which is not limited here.
[0091] 102. receiving an electronic code generation instruction of the electronic code, wherein the electronic code generation instruction is generated after the electronic code display instruction;
[0092] In this embodiment, in an offline state, after receiving the electronic code display instruction, the client generates an electronic code generation instruction. In an online state, after receiving the electronic code display instruction, the client sends the electronic code display instruction to the server, and the server generates an electronic code generation instruction according to the electronic code display instruction, and then sends the electronic code generation instruction to the client.
[0093] 103. Acquire a first moment and a drawing time according to the electronic code generation instruction, wherein the first moment is the moment when the electronic code generation instruction is received, and the drawing time indicates the duration used for drawing the electronic code;
[0094] In this embodiment, after the client obtains the electronic code generation instruction, it parses the electronic code generation instruction, thereby obtaining the first moment and the drawing time. The first moment refers to the moment when the client receives the electronic code generation instruction, and the drawing time refers to the time required to draw an electronic code. The drawing time can be the time taken to draw the previous electronic code, or the average time taken to draw multiple electronic codes, or a pre-set time, which is not limited here.
[0095] 104. Generate a second moment according to the first moment and the drawing time, wherein the second moment is after the first moment;
[0096] In this embodiment, the client generates the second time according to the first time and the drawing time. Specifically, assuming that the first time is 10:00:00 and the drawing time is 5 seconds, the second time is the first time plus the drawing time, that is, 10:00:05.
[0097] 105. Display the electronic code at a second moment, wherein the second moment is a starting moment when the electronic code takes effect.
[0098] In this embodiment, after the client generates the second moment, the electronic code can be displayed at the second moment, that is, the second moment is the effective starting moment of the electronic code.
[0099] In an embodiment of the present invention, a method for displaying an electronic code is provided, wherein a client obtains an electronic code display instruction of an electronic code, and then receives an electronic code generation instruction of the electronic code, wherein the electronic code generation instruction is generated after the electronic code display instruction, and the client obtains a first moment and a drawing time according to the electronic code generation instruction, wherein the first moment is the moment when the electronic code generation instruction is received, and the drawing time indicates the duration used to draw the electronic code, and then the client can generate a second moment according to the first moment and the drawing time, wherein the second moment is after the first moment, and finally the electronic code is displayed at the second moment, wherein the second moment is the effective start moment of the electronic code. Through the above method, the corresponding effective start moment of the electronic code can be calculated respectively according to the performance difference of different terminal devices, and the effective start moment appears after the original effective moment of the electronic code, therefore, the influence of the time consumption of drawing the electronic code on the effective time length of the electronic code can be greatly reduced, thereby facilitating the improvement of the availability of the electronic code.
[0100] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, the embodiment of the present invention provides an optional embodiment of the method for displaying an electronic code, before obtaining the electronic code display instruction of the electronic code, it may also include:
[0101] Obtain the total drawing time of N electronic codes, where N is an integer greater than or equal to 1;
[0102] The drawing time is calculated according to the total drawing time of the N electronic codes and the total number of the N electronic codes.
[0103] In this embodiment, a method for determining the drawing time of an electronic code is introduced. Specifically, the client will first obtain the total drawing time of N electronic codes, and then calculate the drawing time based on the total drawing time of the N electronic codes and the total number of the N electronic codes. At this time, the drawing time is the average drawing time. For example, it takes 10 seconds to generate the first electronic code and 12 seconds to generate the second electronic code, so the drawing time is 11 seconds. Among them, the drawing time can be recorded by the client itself, that is, it is updated in real time based on historical data. It can also be that the client analyzes the performance of the handheld terminal and automatically generates a drawing time based on the performance. For example, if the performance of the processor in the handheld terminal is good, the average time used to generate N electronic codes is set to 1 second. If the performance of the processor in the handheld terminal is poor, the average time used to generate N electronic codes is set to 5 seconds.
[0104] For ease of introduction, the following will introduce the method of generating electronic codes in combination with three scenarios. Figure 4 , Figure 4This is a schematic diagram of an embodiment of generating an electronic code in an embodiment of the present invention. As shown in the figure, the client receives an electronic code generation instruction at the first moment (i.e., moment A). At this time, the client generates a second moment (i.e., moment C1) according to the drawing time of the electronic code. The electronic code takes effect from moment B, and moment B is before the second moment (i.e., moment C1). In other words, the effective duration of the electronic code is from moment B to moment D, and the code scanning machine can verify the reliability of the electronic code within the effective duration of the electronic code. The electronic code will be displayed on the client from the second moment (i.e., moment C1). Therefore, the user can pass through the gate by scanning the electronic code from moment C1 to moment D. During the period from moment B to moment C1, although the electronic code is in a valid state, it has not been drawn yet, so it will not be displayed. Therefore, there is a certain amount of time from the beginning of drawing the electronic code to the complete display of the electronic code, which shortens the effective time length of the electronic code.
[0105] See also Figure 5 , Figure 5 This is a schematic diagram of an embodiment of generating an electronic code in an embodiment of the present invention. As shown in the figure, the client receives an electronic code generation instruction at the first moment (i.e., moment A). At this time, the client generates a second moment (i.e., moment C2) according to the drawing time of the electronic code. The electronic code takes effect from moment B, and moment B is after the second moment (i.e., moment C1). In other words, the effective duration of the electronic code is from moment B to moment D, and the code scanning machine can verify the reliability of the electronic code within the effective duration of the electronic code. The electronic code will be displayed on the client from the second moment (i.e., moment C2). Therefore, the user can pass through the gate by scanning the electronic code from moment B to moment D. During the period from moment C2 to moment B, although the electronic code has been drawn, it has not yet entered the effective state of the electronic code. Although the electronic code will be displayed, it is in an invalid state for a short period of time. Since the determination of moment B is closely related to the average time of drawing the electronic code, the time interval between moment C2 and moment B is often very small, thereby improving the availability of the electronic code.
[0106] See also Figure 6 , Figure 6This is a schematic diagram of an embodiment of generating an electronic code in an embodiment of the present invention. As shown in the figure, the client receives an instruction to generate an electronic code at a first moment (i.e., moment A). At this time, the client generates a second moment (i.e., moment B) according to the drawing time of the electronic code. The electronic code takes effect from moment B, that is, the effective duration of the electronic code is from moment B to moment D, and the code scanning machine can verify the reliability of the electronic code within the effective duration of the electronic code. The electronic code will be displayed on the client from the second moment (i.e., moment B), so the user can pass through the gate by scanning the electronic code from moment B to moment D.
[0107] Based on the above three scenarios, the following describes how to calculate the drawing time. After the client starts drawing the electronic code, it will wait for the electronic code to be drawn, and then record the time when the electronic code is finished drawing. The client can calculate the electronic code drawing time of the electronic code based on the start drawing time and the end drawing time. Specifically, each time the client obtains the drawing time of the electronic code, it can update the average drawing time of the electronic code. Assuming N is 5, that is, the electronic code is drawn a total of 5 times, please refer to Table 1, which shows the drawing time corresponding to drawing the electronic code 5 times.
[0108] Table 1
[0109] Number of electronic code drawing times Electronic code drawing time First drawing 8 seconds Second drawing 9 seconds The third drawing 10 seconds 4th drawing 9 seconds The 5th drawing 8 seconds
[0110] Based on the number of electronic code drawing times and the electronic code drawing time shown in Table 1, the average drawing time can be calculated as:
[0111] (8+9+10+9+8) / 5=8.8 (seconds);
[0112] Assuming that the drawing time of the next electronic code is 10 seconds, the average drawing time can be updated in the following way, and the new average drawing time can be obtained as follows:
[0113] (8+9+10+9+8+10) / (5+1)=9 (seconds);
[0114] It can be seen that the updated average drawing time represents the average time taken to generate (N+1) electronic codes.
[0115] Secondly, in the embodiment of the present invention, a method for updating the drawing time of an electronic code in real time is introduced. Before the client obtains the electronic code display instruction of the electronic code, the total drawing time of N electronic codes can also be obtained, where N is an integer greater than or equal to 1, and then the client calculates the drawing time according to the total drawing time of the N electronic codes and the total number of N electronic codes. In the above manner, each time the client obtains the generation time of an electronic code, the average generation time of the entire electronic code can be updated. In this way, the effective time of the generated electronic code can be closer to the actual situation, and the availability of the electronic code on various terminal devices can be improved.
[0116] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, the embodiment of the present invention provides an optional embodiment of the method for displaying an electronic code, before obtaining the electronic code display instruction of the electronic code, it may also include:
[0117] Get the historical drawing time of the previous adjacent electronic code of the electronic code;
[0118] Determine the historical drawing time as the drawing time.
[0119] In this embodiment, a method for determining the drawing time will be introduced. In the case where no historical drawing time is detected, that is, the electronic code is drawn for the first time, for ease of understanding, please refer to Figure 7 , Figure 7 This is a schematic diagram of an embodiment of generating the first electronic code in an embodiment of the present invention. As shown in the figure, when the client fails to detect the historical drawing time, time E is used as the starting time for drawing the electronic code. The client can start drawing the electronic code from time E and complete drawing at time F. Since there is no historical drawing time, the client cannot determine the drawing time of the electronic code. Therefore, the client uses time E as the effective starting time of the electronic code, and the effective duration of the electronic code is the period from time E to time G. It can be seen that the actual effective duration after the electronic code is drawn is equal to the effective duration of the electronic code minus the electronic code drawing time, that is, Figure 7 The period from time F to time G in the figure, where time G is the expiration time of the electronic code, and the expiration time of the electronic code is equal to time E plus the validity period. Therefore, the shorter the validity period, the higher the requirement for the validity of the electronic code. If the electronic code is drawn for a long time, the actual validity period of the electronic code will be shorter.
[0120] When the historical drawing time of the previous adjacent electronic code is detected, the historical drawing time can be directly used as the drawing time of the electronic code. For example, if the historical drawing time of the previous adjacent electronic code is 5 seconds, the drawing time of the current drawing electronic code is 5 seconds.
[0121] Secondly, in the embodiment of the present invention, a method for determining the drawing time is introduced, that is, before the client obtains the electronic code display instruction of the electronic code, the historical drawing time of the previous adjacent electronic code of the electronic code can also be obtained, and then the client determines the historical drawing time as the drawing time. Through the above method, even if the client does not obtain the average time, the current drawing time can be determined based on the historical drawing time of the previous electronic code. In addition, when the historical drawing time of the electronic code is not detected, there is also a corresponding processing method, thereby improving the practicality and feasibility of the solution.
[0122] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, an embodiment of the present invention provides an optional embodiment of a method for displaying an electronic code, after obtaining the first moment and the drawing time according to the electronic code generation instruction, the method may further include:
[0123] Get the validity period of the electronic code;
[0124] The first expiration time of the electronic code is determined according to the validity period of the electronic code.
[0125] In this embodiment, after the client obtains the first moment and the drawing time according to the electronic code generation instruction, the expiration moment of the electronic code can be further determined, that is, the client determines the first expiration moment of the electronic code according to the validity period of the electronic code. In other words, for the electronic code, its first expiration moment can be the first moment plus the validity period. When the client communicates with the code scanning device, the code scanning device can send relevant parameters to the client, and the parameters carry the first expiration moment, that is, the electronic code becomes invalid from the first expiration moment.
[0126] Secondly, in the embodiment of the present invention, after obtaining the first moment and the drawing time according to the electronic code generation instruction, the client can also obtain the validity period of the electronic code, and then determine the first expiration moment of the electronic code according to the validity period of the electronic code. In the above manner, the expiration moment of the electronic code does not need to consider the drawing time of the electronic code, that is, the validity period of the electronic code will not be extended due to considering the drawing time, thereby improving the security of the electronic code.
[0127] Optionally, in the above Figure 3 On the basis of the corresponding embodiments, an embodiment of the present invention provides an optional embodiment of a method for displaying an electronic code, after obtaining the first moment and the drawing time according to the electronic code generation instruction, the method may further include:
[0128] Get the validity period of the electronic code;
[0129] The second expiration time of the electronic code is determined according to the validity period of the electronic code and the drawing time.
[0130] In this embodiment, after the client obtains the first moment and the drawing time according to the electronic code generation instruction, the expiration moment of the electronic code can be further determined, that is, the client determines the second expiration moment of the electronic code according to the effective duration of the electronic code and the drawing time. In other words, for the electronic code, its second expiration moment can be the first moment plus the drawing time plus the effective duration.
[0131] For easier understanding, see Figure 8 , Figure 8 This is a schematic diagram of an embodiment of generating an electronic code in the application scenario of the present invention. As shown in the figure, it is assumed that the first electronic code is drawn at 10 minutes and 00 seconds and is completed at 10 minutes and 10 seconds, that is, the electronic code drawing time of the electronic code is 10 seconds. When the client draws the electronic code for the first time, it does not know the electronic code drawing time. Therefore, the effective time of the first electronic code is consistent with the drawing start time, which is also 10 minutes and 00 seconds. Assuming that the effective duration of the electronic code is 60 seconds, the effective duration of the first electronic code is from 10 minutes and 00 seconds to 11 minutes and 00 seconds, and the expiration time of the first electronic code is 11 minutes and 00 seconds. At this time, the client can determine 10 seconds as the average drawing time.
[0132] The client enters the process of drawing the electronic code for the second time. That is, assuming that the client starts drawing the second electronic code at 11 minutes and 00 seconds, and completes the drawing at 11 minutes and 08 seconds, that is, the electronic code drawing time of the second electronic code is 8 seconds. According to the electronic code drawing time of the first electronic code and the electronic code drawing time of the second electronic code, it can be calculated that the average drawing time is 9 seconds. The effective time of the second electronic code is 11 minutes and 10 seconds, that is, it is obtained by adding the average drawing time to the starting time of the drawing of the second electronic code, 11 minutes and 00 seconds. Assuming that the effective time of the electronic code is 60 seconds, the effective time of the second electronic code can be from 11 minutes and 10 seconds to 12 minutes and 10 seconds, and the expiration time of the second electronic code is 12 minutes and 10 seconds. At this time, the client can calculate that the average drawing time is 9 seconds.
[0133] The client enters the process of drawing the electronic code for the third time. That is, assuming that the client starts drawing the third electronic code at 12 minutes and 10 seconds, and completes the drawing at 12 minutes and 20 seconds, the electronic code drawing time of the third electronic code is 10 seconds. According to the electronic code drawing time of the first electronic code, the electronic code drawing time of the second electronic code, and the electronic code drawing time of the third electronic code, the average drawing time can be calculated. The effective time of the third electronic code is 12 minutes and 19 seconds, which is obtained by adding the average drawing time to the starting time of the drawing of the third electronic code, 12 minutes and 10 seconds. Assuming that the effective time of the electronic code is 60 seconds, the effective time of the third electronic code is from 12 minutes and 19 seconds to 13 minutes and 19 seconds, and the expiration time of the third electronic code is 13 minutes and 19 seconds.
[0134] It can be seen that the second expiration time of the electronic code is different from the first expiration time, and the second expiration time needs to be determined according to the drawing time. After the electronic code drawing time changes, the next round of electronic code expiration time will also change accordingly, which is conducive to increasing the actual effective time of the electronic code, thereby improving the flexibility and operability of the solution.
[0135] Secondly, in the embodiment of the present invention, after obtaining the first moment and the drawing time according to the electronic code generation instruction, the client can also obtain the validity period of the electronic code, and then determine the second expiration time of the electronic code according to the validity period and the drawing time of the electronic code. In the above manner, the expiration time of the electronic code needs to take into account the drawing time of the electronic code, which is equivalent to extending the validity period of the electronic code, thereby improving the convenience of electronic code application.
[0136] Optionally, based on any one of the above embodiments, an embodiment of the present invention provides an electronic code display method. In an optional embodiment, after obtaining the electronic code display instruction of the electronic code, the method may further include:
[0137] Deviation time of receiving electronic code;
[0138] Generating the second moment according to the first moment and the drawing time may include:
[0139] A second moment is generated according to the first moment, the drawing time, and the deviation time.
[0140] In this embodiment, after obtaining the electronic code display instruction of the electronic code, the client can also receive the deviation time of the electronic code, and then generate the second moment according to the first moment, the drawing time and the deviation time. Since the time of the code scanning machine is not controlled by the client, if the time of the code scanning machine deviates from the standard time, then when verifying the validity period of the electronic code, there is a situation where the electronic code is invalid. In order to improve the key strength of the recognition system and avoid the situation where a large number of electronic codes fail to verify within the validity period, it is assumed that the client time used by the user has been corrected to the standard time, and the electronic code is valid within 60 seconds from the generation time. In an ideal case, the time of the code scanning machine is also the standard time, then the code is scanned and verified within 60 seconds from the generation of the electronic code, and the electronic code is verified within the validity period. However, in actual scenarios, due to the deviation between the client time and the code scanning machine time, it will lead to the situation that the verification fails within the valid time. Therefore, the embodiment of the present invention proposes a client-based adjustable electronic code effective starting time scheme, which can offset the deviation caused by the non-standard code scanning machine time to a certain extent.
[0141] The following will introduce how to update the second moment of the electronic code in combination with three scenarios.
[0142] Scene 1
[0143] The following will be combined Fig. 9 The second time method for updating the electronic code provided by the present invention is introduced. Fig. 9 , Fig. 9 This is a schematic diagram of an embodiment of time alignment between the client and the code scanning machine in an embodiment of the present invention. As shown in the figure, when the code scanning machine time is slower than the client time, it is assumed that the code scanning machine time is 10 seconds slower than the client standard time, that is, the deviation time is -10 seconds. If the second time before the update is 10 minutes and 00 seconds, and the expiration time is 11 minutes and 00 seconds, then, since the code scanning machine is 10 seconds slower, the electronic code is invalid from 10 minutes and 00 seconds to 10 minutes and 10 seconds under the standard time, and the electronic code is valid from 11 minutes and 00 seconds to 11 minutes and 10 seconds under the standard time.
[0144] In order to synchronize the time of the barcode scanner with the standard time of the client, the second moment can be generated according to the first moment, the drawing time and the deviation time, that is:
[0145] Second time before update = first time + drawing time = 10 minutes and 00 seconds
[0146] The second time after updating = the second time before updating - the deviation time
[0147] = 10 minutes 00 seconds - 10 seconds = 9 minutes 50 seconds
[0148] It can be seen that under standard time, the second moment after the update will be earlier than the second moment before the update. It is understandable that the effective duration of the electronic code can be updated according to the update of the second moment, or can maintain the pre-set effective duration, which is not limited here.
[0149] Scene 2
[0150] The following will be combined Fig.10 The second time method for updating the electronic code provided by the present invention is introduced. Fig.10 , Fig.10 This is another embodiment schematic diagram of time alignment between the client and the code scanning tool in the embodiment of the present invention. As shown in the figure, when the code scanning tool time is faster than the client time, it is assumed that the code scanning tool time is 10 seconds faster than the client standard time, that is, the deviation time is +10 seconds. If the second time before the update is 10 minutes and 00 seconds, and the expiration time is 11 minutes and 00 seconds, then because the code scanning tool is 10 seconds faster, the electronic code is invalid from 10 minutes and 50 seconds to 11 minutes and 00 seconds under the standard time, and the electronic code is valid from 9 minutes and 50 seconds to 10 minutes and 00 seconds under the standard time.
[0151] In order to synchronize the time of the barcode scanner with the standard time of the client, the second moment can be generated according to the first moment, the drawing time and the deviation time, that is:
[0152] Second time before update = first time + drawing time = 10 minutes and 00 seconds
[0153] The second time after updating = the second time before updating + the deviation time
[0154] =10 minutes 00 seconds + 10 seconds = 10 minutes 10 seconds
[0155] It can be seen that under standard time, the second moment after the update will be later than the second moment before the update. It is understandable that the effective duration of the electronic code can be updated according to the update of the second moment, or can maintain the pre-set effective duration, which is not limited here.
[0156] Scene 3
[0157] The following will be combined Fig.11 The adjustment method provided by the present invention is introduced. Fig.11 , Fig.11 This is a schematic diagram of an embodiment of time alignment between the client and the code scanning device in an embodiment of the present invention. As shown in the figure, when the time of code scanning device A is faster than the time of the client, it is assumed that the time of code scanning device A is 10 seconds faster than the standard time of the client, that is, the deviation time is +10 seconds. If the second moment before the update is 10 minutes and 00 seconds, and the expiration time is 11 minutes and 00 seconds, then because the code scanning device A is 10 seconds faster, the electronic code scanned in the interval from 10 minutes and 50 seconds to 11 minutes and 00 seconds is invalid, then the electronic code scanned by the code scanning device in the interval from 9 minutes and 50 seconds to 10 minutes and 00 seconds is valid. When the time of code scanning device B is slower than the time of the client, it is assumed that the time of code scanning device B is 10 seconds slower than the standard time of the client, that is, the deviation time is -10 seconds. If the second moment before the update is 10:00 and the expiration moment is 11:00, then, because the barcode scanning machine is 10 seconds slow, the electronic code scanned by barcode scanning machine B in the interval from 10:00 to 10:10 is invalid, and the electronic code is valid in the interval from 11:00 to 11:10 under standard time.
[0158] In order to synchronize the time of scanner A, the time of scanner B and the standard time of the client, the second moment can be generated according to the first moment, the drawing time and the deviation time, that is:
[0159] Second time before update = first time + drawing time = 10 minutes and 00 seconds
[0160] The second time after updating = the second time before updating - the deviation time
[0161] = 10 minutes 00 seconds - 10 seconds = 9 minutes 50 seconds
[0162] Expiration time after update = expiration time before update + deviation time
[0163] =11 minutes 00 seconds + 10 seconds = 11 minutes 10 seconds
[0164] In the embodiment of the present invention, after obtaining the electronic code display instruction of the electronic code, the client can also receive the deviation time of the electronic code, and then generate the second time according to the first time, the drawing time and the deviation time. In the above manner, the client can also adjust the effective start time of the electronic code to solve the problem of time inequality between the code scanning machine and the client, that is, solve the problem of low electronic code validity verification rate caused by the time deviation of the code scanning machine. Corresponding adjustments can be made according to the time deviation between the machine and the client, thereby improving the success rate of electronic code verification.
[0165] Optionally, based on the above embodiment, the embodiment of the present invention provides an electronic code display method. In an optional embodiment, the deviation time of receiving the electronic code may include:
[0166] The deviation time of the electronic code is obtained through short-range communication.
[0167] In this embodiment, a method of obtaining the deviation time of an electronic code by means of near-field communication is introduced. Among them, near-field communication, also known as short-range wireless communication, is a short-range high-frequency wireless communication technology that allows non-contact point-to-point data transmission between terminal devices and code scanning machines. This technology evolved from contactless radio frequency identification (RFID). Near-field communication is a short-range high-frequency radio technology that operates at a frequency of 13.56 MHz within a distance of 20 cm. Its transmission speed is 106 kilobits per second, 212 kilobits per second, or 424 kilobits per second.
[0168] Near Field Communication (NFC) is a new type of service in the field of mobile communications. It combines NFC technology with mobile communication technology to realize multiple functions such as electronic payment, identity authentication, ticketing, data exchange, anti-counterfeiting and advertising. NFC makes users' consumption behavior gradually move towards electronicization and establishes a new user consumption and service model.
[0169] Furthermore, in an embodiment of the present invention, a specific method for receiving the deviation time of an electronic code is introduced, that is, the client can obtain the deviation time of the electronic code through a short-range communication method. Through the above method, non-contact point-to-point data transmission and data exchange between electronic devices are allowed. It is very fast to obtain information through a short-range communication method, and the transaction time is very short. In addition, the short-range communication method is very sensitive and can be placed on a code scanning machine. In addition, the short-range communication method is very safe and is fully compatible with ordinary smart card technology.
[0170] The client in the present invention is described in detail below. Fig.12 , Fig.12 This is a schematic diagram of an embodiment of a client in an embodiment of the present invention. The client 20 includes:
[0171] An acquisition module 201 is used to acquire an electronic code display instruction of an electronic code;
[0172] A receiving module 202, configured to receive an electronic code generation instruction of the electronic code, wherein the electronic code generation instruction is generated after the electronic code display instruction;
[0173] The acquisition module 201 is further used to acquire a first moment and a drawing time according to the electronic code generation instruction received by the receiving module 202, wherein the first moment is the moment when the electronic code generation instruction is received, and the drawing time indicates the duration used for drawing the electronic code;
[0174] A generating module 203, configured to generate a second moment according to the first moment obtained by the obtaining module 201 and the drawing time, wherein the second moment is after the first moment;
[0175] The display module 204 is used to display the electronic code at the second moment generated by the generation module 203, wherein the second moment is the effective start moment of the electronic code.
[0176] In this embodiment, the acquisition module 201 acquires an electronic code display instruction of an electronic code, and the receiving module 202 receives an electronic code generation instruction of the electronic code, wherein the electronic code generation instruction is generated after the electronic code display instruction. The acquisition module 201 acquires a first moment and a drawing time according to the electronic code generation instruction received by the receiving module 202, wherein the first moment is the moment when the electronic code generation instruction is received, and the drawing time represents the duration used to draw the electronic code. The generation module 203 generates a second moment according to the first moment and the drawing time acquired by the acquisition module 201, wherein the second moment is after the first moment. The display module 204 displays the electronic code at the second moment generated by the generation module 203, wherein the second moment is the effective start moment of the electronic code.
[0177] In an embodiment of the present invention, a client is provided, the client obtains an electronic code display instruction of an electronic code, and then receives an electronic code generation instruction of the electronic code, wherein the electronic code generation instruction is generated after the electronic code display instruction, the client obtains a first moment and a drawing time according to the electronic code generation instruction, wherein the first moment is the moment of receiving the electronic code generation instruction, and the drawing time indicates the duration used to draw the electronic code, and then the client can generate a second moment according to the first moment and the drawing time, wherein the second moment is after the first moment, and finally the electronic code is displayed at the second moment, wherein the second moment is the effective start moment of the electronic code. Through the above method, the corresponding effective start moment of the electronic code can be calculated according to the performance difference of different terminal devices, and the effective start moment appears after the original effective moment of the electronic code, therefore, the influence of the time consumption of electronic code drawing on the effective time length of the electronic code can be greatly reduced, thereby facilitating the improvement of the availability of the electronic code.
[0178] Optionally, in the above Fig.12 Based on the corresponding embodiments, please refer to Fig.13 In one embodiment of the client 20 provided by the embodiment of the present invention, the client 20 further includes a calculation module 205;
[0179] The acquisition module 201 is further used to acquire the total drawing time of N electronic codes before acquiring the electronic code display instruction of the electronic code, wherein N is an integer greater than or equal to 1;
[0180] The calculation module 205 is used to calculate the drawing time according to the total drawing time of the N electronic codes obtained by the acquisition module 201 and the total number of the N electronic codes.
[0181] Secondly, in the embodiment of the present invention, a method for updating the drawing time of an electronic code in real time is introduced. Before the client obtains the electronic code display instruction of the electronic code, the total drawing time of N electronic codes can also be obtained, where N is an integer greater than or equal to 1, and then the client calculates the drawing time according to the total drawing time of the N electronic codes and the total number of N electronic codes. In the above manner, each time the client obtains the generation time of an electronic code, the average generation time of the entire electronic code can be updated. In this way, the effective time of the generated electronic code can be closer to the actual situation, and the availability of the electronic code on various terminal devices can be improved.
[0182] Optionally, in the above Fig.12 Based on the corresponding embodiments, please refer to Fig.14 In another embodiment of the client 20 provided by the embodiment of the present invention, the client 20 further includes a determination module 206;
[0183] The acquisition module 201 is further used to acquire the historical drawing time of the previous adjacent electronic code of the electronic code before acquiring the electronic code display instruction of the electronic code;
[0184] The determining module 206 is used to determine the historical drawing time obtained by the obtaining module 201 as the drawing time.
[0185] Secondly, in the embodiment of the present invention, a method for determining the drawing time is introduced, that is, before the client obtains the electronic code display instruction of the electronic code, it can also obtain the historical drawing time of the previous adjacent electronic code of the electronic code, and then the client determines the historical drawing time as the drawing time. Through the above method, even if the client does not obtain the average time, the historical drawing time of the previous electronic code can be used to determine the current drawing time. In addition, when the historical drawing time of the electronic code is not detected, there is also a corresponding processing method, thereby improving the practicality and feasibility of the solution.
[0186] Optionally, in the above Fig.12 Based on the corresponding embodiments, please refer to Fig.14 In another embodiment of the client 20 provided by the embodiment of the present invention, the client 20 further includes a determination module 206;
[0187] The acquisition module 201 is further used to acquire the validity time of the electronic code after acquiring the first moment and the drawing time according to the electronic code generation instruction;
[0188] The determining module 206 is further configured to determine a first expiration time of the electronic code according to the validity duration of the electronic code acquired by the acquiring module 201 .
[0189] Secondly, in the embodiment of the present invention, after obtaining the first moment and the drawing time according to the electronic code generation instruction, the client can also obtain the validity period of the electronic code, and then determine the first expiration moment of the electronic code according to the validity period of the electronic code. In the above manner, the expiration moment of the electronic code does not need to consider the drawing time of the electronic code, that is, the validity period of the electronic code will not be extended due to considering the drawing time, thereby improving the security of the electronic code.
[0190] Optionally, in the above Fig.12 Based on the corresponding embodiments, please refer to Fig.14 In one embodiment of the client 20 provided by the embodiment of the present invention, the client 20 further includes a determination module 206;
[0191] The acquisition module 201 is further used to acquire the validity time of the electronic code after acquiring the first moment and the drawing time according to the electronic code generation instruction;
[0192] The determining module 206 is further configured to determine a second expiration time of the electronic code according to the validity time of the electronic code acquired by the acquiring module 201 and the drawing time.
[0193] Secondly, in the embodiment of the present invention, after obtaining the first moment and the drawing time according to the electronic code generation instruction, the client can also obtain the validity period of the electronic code, and then determine the second expiration time of the electronic code according to the validity period and the drawing time of the electronic code. In the above manner, the expiration time of the electronic code needs to take into account the drawing time of the electronic code, which is equivalent to extending the validity period of the electronic code, thereby improving the convenience of electronic code application.
[0194] Optionally, in the above Fig.12 , Fig.13 or Fig.14 On the basis of the corresponding embodiment, in one embodiment of the client 20 provided by the embodiment of the present invention,
[0195] The receiving module 202 is further configured to receive the deviation time of the electronic code after the obtaining module 201 obtains the electronic code display instruction of the electronic code;
[0196] The generating module 203 is specifically configured to generate the second moment according to the first moment, the drawing time, and the deviation time received by the receiving module 202 .
[0197] Again, in the embodiment of the present invention, after obtaining the electronic code display instruction of the electronic code, the client can also receive the deviation time of the electronic code, and then generate the second time according to the first time, the drawing time and the deviation time. In the above manner, the client can also adjust the effective start time of the electronic code to solve the problem of unequal time between the code scanning machine and the client, that is, solve the problem of low electronic code validity verification rate caused by the time deviation of the code scanning machine. Corresponding adjustments can be made for the time deviation between the machine and the client, thereby improving the success rate of electronic code verification.
[0198] Optionally, in the above Fig.12 , Fig.13 or Fig.14 On the basis of the corresponding embodiment, in another embodiment of the client 20 provided by the embodiment of the present invention,
[0199] The receiving module 202 is specifically configured to obtain the deviation time of the electronic code through short distance communication.
[0200] In an embodiment of the present invention, a specific method for receiving the deviation time of an electronic code is introduced, that is, the client can obtain the deviation time of the electronic code through a short-range communication method. Through the above method, non-contact point-to-point data transmission and data exchange between electronic devices are allowed. It is very fast to obtain information through a short-range communication method, and the transaction time is very short. In addition, the short-range communication method is very sensitive and can be placed on a code scanning machine. In addition, the short-range communication method is very safe and is fully compatible with ordinary smart card technology.
[0201] The embodiment of the present invention also provides a terminal device, such as Fig.15 For the sake of convenience, only the parts related to the embodiments of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present invention. The terminal device can be any terminal device including a mobile phone, a tablet computer, a personal digital assistant (PDA), a point of sales (POS), a car computer, etc., taking the mobile phone as an example:
[0202] Fig.15 FIG. 1 is a block diagram showing a partial structure of a mobile phone related to a terminal device provided in an embodiment of the present invention. Fig.15 The mobile phone includes: a radio frequency (RF) circuit 310, a memory 320, an input unit 330, a display unit 340, a sensor 350, an audio circuit 360, a wireless fidelity (WiFi) module 370, a processor 380, and a power supply 390. Those skilled in the art will understand that Fig.15 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0203] Combine the following Fig.15 A detailed introduction to the various components of the mobile phone:
[0204] The RF circuit 310 can be used for receiving and sending signals during the process of sending and receiving information or making calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 380 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 310 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 310 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the global system of mobile communication (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), long term evolution (LTE), email, short messaging service (SMS), etc.
[0205] The memory 320 can be used to store software programs and modules. The processor 380 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 320. The memory 320 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 320 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0206] The input unit 330 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 330 may include a touch panel 331 and other input devices 332. The touch panel 331, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 331 or near the touch panel 331 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 331 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 380, and can receive and execute commands sent by the processor 380. In addition, the touch panel 331 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 331, the input unit 330 may also include other input devices 332. Specifically, other input devices 332 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.
[0207] The display unit 340 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 340 may include a display panel 341. Optionally, the display panel 341 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 331 may cover the display panel 341. When the touch panel 331 detects a touch operation on or near it, it is transmitted to the processor 380 to determine the type of touch event. Subsequently, the processor 380 provides a corresponding visual output on the display panel 341 according to the type of touch event. Although in Fig.15 In the embodiment, the touch panel 331 and the display panel 341 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 331 and the display panel 341 can be integrated to realize the input and output functions of the mobile phone.
[0208] The mobile phone may also include at least one sensor 350, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 341 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 341 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0209] The audio circuit 360, the speaker 361, and the microphone 362 can provide an audio interface between the user and the mobile phone. The audio circuit 360 can transmit the received audio data to the speaker 361 after converting the electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 362 converts the collected sound signal into an electrical signal, which is received by the audio circuit 360 and converted into audio data, and then the audio data is output to the processor 380 for processing, and then sent to another mobile phone through the RF circuit 310, or the audio data is output to the memory 320 for further processing.
[0210] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 370. It provides users with wireless broadband Internet access. Fig.15 A WiFi module 370 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.
[0211] The processor 380 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. It executes various functions of the mobile phone and processes data by running or executing software programs and / or modules stored in the memory 320, and calling data stored in the memory 320. Optionally, the processor 380 may include one or more processing units; optionally, the processor 380 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 380.
[0212] The mobile phone also includes a power supply 390 (such as a battery) for supplying power to various components. Optionally, the power supply can be logically connected to the processor 380 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.
[0213] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0214] In the embodiment of the present invention, the processor 380 included in the terminal device also has the following functions:
[0215] An electronic code display instruction for obtaining an electronic code;
[0216] receiving an electronic code generation instruction of the electronic code, wherein the electronic code generation instruction is generated after the electronic code display instruction;
[0217] Acquire a first moment and a drawing time according to the electronic code generation instruction, wherein the first moment is the moment when the electronic code generation instruction is received, and the drawing time indicates the duration used for drawing the electronic code;
[0218] generating a second moment according to the first moment and the drawing time, wherein the second moment is after the first moment;
[0219] The electronic code is displayed at the second time, wherein the second time is a starting time when the electronic code becomes effective.
[0220] Optionally, the processor 380 is further configured to perform the following steps:
[0221] Obtaining the total drawing time of N electronic codes, wherein N is an integer greater than or equal to 1;
[0222] The drawing time is calculated according to the total drawing time of the N electronic codes and the total number of the N electronic codes.
[0223] Optionally, the processor 380 is further configured to perform the following steps:
[0224] Obtaining the historical drawing time of the previous adjacent electronic code of the electronic code;
[0225] The historical drawing time is determined as the drawing time.
[0226] Optionally, the processor 380 is further configured to perform the following steps:
[0227] Obtaining the validity period of the electronic code;
[0228] The first expiration time of the electronic code is determined according to the validity period of the electronic code.
[0229] Optionally, the processor 380 is further configured to perform the following steps:
[0230] Obtaining the validity period of the electronic code;
[0231] The second expiration time of the electronic code is determined according to the validity time of the electronic code and the drawing time.
[0232] Optionally, the processor 380 is further configured to perform the following steps:
[0233] a deviation time of receiving the electronic code;
[0234] The second moment is generated according to the first moment, the drawing time, and the deviation time.
[0235] Optionally, the processor 380 is specifically configured to perform the following steps:
[0236] The deviation time of the electronic code is obtained by short distance communication.
[0237] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0238] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0239] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0240] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0241] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes. The embodiment of the present invention also provides a computer-readable storage medium, including instructions, which, when running on a computer, enables the computer to execute the method described in the embodiment of the present invention.
[0242] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for displaying an electronic code, characterized in that: include: The deviation time of receiving the electronic code; the deviation time refers to the deviation between the time of the code scanning machine and the standard time; Obtaining an electronic code display instruction for the electronic code; receiving an electronic code generation instruction of the electronic code, wherein the electronic code generation instruction is generated after the electronic code display instruction; Acquire a first moment and a drawing time according to the electronic code generation instruction, wherein the first moment is the moment when the electronic code generation instruction is received, and the drawing time indicates the duration used for drawing the electronic code, and the drawing time is determined according to the total duration of drawing N electronic codes and the total number of the N electronic codes, where N is an integer greater than or equal to 1; Generate a second moment according to the first moment, the drawing time, and the deviation time, wherein the second moment is after the first moment; Displaying the electronic code at the second time, wherein the second time is the same as the effective start time of the electronic code, or the second time is before or after the effective start time of the electronic code; The validity period of the electronic code is obtained, and the first expiration time of the electronic code is determined according to the validity period of the electronic code.
2. The display method according to claim 1, characterized in that: Before obtaining the electronic code display instruction of the electronic code, the method further includes: Obtaining the historical drawing time of the previous adjacent electronic code of the electronic code; The historical drawing time is determined as the drawing time.
3. The display method according to claim 1, characterized in that: After obtaining the first moment and the drawing time according to the electronic code generation instruction, the method further includes: Obtaining the validity period of the electronic code; The second expiration time of the electronic code is determined according to the validity time of the electronic code and the drawing time.
4. The display method according to claim 1, characterized in that: The deviation time of receiving the electronic code includes: The deviation time of the electronic code is obtained by short-range communication.
5. A client, characterized in that: include: An acquisition module, used for acquiring an electronic code display instruction of an electronic code; A receiving module, used for receiving the deviation time of the electronic code; The deviation time refers to the deviation between the time of the code scanning machine and the standard time; receiving the electronic code generation instruction of the electronic code, wherein the electronic code generation instruction is generated after the electronic code display instruction; The acquisition module is further used to acquire a first moment and a drawing time according to the electronic code generation instruction received by the receiving module, wherein the first moment is the moment when the electronic code generation instruction is received, and the drawing time indicates the duration used for drawing the electronic code, and the drawing time is determined according to the total duration of drawing N electronic codes and the total number of the N electronic codes, where N is an integer greater than or equal to 1; A generating module, configured to generate a second moment according to the first moment acquired by the acquiring module, the drawing time and the deviation time, wherein the second moment is after the first moment; A display module, configured to display the electronic code at the second moment generated by the generation module, wherein the second moment is the same as the effective start moment of the electronic code, or the second moment is before or after the effective start moment of the electronic code; The client also includes a determination module; The acquisition module is further used to acquire the validity time of the electronic code after acquiring the first moment and the drawing time according to the electronic code generation instruction; The determining module is further used to determine a first expiration time of the electronic code according to the validity duration of the electronic code acquired by the acquiring module.
6. The client according to claim 5, characterized in that: The client also includes a determination module; The acquisition module is further used to acquire the historical drawing time of the previous adjacent electronic code of the electronic code before acquiring the electronic code display instruction of the electronic code; The determining module is used to determine the historical drawing time obtained by the obtaining module as the drawing time.
7. The client according to claim 5, characterized in that: The client also includes a determination module; The acquisition module is further used to acquire the validity time of the electronic code after acquiring the first moment and the drawing time according to the electronic code generation instruction; The determining module is further configured to determine a second expiration time of the electronic code according to the validity time of the electronic code acquired by the acquiring module and the drawing time.
8. The client according to claim 5, characterized in that: The receiving module is specifically used to obtain the deviation time of the electronic code through short-range communication.
9. A terminal device, characterized in that: include: Memory and processor; Wherein, the memory is used to store programs; The processor is used to execute the program in the memory, comprising the following steps: The deviation time of receiving the electronic code; the deviation time refers to the deviation between the time of the code scanning machine and the standard time; An electronic code display instruction for obtaining an electronic code; receiving an electronic code generation instruction of the electronic code, wherein the electronic code generation instruction is generated after the electronic code display instruction; Acquire a first moment and a drawing time according to the electronic code generation instruction, wherein the first moment is the moment when the electronic code generation instruction is received, and the drawing time indicates the duration used for drawing the electronic code, and the drawing time is determined according to the total duration of drawing N electronic codes and the total number of the N electronic codes, where N is an integer greater than or equal to 1; Generate a second moment according to the first moment, the drawing time, and the deviation time, wherein the second moment is after the first moment; Displaying the electronic code at the second time, wherein the second time is the same as the effective start time of the electronic code, or the second time is before or after the effective start time of the electronic code; The validity period of the electronic code is obtained, and the first expiration time of the electronic code is determined according to the validity period of the electronic code.
10. A computer-readable storage medium comprising instructions, which, when executed on a computer, causes the computer to perform the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Payment method and payment system based on dynamic two-dimensional code
CN105590199A
Two-dimensional code displaying and identification method and device thereof
CN108681896A