CN110046514B - Debug data protection method, device, server and storage medium - Google Patents

Debug data protection method, device, server and storage medium Download PDF

Info

Publication number
CN110046514B
CN110046514B CN201910297409.7A CN201910297409A CN110046514B CN 110046514 B CN110046514 B CN 110046514B CN 201910297409 A CN201910297409 A CN 201910297409A CN 110046514 B CN110046514 B CN 110046514B
Authority
CN
China
Prior art keywords
data packet
intelligent terminal
debugging
preset
debug
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910297409.7A
Other languages
Chinese (zh)
Other versions
CN110046514A (en
Inventor
柯杰燕
李业生
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN201910297409.7A priority Critical patent/CN110046514B/en
Publication of CN110046514A publication Critical patent/CN110046514A/en
Application granted granted Critical
Publication of CN110046514B publication Critical patent/CN110046514B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a debug data protection method, a device, a server and a storage medium, wherein when a debug request is received, whether a preset field exists in the debug request is judged; when a preset field exists in the debugging request, starting a primary debugging serial port switch of the intelligent terminal, and acquiring a key package identification code of the intelligent terminal by the primary debugging serial port switch; generating a target encrypted data packet according to the key packet identification code; the target encrypted data packet is sent to the intelligent terminal, so that the intelligent terminal compares the local encrypted data packet with the target encrypted data packet to generate and feed back a comparison result; judging whether the current debugging state of the intelligent terminal is switched from the initial locking state to the unlocking state according to the comparison result, the problem that the intelligent terminal is abnormal due to the fact that the debugging data are modified can be avoided, the use cost and the operation cost are reduced, the service life and the safety of the intelligent terminal are improved, and the user experience is improved.

Description

Debug data protection method, device, server and storage medium
Technical Field
The present invention relates to the field of device debugging, and in particular, to a method, an apparatus, a server, and a storage medium for protecting debug data.
Background
With the increasing popularity of intelligent terminals and networks, the small operations of various intelligent terminal debugging on the networks are easy to spread, so that common users of the intelligent terminals can easily master skills, more and more people try to modify by hands, more and more harm to products enter a development or debugging mode, and irreversible debugging data are modified, thereby causing the intelligent terminals to be abnormal; because the development or debugging mode is generally given to a developer or a mode used during production debugging, if the debugging data is modified under the condition, deviation of sound or picture output can be caused, part of modules are abnormal, even the system is blocked, and once the abnormality occurs, the problem can be solved only through after-sales or professional staff, and the use cost of a user and the operation cost of the developer are increased.
Disclosure of Invention
The invention mainly aims to provide a debug data protection method, a device, equipment and a storage medium, which aim to solve the technical problems that in the prior art, the debug data of an intelligent terminal is easy to modify, the system is abnormal, and the operation cost and the use cost are increased.
In order to achieve the above object, the present invention provides a debug data protection method, including the steps of:
judging whether a preset field exists in a debugging request or not when the debugging request is received;
when the preset field exists in the debugging request, a primary debugging serial port switch of the intelligent terminal is started, and a key package identification code of the intelligent terminal is obtained through the primary debugging serial port switch;
generating a target encrypted data packet according to the key packet identification code;
the target encrypted data packet is sent to the intelligent terminal, so that the intelligent terminal compares the local encrypted data packet with the target encrypted data packet, and a comparison result is generated and fed back;
and judging whether the current debugging state of the intelligent terminal is switched from the initial locking state to the unlocking state according to the comparison result.
Preferably, when receiving the debug request, the judging whether the debug request has a preset field specifically includes:
when a debug request is detected, acquiring each field in the debug request;
analyzing each field to determine whether each field contains a preset debugging handshake command and a target debugging field corresponding to a preset identification code reading command;
Judging whether a preset field exists in the debugging request according to whether each field contains the target debugging field or not.
Preferably, the generating the target encrypted data packet according to the key packet identification code specifically includes:
searching a corresponding data packet from a preset database according to the key packet identification code to serve as a verification data packet;
and generating a target encrypted data packet according to the check data packet.
Preferably, the generating the target encrypted data packet according to the check data packet specifically includes:
acquiring a random check code and a hardware identification code corresponding to the check data packet;
generating a target data packet according to a preset random identification code, a preset primary key, a secondary random check code, the random check code and the hardware identification code;
extracting the preset one-time key, the preset random identification code, the secondary random check code and the random check code from the target data packet;
encrypting the secondary random check code and the random check code according to the preset disposable key;
and generating a target encrypted data packet according to the preset random identification code, the encrypted secondary random check code and the random check code.
Preferably, the sending the target encrypted data packet to the intelligent terminal, so that the intelligent terminal compares a local encrypted data packet with the target encrypted data packet, and generates and feeds back a comparison result, which specifically includes:
And sending the target encrypted data packet to the intelligent terminal so that the intelligent terminal decrypts the target encrypted data packet to obtain an encrypted secondary random check code, comparing the local check code in the local encrypted data packet with the encrypted secondary random check code, and generating and feeding back a comparison result.
Preferably, when receiving the debug request, before determining whether a preset field exists in the debug request, the debug data protection method further includes:
when the current state of the intelligent terminal is detected to be a production state and an encryption application of a Personal Computer (PC) debugging tool is received, a preset encryption data packet is generated;
the preset encryption data packet is sent to the intelligent terminal, so that the intelligent terminal can store the preset encryption data packet as a local encryption data packet;
when the current state of the intelligent terminal is detected to be a factory state, a serial port closing instruction is generated, and the primary debugging serial port switch is closed according to the serial port closing instruction.
Preferably, when detecting that the current state of the intelligent terminal is a production state and receiving an encryption application of a PC debugging tool, the method specifically includes:
When the current state of the intelligent terminal is detected to be a production state and an encryption application of a personal computer PC debugging tool is received, acquiring an initial identification code, an initial check code, an initial key and an initial hardware identification code corresponding to the personal computer PC debugging tool according to the encryption application;
generating an initial data packet according to the initial identification code, the initial check code, the initial key and the initial hardware identification code;
encrypting the initial check code according to the initial key, and generating a preset encrypted data packet according to the initial identification code and the encrypted initial check code.
In addition, to achieve the above object, the present invention also proposes a server including: the battery cabinet comprises a battery cabinet body, a memory, a processor and a debugging data protection program which is stored on the memory and can run on the processor, wherein the debugging data protection program is configured to realize the steps of the debugging data protection method.
In addition, to achieve the above object, the present invention also proposes a storage medium having stored thereon a debug data protection program which, when executed by a processor, implements the steps of the debug data protection method as described above.
In addition, to achieve the above object, the present invention also provides a debug data protection device, including:
the judging module is used for judging whether a preset field exists in the debugging request or not when the debugging request is received;
the starting module is used for starting a primary debugging serial port switch of the intelligent terminal when the preset field exists in the debugging request, and acquiring a key package identification code of the intelligent terminal through the primary debugging serial port switch;
the data packet generating module is used for generating a target encrypted data packet according to the key packet identification code;
the comparison module is used for sending the target encrypted data packet to the intelligent terminal so that the intelligent terminal compares the local encrypted data packet with the target encrypted data packet to generate and feed back a comparison result;
and the unlocking module is used for judging whether the current debugging state of the intelligent terminal is switched from the initial locking state to the unlocking state according to the comparison result.
According to the debugging data protection method provided by the invention, when a debugging request is received, whether a preset field exists in the debugging request is judged; when the preset field exists in the debugging request, a primary debugging serial port switch of the intelligent terminal is started, and a key package identification code of the intelligent terminal is obtained through the primary debugging serial port switch; generating a target encrypted data packet according to the key packet identification code; the target encrypted data packet is sent to the intelligent terminal, so that the intelligent terminal compares the local encrypted data packet with the target encrypted data packet, and a comparison result is generated and fed back; and judging whether the current debugging state of the intelligent terminal is switched from the initial locking state to the unlocking state according to the comparison result, so that the problem that the intelligent terminal is abnormal due to the fact that the debugging data are modified can be avoided, the use cost and the operation cost are reduced, the service life and the safety of the intelligent terminal are improved, and the user experience is improved.
Drawings
FIG. 1 is a schematic diagram of a server architecture of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a debug data protection method according to the present invention;
FIG. 3 is a flowchart illustrating a debug data protection method according to a second embodiment of the present invention;
FIG. 4 is a schematic diagram of a data packet structure of the debug data protection method according to the present invention;
FIG. 5 is a flowchart illustrating a third embodiment of a debug data protection method according to the present invention;
FIG. 6 is a functional block diagram of a first embodiment of the debug data protection apparatus of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
The solution of the embodiment of the invention mainly comprises the following steps: judging whether a preset field exists in a debugging request or not when the debugging request is received; when the preset field exists in the debugging request, a primary debugging serial port switch of the intelligent terminal is started, and a key package identification code of the intelligent terminal is obtained through the primary debugging serial port switch; generating a target encrypted data packet according to the key packet identification code; the target encrypted data packet is sent to the intelligent terminal, so that the intelligent terminal compares the local encrypted data packet with the target encrypted data packet, and a comparison result is generated and fed back; judging whether the current debugging state of the intelligent terminal is switched from the initial locking state to the unlocking state according to the comparison result, the problem that debugging data are modified to cause abnormality of the intelligent terminal can be avoided, the use cost and the operation cost are reduced, the service life and the safety of the intelligent terminal are improved, the user experience is improved, and the technical problems that the debugging data of the intelligent terminal are easily modified to cause abnormality of a system and the operation cost and the use cost are increased in the prior art are solved.
Referring to fig. 1, fig. 1 is a schematic diagram of a server structure of a hardware running environment according to an embodiment of the present invention.
As shown in fig. 1, the server may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) Memory or a stable Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the server architecture shown in fig. 1 is not limiting of the server and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user side interface module, and a debug data protection program may be included in the memory 1005 as one type of storage medium.
The present invention server calls the debug data protection program stored in the memory 1005 through the processor 1001, and performs the following operations:
judging whether a preset field exists in a debugging request or not when the debugging request is received;
when the preset field exists in the debugging request, a primary debugging serial port switch of the intelligent terminal is started, and a key package identification code of the intelligent terminal is obtained through the primary debugging serial port switch;
generating a target encrypted data packet according to the key packet identification code;
the target encrypted data packet is sent to the intelligent terminal, so that the intelligent terminal compares the local encrypted data packet with the target encrypted data packet, and a comparison result is generated and fed back;
and judging whether the current debugging state of the intelligent terminal is switched from the initial locking state to the unlocking state according to the comparison result.
Further, the processor 1001 may call the debug data protection program stored in the memory 1005, and further perform the following operations:
when a debug request is detected, acquiring each field in the debug request;
analyzing each field to determine whether each field contains a preset debugging handshake command and a target debugging field corresponding to a preset identification code reading command;
Judging whether a preset field exists in the debugging request according to whether each field contains the target debugging field or not.
Further, the processor 1001 may call the debug data protection program stored in the memory 1005, and further perform the following operations:
searching a corresponding data packet from a preset database according to the key packet identification code to serve as a verification data packet;
and generating a target encrypted data packet according to the check data packet.
Further, the processor 1001 may call the debug data protection program stored in the memory 1005, and further perform the following operations:
acquiring a random check code and a hardware identification code corresponding to the check data packet;
generating a target data packet according to a preset random identification code, a preset primary key, a secondary random check code, the random check code and the hardware identification code;
extracting the preset one-time key, the preset random identification code, the secondary random check code and the random check code from the target data packet;
encrypting the secondary random check code and the random check code according to the preset disposable key;
and generating a target encrypted data packet according to the preset random identification code, the encrypted secondary random check code and the random check code.
Further, the processor 1001 may call the debug data protection program stored in the memory 1005, and further perform the following operations:
and sending the target encrypted data packet to the intelligent terminal so that the intelligent terminal decrypts the target encrypted data packet to obtain an encrypted secondary random check code, comparing the local check code in the local encrypted data packet with the encrypted secondary random check code, and generating and feeding back a comparison result.
Further, the processor 1001 may call the debug data protection program stored in the memory 1005, and further perform the following operations:
when the current state of the intelligent terminal is detected to be a production state and an encryption application of a Personal Computer (PC) debugging tool is received, a preset encryption data packet is generated;
the preset encryption data packet is sent to the intelligent terminal, so that the intelligent terminal can store the preset encryption data packet as a local encryption data packet;
when the current state of the intelligent terminal is detected to be a factory state, a serial port closing instruction is generated, and the primary debugging serial port switch is closed according to the serial port closing instruction.
Further, the processor 1001 may call the debug data protection program stored in the memory 1005, and further perform the following operations:
When the current state of the intelligent terminal is detected to be a production state and an encryption application of a personal computer PC debugging tool is received, acquiring an initial identification code, an initial check code, an initial key and an initial hardware identification code corresponding to the personal computer PC debugging tool according to the encryption application;
generating an initial data packet according to the initial identification code, the initial check code, the initial key and the initial hardware identification code;
encrypting the initial check code according to the initial key, and generating a preset encrypted data packet according to the initial identification code and the encrypted initial check code.
According to the scheme, when the debugging request is received, whether a preset field exists in the debugging request is judged; when the preset field exists in the debugging request, a primary debugging serial port switch of the intelligent terminal is started, and a key package identification code of the intelligent terminal is obtained through the primary debugging serial port switch; generating a target encrypted data packet according to the key packet identification code; the target encrypted data packet is sent to the intelligent terminal, so that the intelligent terminal compares the local encrypted data packet with the target encrypted data packet, and a comparison result is generated and fed back; and judging whether the current debugging state of the intelligent terminal is switched from the initial locking state to the unlocking state according to the comparison result, so that the problem that the intelligent terminal is abnormal due to the fact that the debugging data are modified can be avoided, the use cost and the operation cost are reduced, the service life and the safety of the intelligent terminal are improved, and the user experience is improved.
Based on the hardware structure, the embodiment of the debugging data protection method is provided.
Referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of a debug data protection method according to the present invention.
In a first embodiment, the debug data protection method includes the steps of:
step S10, judging whether a preset field exists in the debugging request or not when the debugging request is received.
It should be noted that, the debug request is request information input from the outside and requiring to debug the intelligent terminal, the preset field is a field corresponding to a preset special command for primary debugging of the intelligent terminal, and whether the debug request is an effective legal debug request can be determined by judging whether the debug request includes the preset field, so as to determine whether to perform corresponding debug operation.
Further, the step S10 specifically includes the following steps:
when a debug request is detected, acquiring each field in the debug request;
analyzing each field to determine whether each field contains a preset debugging handshake command and a target debugging field corresponding to a preset identification code reading command;
judging whether a preset field exists in the debugging request according to whether each field contains the target debugging field or not.
It should be understood that the debug request includes a plurality of fields, by acquiring each field in the debug request and analyzing each field, whether each field includes a preset debug handshake command and a target debug field corresponding to a preset identification code read command can be determined, the preset debug handshake command is a preset command for establishing a connection with the intelligent terminal, the preset identification code read command is a preset command for reading a key package identification code, and whether the debug request includes the preset debug handshake command and the target debug field corresponding to the preset identification code read command is determined by determining whether the debug request includes the preset debug handshake command and the target debug field corresponding to the preset identification code read command, so as to determine whether the debug request is an effective legal debug request.
And step S20, when the preset field exists in the debugging request, starting a primary debugging serial port switch of the intelligent terminal, and acquiring a key package identification code of the intelligent terminal by the primary debugging serial port switch.
It can be understood that the primary debug serial port switch is a switch for starting the primary debug authority of the intelligent terminal, and obtains the key package identification code of the intelligent terminal according to the primary debug serial port switch, wherein the key package identification code is an identification code randomly generated by a server and used for searching a corresponding encrypted data package, and when the preset field exists in the debug request, the debug request is a legal and effective debug request, and at the moment, the primary debug serial port switch can be started, and the corresponding key package identification code is obtained for performing subsequent debug operation.
And step S30, generating a target encrypted data packet according to the key packet identification code.
It should be appreciated that the key identification code may enable the server to generate a target encrypted data packet in preparation for a subsequent debug operation.
And step S40, the target encrypted data packet is sent to the intelligent terminal, so that the intelligent terminal compares the local encrypted data packet with the target encrypted data packet, and a comparison result is generated and fed back.
It can be appreciated that by comparing the target encrypted data packet with the local encrypted data packet of the intelligent terminal, it can be determined that the encrypted data packet is matched with the local encrypted data packet, thereby determining whether to unlock the intelligent terminal for subsequent debugging operations.
Further, the step S40 may include the steps of:
and sending the target encrypted data packet to the intelligent terminal so that the intelligent terminal decrypts the target encrypted data packet to obtain an encrypted secondary random check code, comparing the local check code in the local encrypted data packet with the encrypted secondary random check code, and generating and feeding back a comparison result.
It can be understood that by comparing the local check code in the local encrypted data packet with the encrypted secondary random check code, whether the debug request has corresponding debug permission can be determined, so as to determine whether to switch the debug state of the intelligent terminal from the initial locked state to the unlocked state, and allow subsequent debug operations.
And S50, judging whether the current debugging state of the intelligent terminal is switched from the initial locking state to the unlocking state according to the comparison result.
It should be understood that, according to the comparison result, whether the current debug state of the intelligent terminal is switched from the initial lock state to the unlock state, that is, whether the intelligent terminal is unlocked for subsequent debug operation can be judged, if the comparison result is that the target encrypted data packet is matched with the local encrypted data packet, the intelligent terminal is allowed to be unlocked for subsequent data debug operation; if the comparison result shows that the target encrypted data packet is not matched with the local encrypted data packet, unlocking of the intelligent terminal is not allowed, subsequent data debugging operation is stopped, system debugging data of the intelligent terminal is effectively protected from being tampered maliciously, and service life and safety of the intelligent terminal are improved.
According to the scheme, when the debugging request is received, whether a preset field exists in the debugging request is judged; when the preset field exists in the debugging request, a primary debugging serial port switch of the intelligent terminal is started, and a key package identification code of the intelligent terminal is obtained through the primary debugging serial port switch; generating a target encrypted data packet according to the key packet identification code; the target encrypted data packet is sent to the intelligent terminal, so that the intelligent terminal compares the local encrypted data packet with the target encrypted data packet, and a comparison result is generated and fed back; and judging whether the current debugging state of the intelligent terminal is switched from the initial locking state to the unlocking state according to the comparison result, so that the problem that the intelligent terminal is abnormal due to the fact that the debugging data are modified can be avoided, the use cost and the operation cost are reduced, the service life and the safety of the intelligent terminal are improved, and the user experience is improved.
Further, fig. 3 is a flow chart of a second embodiment of the debug data protection method of the present invention, as shown in fig. 3, the second embodiment of the debug data protection method of the present invention is proposed based on the first embodiment, in this embodiment, the step S30 includes the following steps:
And S31, searching a corresponding data packet from a preset database according to the key packet identification code to serve as a verification data packet.
It should be noted that, the preset database is a preset database for storing various data packets, and the data packet corresponding to the key identification code can be searched from the preset database through the key identification code and used as a verification data packet, so as to prepare for subsequent debugging operations.
And step S32, generating a target encrypted data packet according to the check data packet.
It can be understood that by encrypting the check data packet, a corresponding target encrypted data packet can be generated, and thus, the adjustment of the debugging state of the subsequent intelligent terminal can be used as a basis.
Further, the step S32 specifically includes the following steps:
acquiring a random check code and a hardware identification code corresponding to the check data packet;
generating a target data packet according to a preset random identification code, a preset primary key, a secondary random check code, the random check code and the hardware identification code;
extracting the preset one-time key, the preset random identification code, the secondary random check code and the random check code from the target data packet;
Encrypting the secondary random check code and the random check code according to the preset disposable key;
and generating a target encrypted data packet according to the preset random identification code, the encrypted secondary random check code and the random check code.
It should be noted that, after the verification data packet includes a corresponding random verification code and a hardware identification code, a preset random identification code, a secondary random verification code and a preset one-time key are obtained, a target data packet may be generated according to the preset random identification code, the preset one-time key, the secondary random verification code, the random verification code and the hardware identification code, and then the secondary random verification code and the random verification code are encrypted according to the preset one-time key; generating a target encrypted data packet according to the preset random identification code, the encrypted secondary random check code and the random check code, wherein the target encrypted data packet comprises the secondary random check code and the random check code which are encrypted by a preset one-time key, and the target encrypted data packet is used for preparing for the authentication of the follow-up debugging permission.
In a specific implementation, as shown in fig. 4, fig. 4 is a schematic diagram of a data packet structure of the debug data protection method of the present invention, where the verification data packet D1 includes a preset random identification code SN1, a random verification code C2, a preset one-time Key1 and a hardware identification code PC1; the SN1 is an identification code randomly generated by the server and is used for searching a current data packet from a preset database of the server; c1 is a check code randomly generated by a server and is used for checking a data string when the intelligent terminal is unlocked currently, and C1 is generated for the first time when the intelligent terminal is in a production state; c2 is a check code randomly generated by the server and is used for checking a data string when the intelligent terminal is unlocked next time; key1 is a Key randomly generated by a server and is used for encrypting a random check code, and only encrypting and decrypting the random check code C1 or C2 of the current data packet; the PC1 directly acquires a hardware identification code of a personal computer (Personal Computer, PC) debugging tools, and when a key package is applied to a server, the hardware identification code is uploaded to the server at the same time; the server can generate an encrypted packet P1 according to the verification data packet D1, the encrypted packet P1 comprises an identification code SN1, the random verification codes C1 and C2 encrypted by the Key1 are encrypted by the server, the encrypted packet P1 is encrypted by the aid of a fixed Key K1 and transmitted back to the PC debugging tool, the encrypted packet P1 is directly sent to the intelligent terminal through a debugging serial port by the PC debugging tool, after the encrypted packet P1 is received by the intelligent terminal, the data in the encrypted packet P1 is stored after the encrypted packet P1 is decrypted by the aid of the fixed Key K2 and still recorded as the local encrypted data packet P1.
Correspondingly, the server generates a target data packet D2 according to a preset random identification code SN2, a preset disposable Key Key2, a random check code C2, a secondary random check code C3 and a hardware identification code PC2, wherein the SN2 is a new data packet identification code randomly generated by the server, the C2 is a check code for checking the data packet D1, the C3 is a check code newly generated by the server and is used for a data string checked when the intelligent terminal is unlocked next time, the Key2 is a Key randomly generated by the server and is used for encrypting and decrypting the random check code, only the random check code C2 or the secondary random check code C3 of the current data packet is used, and when the PC2 is a PC used by a debugger, a debugging tool directly acquires the hardware identification code of the PC, and when the Key packet is applied to the server, the hardware identification code is simultaneously required to be uploaded to the server; the server generates a target encrypted data packet P2 according to the target data packet D2, wherein the target encrypted data packet P2 includes an identification code SN2, and the encrypted random check code C2 and the encrypted secondary random check code C3 using the Key2, and the local encrypted data packet P1 and the encrypted check code in the target encrypted data packet P2 are compared to generate a corresponding comparison result.
According to the scheme, the corresponding data packet is searched from the preset database through the key packet identification code and used as a verification data packet; according to the verification data packet, the target encryption data packet is generated, the validity and the effectiveness of the debugging request can be effectively verified, the safety of the intelligent terminal debugging data is improved, the problem that the intelligent terminal is abnormal due to the fact that the debugging data is modified is avoided, the service life and the safety of the intelligent terminal are improved, and the user experience is improved.
Further, fig. 5 is a flow chart of a third embodiment of the debug data protection method according to the present invention, as shown in fig. 5, and the third embodiment of the debug data protection method according to the present invention is proposed based on the second embodiment, in this embodiment, before the step S10, the debug data protection method further includes the following steps:
step S001, when the current state of the intelligent terminal is detected to be a production state and an encryption application of a personal computer PC debugging tool is received, a preset encryption data packet is generated.
When the current state of the intelligent terminal is detected to be a production state and an encryption application of the Personal Computer (PC) debugging tool is received, a preset encryption data packet can be generated, wherein the preset encryption data is a preset data packet for reflecting the encryption state of the current intelligent terminal.
Further, the step S001 specifically includes the following steps:
when the current state of the intelligent terminal is detected to be a production state and an encryption application of a personal computer PC debugging tool is received, acquiring an initial identification code, an initial check code, an initial key and an initial hardware identification code corresponding to the personal computer PC debugging tool according to the encryption application;
generating an initial data packet according to the initial identification code, the initial check code, the initial key and the initial hardware identification code;
encrypting the initial check code according to the initial key, and generating a preset encrypted data packet according to the initial identification code and the encrypted initial check code.
It can be understood that the initial data packet is generated by the initial identification code, the initial check code, the initial key and the initial hardware identification code; and encrypting the initial check code through an initial key, generating a preset encrypted data packet according to the initial identification code and the encrypted initial check code, wherein the preset encrypted data packet can be used as a local data packet of the intelligent terminal and is used for comparing a target encrypted data packet, verifying the validity and the effectiveness of the debugging request, and further performing corresponding debugging operation.
Step S002, sending the preset encrypted data packet to the intelligent terminal, so that the intelligent terminal stores the preset encrypted data packet as a local encrypted data packet.
It should be noted that, generally, when the intelligent terminal is produced, the PC debug tool applies for an encrypted packet from the server and sends the encrypted packet to the intelligent terminal, and the intelligent terminal stores the encrypted packet, that is, stores the preset encrypted data packet as a local encrypted data packet, so as to prepare for the validity authentication of the subsequent debug request.
And step S003, when the current state of the intelligent terminal is detected to be a factory state, a serial port closing instruction is generated, and the primary debugging serial port switch is closed according to the serial port closing instruction.
When the current state of the intelligent terminal is detected to be a factory state, a serial port closing instruction is generated, and a primary debugging serial port switch is closed according to the serial port closing instruction, so that a user can be prevented from being connected with the intelligent terminal through the primary debugging serial port switch to modify data and influence the normal operation of the intelligent terminal, the primary debugging serial port switch comprises a debugging serial port, a common serial port and a debugging bridge switch, wherein the debugging serial port is a special serial port during production and debugging, and data input into the intelligent terminal can not be provided for a system but only provided for a debugging module; the common serial port is a common serial port of an operating system Linux and an android system, and Linux, android commands can be input, output and the like through the serial port; the debug bridge switch is a switch which allows the system to provide a universal debug tool for debugging, and the common Android debug bridge (Android Debug Bridge, ADB) allows the universal debug tool provided by the Android to carry out debugging.
According to the scheme, when the current state of the intelligent terminal is detected to be the production state and the encryption application of the personal computer PC debugging tool is received, a preset encryption data packet is generated; the preset encryption data packet is sent to the intelligent terminal, so that the intelligent terminal can store the preset encryption data packet as a local encryption data packet; when the current state of the intelligent terminal is detected to be a factory state, a serial port closing instruction is generated, and a primary debugging serial port switch is closed according to the serial port closing instruction; the intelligent terminal can be effectively prevented from being connected with the intelligent terminal through the primary debugging serial port switch by a user, data modification is carried out, normal operation of the intelligent terminal is affected, abnormal problems of the intelligent terminal caused by modification of debugging data are avoided, use cost and operation cost are reduced, service life and safety of the intelligent terminal are improved, and user experience is improved.
Based on the embodiment of the debug data protection method, the invention further provides a debug data protection device.
Referring to fig. 6, fig. 6 is a functional block diagram of a first embodiment of the debug data protection apparatus according to the present invention.
In a first embodiment of the debug data protection apparatus of the present invention, the debug data protection apparatus includes:
The judging module 10 is configured to judge whether a preset field exists in a debug request when the debug request is received;
the starting module 20 is configured to start a primary debugging serial port switch of an intelligent terminal when the preset field exists in the debugging request, and obtain a key package identification code of the intelligent terminal through the primary debugging serial port switch;
a data packet generating module 30, configured to generate a target encrypted data packet according to the key packet identifier;
the comparison module 40 is configured to send the target encrypted data packet to the intelligent terminal, so that the intelligent terminal compares a local encrypted data packet with the target encrypted data packet, and generates and feeds back a comparison result;
and the unlocking module 50 is used for judging whether the current debugging state of the intelligent terminal is switched from the initial locking state to the unlocking state according to the comparison result.
The steps for implementing each functional module of the debug data protection device may refer to each embodiment of the debug data protection method of the present invention, and will not be described herein.
In addition, the embodiment of the invention also provides a storage medium, wherein the storage medium stores a debug data protection program, and the debug data protection program realizes the following operations when being executed by a processor:
Judging whether a preset field exists in a debugging request or not when the debugging request is received;
when the preset field exists in the debugging request, a primary debugging serial port switch of the intelligent terminal is started, and a key package identification code of the intelligent terminal is obtained through the primary debugging serial port switch;
generating a target encrypted data packet according to the key packet identification code;
the target encrypted data packet is sent to the intelligent terminal, so that the intelligent terminal compares the local encrypted data packet with the target encrypted data packet, and a comparison result is generated and fed back;
and judging whether the current debugging state of the intelligent terminal is switched from the initial locking state to the unlocking state according to the comparison result.
Further, the debug data protection program, when executed by the processor, further performs the following operations:
when a debug request is detected, acquiring each field in the debug request;
analyzing each field to determine whether each field contains a preset debugging handshake command and a target debugging field corresponding to a preset identification code reading command;
judging whether a preset field exists in the debugging request according to whether each field contains the target debugging field or not.
Further, the debug data protection program, when executed by the processor, further performs the following operations:
searching a corresponding data packet from a preset database according to the key packet identification code to serve as a verification data packet;
and generating a target encrypted data packet according to the check data packet.
Further, the debug data protection program, when executed by the processor, further performs the following operations:
acquiring a random check code and a hardware identification code corresponding to the check data packet;
generating a target data packet according to a preset random identification code, a preset primary key, a secondary random check code, the random check code and the hardware identification code;
extracting the preset one-time key, the preset random identification code, the secondary random check code and the random check code from the target data packet;
encrypting the secondary random check code and the random check code according to the preset disposable key;
and generating a target encrypted data packet according to the preset random identification code, the encrypted secondary random check code and the random check code.
Further, the debug data protection program, when executed by the processor, further performs the following operations:
and sending the target encrypted data packet to the intelligent terminal so that the intelligent terminal decrypts the target encrypted data packet to obtain an encrypted secondary random check code, comparing the local check code in the local encrypted data packet with the encrypted secondary random check code, and generating and feeding back a comparison result.
Further, the debug data protection program, when executed by the processor, further performs the following operations:
when the current state of the intelligent terminal is detected to be a production state and an encryption application of a Personal Computer (PC) debugging tool is received, a preset encryption data packet is generated;
the preset encryption data packet is sent to the intelligent terminal, so that the intelligent terminal can store the preset encryption data packet as a local encryption data packet;
when the current state of the intelligent terminal is detected to be a factory state, a serial port closing instruction is generated, and the primary debugging serial port switch is closed according to the serial port closing instruction.
Further, the debug data protection program, when executed by the processor, further performs the following operations:
when the current state of the intelligent terminal is detected to be a production state and an encryption application of a personal computer PC debugging tool is received, acquiring an initial identification code, an initial check code, an initial key and an initial hardware identification code corresponding to the personal computer PC debugging tool according to the encryption application;
generating an initial data packet according to the initial identification code, the initial check code, the initial key and the initial hardware identification code;
encrypting the initial check code according to the initial key, and generating a preset encrypted data packet according to the initial identification code and the encrypted initial check code.
According to the scheme, when the debugging request is received, whether a preset field exists in the debugging request is judged; when the preset field exists in the debugging request, a primary debugging serial port switch of the intelligent terminal is started, and a key package identification code of the intelligent terminal is obtained through the primary debugging serial port switch; generating a target encrypted data packet according to the key packet identification code; the target encrypted data packet is sent to the intelligent terminal, so that the intelligent terminal compares the local encrypted data packet with the target encrypted data packet, and a comparison result is generated and fed back; and judging whether the current debugging state of the intelligent terminal is switched from the initial locking state to the unlocking state according to the comparison result, so that the problem that the intelligent terminal is abnormal due to the fact that the debugging data are modified can be avoided, the use cost and the operation cost are reduced, the service life and the safety of the intelligent terminal are improved, and the user experience is improved.
It should be noted that, in this document, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (10)

