CN108170607B - Control device and control method of OTP switch - Google Patents

Control device and control method of OTP switch Download PDF

Info

Publication number
CN108170607B
CN108170607B CN201810005832.0A CN201810005832A CN108170607B CN 108170607 B CN108170607 B CN 108170607B CN 201810005832 A CN201810005832 A CN 201810005832A CN 108170607 B CN108170607 B CN 108170607B
Authority
CN
China
Prior art keywords
type
port
state
user
otp
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
CN201810005832.0A
Other languages
Chinese (zh)
Other versions
CN108170607A (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.)
Shanghai Chuanying Information Technology Co Ltd
Original Assignee
Shanghai Chuanying Information 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 Shanghai Chuanying Information Technology Co Ltd filed Critical Shanghai Chuanying Information Technology Co Ltd
Priority to CN201810005832.0A priority Critical patent/CN108170607B/en
Publication of CN108170607A publication Critical patent/CN108170607A/en
Application granted granted Critical
Publication of CN108170607B publication Critical patent/CN108170607B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Input From Keyboards Or The Like (AREA)

Abstract

The invention provides a control device and a control method of an OTP switch, wherein the control device of the OTP switch comprises the following steps: the judging module is used for judging whether the current test version has Root authority or not; the control module is used for controlling the state of the OTP switch based on a user instruction when the current test version has Root authority; and the execution module is used for executing the state of the OTP switch of the corresponding port according to the selection of the user. In the control device and the control method of the OTP switch, the test mode is simpler and more convenient, and the efficiency is higher; and because the Root authority is judged, the safety performance of the test is improved, and meanwhile, because the instruction types are distinguished, the reliability of the test is improved.

Description

