Local resource checking method and device

文档序号:190883 发布日期:2021-11-02 浏览:29次 中文

阅读说明:本技术 一种本地资源校验方法及装置 (Local resource checking method and device ) 是由 赵磊 赵立永 李文博 王昊明 王昊月 于 2021-06-19 设计创作,主要内容包括:本发明公开了一种本地资源校验方法及装置,其中,所述方法包括:自助终端设备在确定需进行显示操作之后,从本地获取待显示的资源文件以及相应的密文;所述自助终端设备基于所述资源文件以及预设加密算法生成校验值,其中,所述密文也由所述预设加密算法计算生成;所述自助终端设备将所述校验值与所述密文进行对比认证,如果认证成功则显示所述资源文件的内容,否则不显示所述资源文件的内容。本发明先对本地资源进行加密,并在资源文件显示之前,动态进行加密校验,以判断资源文件是否合法,只有合法的资源才会被显示出来,从而能够提高产品的安全性,并有效解决自助终端设备本地资源被偷换,进行非法宣传的问题。(The invention discloses a local resource checking method and a local resource checking device, wherein the method comprises the following steps: after the self-service terminal equipment determines that the display operation is required, the resource file to be displayed and the corresponding ciphertext are obtained locally; the self-service terminal equipment generates a check value based on the resource file and a preset encryption algorithm, wherein the ciphertext is generated by the preset encryption algorithm in a calculation mode; and the self-service terminal equipment compares the check value with the ciphertext for authentication, if the authentication is successful, the content of the resource file is displayed, otherwise, the content of the resource file is not displayed. According to the invention, the local resources are encrypted firstly, and before the resource file is displayed, encryption verification is dynamically carried out to judge whether the resource file is legal or not, and only the legal resources can be displayed, so that the safety of the product can be improved, and the problems that the local resources of the self-service terminal equipment are stolen and illegally publicized are solved effectively.)

1. A local resource checking method, the method comprising:

after the self-service terminal equipment determines that the display operation is required, the resource file to be displayed and the corresponding ciphertext are obtained locally;

the self-service terminal equipment generates a check value based on the resource file and a preset encryption algorithm, wherein the ciphertext is generated by the preset encryption algorithm in a calculation mode;

and the self-service terminal equipment compares the check value with the ciphertext for authentication, if the authentication is successful, the content of the resource file is displayed, otherwise, the content of the resource file is not displayed.

2. The method of claim 1, further comprising:

and after receiving a system software upgrading package sent by a server, the self-service terminal equipment downloads the resource file and the ciphertext file in the system software upgrading package to the local.

3. The method according to claim 1, wherein the predetermined encryption algorithm employs MD5 message digest algorithm.

4. The method according to claim 3, wherein the step of generating a check value by the self-service terminal device based on the resource file and a preset encryption algorithm comprises:

respectively generating a group of MD5 values based on one or more of the resource file, the local certificate file, the self-service terminal equipment related number and the system software version number;

regenerating a new set of MD5 values as the check values based on the generated total MD5 values.

5. The method of claim 4, wherein the self-service terminal device is a charging post,

the number related to the self-service terminal equipment comprises one or more of a charging station number, a charging pile number and a charging gun number.

6. A local resource verifying device is applied to self-service terminal equipment and comprises the following components:

the acquisition module is used for acquiring the resource file to be displayed and the corresponding ciphertext from the local after the display operation is determined to be required;

the generating module is used for generating a check value based on the resource file and a preset encryption algorithm, wherein the ciphertext is generated by the preset encryption algorithm;

and the authentication module is used for comparing and authenticating the check value and the ciphertext, displaying the content of the resource file if the authentication is successful, and not displaying the content of the resource file if the authentication is not successful.

7. The apparatus of claim 6, further comprising a download module;

and the downloading module is used for downloading the resource file and the ciphertext file in the system software upgrading package to the local after receiving the system software upgrading package sent by the server.

8. The apparatus of claim 6,

the generating module is specifically configured to generate a group of MD5 values based on one or more of the resource file, the local certificate file, the self-service terminal device-related number, and the system software version number;

regenerating a new set of MD5 values as the check values based on the generated total MD5 values.

9. The apparatus of claim 8, wherein the self-service terminal device is a charging post,