1. A debug data protection method, the debug data protection method comprising:
judging whether a preset field exists in a debugging request or not when the debugging request is received;
when the preset field exists in the debugging request, a primary debugging serial port switch of the intelligent terminal is started, and a key package identification code of the intelligent terminal is obtained through the primary debugging serial port switch;
generating a target encrypted data packet according to the key packet identification code;
the target encrypted data packet is sent to the intelligent terminal, so that the intelligent terminal compares the local encrypted data packet with the target encrypted data packet, and a comparison result is generated and fed back;
and judging whether the current debugging state of the intelligent terminal is switched from the initial locking state to the unlocking state according to the comparison result.
2. The method for protecting debug data as claimed in claim 1, wherein when a debug request is received, determining whether a preset field exists in the debug request comprises:
when a debug request is detected, acquiring each field in the debug request;
analyzing each field to determine whether each field contains a preset debugging handshake command and a target debugging field corresponding to a preset identification code reading command;
judging whether a preset field exists in the debugging request according to whether each field contains the target debugging field or not.
3. The debug data protection method as claimed in claim 2, wherein generating the target encrypted data packet according to the key packet identification code specifically comprises:
searching a corresponding data packet from a preset database according to the key packet identification code to serve as a verification data packet;
and generating a target encrypted data packet according to the check data packet.
4. The debug data protection method as claimed in claim 3, wherein generating a target encrypted data packet from the check data packet specifically comprises:
acquiring a random check code and a hardware identification code corresponding to the check data packet;
Generating a target data packet according to a preset random identification code, a preset primary key, a secondary random check code, the random check code and the hardware identification code;
extracting the preset one-time key, the preset random identification code, the secondary random check code and the random check code from the target data packet;
encrypting the secondary random check code and the random check code according to the preset disposable key;
and generating a target encrypted data packet according to the preset random identification code, the encrypted secondary random check code and the random check code.
5. The method for protecting debug data according to claim 4, wherein said sending the target encrypted data packet to the intelligent terminal, so that the intelligent terminal compares a local encrypted data packet with the target encrypted data packet, and generates and feeds back a comparison result, specifically includes:
and sending the target encrypted data packet to the intelligent terminal so that the intelligent terminal decrypts the target encrypted data packet to obtain an encrypted secondary random check code, comparing the local check code in the local encrypted data packet with the encrypted secondary random check code, and generating and feeding back a comparison result.
6. The debug data protection method according to any one of claims 1 to 5, wherein, when a debug request is received, before determining whether a preset field exists in the debug request, the debug data protection method further comprises:
when the current state of the intelligent terminal is detected to be a production state and an encryption application of a Personal Computer (PC) debugging tool is received, a preset encryption data packet is generated;
the preset encryption data packet is sent to the intelligent terminal, so that the intelligent terminal can store the preset encryption data packet as a local encryption data packet;
when the current state of the intelligent terminal is detected to be a factory state, a serial port closing instruction is generated, and the primary debugging serial port switch is closed according to the serial port closing instruction.
7. The method for protecting debug data according to claim 6, wherein when detecting that the current state of the intelligent terminal is a production state and receiving an encryption application of a personal computer PC debug tool, generating a preset encrypted data packet specifically comprises:
when the current state of the intelligent terminal is detected to be a production state and an encryption application of a personal computer PC debugging tool is received, acquiring an initial identification code, an initial check code, an initial key and an initial hardware identification code corresponding to the personal computer PC debugging tool according to the encryption application;
Generating an initial data packet according to the initial identification code, the initial check code, the initial key and the initial hardware identification code;
encrypting the initial check code according to the initial key, and generating a preset encrypted data packet according to the initial identification code and the encrypted initial check code.
8. A debug data protection apparatus, the apparatus comprising:
the judging module is used for judging whether a preset field exists in the debugging request or not when the debugging request is received;
the starting module is used for starting a primary debugging serial port switch of the intelligent terminal when the preset field exists in the debugging request, and acquiring a key package identification code of the intelligent terminal through the primary debugging serial port switch;
the data packet generating module is used for generating a target encrypted data packet according to the key packet identification code;
the comparison module is used for sending the target encrypted data packet to the intelligent terminal so that the intelligent terminal compares the local encrypted data packet with the target encrypted data packet to generate and feed back a comparison result;
and the unlocking module is used for judging whether the current debugging state of the intelligent terminal is switched from the initial locking state to the unlocking state according to the comparison result.
9. A server, the server comprising: a memory, a processor and a debug data protection program stored on the memory and executable on the processor, the debug data protection program configured to implement the steps of the debug data protection method of any of claims 1 to 7.
10. A storage medium having stored thereon a debug data protection program which when executed by a processor implements the steps of the debug data protection method of any of claims 1 to 7.
CN201910297409.7A 2019-04-12 2019-04-12 Debug data protection method, device, server and storage medium Active CN110046514B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910297409.7A CN110046514B (en) 2019-04-12 2019-04-12 Debug data protection method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910297409.7A CN110046514B (en) 2019-04-12 2019-04-12 Debug data protection method, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN110046514A CN110046514A (en) 2019-07-23
CN110046514B true CN110046514B (en) 2023-05-26