Control device and control method of OTP switch
Technical Field
The invention relates to the technical field of electronic communication, in particular to a control device and a control method of an OTP switch.
Background
With the development and progress of technology, more and more intelligent devices are widely used by people. In the development and manufacturing process of the intelligent equipment, the performance and safety of the intelligent equipment are necessarily tested.
Generally, in the aspect of testing, in order to greatly reduce input operations on related commands, scripts are generally used, for example, related commands are edited and integrated into one script, and then a more automatic testing mode is realized by setting related script use cases. That is, it is generally necessary to complete a test task by testing a script in the process of testing a device under test or the like.
At present, scripts are usually written based on scripting languages (such as python or javascript) and basic syntax, and all functional modules (such as a test function execution module, a process processing module and a data processing module) are realized in the writing process in the form of scripts.
For the control and test of the OTP switch in the smart phone, corresponding commands are different because the OTP is divided into a platform-end OTP and a sensor-end OTP, and then a string of adb commands needs to be input for switching the OTP each time, so that the test process is very complicated and the efficiency is low; moreover, because many input commands are input, errors are easy to occur, so that the test accuracy is not high, and the test efficiency is further reduced.
Generally, to address this issue, the commands may be integrated into the script. For example, when the OTP is turned on and off, the relevant interface code may be implemented in the code, so that the OTP switch may be controlled in real time by inputting some adb command.
However, in the current test mode, the running script is still input, and whether the OTP switch is effective or not can be verified only by inputting the correct running script. This way it may be very simple for a developer familiar with scripts to input a corresponding command to verify that the OTP switch is in effect. But it is very difficult for operators who are not very familiar with scripts or control commands, such as testers and some other personnel, to verify that the OTP is valid. At the same time, these operators, who are not familiar with scripts or control commands, are more concerned with the output results.
Therefore, how to intuitively reflect the verification result to effectively improve the efficiency becomes one of the problems to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a control device and a control method of an OTP switch, so as to effectively avoid the problems of complex operation and poor test performance in the prior art.
To achieve the above object, the present invention provides a control device of an OTP switch, including: the judging module is used for judging whether the current test version has Root authority or not; the control module is used for controlling the state of the OTP switch based on a user instruction when the current test version has Root authority; and the execution module is used for executing the state of the OTP switch of the corresponding port according to the selection of the user.
The judging module comprises: the calling unit is used for calling the script command in the current test version; and the confirming unit is used for confirming whether the Root authority exists according to the output result of the script command.
The control module includes: the instruction identification unit is used for judging and identifying the type of the user instruction; the switch control unit is used for controlling the state of the OTP switch to be an open state when a user instruction is of an opening type; and when the user instruction is of an off type, controlling the state of the OTP switch to be an off state.
The control device of the OTP switch further comprises: and the prompting module is used for prompting input exception when the user instruction is of other types.
The execution module comprises: the port identification unit is used for judging and identifying the type of the port selected by the user; the switch control unit is also used for controlling the state of the OTP switch of the selected induction port when the selected port type is the induction port; and when the selected port type is the platform port, controlling the state of the OTP switch of the selected platform port.
The invention also discloses a control method of the OTP switch, which comprises the following steps:
judging whether the current test version has Root authority or not;
if the current test version has Root authority, controlling the state of the OTP switch based on a user instruction;
and executing the state of the OTP switch of the corresponding port according to the selection of the user.
The step of judging whether the current test version has Root authority or not comprises the following steps: calling a script command in the current test version; and confirming whether the Root authority is available according to the output result of the script command.
The step of controlling the state of the OTP switch based on a user instruction includes: judging the type of a user instruction; when the user instruction is of an opening type, controlling the state of the OTP switch to be an opening state; and when the user instruction is of an off type, controlling the state of the OTP switch to be an off state.
The control method of the OTP switch further comprises the following steps: and when the user command is of other types, prompting for inputting exception is carried out.
The step of executing the state of the OTP switch of the corresponding port according to the user selection includes: judging the type of the port selected by the user; when the selected port type is the induction port, controlling the state of the OTP switch of the selected induction port; and when the selected port type is the platform port, controlling the state of the OTP switch of the selected platform port.
In summary, compared with the prior art, the control device and the control method of the OTP switch of the present invention have the following advantages:
according to the control device and the control method of the OTP switch, the Root authority is judged at first, and only when the current test version has the Root authority, the subsequent operation can be carried out, so that the safety performance of the OTP switch is improved; and the types of the instructions input by the user are identified and distinguished, and different instruction types correspond to different operations, so that the reliability of the system is effectively improved.
In addition, the invention can realize operation only according to user instructions or selections, thereby improving the simplicity of operation and improving the efficiency of test.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are 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 inventive labor.
FIG. 1 is a schematic flow chart of a prior art method for controlling an OTP switch;
FIG. 2 is a schematic structural diagram of an implementation of the control apparatus of the OTP switch in the invention;
FIG. 3 is a schematic structural diagram of an implementation manner of a judgment module in the present invention;
FIG. 4 is a schematic diagram of an implementation of a control module according to the present invention
FIG. 5 is a schematic diagram of an implementation of an execution module according to the present invention;
fig. 6 is a flowchart illustrating an implementation manner of the method for controlling the OTP switch according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It is noted that, in this document, relational terms such as "first," "second," "third," and the like, if any, are 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. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," "includes," "including," "has," "having" or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal 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 terminal. Without further limitation, an element defined by the phrases "comprising … …" or "comprising … …" does not exclude the presence of additional elements in a process, method, article, or terminal that comprises the element. Further, herein, "greater than," "less than," "more than," and the like are understood to exclude the present numbers; the terms "above", "below", "within" and the like are to be understood as including the number.
The technical solution of the present invention will be described in detail with reference to fig. 1 to 6 as specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
As previously set forth: at this stage, control commands are often edited to form scripts in order to improve the convenience of testing. However, the existing script is very simple for developers, and the developers can verify whether the OTP switch is effective or not by inputting the running script and inputting the corresponding command. However, for testing and some other persons who do not know how to verify that the OTP is valid, they only focus on the results and cannot draw an intuitive conclusion as to whether the OTP is valid, resulting in a less efficient test.
Fig. 1 is a flowchart illustrating an implementation manner of a control method of an OTP switch in the prior art, and as shown in fig. 1, in the control method of the OTP switch in the prior art, the control of the state of the OTP switch can be implemented only according to a user instruction and a user selection. In the existing mode, the user instruction type and the port type selected by the user are not distinguished, in other words, even if the user instruction input by the user does not belong to an adb control command (for example, only a blank is input), the subsequent operation can still be performed, which reduces the accuracy and reliability of the test process and reduces the test efficiency.
Based on the above, the invention provides a control device and a control method of an OTP switch, so as to integrate an adb command into a new bat script again, avoid the misoperation of non-professional persons, and add corresponding prompts, so that a corresponding user only needs to run the script and input corresponding operation according to the prompts, and meanwhile, whether the permission is OK or not and whether the OTP switch is successful or not can be visually confirmed.
It should be noted that the control apparatus and the control method of the OTP switch of the present invention can be applied to portable electronic devices, including but not limited to a handheld computer, a tablet computer, a mobile phone, a smart phone, a media player, a Personal Digital Assistant (PDA), a digital camera, and the like, and also including a combination of two or more of them.
The electronic device typically includes memory, a memory controller, one or more processing units (CPUs), peripheral interfaces, RF circuits, audio circuits, speakers, microphones, input/output (I/O) subsystems, touch screens, other output or control devices, and external ports. These components communicate over one or more communication buses or signal lines. It should be understood that the electronic device in this embodiment is only an example, and in a specific application, the components of the electronic device may have more or less components or have different component configurations; and the various components may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The electronic device may also include a power system for powering the various components. The power system may include a power management system, one or more power sources (e.g., battery, Alternating Current (AC)), a charging system, power failure detection circuitry, a power converter or inverter, a power status indicator (e.g., Light Emitting Diode (LED)), and any other components associated with power generation, management, and distribution in a portable device.
Fig. 2 shows a schematic structural diagram of an implementation of the control device of the OTP switch of the present invention, and as shown in fig. 2, the control device 1 of the OTP switch includes: a judging module 10, a control module 20 and an executing module 30.
The judging module 10 is configured to judge whether the current test version has Root permission. And when the judging module 10 judges that the current test version does not have the Root right, exiting the current operation.
Specifically, fig. 3 shows a schematic structural diagram of an implementation manner of the determining module in the present invention, and as shown in fig. 3, the determining module 10 includes:
the calling unit 101 is used for calling a script command in the current test version;
and the confirming unit 102 is used for confirming whether the Root authority is available according to the output result of the script command.
For example, in practical applications, the invoking unit 101 invokes a script command in the current test version, if the output result is 0, it represents that the current test version has Root rights, and if the output result is 1, it represents that the current test version does not have Root rights. When the output result is 0, the confirming unit 102 determines that the current test version has Root authority, otherwise, the confirming unit 102 determines that the current test version does not have Root authority.
And if the current test version does not have the Root right, exiting the current operation, specifically, exiting the current operation according to a selection instruction by a user, for example, exiting the current operation by selecting an "N" instruction representing the exiting operation by the user.
If the current test version has Root authority, the user can continue the operation according to the selection instruction, for example, the user selects a 'Y' instruction representing the continuous operation to enter the following operation.
With continued reference to fig. 2, the control module 20 is configured to control the state of the OTP switch based on a user instruction when the current test version has Root authority.
Specifically, fig. 4 shows a schematic structural diagram of an implementation of the control module in the present invention, and as shown in fig. 4, the control module 20 includes:
an instruction identification unit 201 for judging and identifying the type of the user instruction;
a switch control unit 202, configured to control a state of the OTP switch to be an on state when the user instruction is of an on type; and when the user instruction is of an off type, controlling the state of the OTP switch to be an off state.
In this embodiment, the types of the user command may be divided into an open type and a close type. In a specific application, the on type may be represented by "1"; the shut down type is represented by "0". That is, when the instruction identifying unit receives "1", that is, the user instruction is identified as the on type, and when the instruction identifying unit receives "10", the user instruction is identified as the off type.
When a user instruction of an on type is recognized, the state of the OTP switch is set to an on state by the switch control unit 202, whereas when a user instruction of an off type is recognized, the state of the OTP switch is set to an off state by the switch control unit 202.
By identifying the type of the user instruction, the accuracy of the input instruction can be effectively improved, so that the testing efficiency is greatly improved, the mode is easy to realize, and the testing process is effectively simplified.
In this embodiment, the control device of the OTP switch may further include a prompt module (not shown in the figure), and the prompt module is configured to prompt an input abnormality when the user command is of another type.
That is, when the user instruction is neither an on type nor an off type, but is other types than the two types, the prompt module prompts for an input abnormality. The prompting modes include but are not limited to: the prompt is made in one or more of text, picture, video, sound, audio and the like. Of course, other ways may be used for prompting, such as a ticker, an indicator light, etc., which is not limited in the present invention.
In the embodiment, only when the user command is recognized to be the opening type or the closing type, the subsequent operation is continuously executed, and when other types are recognized, the prompt of input abnormity is performed, so that the accuracy and the reliability of the test are further improved.
With continued reference to fig. 2, the execution module 30 is configured to execute the state of the OTP switch of the corresponding port according to the user selection.
Specifically, fig. 5 shows a schematic structural diagram of an implementation manner of the execution module in the present invention, and as shown in fig. 5, the execution module includes: a port identification unit 301, configured to determine and identify a type of a port selected by a user. In this embodiment, the port identification unit 301 is connected to the switch control unit 202.
The switch control unit 202 is further configured to control a state of the OTP switch of the selected sensing port when the selected port type is the sensing port; and when the selected port type is the platform port, controlling the state of the OTP switch of the selected platform port.
In this embodiment, the port types include: platform ports and sensing (sensor) ports, for example, a platform port is represented by "1" and a sensing port is represented by "0". When the port identification unit receives '1', identifying the port selected by the user as a platform port; and when the port identification unit receives '0', the port selected by the user is identified as the sensing port.
When the platform port is identified, the switch control unit 202 controls the on-off state of the OTP of the platform port, specifically, controls according to the user instruction identified by the instruction identification unit 201.
For example, when the instruction identifying unit 201 identifies that the user instruction type is an on type, and the port identifying unit 301 identifies the platform port, the switch control unit 202 sets the switch state of the OTP of the platform port to an on state. If the instruction identification unit 201 identifies that the user instruction type is the off type, and when the port identification unit 301 identifies the platform port, the switch control unit 202 sets the on-off state of the OTP of the platform port to the off state.
For another example, when the instruction identification unit 201 identifies that the user instruction type is the on type, and the port identification unit 301 identifies the sensing port, the switch control unit 202 sets the switch state of the OTP of the sensing port to the on state. If the instruction identification unit 201 identifies that the user instruction type is the off type, and when the port identification unit 301 identifies the sensing port, the switch control unit 202 sets the on-off state of the OTP of the sensing port to the off state.
In this embodiment, a user first inputs a user instruction, the instruction identification unit 201 identifies the type of the user instruction, and then the port identification unit 301 identifies the corresponding port type according to the selection of the user, but this way should not limit the scope of the present invention.
That is to say, in other embodiments, the port type may also be selected by the user through corresponding adjustment, that is, the port identification unit 301 identifies the corresponding port type, then the user instruction is input, the instruction identification unit 201 identifies the user instruction type, and finally the OTP switch of the corresponding port is controlled to be in the corresponding on state or off state according to the identified port type and instruction type.
The control device of the OTP switch may further include a prompt module (not shown in the figure), and the prompt module is configured to prompt an input abnormality when the port type is another type.
That is, when the port type is neither a platform port nor a sensing port, but is other types than the two categories, the prompt module prompts for an input abnormality. The prompting modes include but are not limited to: the prompt is made in one or more of text, picture, video, sound, audio and the like. Of course, other ways may be used for prompting, such as a ticker, an indicator light, etc., which is not limited in the present invention.
In this embodiment, only when the port type is identified as the sensing port or the platform port, the subsequent operation is continuously executed, and when other types are identified, the prompt for the input exception is performed, so that the accuracy and reliability of the test are further improved.
Certainly, in other embodiments, the prompt module may prompt the state of the OTP switch when the execution module controls the state of the corresponding OTP switch, and in such a manner, the state of the OTP switch may be monitored intuitively, so as to improve the accuracy and efficiency of the test.
In this embodiment, the determining module 10, the control module 20 and the executing module 30 may all be implemented by software, and in other embodiments, the modules or units may also be implemented by hardware, software or a combination of hardware and software.
For example, the aforementioned modules may be integrated on the same circuit board, and the corresponding circuit modules implement the functions, and the circuit board may further include necessary memories (such as an FIFI memory, a RAM, or any other suitable memory). The clock signal, the line length signal, or the calculated exposure time of the pixels may be stored in the memory. In addition, the integrated circuit may be implemented as a microprocessor, such as a CPU, MCU, etc., executing executable instructions stored in a memory (e.g., RAM, ROM, distributed memory in an internet server, or any other suitable memory storing executable instructions), which is not limited in this respect.
The memory may include high speed random access memory and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other non-volatile solid state storage devices. In certain embodiments, the memory may also include memory that is remote from the one or more processors, such as network-attached memory accessed via RF circuitry or external ports and a communication network (not shown), which may be the internet, one or more intranets, Local Area Networks (LANs), wide area networks (WLANs), Storage Area Networks (SANs), etc., or a suitable combination thereof. The memory controller may control access to the memory by other components of the device, such as the CPU and peripheral interfaces.
The present invention also provides a method for controlling an OTP switch, as shown in fig. 6, the method for controlling an OTP switch includes:
step S10, judging whether the current test version has Root authority;
if the current test version has Root authority, executing step S20, and controlling the state of the OTP switch based on the user instruction;
step S30 is executed, and the state of the OTP switch of the corresponding port is executed according to the user selection.
In this embodiment, if the current test version does not have Root authority, step S40 is executed, and the current operation is exited, that is, the operation in the subsequent step S30 is not executed any more. That is, in the case where the Root authority is not provided, the state of the OTP switch cannot be controlled, and neither on nor off of the OTP switch can be controlled.
By judging the Root authority, the subsequent operation can be carried out only when the current test version has the Root authority, and the condition without the Root authority is eliminated, so that the test safety is greatly improved.
Specifically, the step S10, namely, the step of determining whether the current test version has Root authority includes: calling a script command in the current test version; and confirming whether the Root authority is available according to the output result of the script command.
For example, in practical application, if the script command in the current test version is called and the output result is 0, it represents that the current test version has Root permission; and if the output result is 1, the current test version does not have Root authority.
That is, when the output result is 0, it is determined that the current test version has the Root authority, otherwise, it is determined that the current test version does not have the Root authority.
And if the current test version does not have the Root right, exiting the current operation, specifically, exiting the current operation according to a selection instruction by a user, for example, exiting the current operation by selecting an "N" instruction representing the exiting operation by the user.
If the current test version has Root authority, the user can continue the operation according to the selection instruction, for example, the user selects a 'Y' instruction representing the continuous operation to enter the following operation.
In this embodiment, the step S20 may be implemented by the aforementioned control module. The step of controlling the state of the OTP switch based on a user instruction includes: judging the type of a user instruction; when the user instruction is of an opening type, controlling the state of the OTP switch to be an opening state; and when the user instruction is of an off type, controlling the state of the OTP switch to be an off state.
In this embodiment, the types of the user command may be divided into an open type and a close type. In a specific application, the on type may be represented by "1"; the shut down type is represented by "0". That is, when the instruction identifying unit receives "1", that is, the user instruction is identified as the on type, and when the instruction identifying unit receives "10", the user instruction is identified as the off type.
When a user instruction of an on type is recognized, the state of the OTP switch is set to an on state by the switch control unit 202, whereas when a user instruction of an off type is recognized, the state of the OTP switch is set to an off state by the switch control unit 202.
By identifying the type of the user instruction, the accuracy of the input instruction can be effectively improved, so that the testing efficiency is greatly improved, the mode is easy to realize, and the testing process is effectively simplified.
In this embodiment, the method for controlling the OTP switch may further include: and when the user command is of other types, prompting for inputting exception is carried out.
That is, when the user instruction is neither the on type nor the off type but is of a type other than these two categories, a prompt to input an exception is made. The prompting modes include but are not limited to: the prompt is made in one or more of text, picture, video, sound, audio and the like. Of course, other ways may be used for prompting, such as a ticker, an indicator light, etc., which is not limited in the present invention.
In the embodiment, only when the user command is recognized to be the opening type or the closing type, the subsequent operation is continuously executed, and when other types are recognized, the prompt of input abnormity is performed, so that the accuracy and the reliability of the test are further improved.
In step S30, the step of executing the state of the OTP switch of the corresponding port according to the user selection includes: judging the type of the port selected by the user; when the selected port type is the induction port, controlling the state of the OTP switch of the selected induction port; and when the selected port type is the platform port, controlling the state of the OTP switch of the selected platform port.
In this embodiment, the step S30 may be implemented by the foregoing execution module. Specifically, the port types include: platform ports and sensing (sensor) ports, for example, a platform port is represented by "1" and a sensing port is represented by "0". When the port identification unit receives '1', identifying the port selected by the user as a platform port; and when the port identification unit receives '0', the port selected by the user is identified as the sensing port.
When the platform port is identified, the switch control unit 202 controls the on-off state of the OTP of the platform port, specifically, controls according to the user instruction identified by the instruction identification unit 201.
For example, when the instruction identifying unit 201 identifies that the user instruction type is an on type, and the port identifying unit 301 identifies the platform port, the switch control unit 202 sets the switch state of the OTP of the platform port to an on state. If the instruction identification unit 201 identifies that the user instruction type is the off type, and when the port identification unit 301 identifies the platform port, the switch control unit 202 sets the on-off state of the OTP of the platform port to the off state.
For another example, when the instruction identification unit 201 identifies that the user instruction type is the on type, and the port identification unit 301 identifies the sensing port, the switch control unit 202 sets the switch state of the OTP of the sensing port to the on state. If the instruction identification unit 201 identifies that the user instruction type is the off type, and when the port identification unit 301 identifies the sensing port, the switch control unit 202 sets the on-off state of the OTP of the sensing port to the off state.
In this embodiment, a user first inputs a user instruction, the instruction identification unit 201 identifies the type of the user instruction, and then the port identification unit 301 identifies the corresponding port type according to the selection of the user, but this way should not limit the scope of the present invention.
That is to say, in other embodiments, the port type may also be selected by the user through corresponding adjustment, that is, the port identification unit 301 identifies the corresponding port type, then the user instruction is input, the instruction identification unit 201 identifies the user instruction type, and finally the OTP switch of the corresponding port is controlled to be in the corresponding on state or off state according to the identified port type and instruction type.
The control device of the OTP switch may further include a prompt module (not shown in the figure), and the prompt module is configured to prompt an input abnormality when the port type is another type.
That is, when the port type is neither a platform port nor a sensing port, but is other types than the two categories, the prompt module prompts for an input abnormality. The prompting modes include but are not limited to: the prompt is made in one or more of text, picture, video, sound, audio and the like. Of course, other ways may be used for prompting, such as a ticker, an indicator light, etc., which is not limited in the present invention.
In this embodiment, only when the port type is identified as the sensing port or the platform port, the subsequent operation is continuously executed, and when other types are identified, the prompt for the input exception is performed, so that the accuracy and reliability of the test are further improved.
Certainly, in other embodiments, the prompt module may prompt the state of the OTP switch when the execution module controls the state of the corresponding OTP switch, and in such a manner, the state of the OTP switch may be monitored intuitively, so as to improve the accuracy and efficiency of the test.
In this embodiment, the steps S10, S20, and S30 may be implemented by software, and in other embodiments, the modules or units may also be implemented by hardware, software, or a combination of hardware and software.
For example, each of the foregoing steps may be stored in a corresponding memory. The memory may also include necessary memory (e.g., FIFI memory, RAM, or any other suitable memory, etc.). The aforementioned data such as the prompt signal, the port type, the user instruction type, etc. may be stored in the memory. In addition, the integrated circuit may be implemented as a microprocessor, such as a CPU, MCU, etc., executing executable instructions stored in a memory (e.g., RAM, ROM, distributed memory in an internet server, or any other suitable memory storing executable instructions), which is not limited in this respect.
The memory may include high speed random access memory and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other non-volatile solid state storage devices. In certain embodiments, the memory may also include memory that is remote from the one or more processors, such as network-attached memory accessed via RF circuitry or external ports and a communication network (not shown), which may be the internet, one or more intranets, Local Area Networks (LANs), wide area networks (WLANs), Storage Area Networks (SANs), etc., or a suitable combination thereof. The memory controller may control access to the memory by other components of the device, such as the CPU and peripheral interfaces.
In summary, the control device and the control method for the OTP switch provided by the present invention firstly judge the Root right, and only when the current test version has the Root right, the subsequent operation can be performed, so that the security performance is increased; and the types of the instructions input by the user are identified and distinguished, and different instruction types correspond to different operations, so that the reliability of the system is effectively improved. In addition, the invention can realize operation only according to user instructions or selections, thereby improving the simplicity of operation and improving the efficiency of test.
Compared with the prior art, the control device and the control method of the OTP switch have the following advantages that: the testing mode is simpler and more humanized, better in interaction and higher in efficiency; moreover, as the Root authority is judged, while avoiding some misoperation, whether the version authority is enough can be timely confirmed, so that the safety performance of the test is improved, and simultaneously, the instruction types are distinguished, so that the reliability of the test is improved.
As will be appreciated by one skilled in the art, the above-described embodiments may be provided as a method, apparatus, or computer program product. These embodiments may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. All or part of the steps in the methods according to the embodiments may be implemented by a program instructing related hardware, where the program may be stored in a storage medium readable by a computer device and used to execute all or part of the steps in the methods according to the embodiments.
The various embodiments described above are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a computer apparatus to produce a machine, such that the instructions, which execute via the processor of the computer apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the present invention has been described in detail with reference to the preferred embodiments, it should be understood that the above description should not be taken as limiting the invention. Various modifications and alterations to this invention will become apparent to those skilled in the art upon reading the foregoing description. Accordingly, the scope of the invention should be determined from the following claims.