the number related to the self-service terminal equipment comprises one or more of a charging station number, a charging pile number and a charging gun number.

10. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;

a memory for storing a computer program;

a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.

Technical Field

The invention relates to the technical field of computers, in particular to a local resource checking method and a local resource checking device.

Background

Self-service terminal equipment generally consists of a human-computer interface, and is operated by a user according to equipment prompts. Such as self-service ticket vending machines, self-service registration machines, self-service vending machines, and charging piles for charging new energy vehicles. The self-service terminal equipment can display corresponding picture contents in the human-computer interaction process so that a user can smoothly handle related services. Currently, self-service terminal equipment has the risk of being stolen for local resources. If the local resources are stolen, the self-service terminal equipment can display illegal contents after acquiring the local resources and displaying the local resources, so that the user experience is reduced. Therefore, a local resource checking method is needed to ensure that the operation can be terminated when displaying illegal contents, so as to prevent illegal propaganda.

Disclosure of Invention

In order to solve the problems in the prior art, embodiments of the present invention provide a local resource checking method and apparatus. The technical scheme is as follows:

in a first aspect, a local resource checking method is provided, where the method includes:

after the self-service terminal equipment determines that the display operation is required, the resource file to be displayed and the corresponding ciphertext are obtained locally;

the self-service terminal equipment generates a check value based on the resource file and a preset encryption algorithm, wherein the ciphertext is generated by the preset encryption algorithm in a calculation mode;

and the self-service terminal equipment compares the check value with the ciphertext for authentication, if the authentication is successful, the content of the resource file is displayed, otherwise, the content of the resource file is not displayed.

Further, the method further comprises:

and after receiving a system software upgrading package sent by a server, the self-service terminal equipment downloads the resource file and the ciphertext file in the system software upgrading package to the local.

Further, the preset encryption algorithm adopts an MD5 message digest algorithm.

Further, the step of generating, by the self-service terminal device, a check value based on the resource file and a preset encryption algorithm includes:

respectively generating a group of MD5 values based on one or more of the resource file, the local certificate file, the self-service terminal equipment related number and the system software version number;

regenerating a new set of MD5 values as the check values based on the generated total MD5 values.

Further, the self-service terminal equipment is a charging pile, and the related serial numbers of the self-service terminal equipment comprise one or more of a charging station serial number, a charging pile serial number and a charging gun serial number.

In a second aspect, a local resource checking device is provided, which is applied to self-service terminal equipment, and the device includes:

the acquisition module is used for acquiring the resource file to be displayed and the corresponding ciphertext from the local after the display operation is determined to be required;

the generating module is used for generating a check value based on the resource file and a preset encryption algorithm, wherein the ciphertext is generated by the preset encryption algorithm;

and the authentication module is used for comparing and authenticating the check value and the ciphertext, displaying the content of the resource file if the authentication is successful, and not displaying the content of the resource file if the authentication is not successful.

In a third aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;

a memory for storing a computer program;

and the processor is configured to implement the local resource checking method according to the first aspect when executing the program stored in the memory.

In the embodiment of the invention, the local resources are encrypted firstly, and before the resource file is displayed, the encryption is dynamically checked to judge whether the resource file is legal or not, and only the legal resources can be displayed, so that the safety of the product can be improved, and the problems that the local resources of the self-service terminal equipment are stolen and illegally publicized are effectively solved.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.

Fig. 1 is a flowchart of a local resource checking method according to an embodiment of the present invention;

fig. 2 is a block diagram of a local resource checking apparatus according to an embodiment of the present invention;

fig. 3 is a block diagram of an electronic device according to an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.

Referring to fig. 1, a flowchart of a local resource checking method provided in an embodiment of the present invention is applied to a self-service terminal device, that is, executed by the self-service terminal device.

Step 101, after receiving a system software upgrading package sent by a server, self-service terminal equipment downloads resource files and ciphertext files in the system software upgrading package to the local.

The system software required by the operation of the self-service terminal equipment can be issued to the self-service terminal equipment by the server side. When system software needs to be upgraded, for example, new module functions and interfaces are added, so that new resource files for display need to be added, ciphertext of each resource file is generated through a preset encryption algorithm, wherein each resource file generates a ciphertext. And then, packaging the new system software and the generated ciphertext file into an upgrade package, and sending the packaged system software upgrade package to the self-service terminal equipment by the server side. And after receiving the system software upgrading package sent by the server, the self-service terminal equipment conducts decompression installation and downloads the resource file and the ciphertext file in the system software upgrading package to the local. And storing the ciphertext corresponding to each resource file in the ciphertext file.