Family

ID=67277085

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910297409.7A Active CN110046514B (en) 2019-04-12 2019-04-12 Debug data protection method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN110046514B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110688663A (en) * 2019-09-23 2020-01-14 深圳市网心科技有限公司 Execution command protection method and device, android device and storage medium
CN111506497B (en) * 2020-03-12 2023-06-16 平安科技(深圳)有限公司 Business logic debugging method, device, equipment and computer readable storage medium
CN113407434B (en) * 2020-03-16 2024-06-14 腾讯科技(深圳)有限公司 Method and device for processing debug file
CN113268752A (en) * 2021-05-24 2021-08-17 深圳Tcl新技术有限公司 Data management method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101427222A (en) * 2006-04-24 2009-05-06 松下电器产业株式会社 Data processing device, method, program, integrated circuit, and program generating device
KR20130116473A (en) * 2012-04-02 2013-10-24 주식회사 한국스마트카드 Method for securing debug serial connection of embedded system terminal
CN105279460A (en) * 2014-07-24 2016-01-27 中兴通讯股份有限公司 Method and device for starting USB (Universal Serial Bus) debugging mode interface, and terminal
CN106708489A (en) * 2015-11-17 2017-05-24 杭州海康威视数字技术股份有限公司 Debugging method and system of equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101427222A (en) * 2006-04-24 2009-05-06 松下电器产业株式会社 Data processing device, method, program, integrated circuit, and program generating device
KR20130116473A (en) * 2012-04-02 2013-10-24 주식회사 한국스마트카드 Method for securing debug serial connection of embedded system terminal
CN105279460A (en) * 2014-07-24 2016-01-27 中兴通讯股份有限公司 Method and device for starting USB (Universal Serial Bus) debugging mode interface, and terminal
CN106708489A (en) * 2015-11-17 2017-05-24 杭州海康威视数字技术股份有限公司 Debugging method and system of equipment