Claims (10)

1. An apparatus for controlling an OTP switch, comprising:
the judging module is used for judging whether the current test version has Root authority or not;
the control module is used for judging and identifying the type of a user instruction and the type of a port selected by a user under the condition that the current test version has Root authority;
and the execution module is used for controlling the state of the OTP switch of the port selected by the user according to the type of the user instruction.
2. The apparatus for controlling an OTP switch of claim 1 wherein the determining means includes:
the calling unit is used for calling the script command in the current test version;
and the confirming unit is used for confirming whether the Root authority exists according to the output result of the script command.
3. The control apparatus of an OTP switch as recited in claim 1,
the types of user instructions include: an on type for controlling a state of the OTP switch to an on state, and an off type for controlling a state of the OTP switch to an off state.
4. The control apparatus of an OTP switch as recited in claim 1, further comprising: and the prompting module is used for prompting input exception when the user instruction is of other types.
5. The control apparatus of an OTP switch of claim 1 wherein the user-selected type of port includes: sensing the port and the platform port.
6. A method of controlling an OTP switch, comprising:
judging whether the current test version has Root authority or not;
if the current test version has Root authority, judging and identifying the type of a user instruction, and judging and identifying the type of a port selected by a user;
and controlling the state of the OTP switch of the port selected by the user according to the type of the user instruction.
7. The method of claim 6, wherein the step of determining whether the current test version has Root rights comprises:
calling a script command in the current test version;
and confirming whether the Root authority is available according to the output result of the script command.
8. The method of controlling an OTP switch as recited in claim 6,
the types of user instructions include: an on type for controlling a state of the OTP switch to an on state, and an off type for controlling a state of the OTP switch to an off state.
9. The method of controlling an OTP switch of claim 8 further comprising: and when the user command is of other types, prompting for inputting exception is carried out.
10. The method of controlling an OTP switch as recited in claim 6,
the types of ports selected by the user include: a sensing port and a platform port.
CN201810005832.0A 2018-01-03 2018-01-03 Control device and control method of OTP switch Active CN108170607B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810005832.0A CN108170607B (en) 2018-01-03 2018-01-03 Control device and control method of OTP switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810005832.0A CN108170607B (en) 2018-01-03 2018-01-03 Control device and control method of OTP switch

