Equipment state management method and device, equipment, storage medium and program product
By implementing the device status management method in computer equipment, and using the debugging program in the test equipment to adjust the switch status of the debugging port, the problem of debugging port disabling after the computer equipment leaves the factory is solved, and the flexibility and data security of the debugging port are improved.
Patent Information
- Application Number
- CN202311149288.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-06
- Publication Date
- 2025-03-11
AI Technical Summary
In the prior art, the debug port is disabled after the computer equipment leaves the factory, resulting in designers being unable to debug the application, which affects the development of the debugging business.
Provides a device status management method, which obtains the debug port switch status in a computer device through a debugging program in a test device, and adjusts it to different switch statuses according to the adjustment instructions to ensure data security.
On the premise of ensuring data security, the switching flexibility of the debug port is improved, so that computer equipment can still be used in the debugging process in program development after leaving the factory.
Smart Images

Figure CN119597622A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of equipment maintenance, and in particular to an equipment status management method, apparatus, equipment, storage medium, and program product. Background Art
[0002] The debugging process is a very important part of the manufacturing process of computer equipment. Usually, a debugging program is installed in the test equipment, and the computer equipment is debugged through the debugging program after the test equipment and the computer equipment are connected through ports, so as to detect the vulnerabilities generated by the computer equipment during the manufacturing process.
[0003] In the related art, for computer devices with a specified operating system, such as Android system devices, Android Debug Bridge (ADB) is usually used as a debugging program during the device manufacturing stage. The debugging port in the computer device is in an enabled state and connected to the test port in the test device, so that the computer device is debugged through ADB. The debugging port is disabled after the computer device leaves the factory.
[0004] However, in the related art, disabling the debugging port will make it impossible for designers to use the computer device to debug the application being developed after the computer device leaves the factory, which affects the development of the debugging business. Summary of the invention
[0005] The embodiments of the present application provide a device status management method, apparatus, device, storage medium and program product, which can improve the flexibility of the debug port switch under the premise of ensuring data security on the computer device. The technical solution is as follows.
[0006] In one aspect, a device status management method is provided, which is applied to a computer device of a specified operating system, wherein the test device is connected to an integrated circuit to be tested, and the method comprises:
[0007] Obtaining a switch state corresponding to a debug port in the computer device, wherein the debug port is used to connect to a test port in a test device, wherein a debug program is installed in the test device, and wherein the debug program debugs the computer device through the debug port in an open state;
[0008] In response to the debug port being in a first switch state, sending state indication information corresponding to the first switch state to the test device, where the first switch state includes an open state or a closed state;
[0009] Receiving adjustment instruction information sent by the test device, wherein the adjustment instruction information is information sent by the test device after receiving the status instruction information, and the adjustment instruction information is used to instruct to adjust the switch status of the debug port;
[0010] The switch state of the debug port is adjusted from the first switch state to a second switch state based on the adjustment indication information, wherein the first switch state is different from the second switch state.
[0011] On the other hand, a device status management method is provided, which is applied to a test device, and the method includes:
[0012] Display a status configuration interface, wherein the status configuration interface is used to debug the switch status of the debug port in the candidate device connected to the test port in the test device;
[0013] In response to a debug port in a computer device being in a first switch state, receiving state indication information corresponding to the first switch state sent by the computer device, the debug port being used to connect to a test port in the test device, the first switch state including an on state or a off state;
[0014] Displaying a target device identifier corresponding to the computer device in the status configuration interface based on the status indication information;
[0015] In response to receiving a state adjustment operation for the target device identifier, adjustment indication information is sent to the computer device based on the state adjustment operation, where the adjustment indication information is used to indicate adjustment of the switch state of the debug port.
[0016] On the other hand, a device state management device is also provided, the device comprising:
[0017] an acquisition module, used for acquiring a switch state corresponding to a debug port in a computer device of a specified operating system, wherein the debug port is used for connecting to a test port in a test device, wherein a debug program is installed in the test device, and wherein the debug program debugs the computer device through the debug port in an open state;
[0018] a sending module, configured to send, in response to the debug port being in a first switch state, state indication information corresponding to the first switch state to the test device, wherein the first switch state includes an on state or a off state;
[0019] A receiving module, used for receiving adjustment indication information sent by the test device, wherein the adjustment indication information is information sent by the test device after receiving the status indication information, and the adjustment indication information is used for indicating adjustment of the switch status of the debug port;
[0020] An adjustment module is used to adjust the switch state of the debugging port from the first switch state to a second switch state based on the adjustment indication information, wherein the first switch state is different from the second switch state.
[0021] On the other hand, a device state management device is also provided, the device comprising:
[0022] A display module, used for displaying a status configuration interface, wherein the status configuration interface is used for debugging the switch status of the debug port in the candidate device connected to the test port in the test device, wherein a debugging program is installed in the test device, and the debugging program debugs the computer device through the debug port in the open state;
[0023] a receiving module, configured to receive status indication information corresponding to a first switch state sent by the computer device in response to a debug port in the computer device being in a first switch state, wherein the debug port is used to connect to a test port in the test device, and the first switch state includes an on state or a off state;
[0024] The display module is further used to display the target device identifier corresponding to the computer device in the status configuration interface based on the status indication information;
[0025] The sending module is used for sending adjustment indication information to the computer device in response to receiving the state adjustment operation for the target device identifier, based on the state adjustment operation, wherein the adjustment indication information is used for indicating to adjust the switch state of the debug port.
[0026] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement a device status management method as described in any of the above-mentioned embodiments of the present application.
[0027] On the other hand, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement a device status management method as described in any of the above-mentioned embodiments of the present application.
[0028] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the device status management method described in any of the above embodiments.
[0029] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0030] In the process of debugging a computer device of a specified operating system through a debugging program in a test device, a switch state corresponding to a debugging port connected to a test port in the test device is obtained. When the debugging port is in a first switch state, state indication information corresponding to the first switch state is sent to the test device, and adjustment indication information fed back by the test device is received, so that the computer device adjusts the switch state of the debugging port to a second switch state different from the first switch state according to the adjustment indication information. That is, the computer device sends the switch state (open state or closed state) corresponding to the debugging port to the test device, and the test device timely monitors the switch state of the debugging port. If the debugging port is in an open state without a debugging requirement, the test device can timely adjust the debugging port from an open state to a closed state by sending debugging indication information, so as to prevent the relevant data in the computer device from being leaked through the debugging port. Under the premise of ensuring data security, the switch state of the debugging port is controlled by the test device instead of the scheme of disabling the debugging port, thereby improving the switch flexibility of the debugging port and ensuring that the computer device can be used in the debugging process in program development after leaving the factory. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0032] Figure 1 It is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;
[0033] Figure 2 is a flow chart of a device status management method provided by an exemplary embodiment of the present application;
[0034] Figure 3 is a flow chart of a device status management method provided by another exemplary embodiment of the present application;
[0035] Figure 4 is a schematic diagram of a device status management method provided by an exemplary embodiment of the present application;
[0036] Figure 5 is a schematic diagram of a device status management method provided by an exemplary embodiment of the present application;
[0037] Figure 6 is a schematic diagram of a status configuration interface provided by another exemplary embodiment of the present application;
[0038] Figure 7 is a schematic diagram of a device status management method provided by an exemplary embodiment of the present application;
[0039] Figure 8 is a flowchart of adjusting the state of a computer device in a turned-on state provided by an exemplary embodiment of the present application;
[0040] Fig. 9 is a flow chart of a switch state adjustment method provided by an exemplary embodiment of the present application;
[0041] Fig.10 It is a structural block diagram of a device status management apparatus provided by an exemplary embodiment of the present application;
[0042] Fig.11 is a structural block diagram of a device status management apparatus provided by another exemplary embodiment of the present application;
[0043] Fig.12 It is a schematic diagram of the structure of a server provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0045] First, the implementation environment of this application is introduced. Figure 1 , which shows a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application, such as Figure 1 As shown, the implementation environment includes a computer device 110, a test device 120 and a server 130. The computer device 110, the test device 120 and the server 130 are connected via a communication network 140. In another case, the computer device 110 and the test device 120 are connected via a physical interface, for example, via a Universal Serial Bus (USB). The computer device 110 and the server 130, as well as the test device 120 and the server 130 are respectively connected via a communication network.
[0046] The computer device 110 obtains the switch state corresponding to its own debugging port, and the debugging port is connected to the test port in the test device 120. The debugging program installed in the test device 120 debugs the computer device 110 through the debugging port in the turned-on state.
[0047] In response to the debug port being in the first switch state, the computer device 110 sends a status indication request corresponding to the first switch state to the server 130 , where the status indication request is used to request to display the switch state of the debug port to the test device 120 .
[0048] After receiving the status indication request, the server 130 generates a status indication result according to the first switch status included in the status indication request, and sends the result to the test device 120 .
[0049] A status configuration interface corresponding to the debugging program is displayed in the test device 120, and the status configuration interface includes device identifiers corresponding to multiple candidate devices. When the test device 120 receives the status indication result, the target device identifier and the first switch status corresponding to the computer device 110 are displayed in the status configuration interface. When a status adjustment operation for the target device identifier is received, a status adjustment request is generated and sent to the server 130, wherein the status adjustment request is used to request adjustment of the switch status of the debugging port in the computer device 110.
[0050] After receiving the state adjustment request sent by the test device 120 , the server 130 determines a second switch state different from the first switch state according to the state adjustment request, and sends the second switch state to the computer device 110 as a switch adjustment result.
[0051] After receiving the switch adjustment result, the computer device 110 adjusts the debugging port from the first switch state to the second switch state according to the switch adjustment result.
[0052] Among them, the computer device 110 can be optional, and can be a desktop computer, a laptop computer, a mobile phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Compression Standard Audio Layer 3) player, an MP4 (Moving Picture Experts Group AudioLayer IV, Moving Picture Experts Compression Standard Audio Layer 4) player, a smart TV, a smart car, and other forms of test equipment, which are not limited to the embodiments of the present application.
[0053] Among them, the test equipment 120 can be optional, and can be a desktop computer, a laptop computer, a mobile phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Compression Standard Audio Layer 3) player, an MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4) player, a smart TV, a smart car, and other forms of test equipment, which are not limited to the embodiments of the present application.
[0054] The server 130 includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. Optionally, the server 130 undertakes the main computing work, and the computer device 110 or the test device 120 undertakes the secondary computing work; or, the server 130 undertakes the secondary computing work, and the computer device 110 or the test device 120 undertakes the main computing work; or, the server 130, the computer device 110, and the test device 120 adopt a distributed computing architecture to perform collaborative computing.
[0055] It is worth noting that the above-mentioned server 130 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), as well as big data and artificial intelligence platforms.
[0056] Among them, cloud technology refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.
[0057] In some embodiments, the server 130 may also be implemented as a node in a blockchain system.
[0058] It is worth noting that the above-mentioned communication network can be implemented as a wired network or a wireless network, and the communication network can be implemented as any one of a local area network, a metropolitan area network or a wide area network, which is not limited in the embodiments of the present application.
[0059] It should be noted that before collecting relevant data of users and during the process of collecting relevant data of users, this application can display a prompt interface, pop-up window or output voice prompt information, and the prompt interface, pop-up window or voice prompt information is used to prompt the user that its relevant data is currently being collected, so that this application only starts to execute the relevant steps of obtaining relevant data of users after obtaining the confirmation operation issued by the user to the prompt interface or pop-up window, otherwise (that is, when the confirmation operation issued by the user to the prompt interface or pop-up window is not obtained), the relevant steps of obtaining relevant data of users are terminated, that is, the relevant data of users are not obtained. In other words, all user data collected by this application are collected with the consent and authorization of the user, and the collection, use and processing of relevant user data need to comply with the relevant laws, regulations and standards of the relevant regions.
[0060] In combination with the above-mentioned noun introduction and implementation environment, the device status management method provided in the embodiment of the present application is described, and the method is performed by a computer device with a specified operating system as an example. For schematic illustration, please refer to Figure 2 , which shows a flowchart of a device status management method provided by an exemplary embodiment of the present application, the method includes the following steps.
[0061] Step 210, obtaining the switch status corresponding to the debugging port in the computer device.
[0062] The debugging port is used to connect to a test port in a test device. A debugging program is installed in the test device. The debugging program debugs the computer device through the debugging port in an open state.
[0063] Optionally, the operating system corresponding to the computer device includes any one of Android, iOS (an operating system developed by Apple), Symbian, Windows Phone, BlackBerry OS or Hongmeng system.
[0064] Optionally, the computer device and the test device are devices of different device types, for example, the computer device is a mobile phone and the test device is a computer; or, the computer device and the test device are different devices of the same device type, for example, the computer device is computer a and the test device is computer b.
[0065] Illustratively, different debugging programs are used for different operating systems, that is, the debugging programs correspond to the operating systems.
[0066] Optionally, the computer device is a terminal type device; or, the computer device is a simulator device.
[0067] In some embodiments, the debugging program is a program installed in the test device to debug the computer device. The debugging content includes at least one of running the command line (shell) of the computer device, managing the port mapping relationship of the computer device, uploading / downloading files between the computer device and the test device, and installing the application program in the test device to the computer device. The command line refers to the programming language used to operate and control the operating system.
[0068] Optionally, a debugging program is also installed in the computer device; or a debugging mode is configured in the operating system corresponding to the computer device.
[0069] In some embodiments, the debug port is a port used to connect a computer device to an external device (e.g., a test device) for communication, thereby realizing data transmission between the two devices. For example, when the test port in test device a is connected to the debug port in computer device b, computer device b forwards data A to the debug port of computer device b through the test port, so that the computer device processes data A.
[0070] In some embodiments, the test port is a port used to connect the test device to an external device (eg, a computer device) for communication, thereby achieving data transmission between the two devices.
[0071] Optionally, the port type of the debug port and the test port includes any one of the following types:
[0072] 1. The debug port is a physical port in the computer device, and the test port is a physical port in the test device, so the debug port and the test port are connected through the universal serial bus;
[0073] 2. The debug port is a virtual port in the computer device, and the device port is a virtual port in the test device, so the debug port and the test port are connected through network communication.
[0074] It is worth noting that the above-mentioned port types regarding the debug port and the test port are merely illustrative examples and are not limited to this in the embodiments of the present application.
[0075] Among them, when the debug port is implemented as a virtual port, a client corresponding to the debug program is installed in the computer device, and the debug port is the client port of the debug program; or, a debug mode is configured in the operating system of the computer device, and the debug port is the mode port corresponding to the debug mode.
[0076] Optionally, when the debug port is a client port, the debug port is in an open state when the client corresponding to the debug program is running in the computer device; when the debug port is a mode port, the debug port is in an open state when the debug mode is turned on in the operating system of the computer device.
[0077] Optionally, when both the debug port and the test port are implemented as virtual ports, when the debug port in the computer device is in an turned-on state, when the debug program is also running in the test device at the same time, the debug port and the test port are automatically connected; or, when the debug program is also running in the test device at the same time, and the debug device and the test device are both in the same wireless local area network, the debug port and the test port are automatically connected; or, when the debug program is also running in the test device at the same time, the test device sends a connection request to the computer device, and when the user performs a confirmation operation on the computer device, the debug port and the test port are connected; or, when the debug program is also running in the test device at the same time, the computer device sends a connection request to the test device, and when the user performs a confirmation operation on the test device, the debug port and the test port are connected.
[0078] In some embodiments, the switch state corresponding to the debug port includes an on state or a off state, wherein, when the debug port is in the on state, the debug program in the test device debugs the computer device through the debug port, and when the debug port is in the off state, the debug program in the test device cannot debug the computer device through the debug port.
[0079] Optionally, the opportunity to obtain the switch status of the debug port includes at least one of the following situations:
[0080] 1. Whenever the computer device is in a specified state, obtaining a switch state corresponding to a debugging port in the computer device, wherein the specified state includes at least one of a restart state, a battery power reaching a power threshold, a standby state, a battery power full state, and the like;
[0081] 2. When the running time of the computer device reaches the running time interval, the switch status corresponding to the debugging port in the computer device is obtained, for example: the switch status is obtained every five minutes.
[0082] It is worth noting that the above switch status of the debugging port is only an illustrative example and is not limited to this in the embodiments of the present application.
[0083] Optionally, a single computer device is connected to only one test device; or, a single computer device may be connected to multiple test devices.
[0084] In some embodiments, a single test device may be connected to multiple different computer devices, that is, the single test device may control the switch states of the debug ports in multiple different computer devices.
[0085] Optionally, the switch state of the debug port is manually controlled by a designer, for example, the designer manually turns on the debug port; or, the debug port is automatically turned on in a specified state.
[0086] Step 220: In response to the debug port being in the first switch state, sending state indication information corresponding to the first switch state to the test device.
[0087] The first switch state includes an on state or a off state.
[0088] Illustratively, the first switch state is used to indicate a switch state detection result corresponding to the debug port at the current moment.
[0089] In some embodiments, the status indication information refers to the status data corresponding to the first switch state sent by the computer device to the test device. For example, the status indication information of the debug port is preset to "0" when it is in the on state and to "1" when it is in the off state. If the first switch state is in the on state, the computer device sends the status indication information "0" to the test device.
[0090] Illustratively, when the debugging port is a virtual port, after the computer device detects the first switch state of the debugging port, it sends state indication information corresponding to the first switch state to the test device through the communication network.
[0091] Step 230: Receive adjustment instruction information sent by the test equipment.
[0092] The adjustment indication information is information sent by the test device after receiving the status indication information, and the adjustment indication information is used to instruct to adjust the switch status of the debugging port.
[0093] In some embodiments, after receiving the status indication information sent by the computer device, the test device sends an instruction to adjust the first switch state to the computer device as the adjustment indication information.
[0094] Illustratively, the adjustment indication information is used to indicate that the switch state of the debugging port is adjusted from the current state to the opposite state.
[0095] When the first switch state is in the on state, the adjustment instruction information is used to adjust the on state to the off state.
[0096] When the first switch state is in the closed state, the adjustment instruction information is used to adjust the open state to the open state.
[0097] Optionally, the information type of the adjustment indication information includes at least one of the following modes:
[0098] 1. The adjustment instruction information is issued with a digital identifier. For example, the adjustment instruction information corresponding to adjusting the open state to the closed state is "1000", and the adjustment instruction information corresponding to adjusting the closed state to the open state is "1001";
[0099] 2. The adjustment instruction information is sent in the form of a character string. For example, the adjustment instruction information corresponding to adjusting the open state to the closed state is "close", and the adjustment instruction information corresponding to adjusting the closed state to the open state is "open".
[0100] It is worth noting that the above-mentioned information types regarding the adjustment indication information are merely illustrative examples and are not limited to this in the embodiments of the present application.
[0101] In an optional case, when the test device is connected to multiple different computer devices, after receiving status indication information sent by different computer devices, the test device can simultaneously send adjustment indication information to the multiple computer devices, wherein different computer devices receive different adjustment indication information, that is, the adjustment indication information received by each computer device only includes its own adjustment content; or, after receiving status indication information sent by different computer devices, the test device can simultaneously send the same adjustment indication information to the multiple computer devices, and the adjustment indication information is an information set, which includes adjustment indication sub-information corresponding to the multiple computer devices, and the adjustment indication sub-information includes the device identification and adjustment content corresponding to the computer device. After the computer device receives the information set, it reads the adjustment indication sub-information corresponding to itself from the information set according to its own device identification.
[0102] Step 240: Adjust the switch state of the debugging port from the first switch state to the second switch state based on the adjustment indication information.
[0103] The first switch state is different from the second switch state.
[0104] Illustratively, after receiving the adjustment indication information, the computer device determines the switch state adjustment method corresponding to the adjustment indication information, and thereby adjusts the switch state of the debug port according to the switch state adjustment method. For example, when the switch state adjustment method is from a closed state to an open state, the debug port is adjusted from the first switch state (closed state) to an open state as the second switch state.
[0105] Optionally, when the computer device receives the adjustment instruction information, the switch state of the debugging port is adjusted immediately; or, when the computer device receives the adjustment instruction information, the switch state of the debugging port is adjusted if the computer device meets the adjustment requirements.
[0106] The adjustment requirement includes that the computer device reaches a specified state involved in the above steps; or, the running time of the computer device reaches a running time interval, which is not limited.
[0107] In summary, the device state management method provided by the embodiment of the present application, in the process of debugging a computer device of a specified operating system through a debugging program in a test device, obtains the switch state corresponding to the debug port connected to the test port in the test device, and when the debug port is in a first switch state, sends the state indication information corresponding to the first switch state to the test device, and receives the adjustment indication information fed back by the test device, so that the computer device adjusts the switch state of the debug port to a second switch state different from the first switch state according to the adjustment indication information. That is, the computer device sends the switch state (open state or closed state) corresponding to the debug port to the test device, and the test device monitors the switch state of the debug port in a timely manner. If the debug port is in an open state without a debugging requirement, the test device can adjust the debug port from the open state to the closed state in a timely manner by issuing the debugging indication information, so as to prevent the relevant data in the computer device from being leaked through the debug port. Under the premise of ensuring data security, the switch state of the debug port is controlled by the test device instead of the scheme of disabling the debug port, which improves the switch flexibility of the debug port and ensures that the computer device can be used in the debugging process in program development after leaving the factory.
[0108] In some embodiments, the switch state of the debug port is rewritten according to the adjustment indication information to obtain a new switch state. For example, please refer to Figure 3 , which shows a flow chart of a device status management method provided by an exemplary embodiment of the present application, that is, step 210 includes step 211, and step 240 also includes step 241 and step 242, such as Figure 3 As shown, the method includes the following steps.
[0109] Step 211, in response to the computer device meeting the status detection requirement, a status detection component in the computer device is used to perform status detection on the debug port to obtain a switch status corresponding to the debug port.
[0110] The status detection component is a component in a computer device used to detect the switch status of a debugging port.
[0111] Indicatively, the status detection requirement is a requirement pre-set by a user. Only when the computer device meets the requirement can the status detection of the debug port be performed through the status detection component in the computer device; when the computer device does not meet the requirement, the status detection of the debug port is not performed.
[0112] In some embodiments, in response to the computer device being in a restart state, it is determined that the computer device meets the status detection requirement; or, in response to the running time of the computer device reaching the running time interval, it is determined that the computer device meets the status detection requirement.
[0113] In this embodiment, when the computer device is in a restart state, it is determined that the computer device meets the status detection requirements, so the status detection component in the computer device is used to perform a status detection on the debug port to obtain a switch state corresponding to the debug port; or, when the running time of the computer device reaches a running time interval preset by the user, it is determined that the computer device meets the status detection requirements, so the status detection component in the computer device is used to perform a status detection on the debug port to obtain a switch state corresponding to the debug port.
[0114] Optionally, the status detection component is a virtual component, that is, the status detection component is a code pre-compiled in the operating system of the computer device, used to read the status data corresponding to the debug port; or, the status detection component is a physical component installed in the computer device, used to read the status data corresponding to the debug port.
[0115] Step 220: In response to the debug port being in the first switch state, sending state indication information corresponding to the first switch state to the test device.
[0116] The first switch state includes an on state or a off state.
[0117] Illustratively, after the state detection component performs state detection on the debugging port of the computer device to obtain the first switch state, if the first switch state is an on state, state indication information corresponding to the first switch state is sent to the test device.
[0118] If the first switch state is the closed state, the state indication information corresponding to the first switch state is directly sent to the test device.
[0119] Illustratively, the user pre-configures different candidate indication information for different switch states, and after determining the first switch state corresponding to the computer device, determines the target indication information corresponding to the first switch state from the candidate indication information, and sends it to the test device as the state indication information.
[0120] Step 230: Receive adjustment instruction information sent by the test equipment.
[0121] The adjustment indication information is information sent by the test device after receiving the status indication information, and the adjustment indication information is used to instruct to adjust the switch status of the debugging port.
[0122] The relevant contents in step 230 have been described in detail in the above embodiments, and the embodiments of the present application are not limited to this.
[0123] Step 241: Acquire state configuration information based on the adjustment indication information.
[0124] The status configuration information is the switch status adjustment method of the debugging port configuration in the computer device by the test device.
[0125] Schematically, the state configuration information indicates a switch state adjustment mode configured by the test device based on the switch state corresponding to the current debug port.
[0126] In some embodiments, the state configuration information is read from the test device based on the adjustment indication information.
[0127] In this embodiment, the adjustment instruction information includes multiple information contents, for example, including an adjustment permission instruction and state configuration information. Among them, the adjustment permission instruction means that the test device allows the switch state corresponding to the current debug port to be adjusted. In some embodiments, the adjustment instruction information includes an adjustment prohibition instruction, which means that the test device does not allow the switch state corresponding to the debug port to be adjusted. At this time, after the computer device receives the adjustment instruction information, it will not adjust the switch state of the debug port.
[0128] In this embodiment, when the computer device receives the adjustment instruction information, when the adjustment permission instruction is read therefrom, the state configuration information is read, wherein the data form corresponding to the state configuration information is implemented as a preset key-value pair (key-value), which is used to indicate the switch state corresponding to the debug port after adjustment, for example: the state configuration information is expressed as: operate_adb: true / false. Among them, true indicates adjustment from the closed state to the open state, false indicates adjustment from the open state to the closed state, and adb indicates the debugging program.
[0129] In some embodiments, when reading state configuration information from the test device based on the adjustment indication information fails, historical configuration information is obtained from the cache as the state configuration information, where the historical configuration information is the state configuration information read by the computer device from the test device within a historical time range.
[0130] In this embodiment, if the status configuration information is not read from the adjustment indication information sent by the test device, or the reading fails, the historical configuration information is read from the cache of the computer device itself as the status indication information for the current adjustment of the debug port.
[0131] The historical configuration information is the status configuration information read by the computer device from the test device within a historical time range, for example, the status configuration information used for the last adjustment of the debug port; or, the historical configuration information can also be implemented as configuration information designed and stored in advance in the computer device.
[0132] In one feasible case, a plurality of candidate historical configuration information is stored in the cache, from which historical configuration information adapted to the current first switch state (ie, configuration information corresponding to adjusting the first switch state to its opposite state) is selected as the state configuration information.
[0133] Step 242: rewrite the switch state of the debug port based on the state configuration information to obtain a data rewriting result as a second switch state.
[0134] Illustratively, the first switch state corresponds to the first state data. When the computer reads the state configuration information, the first state data is rewritten into the second state data according to the state configuration information as a data rewriting result, wherein the switch state corresponding to the second state data is the second switch state.
[0135] For example: when the first state data is "false" (off state), the state configuration information is operate_adb: true, therefore, the first state data is rewritten from false to true (on state), and the data rewriting result is obtained, and the switch state corresponding to true is used as the second switch state.
[0136] In summary, the device state management method provided by the embodiment of the present application, in the process of debugging a computer device of a specified operating system through a debugging program in a test device, obtains the switch state corresponding to the debug port connected to the test port in the test device, and when the debug port is in a first switch state, sends the state indication information corresponding to the first switch state to the test device, and receives the adjustment indication information fed back by the test device, so that the computer device adjusts the switch state of the debug port to a second switch state different from the first switch state according to the adjustment indication information. That is, the computer device sends the switch state (open state or closed state) corresponding to the debug port to the test device, and the test device monitors the switch state of the debug port in a timely manner. If the debug port is in an open state without a debugging requirement, the test device can adjust the debug port from the open state to the closed state in a timely manner by issuing the debugging indication information, so as to prevent the relevant data in the computer device from being leaked through the debug port. Under the premise of ensuring data security, the switch state of the debug port is controlled by the test device instead of the scheme of disabling the debug port, which improves the switch flexibility of the debug port and ensures that the computer device can be used in the debugging process in program development after leaving the factory.
[0137] In this embodiment, the status configuration information is obtained according to the debugging indication information, and then the switch status of the debugging port is rewritten according to the status configuration information to obtain the second switch state, which enables the test device to have the right to rewrite the debugging port of the computer device and to close the debugging port in the open state in time, thereby improving the security of data in the computer device and the flexibility of the debugging port switch.
[0138] In this embodiment, the status configuration information is read from the test device according to the adjustment indication information, so that the status of the debug port in the computer device can be set by the test device, ensuring that the computer device can be debugged with the debug port turned on. The switch status of the debug port can also be adjusted by the test device to prevent data leakage.
[0139] In this embodiment, if the computer device fails to read the status configuration information, it can also obtain historical configuration information from the cache module to adjust the switch state of the debugging port to ensure that the debugging port can be closed in time when it is in the open state to avoid data leakage.
[0140] In this embodiment, when the computer device meets the status detection requirements, the status detection component is used to perform status detection on the debugging port, thereby avoiding repeated detection and reducing calculation overhead.
[0141] In this embodiment, different status detection requirements are set to enable timely detection of the debugging port in the computer device to ensure data security.
[0142] In some embodiments, the computer device needs to be registered and identified before adjusting the debugging port. For example, please refer to Figure 4 , which shows a flow chart of a device status management method provided by an exemplary embodiment of the present application, that is, step 220 also includes steps 221 to 223, step 240 also includes step 2401 before step 240, and step 240 also includes steps 2402 to 2404, such as Figure 4 As shown, the method includes the following steps.
[0143] Step 221: In response to the debug port being in the first switch state, obtain device attribute information corresponding to the computer device.
[0144] The device attribute information refers to the debugging stage corresponding to the computer device during the debugging process.
[0145] In some embodiments, device attribute information refers to the debugging stage of a computer device marked by a user during the manufacturing process, for example: a formal debugging device and an informal debugging device, wherein the attribute identifier of the formal debugging device is 1111, and the attribute identifier of the informal debugging device is 1110, wherein the formal debugging device indicates that the current computer device is in the formal debugging stage, and the informal debugging device indicates that the current computer device is in the temporary debugging stage and formal debugging has not yet been performed.
[0146] In this embodiment, when the debugging port is in the first switch state, the computer device reads a device attribute identifier corresponding to the computer device from the test device as the device attribute information corresponding to the computer device.
[0147] Step 222: In response to the device information corresponding to the computer device meeting the device attribute condition, generate state indication information corresponding to the first switch state.
[0148] Illustratively, the device attribute condition is a condition pre-set by the user. In this embodiment, device attribute conditions are set for different types of attribute identifiers (including 1111 and 1110) (the computer device identified as 1111 meets the device attribute conditions), and the attribute identifier corresponding to each device connected to the test device is recorded.
[0149] In this embodiment, when the computer device reads from the test device the attribute identifier corresponding to the computer device belonging to the formal debugging device, it is determined that the device information corresponding to the computer device meets the device attribute condition, thereby generating state indication information corresponding to the first switch state.
[0150] Optionally, the first switch state itself is a state data, and the state data is directly used as the state indication information; or, the computer device stores state data corresponding to different switch states, and the state data corresponding to the first switch state is selected as the state indication information according to the first switch state.
[0151] Step 223: Send status indication information to the test device.
[0152] Illustratively, after the state indication information corresponding to the first switch state is generated, the state indication information is sent to the test device.
[0153] Step 230: Receive adjustment instruction information sent by the test equipment.
[0154] The adjustment indication information is information sent by the test device after receiving the status indication information, and the adjustment indication information is used to instruct to adjust the switch status of the debugging port.
[0155] The relevant contents in step 230 have been described in detail in the above embodiments, and the embodiments of the present application are not limited to this.
[0156] Step 2401, sending a list acquisition request to the test device.
[0157] The list acquisition request is used to request to acquire a device registration list recorded by the test device, wherein the device registration list includes device numbers corresponding to a plurality of candidate computer devices connected to the test device.
[0158] In some embodiments, after the computer device receives the adjustment instruction information sent by the test device, it first needs to perform a registered identification on the computer device itself, wherein the registered identification is used to determine whether the computer device is in the device registration list stored in the test device.
[0159] Therefore, during the registered identification process, a list acquisition request is first sent to the test device to request to read the device registration list stored in the test device, wherein the device registration list includes device numbers corresponding to the candidate computer devices connected to the test port of the test device.
[0160] Optionally, the device code and the above-mentioned device information belong to different concepts; or, they may belong to the same concept. If they belong to the same concept, the device registration list may no longer be obtained after it is determined that the device information meets the device attribute conditions.
[0161] Schematically, different candidate computer devices correspond to different device numbers.
[0162] Step 2402: Receive a device registration list sent by the test device.
[0163] Illustratively, after sending a list acquisition request to the test device, the device registration list fed back by the test device is received, thereby reading the device numbers corresponding to each candidate computer device in the device registration list, and determining whether the device number corresponding to the computer device is in the device registration list.
[0164] Step 2403: In response to the device number corresponding to the computer device being in the device registration list, obtaining state configuration information based on the adjustment indication information.
[0165] In this embodiment, if the device number corresponding to the computer device is in the device registration list stored in the test device, the computer device is considered to be a registered device, so the state configuration information is read from the adjustment indication information for subsequent adjustment of the first switch state.
[0166] If the device number corresponding to the computer device is not in the device registration list stored in the test device, it is considered that the computer device does not belong to the registered device, so the switch state of the first switch state of the computer device is not adjusted.
[0167] Step 2404: rewrite the switch state of the debug port based on the state configuration information to obtain a data rewriting result as the second switch state.
[0168] The relevant contents in step 2404 have been described in detail in the above step 242 and will not be repeated here.
[0169] In some embodiments, when the first switch state is the on state, a port opening record corresponding to the debug port in the computer device is obtained, wherein the port opening record includes a port identifier corresponding to the first port, the first port refers to a port connected to the debug port, and after the first port is connected to the debug port, a port opening request is sent to the debug port to open the debug port; the port opening record is sent to a test device, and after the test device receives the port opening record, the port identifier in the port opening record is matched with a pre-stored port identifier set, wherein the port identifier set includes the port identifier corresponding to the computer device that meets the device attribute condition; in response to the port identifier not being in the port identifier set, a port shielding instruction is sent to the computer device to instruct the computer device to shield the port opening request of the first port after receiving the port opening request again. That is, in response to the debug port being in an open state, a port opening record corresponding to the debug port is obtained, the port opening record includes a port identifier corresponding to a first port, the first port is a port corresponding to a first device connected to the computer device, the first port is used to send a port opening request to the debug port, and the port opening request is used to request to open the debug port; the port opening record is sent to a test device, wherein the test device is used to match the port identifier corresponding to the first port in the port opening record with a port identifier set pre-stored in the test device after receiving the port opening record, the port identifier set including multiple candidate port identifiers that meet the connection requirements; in response to the port identifier not being in the port identifier, a port shielding instruction sent by the test device is received, and the port shielding instruction is used to instruct the computer device to shield the port opening request of the first port.
[0170] In this embodiment, in addition to periodically reporting the switch status corresponding to the debugging port to the test device, if the debugging port is enabled after the computer device is connected to the port of the first device, the computer device will also record the port number corresponding to the port of the first device, and send the port enabling record to the test device, so that the test device detects the first device through the port enabling record, that is, the test device pre-stores port identifiers corresponding to multiple formal devices. If the port identifier corresponding to the first device is not in the port identifier set, it indicates that the target computer is an informal device. Therefore, a port shielding instruction is sent to the computer device, so that after the subsequent computer device receives the port enabling request sent by the first device, it directly shields the port to avoid the debugging port being enabled, thereby improving data security.
[0171] In summary, the device state management method provided by the embodiment of the present application, in the process of debugging a computer device of a specified operating system through a debugging program in a test device, obtains the switch state corresponding to the debug port connected to the test port in the test device, and when the debug port is in a first switch state, sends the state indication information corresponding to the first switch state to the test device, and receives the adjustment indication information fed back by the test device, so that the computer device adjusts the switch state of the debug port to a second switch state different from the first switch state according to the adjustment indication information. That is, the computer device sends the switch state (open state or closed state) corresponding to the debug port to the test device, and the test device monitors the switch state of the debug port in a timely manner. If the debug port is in an open state without a debugging requirement, the test device can adjust the debug port from the open state to the closed state in a timely manner by issuing the debugging indication information, so as to prevent the relevant data in the computer device from being leaked through the debug port. Under the premise of ensuring data security, the switch state of the debug port is controlled by the test device instead of the scheme of disabling the debug port, which improves the switch flexibility of the debug port and ensures that the computer device can be used in the debugging process in program development after leaving the factory.
[0172] In this embodiment, by acquiring device attribute information of computer devices, status indication information is generated for computer devices that meet device attribute conditions, thereby avoiding adjustment of computer devices that do not need switch state adjustment, thereby improving device state adjustment efficiency.
[0173] In this embodiment, by acquiring the device registration list in the test device, the computer device with the device number in the device registration list acquires the status indication information, which can improve the efficiency of device status adjustment.
[0174] Indicatively, the method is performed by a test device as an example for explanation. A debugging program is installed in the test device. The debugging program debugs the computer device through the debugging port in an open state. Indicatively, please refer to Figure 5 , which shows a flowchart of a device status management method provided by an exemplary embodiment of the present application, the method includes the following steps.
[0175] Step 510, display the status configuration interface.
[0176] The status configuration interface is used to debug the switch status of the debug port in the candidate device connected to the test port in the test device.
[0177] In some embodiments, the debugging program is a program installed in the test device for debugging the candidate device connected to the test device. The debugging content includes at least one of running the command line (shell) of the computer device, managing the port mapping relationship of the computer device, uploading / downloading files between the computer device and the test device, and installing the application program in the test device to the computer device. The command line refers to the programming language used to operate and control the operating system.
[0178] Optionally, the candidate device is a terminal type device; or, the candidate device is a simulator device.
[0179] Optionally, the candidate device and the test device are devices of different device types, for example, the candidate device is a mobile phone and the test device is a computer; or, the candidate device and the test device are different devices of the same device type, for example, the candidate device is computer a and the test device is computer b.
[0180] Optionally, different candidate devices are connected to the same test port in the test device through their respective debug ports; or, the test device includes multiple different test ports, and respective debug ports in different candidate devices are connected one-to-one with different test ports of the test device.
[0181] Optionally, the operating system corresponding to the candidate device includes any one of Android, iOS (an operating system developed by Apple), Symbian, Windows Phone, BlackBerry OS or Hongmeng system.
[0182] Optionally, for the debugging program installed in the test device, the debugging program is used to debug a device of a specified operating system, so the multiple candidate devices connected to the test device belong to devices of the same operating system.
[0183] In another possible implementation, a plurality of different debugging programs are installed in the test device, and different debugging programs are used to debug candidate devices of different operating systems, and different debugging programs correspond to different test interfaces.
[0184] Step 520: In response to the debug port in the computer device being in the first switch state, receiving state indication information corresponding to the first switch state sent by the computer device.
[0185] The debugging port is used to connect to a test port in a test device, and the first switch state includes an on state or a off state.
[0186] Illustratively, the first switch state is used to indicate a switch state detection result corresponding to the debug port at the current moment.
[0187] In some embodiments, the status indication information refers to the status data corresponding to the first switch state sent by the computer device to the test device. For example, the status indication information of the debug port is preset to "0" when it is in the on state and to "1" when it is in the off state. If the first switch state is in the on state, the computer device sends the status indication information "0" to the test device.
[0188] Illustratively, when the debugging port is a virtual port, after the computer device detects the first switch state of the debugging port, it sends state indication information corresponding to the first switch state to the test device through the communication network.
[0189] Step 530: Display the target device identifier corresponding to the computer device in the status configuration interface based on the status indication information.
[0190] Illustratively, the device identifier is a unique identification number corresponding to the device identity of the candidate device, and the multiple device identifiers displayed in the current state configuration interface are used to represent multiple candidate devices currently connected to the test device.
[0191] In some embodiments, each time the testing device receives status indication information sent by a device, the device identification corresponding to the device will be displayed in the status configuration interface.
[0192] For illustration, please refer to Figure 6 , which shows a schematic diagram of a status configuration interface provided by an exemplary implementation of the present application, such as Figure 6 As shown, when the test device runs the debugging program, a state configuration interface 600 corresponding to the debugging program is displayed. The state configuration interface includes device identifiers 610 corresponding to the computer devices, and other device information 620 corresponding to the computer devices.
[0193] Step 540: In response to receiving the state adjustment operation for the target device identifier, send adjustment indication information to the computer device based on the state adjustment operation.
[0194] The adjustment instruction information is used to instruct to adjust the switch state of the debugging port.
[0195] Illustratively, the state adjustment operation is used to adjust the switch state of the debug port. For example, the state configuration interface includes a close control, and the designer triggers the close control as a state adjustment operation to adjust the debug port in the open state to the closed state.
[0196] In some embodiments, after receiving the status indication information sent by the computer device, the test device sends an instruction to adjust the first switch state (ie, complete the status adjustment operation) to the computer device as the adjustment indication information.
[0197] Illustratively, the adjustment indication information is used to indicate that the switch state of the debugging port is adjusted from the current state to the opposite state.
[0198] When the first switch state is in the on state, the adjustment instruction information is used to adjust the on state to the off state.
[0199] When the first switch state is in the closed state, the adjustment instruction information is used to adjust the open state to the open state.
[0200] Optionally, the information type of the adjustment indication information includes at least one of the following modes:
[0201] 1. The adjustment instruction information is issued with a digital identifier. For example, the adjustment instruction information corresponding to adjusting the open state to the closed state is "1000", and the adjustment instruction information corresponding to adjusting the closed state to the open state is "1001";
[0202] 2. The adjustment instruction information is sent in the form of a character string. For example, the adjustment instruction information corresponding to adjusting the open state to the closed state is "close", and the adjustment instruction information corresponding to adjusting the closed state to the open state is "open".
[0203] It is worth noting that the above-mentioned information types regarding the adjustment indication information are merely illustrative examples and are not limited to this in the embodiments of the present application.
[0204] In an optional case, when the test device is connected to multiple different computer devices, after receiving status indication information sent by different computer devices, the test device can simultaneously send adjustment indication information to the multiple computer devices, wherein different computer devices receive different adjustment indication information, that is, the adjustment indication information received by each computer device only includes its own adjustment content; or, after receiving status indication information sent by different computer devices, the test device can simultaneously send the same adjustment indication information to the multiple computer devices, and the adjustment indication information is an information set, which includes adjustment indication sub-information corresponding to the multiple computer devices, and the adjustment indication sub-information includes the device identification and adjustment content corresponding to the computer device. After the computer device receives the information set, it reads the adjustment indication sub-information corresponding to itself from the information set according to its own device identification.
[0205] Indicative, such as Figure 6As shown, the current state configuration interface 600 displays a target device identifier 610 corresponding to the computer device. In addition, the state configuration interface 600 also displays a state editing control 602. When a trigger operation is received on the state editing control 602, a state editing interface 630 corresponding to the computer device is displayed. The state editing interface 630 includes multiple editing parameters, such as: effective time, end time, version upper limit, version lower limit, device number, configuration state (if the first switch state is on, the configuration state is off, otherwise it is on), etc. When the editing parameter setting is completed, the state adjustment operation is completed, and adjustment indication information is generated and fed back to the computer device.
[0206] In some embodiments, first location information corresponding to a computer device is sent to a test device at a specified time interval, the first location information being used to indicate a geographical location of the computer device; in response to the geographical location of the computer device and the geographical location of the test device meeting a specified location requirement, adjustment indication information sent by the test device is received.
[0207] In this embodiment, the test device adjusts the switch state of the debug port in the computer device that meets the specified location requirements. Therefore, the computer device reports the current geographical location of the computer device to the test device at a specified time interval. When the test device receives the first location information sent by the computer device, the geographical location of the test device is matched with the geographical location of the computer device. If the distance between the geographical location of the test device and the geographical location of the computer device meets the distance requirements, it is considered that the current test device has the right to adjust the switch state of the debug port in the computer device.
[0208] In another feasible situation, the computer device and the test device report the first location information and the second location information to the server at a specified time interval, wherein the first location information is used to indicate the geographical location of the computer device, and the second location information is used to indicate the geographical location of the test device. After receiving the first location information and the second location information, the server matches the geographical location of the computer device with the geographical location of the test device. If the geographical location of the computer device and the geographical location of the test device meet the specified location requirements, the server sends adjustment permission instructions to the test device and the computer device respectively, and the adjustment permission instructions are used to indicate that the test device has the right to adjust the switch state of the debug port in the computer device. By sending the location information at regular intervals, it can be ensured that the switch state of the debug port is adjusted only when the location requirements are met between the test device and the computer device, thereby improving data security.
[0209] In summary, the device state management method provided by the embodiment of the present application, in the process of debugging a computer device of a specified operating system through a debugging program in a test device, obtains the switch state corresponding to the debug port connected to the test port in the test device, and when the debug port is in a first switch state, sends the state indication information corresponding to the first switch state to the test device, and receives the adjustment indication information fed back by the test device, so that the computer device adjusts the switch state of the debug port to a second switch state different from the first switch state according to the adjustment indication information. That is, the computer device sends the switch state (open state or closed state) corresponding to the debug port to the test device, and the test device monitors the switch state of the debug port in a timely manner. If the debug port is in an open state without a debugging requirement, the test device can adjust the debug port from the open state to the closed state in a timely manner by issuing the debugging indication information, so as to prevent the relevant data in the computer device from being leaked through the debug port. Under the premise of ensuring data security, the switch state of the debug port is controlled by the test device instead of the scheme of disabling the debug port, which improves the switch flexibility of the debug port and ensures that the computer device can be used in the debugging process in program development after leaving the factory.
[0210] For example, the operating system is Android system and the debugging program is debugging bridge program, and the device status management method is described in detail. Figure 7 , which shows a schematic diagram of a device status management method provided by an exemplary embodiment of the present application. Whenever the Android device 710 is in a restart state, the switch state of the debug bridge mode in the Android device is obtained as the switch state of the debug port. The debug bridge program 721 is installed in the test device 720. The Android device 710 and the test device 720 are in the same wireless local area network. The debug bridge program 721 debugs the Android device 710 through the debug bridge mode in the turned-on state.
[0211] The first switch state of the debug port is turned on as an example for detailed description. Figure 8 , which shows an exemplary flowchart of the computer device state adjustment in the turned-on state provided by the present application.
[0212] Step 801, the device restarts.
[0213] The current Android device is in restarting state.
[0214] Step 802, detecting the switch status of the debugging port of the Android device.
[0215] When the Android device is restarted, the switch state of the debugging port of the Android device is detected by the state detection component in the Android device. If the debugging port is in the on state, step 803 is executed, otherwise the process ends.
[0216] Step 803, obtaining device attribute information.
[0217] If the debugging port is in an open state, the Android device reads device data from the test device to determine device attribute information corresponding to the Android device. If the Android device is a formal debugging device, step 804 is executed, otherwise the process ends.
[0218] Step 804, create a risk list and send status indication information to the test device.
[0219] When the debugging port of the Android device is turned on and the Android device is a formal debugging device, a risk ticket is created and sent to the test device as status indication information.
[0220] Step 805, confirm the status of the Android device, and close the debugging port of the Android device through the debugging program management platform.
[0221] A debug bridge management platform is logged in to the test device, and status indication information is received through the debug bridge management platform. The designer confirms the switch status of the debug port through the status indication information on the debug bridge management platform, and uses the device number as an identifier in the status configuration interface of the debug bridge management platform to issue instructions to close the debug ports of the Android device or multiple devices other than the Android device as adjustment indication information.
[0222] The following is a detailed description of how to adjust the debugging port switch status after the Android device receives the adjustment instruction information. For illustration, please refer to Fig. 9 , which shows a flow chart of a switch state adjustment method provided by an exemplary embodiment of the present application, such as Fig. 9 As shown, the method includes the following steps.
[0223] Step 901, read the device registration information.
[0224] When the Android device receives the adjustment instruction information, it first performs a registered identification on the Android device. If the Android device is in the registered state, step 902 is executed, otherwise the process ends.
[0225] Step 902, obtaining status configuration information.
[0226] If the Android device is in the registered state, the state configuration information is obtained according to the adjustment instruction information. If the state configuration information is not obtained or the acquisition fails, step 903 is executed. If the acquisition is successful, step 904 is executed.
[0227] Step 903: Adjust the switch state according to the historical configuration information.
[0228] The historical configuration information is read from the cache of the Android device to adjust the switch state of the debugging port to obtain a second switch state.
[0229] Step 904: adjust the switch state according to the state configuration information.
[0230] The switch state of the debugging port is rewritten with data through the state configuration information to obtain a second switch state.
[0231] Step 905: Write the state configuration information into the cache.
[0232] The Android device reads the status configuration information from the test device at a specified time interval and updates the switch status of the debugging port to ensure that the debugging port is consistent with the preset port status of the test device.
[0233] The first switch state of the debug port is closed as an example for detailed description. If the developer needs to open the debug port of the Android device for development and debugging, in addition to sending status indication information to the test device, it is also necessary to send a port opening request to the test device. After the designer approves the port opening request through the debug bridge management platform, the port opening instruction is issued for the developer to debug the Android device and application.
[0234] Fig.10 is a structural block diagram of a device status management apparatus provided by an exemplary embodiment of the present application, such as Fig.10 As shown, the device comprises:
[0235] The acquisition module 1010 is used to acquire the switch state corresponding to the debug port in the computer device of the specified operating system, wherein the debug port is used to connect to the test port in the test device, wherein the test device is installed with a debug program, and the debug program debugs the computer device through the debug port in the turned-on state;
[0236] The sending module 1020 is used for sending, in response to the debug port being in a first switch state, state indication information corresponding to the first switch state to the test device, where the first switch state includes an open state or a closed state;
[0237] The receiving module 1030 is used to receive the adjustment instruction information sent by the test device, wherein the adjustment instruction information is information sent by the test device after receiving the status instruction information, and the adjustment instruction information is used to instruct to adjust the switch status of the debug port;
[0238] The adjustment module 1040 is configured to adjust the switch state of the debug port from the first switch state to a second switch state based on the adjustment indication information, wherein the first switch state is different from the second switch state.
[0239] In some embodiments, the adjustment module 1040 is also used to obtain status configuration information based on the adjustment indication information, and the status configuration information is the switch status adjustment method of the debugging port configuration in the computer device by the test device; based on the status configuration information, the switch status of the debugging port is rewritten to obtain the data rewriting result as the second switch state.
[0240] In some embodiments, the adjustment module 1040 is further configured to read the state configuration information from the test device based on the adjustment indication information.
[0241] In some embodiments, the adjustment module 1040 is also used to obtain historical configuration information from the cache as the status configuration information when reading the status configuration information from the test device based on the adjustment indication information fails, and the historical configuration information is the status configuration information read by the computer device from the test device within a historical time range.
[0242] In some embodiments, the acquisition module 1010 is also used to send a list acquisition request to the test device, the list acquisition request is used to request to obtain a device registration list recorded by the test device, the device registration list includes device numbers corresponding to multiple candidate computer devices connected to the test device; receive the device registration list sent by the test device; in response to the device number corresponding to the computer device being in the device registration list, obtain the status configuration information based on the adjustment indication information.
[0243] In some embodiments, the acquisition module 1010 is also used to, in response to the computer device meeting the status detection requirements, perform status detection on the debug port through a status detection component in the computer device to obtain a switch status corresponding to the debug port. The status detection component is a component in the computer device used to detect the switch status of the debug port.
[0244] In some embodiments, the acquisition module 1010 is further used to determine that the computer device meets the status detection requirement in response to the computer device being in a restart state; or to determine that the computer device meets the status detection requirement in response to the running time of the computer device reaching the running time interval.
[0245] In some embodiments, a debugging program is installed in the test device, and the debugging program debugs the computer device through the debugging port in an open state;
[0246] The debugging module is also used to display a status configuration interface, and the status configuration interface is used to debug the switch status of the debugging port in the candidate device connected to the test port in the test device; in response to the debugging port in the computer device being in a first switch state, receiving status indication information corresponding to the first switch state sent by the computer device, the debugging port is used to connect to the test port in the test device, and the first switch state includes an open state or a closed state; based on the status indication information, a target device identifier corresponding to the computer device is displayed in the status configuration interface; in response to receiving a status adjustment operation for the target device identifier, adjustment indication information is sent to the computer device based on the status adjustment operation, and the adjustment indication information is used to indicate adjustment of the switch status of the debugging port.
[0247] In some embodiments, the sending module 1020 is also used to obtain device information corresponding to the computer device in response to the debug port being in the first switch state; generate status indication information corresponding to the first switch state in response to the device information corresponding to the computer device meeting the device attribute conditions; and send the status indication information to the test device.
[0248] In some embodiments, the receiving module 1030 is also used to send first location information corresponding to the computer device to the test device at a specified time interval, wherein the first location information is used to indicate the geographical location of the computer device; in response to the geographical location of the computer device and the geographical location of the test device meeting the specified location requirements, receive adjustment indication information sent by the test device.
[0249] Fig.11 is a structural block diagram of a device status management apparatus provided by an exemplary embodiment of the present application, such as Fig.11 As shown, the device comprises:
[0250] A display module 1110 is used to display a status configuration interface, wherein the status configuration interface is used to debug the switch status of the debug port in the candidate device connected to the test port in the test device, wherein a debug program is installed in the test device, and the debug program debugs the computer device through the debug port in the open state;
[0251] The receiving module 1120 is used for receiving, in response to a debug port in a computer device being in a first switch state, state indication information corresponding to the first switch state sent by the computer device, wherein the debug port is used to connect to a test port in the test device, and the first switch state includes an open state or a closed state;
[0252] The display module 1110 is further configured to display a target device identifier corresponding to the computer device in the status configuration interface based on the status indication information;
[0253] The sending module 1130 is used for sending adjustment indication information to the computer device in response to receiving the state adjustment operation for the target device identifier based on the state adjustment operation, wherein the adjustment indication information is used for indicating to adjust the switch state of the debug port.
[0254] In summary, the device state management device provided by the embodiment of the present application obtains the switch state corresponding to the debug port connected to the test port in the test device during the process of debugging the computer device of the specified operating system through the debugging program in the test device, and when the debug port is in the first switch state, sends the state indication information corresponding to the first switch state to the test device, and receives the adjustment indication information fed back by the test device, so that the computer device adjusts the switch state of the debug port to a second switch state different from the first switch state according to the adjustment indication information. That is, the computer device sends the switch state (open state or closed state) corresponding to the debug port to the test device, and the test device monitors the switch state of the debug port in a timely manner. If the debug port is in the open state without debugging requirements, the test device can adjust the debug port from the open state to the closed state in a timely manner by issuing the debugging indication information, so as to prevent the relevant data in the computer device from being leaked through the debug port. Under the premise of ensuring data security, the switch state of the debug port is controlled by the test device instead of the scheme of disabling the debug port, which improves the switch flexibility of the debug port and ensures that the computer device can be used in the debugging process in program development after leaving the factory.
[0255] It should be noted that the device state management device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device state management device provided in the above embodiment and the device state management method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0256] Fig.12 The following is a schematic diagram showing the structure of a server provided by an exemplary embodiment of the present application. Specifically:
[0257] The server 1200 includes a central processing unit (CPU) 1201, a system memory 1204 including a random access memory (RAM) 1202 and a read-only memory (ROM) 1203, and a system bus 1205 connecting the system memory 1204 and the central processing unit 1201. The server 1200 also includes a mass storage device 1206 for storing an operating system 1213, application programs 1214, and other program modules 1215.
[0258] The mass storage device 1206 is connected to the central processing unit 1201 through a mass storage controller (not shown) connected to the system bus 1205. The mass storage device 1206 and its associated computer-readable media provide non-volatile storage for the server 1200. That is, the mass storage device 1206 may include a computer-readable medium (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.
[0259] Without loss of generality, computer readable media may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other solid-state storage technology, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media are not limited to the above. The above-mentioned system memory 1204 and mass storage device 1206 can be collectively referred to as memory.
[0260] According to various embodiments of the present application, the server 1200 can also be connected to a remote computer on the network through a network such as the Internet. That is, the server 1200 can be connected to the network 1212 through the network interface unit 1211 connected to the system bus 1205, or the network interface unit 1211 can be used to connect to other types of networks or remote computer systems (not shown).
[0261] The above-mentioned memory also includes one or more programs, and the one or more programs are stored in the memory and configured to be executed by the CPU.
[0262] An embodiment of the present application also provides a computer device, which includes a processor and a memory, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, at least one program, a code set or an instruction set is loaded and executed by the processor to implement the device status management method provided by the above-mentioned method embodiments.
[0263] An embodiment of the present application also provides a computer-readable storage medium, on which is stored at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the device status management method provided by the above-mentioned method embodiments.
[0264] The embodiment of the present application also provides a computer program product, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the device status management method described in any of the above embodiments.
[0265] Optionally, the computer readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a solid state drive (SSD), or an optical disk. Among them, the random access memory may include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM). The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0266] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0267] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A device status management method, characterized in that: Applied to a computer device of a specified operating system, the method comprises: Obtaining a switch state corresponding to a debug port in the computer device, wherein the debug port is used to connect to a test port in a test device, wherein a debug program is installed in the test device, and wherein the debug program debugs the computer device through the debug port in an open state; In response to the debug port being in a first switch state, sending state indication information corresponding to the first switch state to the test device, where the first switch state includes an on state or a off state; Receiving adjustment instruction information sent by the test device, wherein the adjustment instruction information is information sent by the test device after receiving the status instruction information, and the adjustment instruction information is used to instruct to adjust the switch status of the debug port; The switch state of the debug port is adjusted from the first switch state to a second switch state based on the adjustment indication information, wherein the first switch state is different from the second switch state.
2. The method according to claim 1, characterized in that The adjusting the switch state of the debug port from the first switch state to the second switch state based on the adjustment indication information includes: Acquire state configuration information based on the adjustment indication information, wherein the state configuration information is a switch state adjustment method of the test device for the debug port configuration in the computer device; The switch state of the debug port is rewritten based on the state configuration information to obtain a data rewriting result as the second switch state.
3. The method according to claim 2, characterized in that The acquiring the state configuration information based on the adjustment indication information includes: The state configuration information is read from the test device based on the adjustment indication information.
4. The method according to claim 3, characterized in that The method further comprises: In the case where reading the state configuration information from the test device based on the adjustment indication information fails, historical configuration information is obtained from the cache as the state configuration information, where the historical configuration information is the state configuration information read by the computer device from the test device within a historical time range.
5. The method according to claim 2, characterized in that: Before acquiring the state configuration information based on the adjustment indication information, the method further includes: Sending a list acquisition request to the test device, wherein the list acquisition request is used to request to acquire a device registration list recorded by the test device, wherein the device registration list includes device numbers corresponding to a plurality of candidate computer devices connected to the test device; receiving the device registration list sent by the test device; The acquiring the state configuration information based on the adjustment indication information includes: In response to the device number corresponding to the computer device being in the device registration list, the state configuration information is acquired based on the adjustment instruction information.
6. The method according to any one of claims 1 to 5, characterized in that: The obtaining of the switch status corresponding to the debugging port in the computer device includes: In response to the computer device meeting the status detection requirements, the status detection component in the computer device performs status detection on the debug port to obtain the switch status corresponding to the debug port. The status detection component is a component in the computer device used to detect the switch status of the debug port.
7. The method according to claim 6, characterized in that Before the state detection component in the computer device detects the state of the debug port, the method further includes: In response to the computer device being in a restart state, determining that the computer device meets the state detection requirement; or, In response to the running time of the computer device reaching the running time interval, it is determined that the computer device meets the status detection requirement.
8. The method according to any one of claims 1 to 5, characterized in that: In response to the debug port being in the first switch state, sending state indication information corresponding to the first switch state to the test device includes: In response to the debugging port being in the first switch state, acquiring device attribute information corresponding to the computer device, the device attribute information referring to a debugging stage corresponding to the computer device during the debugging process; In response to the device attribute information corresponding to the computer device meeting the device attribute condition, generating state indication information corresponding to the first switch state; The status indication information is sent to the test device.
9. The method according to any one of claims 1 to 5, characterized in that: The first switch state includes the on state; The method further comprises: In response to the debug port being in the open state, obtaining a port open record corresponding to the debug port, wherein the port open record includes a port identifier corresponding to a first port, the first port is a port corresponding to a first device connected to the computer device, the first port is used to send a port open request to the debug port, and the port open request is used to request to open the debug port; Sending the port opening record to the test device, wherein the test device is used to match the port identifier corresponding to the first port in the port opening record with a port identifier set pre-stored in the test device after receiving the port opening record, wherein the port identifier set includes multiple candidate port identifiers that meet the connection requirements; In response to the port identifier not being in the port identifier, receiving a port shielding instruction sent by the test device, wherein the port shielding instruction is used to instruct the computer device to shield the port opening request of the first port.
10. A device status management method, characterized in that: Applied to a test device, wherein a debugging program is installed in the test device, and the debugging program debugs the computer device through the debugging port in an open state, the method comprising: Display a status configuration interface, wherein the status configuration interface is used to debug the switch status of the debug port in the candidate device connected to the test port in the test device; In response to a debug port in a computer device being in a first switch state, receiving state indication information corresponding to the first switch state sent by the computer device, the debug port being used to connect to a test port in the test device, the first switch state including an on state or a off state; Displaying a target device identifier corresponding to the computer device in the status configuration interface based on the status indication information; In response to receiving a state adjustment operation for the target device identifier, adjustment indication information is sent to the computer device based on the state adjustment operation, where the adjustment indication information is used to indicate adjustment of the switch state of the debug port.
11. A device status management device, characterized in that: The device comprises: an acquisition module, used for acquiring a switch state corresponding to a debug port in a computer device of a specified operating system, wherein the debug port is used for connecting to a test port in a test device, wherein a debug program is installed in the test device, and wherein the debug program debugs the computer device through the debug port in an open state; a sending module, configured to send, in response to the debug port being in a first switch state, state indication information corresponding to the first switch state to the test device, wherein the first switch state includes an on state or a off state; A receiving module, used for receiving adjustment indication information sent by the test device, wherein the adjustment indication information is information sent by the test device after receiving the status indication information, and the adjustment indication information is used for indicating adjustment of the switch status of the debug port; An adjustment module is used to adjust the switch state of the debugging port from the first switch state to a second switch state based on the adjustment indication information, wherein the first switch state is different from the second switch state.
12. A device status management device, characterized in that: The device comprises: A display module, used for displaying a status configuration interface, wherein the status configuration interface is used for debugging the switch status of the debug port in the candidate device connected to the test port in the test device, wherein a debugging program is installed in the test device, and the debugging program debugs the computer device through the debug port in the open state; a receiving module, configured to receive status indication information corresponding to a first switch state sent by the computer device in response to a debug port in the computer device being in a first switch state, wherein the debug port is used to connect to a test port in the test device, and the first switch state includes an on state or a off state; The display module is further used to display the target device identifier corresponding to the computer device in the status configuration interface based on the status indication information; The sending module is used for sending adjustment indication information to the computer device in response to receiving the state adjustment operation for the target device identifier, based on the state adjustment operation, wherein the adjustment indication information is used for indicating to adjust the switch state of the debug port.
13. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the device status management method according to any one of claims 1 to 10.
14. A computer-readable storage medium, characterized in that: The storage medium stores at least one program, and the at least one program is loaded and executed by the processor to implement the device status management method according to any one of claims 1 to 10.
15. A computer program product, characterized in that It comprises computer instructions, which, when executed by a processor, implement the device status management method as claimed in any one of claims 1 to 10.