Also Published As

Publication number Publication date
CN110046514A (en) 2019-07-23

Similar Documents

Publication Publication Date Title
CN110046514B (en) Debug data protection method, device, server and storage medium
US11258792B2 (en) Method, device, system for authenticating an accessing terminal by server, server and computer readable storage medium
KR101548041B1 (en) Validation and/or authentication of a device for communication with a network
CN110519115B (en) Gateway interface test method, terminal device, storage medium and device
CN108616360B (en) User identity verification and registration method and device
US8375454B2 (en) Method for locking an application program
CN111107073B (en) Application automatic login method and device, computer equipment and storage medium
CN111813614B (en) Debugging processing method and device and debugging processing system
CN110034926B (en) Internet of things dynamic password generation and verification method and system and computer equipment
CN113221128B (en) Account and password storage method and registration management system
CN101102574A (en) Terminal verification method and device
CN106372497B (en) Application programming interface API protection method and protection device
WO2019109968A1 (en) Method for unlocking sim card and mobile terminal
CN109359445B (en) Database password management system and method
CN104573493B (en) A kind of method for protecting software and system
CN111770087A (en) Service node verification method and related equipment
CN109451504B (en) Internet of things module authentication method and system
CN113268716A (en) Authorization verification system, method and device for application and storage medium
WO2020024852A1 (en) Authentication method and authentication device
CN114329541A (en) Data encryption method, device, equipment and storage medium
EP2985712B1 (en) Application encryption processing method, apparatus, and terminal
JP4998314B2 (en) Communication control method and communication control program
CN107679372A (en) Access control method, terminal and the storage medium of application program
KR102365254B1 (en) Management system and method for data security for storage device using security device
CN109743283B (en) Information transmission method and equipment

Legal Events

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