Publications (2)

Publication Number Publication Date
CN108170607A CN108170607A (en) 2018-06-15
CN108170607B true CN108170607B (en) 2021-05-18

Family

ID=62517227

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810005832.0A Active CN108170607B (en) 2018-01-03 2018-01-03 Control device and control method of OTP switch

Country Status (1)

Country Link
CN (1) CN108170607B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110764840B (en) * 2019-09-29 2023-11-03 望海康信(北京)科技股份公司 Method, device and system for wirelessly debugging android device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7058864B1 (en) * 2003-05-21 2006-06-06 Hewlett-Packard Development Company, L.P. Test for processor memory cache
CN103744787A (en) * 2014-01-21 2014-04-23 上海斐讯数据通信技术有限公司 Cellphone automated testing method
CN105786685A (en) * 2014-12-18 2016-07-20 青岛海信移动通信技术股份有限公司 Mobile terminal online debugging and diagnosis method and terminal
CN106021105A (en) * 2016-05-19 2016-10-12 武汉精测电子技术股份有限公司 Display module adjustment method and apparatus
CN106547687A (en) * 2016-10-14 2017-03-29 深圳前海微众银行股份有限公司 Application testing method, device and system
CN106875974A (en) * 2017-03-16 2017-06-20 成都信息工程大学 A kind of OTP storage devices and the method for accessing otp memory

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5828857A (en) * 1996-01-05 1998-10-27 Apple Computer, Inc. ASIC cell implementation of a bus controller with programmable timing value registers for the apple desktop bus
US7774619B2 (en) * 2004-11-17 2010-08-10 Broadcom Corporation Secure code execution using external memory
CN103092732B (en) * 2013-01-23 2016-08-17 加弘科技咨询(上海)有限公司 Utilize the system of the dynamic monitoring device of script
CN103713993B (en) * 2013-05-30 2015-07-22 深圳市汇春科技有限公司 Chip verification platform and method for implementing chip testing
CN106384366A (en) * 2016-08-24 2017-02-08 乐视控股(北京)有限公司 Image calibration method and device
CN106782660A (en) * 2016-11-28 2017-05-31 湖南国科微电子股份有限公司 On-chip system chip burning Write-protection method and on-chip system chip

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7058864B1 (en) * 2003-05-21 2006-06-06 Hewlett-Packard Development Company, L.P. Test for processor memory cache
CN103744787A (en) * 2014-01-21 2014-04-23 上海斐讯数据通信技术有限公司 Cellphone automated testing method
CN105786685A (en) * 2014-12-18 2016-07-20 青岛海信移动通信技术股份有限公司 Mobile terminal online debugging and diagnosis method and terminal
CN106021105A (en) * 2016-05-19 2016-10-12 武汉精测电子技术股份有限公司 Display module adjustment method and apparatus
CN106547687A (en) * 2016-10-14 2017-03-29 深圳前海微众银行股份有限公司 Application testing method, device and system
CN106875974A (en) * 2017-03-16 2017-06-20 成都信息工程大学 A kind of OTP storage devices and the method for accessing otp memory

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
OTP存储器应用开发技术研究;张剑;《中国优秀硕士学位论文全文数据库 信息科技辑》;20160315(第03期);全文 *