The preset encryption algorithm may employ an irreversible encryption algorithm, such as the MD5 message digest algorithm. After the original text is encrypted by the irreversible encryption algorithm, the ciphertext cannot be restored to the original text, the difficulty of reversely cracking the algorithm is improved, and the safety of the product is improved. In implementation, the encryption can be performed by using not only the resource file for display, but also other resource information, such as a local certificate file, a self-service terminal device related number, a system software version number, and the like. The invention utilizes multi-resource control encryption, and can greatly improve the safety of products.

The process of generating the ciphertext of the resource file by using the preset encryption algorithm may specifically include: respectively generating a group of MD5 values based on one or more of resource files, local certificate files, self-service terminal equipment related numbers and system software version numbers, and then generating a new group of MD5 values as ciphertext based on all the generated MD5 values. The local certificate may have a string key for identification. Taking self-service terminal equipment as an example of charging pile, the number related to the self-service terminal equipment can comprise one or more of a charging station number, a charging pile number and a charging gun number. If each charging pile only has one charging gun, a group of MD5 values can be respectively generated by using the charging station number and the charging pile number; if there are multiple charging guns on each charging post, in addition to using the charging station number and the charging post number to generate an MD5 value, a set of MD5 values may be generated using the charging gun number.

For example, a set of MD5 values with a preset number of digits (e.g., 16 digits) is generated based on 5 resources, i.e., a total of 5 sets of MD5 values, such as a resource file, a local certificate file, a charging station number, a charging post number, and a system software version number. The generated 5 groups of MD5 values can be synthesized into a new character string by a tail addition mode, then the synthesized new character string is processed by an MD5 information summarization algorithm to calculate and generate a new group of MD5 values with preset digits (for example, 16 digits), and the newly generated MD5 value is used as the ciphertext of the resource file.

It should be noted that, the embodiment of the present invention does not specifically limit the resources used for encryption, and in specific implementation, appropriate resource information may be selected by user according to a specific application scenario to perform encryption calculation, so as to obtain a corresponding ciphertext.

And step 102, after the self-service terminal equipment determines that the display operation is required, the resource file to be displayed and the corresponding ciphertext are obtained from the local.

When the self-service terminal equipment performs man-machine interaction with a user, relevant contents are inevitably required to be displayed on an interface of the equipment. And after the self-service terminal equipment determines that the display operation is required, the resource file to be displayed and the corresponding ciphertext are acquired from the local.

And 103, generating a check value by the self-service terminal equipment based on the resource file and a preset encryption algorithm.

And step 104, the self-service terminal equipment compares and authenticates the check value and the ciphertext, if the authentication is successful, the content of the resource file is displayed, otherwise, the content of the resource file is not displayed.

After the self-service terminal equipment acquires the resource file and the corresponding ciphertext from the local, a check value is generated according to a preset encryption algorithm. Wherein, the encryption algorithm for generating the check value is the same as the encryption algorithm for generating the ciphertext. That is to say, the process of generating the check value by the self-service terminal device based on the resource file and the preset encryption algorithm may include: respectively generating a group of MD5 values based on one or more of resource files, local certificate files, self-service terminal equipment related numbers and system software version numbers, and then generating a new group of MD5 values as ciphertext based on all the generated MD5 values. If the self-service terminal device is a charging pile, the number related to the self-service terminal device can comprise one or more of a charging station number, a charging pile number and a charging gun number.

It should be noted that, the encryption algorithm used for generating the check value is the same as the encryption algorithm used for generating the ciphertext, and the process of generating the check value may specifically refer to the process of generating the ciphertext, which is not described herein again.

After the self-service terminal equipment generates a check value, the check value and the ciphertext are compared and authenticated, if the authentication is successful, namely the check value is the same as the ciphertext, the acquired resource file is a legal resource, the content of the acquired resource file is displayed, and otherwise, the content of the resource file is not displayed. If the check value is different from the ciphertext, the obtained resource file is an illegal resource, and the local resource is possibly illegally tampered, the illegal resource can be deleted, and then the default resource is displayed, so that the normal operation of the self-service terminal equipment is ensured.