Also Published As

Publication number Publication date
CN108170607A (en) 2018-06-15

Similar Documents

Publication Publication Date Title
CN105049711A (en) Photographing method and user terminal
CN104866406B (en) A kind of reminding method and terminal based on fingerprint recognition
CN112996020B (en) Bluetooth-based automatic test method and device and Bluetooth test terminal
CN109214187A (en) A kind of method, apparatus and electronic equipment controlling computer starting
CN116955044B (en) Method, device, equipment and medium for testing cache working mechanism of processor
CN104853095A (en) Photographing method and user terminal
CN111158806B (en) Interface display method, device, computer equipment and storage medium
CN105740013B (en) Brush machine method of controlling operation thereof and device
CN108170607B (en) Control device and control method of OTP switch
CN110459260B (en) Automatic test switching device, method and system
CN107679423A (en) Partition integrity inspection method and device
CN114328240A (en) Electronic equipment detection method, system, equipment and storage medium
CN109753148A (en) A kind of control method, device and the controlling terminal of VR equipment
CN117215217A (en) Method, system and platform for single shower decontamination of personnel in and out based on Internet of things
CN107315947A (en) Pay class application management method, device and mobile terminal
CN110850941A (en) Terminal equipment cooling method and related equipment
CN105867771A (en) Mobile terminal and method and device for turning off application programs
CN110580221A (en) Control testing method and device, storage medium and electronic equipment
CN104932885B (en) A kind of information processing method and electronic equipment
CN113612659B (en) Device networking test method and device, electronic device and storage medium
CN109522174A (en) Control adb enabled method, apparatus, terminal and storage medium
CN109740306A (en) The method and device that application software is authorized based on hybrid plan
US20220406125A1 (en) Game state detection and configuration updating method and apparatus, device and storage medium
CN109697356B (en) Application software permission adaptation method and device
CN109543420B (en) Permission configuration method and device based on sud, electronic equipment and storage medium

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