In one scenario, if the local resource has been tampered and the tampered resource file is not encrypted, the ciphertext cannot be obtained, and after the resource file is obtained from the local, the obtained resource file can be directly determined to be an illegal resource.

In implementation, the self-service terminal device may use a plurality of resource files when displaying, that is, the resource files need to be checked at the same time, so that the embodiment may adopt a processing method of multi-thread operation to improve the operation efficiency.

In addition, the present embodiment adopts a mutual exclusion manner of shared resources, that is, the same resource can be used by only one program, so as to ensure the stability of the program. For example, when two threads need to acquire the same resource file for encryption verification, only one thread is allowed to acquire the resource file.

In the embodiment of the invention, the local resources are encrypted firstly, and before the resource file is displayed, the encryption is dynamically checked to judge whether the resource file is legal or not, and only the legal resources can be displayed, so that the safety of the product can be improved, and the problems that the local resources of the self-service terminal equipment are stolen and illegally publicized are effectively solved.

Referring to fig. 2, a structural block diagram of a local resource checking apparatus provided in an embodiment of the present invention is applied to a self-service terminal device, and the apparatus may specifically include a downloading module 201, an obtaining module 202, a generating module 203, and an authenticating module 204.

The downloading module 201 is configured to, after receiving a system software upgrade package sent by a server, download a resource file and a ciphertext file in the system software upgrade package to a local location.

The obtaining module 202 is configured to obtain a resource file to be displayed and a corresponding ciphertext from a local location after it is determined that a display operation needs to be performed;

a generating module 203, configured to generate a check value based on the resource file and a preset encryption algorithm, where the ciphertext is generated by the preset encryption algorithm;

and the authentication module 204 is configured to compare the check value with the ciphertext for authentication, display the content of the resource file if the authentication is successful, and not display the content of the resource file if the authentication is not successful.

Preferably, the preset encryption algorithm adopts an MD5 message digest algorithm.

Preferably, the generating module 203 is specifically configured to generate a set of MD5 values based on one or more of the resource file, the local certificate file, the self-service terminal device related number, and the system software version number;

regenerating a new set of MD5 values as the check values based on the generated total MD5 values.

Preferably, the self-service terminal equipment is a charging pile, and the related serial number of the self-service terminal equipment comprises one or more of a charging station serial number, a charging pile serial number and a charging gun serial number.

In the embodiment of the invention, the local resources are encrypted firstly, and before the resource file is displayed, the encryption is dynamically checked to judge whether the resource file is legal or not, and only the legal resources can be displayed, so that the safety of the product can be improved, and the problems that the local resources of the self-service terminal equipment are stolen and illegally publicized are effectively solved.

An embodiment of the present invention further provides an electronic device, as shown in fig. 3, including a processor 001, a communication interface 002, a memory 003 and a communication bus 004, where the processor 001, the communication interface 002 and the memory 003 complete mutual communication through the communication bus 004,

a memory 003 for storing a computer program;

the processor 001 is configured to implement the local resource checking method when executing the program stored in the memory 003, and the method includes:

after the display operation is determined to be required, the resource file to be displayed and the corresponding ciphertext are obtained locally;

generating a check value based on the resource file and a preset encryption algorithm, wherein the ciphertext is generated by the preset encryption algorithm;

and comparing and authenticating the check value and the ciphertext, if the authentication is successful, displaying the content of the resource file, otherwise, not displaying the content of the resource file.

In the embodiment of the invention, the local resources are encrypted firstly, and before the resource file is displayed, the encryption is dynamically checked to judge whether the resource file is legal or not, and only the legal resources can be displayed, so that the safety of the product can be improved, and the problems that the local resources of the self-service terminal equipment are stolen and illegally publicized are effectively solved.

The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.

The communication interface is used for communication between the electronic equipment and other equipment.

The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.

The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.

In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.

It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the embodiments of the apparatus and the electronic device, since they are substantially similar to the embodiments of the method, the description is simple, and the relevant points can be referred to only in the partial description of the embodiments of the method.

The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:三元数据保护方法、装置、设备和计算机可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类