Detection methods, apparatus and electronic equipment
By configuring verification information in the operating system kernel, the code path for unique status in snapshot recovery is automatically located, which solves MAC address conflicts and security issues in snapshot recovery and improves the efficiency and accuracy of the location.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2022-07-13
- Publication Date
- 2026-05-26
AI Technical Summary
When restoring multiple instances from a snapshot, existing technologies rely on manual lookup, which is inefficient and prone to omissions due to MAC address conflicts and security issues caused by outdated unique states.
Configure verification information in the operating system kernel, receive unique status call requests, compare process information and output user-mode stack, and locate the code path of unique status based on function call relationships.
Automated location of code involved in unique states improves efficiency, reduces omissions, and ensures the accuracy and security of snapshot recovery.
Smart Images

Figure CN115309512B_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification relate to the field of computer technology, and in particular to a detection method, apparatus, and electronic device. Background Technology
[0002] A snapshot is a snapshot taken of software (such as an application or virtual machine) after it has been running for a period of time. The purpose of a snapshot is to save the current state of the software or the entire virtual machine so that the software can be quickly restored to the running state at the time the snapshot was taken, without having to run the software from scratch.
[0003] In practical applications, when multiple instances need to be restored from a snapshot, the unique information saved in the snapshot (such as UUID, IP, MAC, random number seed, etc.) may become outdated, resulting in abnormalities in the restored instances.
[0004] Taking the unique status information of MAC address as an example, when performing snapshot recovery of multiple instances, although the MAC address of the underlying network card has changed, the MAC address saved in the snapshot is still the previous MAC address. Therefore, the multiple instances that are recovered still use the wrong MAC address, which will conflict with the current MAC address of the underlying network card, resulting in anomalies such as unavailability of functions in the multiple instances that are recovered. Summary of the Invention
[0005] This specification provides a detection method, apparatus, and electronic device through its embodiments.
[0006] According to a first aspect of the embodiments of this specification, a detection method is provided, applied to the kernel of an operating system, wherein the kernel is configured with verification information corresponding to the software for verifying uniqueness status; the method includes:
[0007] Receive a unique status call request initiated by the software;
[0008] In response to the call request, when returning the uniqueness status to the software, the process information corresponding to the uniqueness status is compared with the verification information configured in the kernel to determine whether the process information is consistent with the verification information;
[0009] If so, output the user-mode stack of the software runtime; wherein, the user-mode stack stores the function call relationships between various functions during the uniqueness state call process of the software, and the function call relationships are used to determine the code path of the code corresponding to the function that initially calls the uniqueness state in the source code of the software.
[0010] Optionally, when the software relies on a third-party library for operation, and the third-party library involves a unique state, receiving the unique state call request initiated by the software includes:
[0011] Receive a unique status call request initiated by the software and / or a third-party library running in the same process as the software;
[0012] The user-mode stack stores the function call relationships between various functions during the invocation of the uniqueness state by the software. These function call relationships are used to determine the code path in the software's source code corresponding to the function that initially invokes the uniqueness state, including:
[0013] The user-mode stack stores the function call relationships between various functions of the software and / or third-party libraries during the invocation of the uniqueness state. The function call relationships are used to determine the code path of the code corresponding to the function that initially invokes the uniqueness state in the source code of the software and / or third-party libraries.
[0014] According to a second aspect of the embodiments of this specification, a detection method is provided, the method comprising:
[0015] Obtain the user-space stack output by the kernel based on any of the above detection methods;
[0016] Based on the function call relationships in the user-mode stack, determine the code path in the software's source code for the code that calls the unique state.
[0017] Optionally, determining the code path in the software's source code for the code calling the unique state based on the function call relationship in the user-mode stack includes:
[0018] Based on the function call relationships in the user-mode stack, obtain the function that initially initiated the call;
[0019] Determine the code path of the code corresponding to the called function in the source code of the software.
[0020] Optional, also includes:
[0021] Obtain the uploaded code pointed to by the code path and the solution to the uniqueness anomaly that exists when performing snapshot restoration;
[0022] According to the repair scheme, the uniqueness state is fixed up in the fixup callback function of snapshot recovery.
[0023] According to a third aspect of the embodiments of this specification, a detection device is provided, applied to the kernel of an operating system, wherein the kernel is configured with verification information corresponding to the software for verifying uniqueness status; the device includes:
[0024] The receiving unit receives the unique status call request initiated by the software;
[0025] The response unit, in response to the call request, when returning the uniqueness status to the software, compares the process information corresponding to the uniqueness status with the verification information configured in the kernel to determine whether the process information is consistent with the verification information;
[0026] The output unit, if applicable, outputs the user-mode stack of the software runtime; wherein the user-mode stack stores the function call relationships between various functions during the uniqueness state call process of the software, and the function call relationships are used to determine the code path in the source code of the software corresponding to the function that initially calls the uniqueness state.
[0027] Optionally, when the software operation depends on a third-party library, and the third-party library involves a unique state, the receiving unit further includes receiving a unique state call request initiated by the software and / or a third-party library running in the same process as the software;
[0028] The user-mode stack stores the function call relationships between various functions during the invocation of the uniqueness state by the software. These function call relationships are used to determine the code path in the software's source code corresponding to the function that initially invokes the uniqueness state, including:
[0029] The user-mode stack stores the function call relationships between various functions of the software and / or third-party libraries during the invocation of the uniqueness state. The function call relationships are used to determine the code path of the code corresponding to the function that initially invokes the uniqueness state in the source code of the software and / or third-party libraries.
[0030] According to a fourth aspect of the embodiments of this specification, a detection apparatus is provided, the apparatus comprising:
[0031] The acquisition unit acquires the user-space stack output by the kernel based on any of the above detection methods.
[0032] The determining unit determines the code path in the source code of the software that calls the unique state, based on the function call relationship in the user-mode stack.
[0033] Optionally, the determining unit includes: obtaining the calling function that initially initiated the call based on the function call relationship in the user-mode stack; and determining the code path of the code corresponding to the calling function in the source code of the software.
[0034] Optionally, the device further includes:
[0035] The repair unit acquires the uploaded repair plan for the uniqueness anomaly that exists when performing snapshot recovery, targeting the code pointed to by the code path; and performs fixup processing on the uniqueness state in the fixup callback function of snapshot recovery according to the repair plan.
[0036] According to a fifth aspect of the embodiments of this specification, an electronic device is provided, comprising:
[0037] processor;
[0038] Memory used to store processor-executable instructions;
[0039] The processor is configured to use any of the above detection methods.
[0040] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to perform any of the above-described detection methods.
[0041] This specification provides a detection scheme that, by configuring verification information corresponding to the software in the kernel for verifying uniqueness status, confirms whether the process information corresponding to the returned uniqueness status matches the verification information configured in the kernel when the kernel returns the uniqueness status to the software. If so, the user-mode stack of the software at this time is output. Furthermore, based on the function call relationships recorded in the user-mode stack, the code path of the code calling the uniqueness status in the source code of the software is determined. In this way, the location of the code calling the uniqueness status can be quickly located based on the code path. Attached Figure Description
[0042] Figure 1 This is a flowchart of a detection method provided in one embodiment of this specification;
[0043] Figure 2 This is a flowchart of a detection method provided in one embodiment of this specification;
[0044] Figure 3 This is a hardware structure diagram of a detection device provided in one embodiment of this specification;
[0045] Figure 4 This is a module of the detection device provided in one embodiment of this specification;
[0046] Figure 5 This is a module of the detection device provided in one embodiment of this specification;
[0047] Figure 6 This is a schematic block diagram of an electronic device provided in one embodiment of this specification. Detailed Implementation
[0048] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this specification as detailed in the appended claims.
[0049] The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” as used in this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.
[0050] It should be understood that although the terms first, second, third, etc., may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this specification, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."
[0051] As mentioned earlier, in snapshot technology, when multiple instances need to be restored from a snapshot, the unique states saved in the snapshot (such as UUID, IP, MAC, random number seed, etc.) may become outdated, resulting in abnormalities in the restored instances.
[0052] The above anomalies could be either functional or security issues. For example, regarding the uniqueness of MAC addresses, when restoring multiple instances from a snapshot, although the underlying network interface card's MAC address has changed, the MAC address saved in the snapshot is still the previous MAC address. Therefore, the restored instances still use incorrect MAC addresses, which will conflict with the current MAC address of the underlying network interface card, resulting in functional problems such as the restored instances becoming unusable.
[0053] For example, regarding the uniqueness of the random number seed, different instances will randomly generate different random number seeds; however, when multiple instances are restored from a snapshot, the restored instances will reuse the same random number seed saved in the snapshot. This may lead to a situation where if the random number sequence of one instance is compromised, all other instances will also be compromised, thus posing a security problem.
[0054] While the uniqueness can be repaired in the fixup callback function—for example, by re-acquiring the MAC address so that multiple recovered instances use the latest MAC address, or by generating a different random number seed for each instance so that multiple recovered instances use their own different random number seeds—this requires identifying the uniqueness causing the snapshot recovery anomaly and further locating the code involved in that uniqueness.
[0055] In related technologies, a common method for locating such information is for developers to manually search through the source code. This method relies on the developer's experience, is not only inefficient but also prone to omissions.
[0056] Therefore, this specification aims to provide a detection scheme that can automatically identify unique states and automatically locate the code involved in the unique state. Since the unique states involved in software runtime need to be obtained from the kernel, by configuring verification information corresponding to the software in the kernel for verifying the unique state, when the kernel returns the unique state to the software, it is confirmed whether the process information corresponding to the returned unique state is consistent with the verification information configured in the kernel. If so, the user-mode stack of the software at this time is output; furthermore, based on the function call relationships recorded in the user-mode stack, the code path of the code calling the unique state in the software's source code is determined. Thus, the location of the code calling the unique state can be quickly located based on this code path.
[0057] The following combination Figure 1 This specification describes an embodiment of the detection method applied to the kernel of an operating system, wherein the kernel is configured with verification information corresponding to the software for verifying uniqueness status; the method includes:
[0058] Step 110: Receive the unique status call request initiated by the software.
[0059] In this specification, the operating system kernel can provide secure access to computer hardware for numerous software applications, and this secure access may include invocation of uniqueness status. Developers can configure verification information for verifying the uniqueness status of software within the kernel through environment variables, the kernel's proc filesystem, or configuration methods such as ftrace.
[0060] After configuration, the software can be started. During the software's operation, when the unique state is needed, the software will send a unique state call request to the kernel.
[0061] Step 120: In response to the call request, when returning the uniqueness status to the software, the process information corresponding to the uniqueness status is compared with the verification information configured in the kernel to determine whether the process information is consistent with the verification information;
[0062] In response to a software-initiated call request, the kernel returns a unique status to the software. Simultaneously, because the kernel is configured with verification information, it can identify whether this returned unique status matches the unique status configured by the developer. Specifically, the process information corresponding to the unique status is compared with the verification information to determine if they match. If they match, it means this unique status is the one the developer is looking for, and subsequent step 130 is executed. Conversely, if they do not match, it means this unique status is not the one the developer is looking for, and subsequent step 130 is unnecessary.
[0063] For example, suppose a developer wants to obtain the unique status information of the MAC address called in the software. The verification information configured in the kernel could be "whether the MAC address was called". In this way, when the process information corresponding to the unique status returned by the kernel indicates that the MAC address was called, it is consistent with the above verification information, and the user-mode stack can be output.
[0064] Step 130: If yes, output the user-mode stack of the software runtime; wherein, the user-mode stack stores the function call relationships between various functions during the uniqueness state call process of the software, and the function call relationships are used to determine the code path of the code corresponding to the function that initially calls the uniqueness state in the source code of the software.
[0065] In this specification, the output user-mode stack can be stored in the kernel log or the ftrace output buffer. For example, since ftrace provides a function to print the user-mode stack, it can be used in the kernel to print the user-mode stack.
[0066] In this specification, the output user-mode stack can be used by developers to locate the code involved in the unique state. Generally, the code path in the software's source code that calls the unique state can be determined based on the function call relationships in the user-mode stack.
[0067] In implementation, since software code logic usually involves multiple functions calling sequentially to finally complete the unique state call, the last function called is not the function that the developer wants to locate. Instead, it is necessary to determine the function that initially initiated the unique state call based on the function call relationship and locate the code path corresponding to that function call.
[0068] By applying the above embodiments, by configuring verification information corresponding to the software for verifying the uniqueness state in the kernel, the kernel can output the user-mode stack of the software runtime when the uniqueness state called by the software matches the verification information. Since the user-mode stack records the function call relationship between various functions in the process of calling the uniqueness state, the code path of the code corresponding to the function that initially calls the uniqueness state in the source code of the software can be determined based on the user-mode stack, and the location of the code that calls the uniqueness state can be quickly located based on the code path.
[0069] In application implementation, software operation may involve third-party libraries. These third-party libraries can refer to code libraries provided by third parties outside the current software to support certain functionalities within the software. Examples include the libc library and third-party libraries like Node.js / Python imports. These third-party libraries also involve uniqueness considerations when supporting software functionality.
[0070] Therefore, in one embodiment, when the software operation depends on a third-party library, and the third-party library involves a unique state, receiving the unique state call request initiated by the software includes:
[0071] Receive a unique status call request initiated by the software and / or a third-party library running in the same process as the software;
[0072] Accordingly, the user-mode stack stores the function call relationships between various functions during the invocation of the uniqueness state by the software. These function call relationships are used to determine the code path in the software's source code corresponding to the function that initially invokes the uniqueness state. Further, they may include:
[0073] The user-mode stack stores the function call relationships between various functions of the software and / or third-party libraries during the invocation of the uniqueness state. The function call relationships are used to determine the code path of the code corresponding to the function that initially invokes the uniqueness state in the source code of the software and / or third-party libraries.
[0074] Using a similar approach to that described for the software code itself, the verification information configured in the kernel can also be used to identify the uniqueness of third-party library calls.
[0075] The above embodiments can not only locate the code path of the software code that calls the unique state, but also the code path of the third-party library code that calls the unique state. This comprehensive location of the unique state's code path avoids omissions.
[0076] After introducing an example of kernel-outputted user-mode stack, the following example describes subsequent processing based on the kernel-outputted user-mode stack. Please refer to [link / reference]. Figure 2 An embodiment of the detection method shown may include:
[0077] Step 210, obtain the kernel based on the above. Figure 1 The user-space stack output by the detection method shown;
[0078] Step 220: Based on the function call relationships in the user-mode stack, determine the code path in the source code of the software that calls the unique state.
[0079] This embodiment can be applied to the terminal device where the kernel resides, or other terminal devices associated with the terminal device where the kernel resides. For example, the kernel in terminal device A is based on the above... Figure 1 After the detection method shown outputs the user-mode stack, the terminal device A can continue to execute steps 210 to 220 above; or, the terminal device B associated with the terminal device A can execute steps 210 to 220 above.
[0080] In one embodiment, step 220, determining the code path in the software's source code for the code calling the unique state based on the function call relationships in the user-mode stack, may include:
[0081] Based on the function call relationships in the user-mode stack, obtain the function that initially initiated the call;
[0082] Determine the code path of the code corresponding to the called function in the source code of the software.
[0083] In implementation, since software code logic usually involves multiple functions calling sequentially to finally complete the unique state call, the last function called is not the function that the developer wants to locate. Instead, it is necessary to determine the function that initially initiated the unique state call based on the function call relationship and locate the code path corresponding to that function call.
[0084] In this way, after locating the code that calls the unique state, developers can analyze the code logic to determine whether it will cause the unique state to malfunction during snapshot recovery.
[0085] If developers determine that the code logic leads to a unique state where snapshot recovery will fail, then snapshot recovery needs to be fixed; accordingly, in the above... Figure 2 Based on the illustrated embodiment, it may also include:
[0086] Obtain the uploaded code pointed to by the code path and the solution to the uniqueness anomaly that exists when performing snapshot restoration;
[0087] According to the repair scheme, the uniqueness state is fixed up in the fixup callback function of snapshot recovery.
[0088] In this specification, developers can quickly locate which part of the software source code is involved in the unique state by viewing the output user-mode stack, and by analyzing the code logic of this part of the code, perform fixup processing on the unique state in the fixup callback function of snapshot recovery.
[0089] For example, if the code logic is to obtain the MAC address, then since the snapshot stores outdated MAC addresses, the uniqueness state is fixed up in the snapshot recovery fixup callback function to obtain the latest MAC address for the snapshot recovery instance.
[0090] The fixup process can resolve the issue of instance anomalies during snapshot recovery caused by outdated uniqueness states.
[0091] In practical applications, as shown in the foregoing embodiments, when the software operation depends on a third-party library, and the third-party library involves a unique state, the user-mode stack can also store the function call relationships between various functions of the software and / or the third-party library during the invocation of the unique state. These function call relationships are used to determine the code path of the code corresponding to the function that initially invokes the unique state in the source code of the software and / or the third-party library. In other words, this specification can not only resolve snapshot recovery anomalies caused by unique state abnormalities in the software's own code, but also resolve snapshot recovery anomalies caused by unique state abnormalities in the code of third-party libraries.
[0092] However, since the code of third-party libraries may not be open source, the software developers themselves do not have the right to view the code of third-party libraries, and therefore cannot directly provide a solution. In this regard, this manual also provides the following examples:
[0093] If the source code of the third-party library is not open source code, the user-mode stack output by the kernel is sent to the administrator of the third-party library so that the administrator can determine the code path of the code that calls the unique state in the source code of the software based on the function call relationship in the user-mode stack.
[0094] Receive the repair solution returned by the administrator of the third-party library, and perform fixup processing on the uniqueness state in the fixup callback function of snapshot recovery based on the repair solution.
[0095] Through the above embodiments, even if the source code of the third-party library is not open source, the snapshot recovery anomaly caused by the uniqueness status can be repaired with the help of the third-party library administrator.
[0096] Corresponding to the aforementioned detection method embodiments, this specification also provides embodiments of a detection device. These device embodiments can be implemented through software, hardware, or a combination of both. Taking software implementation as an example, as a logical device, it is formed by the processor of its host device reading the corresponding computer program from non-volatile memory into memory and running it. From a hardware perspective, such as... Figure 3 The diagram shown is a hardware structure diagram of the device containing the testing apparatus described in this manual. (Except for...) Figure 3 In addition to the processor, network interface, memory, and non-volatile memory shown, the device in the embodiment may also include other hardware depending on the actual detection function, which will not be described in detail here.
[0097] Please see Figure 4 This is a block diagram of a detection device provided in one embodiment of this specification, the device corresponding to... Figure 1The illustrated embodiment is applied to the kernel of an operating system, wherein the kernel is configured with verification information corresponding to the software for verifying uniqueness status; the device includes:
[0098] The receiving unit 410 receives the unique status call request initiated by the software;
[0099] The response unit 420, in response to the call request, when returning the uniqueness status to the software, compares the process information corresponding to the uniqueness status with the verification information configured in the kernel to determine whether the process information is consistent with the verification information;
[0100] Output unit 430, if yes, outputs the user-mode stack of the software runtime; wherein, the user-mode stack stores the function call relationships between various functions during the uniqueness state call process of the software, and the function call relationships are used to determine the code path in the source code of the software corresponding to the function that initially calls the uniqueness state.
[0101] Optionally, when the software operation depends on a third-party library, and the third-party library involves a unique state, the receiving unit 410 further includes receiving a unique state call request initiated by the software and / or a third-party library running in the same process as the software.
[0102] The user-mode stack stores the function call relationships between various functions during the invocation of the uniqueness state by the software. These function call relationships are used to determine the code path in the software's source code corresponding to the function that initially invokes the uniqueness state, including:
[0103] The user-mode stack stores the function call relationships between various functions of the software and / or third-party libraries during the invocation of the uniqueness state. The function call relationships are used to determine the code path of the code corresponding to the function that initially invokes the uniqueness state in the source code of the software and / or third-party libraries.
[0104] Please see Figure 5 This is a block diagram of a detection device provided in one embodiment of this specification, the device corresponding to... Figure 2 The illustrated embodiment shows that the apparatus includes:
[0105] Acquisition unit 510 acquires the user-mode stack output by the kernel based on any of the above detection methods;
[0106] The determining unit 520 determines the code path in the source code of the software that calls the unique state based on the function call relationship in the user-mode stack.
[0107] Optionally, the determining unit 520 includes: obtaining the calling function that initially initiated the call based on the function call relationship in the user-mode stack; and determining the code path of the code corresponding to the calling function in the source code of the software.
[0108] Optionally, the device further includes:
[0109] The repair unit acquires the uploaded repair plan for the uniqueness anomaly that exists when performing snapshot recovery, targeting the code pointed to by the code path; and performs fixup processing on the uniqueness state in the fixup callback function of snapshot recovery according to the repair plan.
[0110] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.
[0111] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0112] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this specification according to actual needs. Those skilled in the art can understand and implement this without creative effort.
[0113] Figure 6 This is a schematic block diagram illustrating an electronic device according to an embodiment of the present disclosure. (Refer to...) Figure 6 The electronic device 600 may include one or more of the following components: a processing component 602, a memory 604, a power supply component 606, a multimedia component 608, an audio component 610, an input / output (I / O) interface 612, a sensor component 614, and a communication component 618. The aforementioned electronic device may employ a similar hardware architecture.
[0114] Processing component 602 typically controls the overall operation of electronic device 600, such as operations associated with display, telephone calls, data communication, camera operation, and recording. Processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the aforementioned method for generating the three-dimensional virtual image. Furthermore, processing component 602 may include one or more modules to facilitate interaction between processing component 602 and other components. For example, processing component 602 may include a multimedia module to facilitate interaction between multimedia component 608 and processing component 602.
[0115] Memory 604 is configured to store various types of data to support the operation of electronic device 600. Examples of this data include instructions for any application or method operating on electronic device 600, contact data, phonebook data, messages, pictures, videos, etc. Memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0116] Power supply component 606 provides power to various components of electronic device 600. Power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 600.
[0117] Multimedia component 608 includes a screen that provides an output interface between electronic device 600 and user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 608 includes a front-facing camera and / or a rear-facing camera. When electronic device 600 is in an operating mode, such as a shooting mode or video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed or an optical lens system with focal length and optical zoom capabilities.
[0118] Audio component 610 is configured to output and / or input audio signals. For example, audio component 610 includes a microphone (MIC) configured to receive external audio signals when electronic device 600 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 604 or transmitted via communication component 618. In some embodiments, audio component 610 also includes a speaker for outputting audio signals.
[0119] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, and options. These options may include, but are not limited to, home page options, volume options, startup options, and lock options.
[0120] Sensor assembly 614 includes one or more sensors for providing state assessments of various aspects of electronic device 600. For example, sensor assembly 614 can detect the on / off state of electronic device 600, the relative positioning of components such as the display and keypad of electronic device 600, changes in position of electronic device 600 or a component of electronic device 600, the presence or absence of user contact with electronic device 600, orientation or acceleration / deceleration of electronic device 600, and temperature changes of electronic device 600. Sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 614 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0121] Communication component 618 is configured to facilitate wired or wireless communication between electronic device 600 and other devices. Electronic device 600 can access wireless networks based on communication standards, such as WiFi, carrier networks (such as 2G, 3G, 4G, or 4G), or combinations thereof. In one exemplary embodiment, communication component 618 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 618 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0122] In one embodiment of this disclosure, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the detection method described in any of the above embodiments.
[0123] In one embodiment of this disclosure, a computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, which can be executed by a processor 620 of an electronic device 600 to perform the detection method described in any of the above embodiments. For example, the computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0124] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the electronic device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0125] Other embodiments of this specification will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This specification is intended to cover any variations, uses, or adaptations that follow the general principles of this specification and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this specification are indicated by the following claims.
[0126] It should be understood that this specification is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this specification is limited only by the appended claims.
Claims
1. A detection method applied to the kernel of an operating system, wherein the kernel is configured with verification information corresponding to the software for verifying uniqueness status; the method includes: Receive a unique status call request initiated by the software; In response to the call request, when returning the uniqueness status to the software, the process information corresponding to the uniqueness status is compared with the verification information configured in the kernel to determine whether the process information is consistent with the verification information; If so, output the user-mode stack of the software runtime; wherein, the user-mode stack stores the function call relationships between various functions during the uniqueness state call process of the software, and the function call relationships are used to determine the code path of the code corresponding to the function that initially calls the uniqueness state in the source code of the software.
2. The method according to claim 1, wherein when the software operation depends on a third-party library, and the third-party library involves a unique state, receiving the unique state call request initiated by the software includes: Receive a unique status call request initiated by the software and / or a third-party library running in the same process as the software; The user-mode stack stores the function call relationships between various functions during the invocation of the uniqueness state by the software. These function call relationships are used to determine the code path in the software's source code corresponding to the function that initially invokes the uniqueness state, including: The user-mode stack stores the function call relationships between various functions of the software and / or third-party libraries during the invocation of the uniqueness state. The function call relationships are used to determine the code path of the code corresponding to the function that initially invokes the uniqueness state in the source code of the software and / or third-party libraries.
3. A detection method, the method comprising: Obtain the user-mode stack output by the kernel based on the method described in claim 1; Based on the function call relationships in the user-mode stack, determine the code path in the software's source code for the code that calls the unique state.
4. The method according to claim 3, wherein determining the code path in the source code of the software that calls the unique state based on the function call relationship in the user-mode stack includes: Based on the function call relationships in the user-mode stack, obtain the function that initially initiated the call; Determine the code path of the code corresponding to the called function in the source code of the software.
5. The method according to claim 3, further comprising: Obtain the uploaded code pointed to by the code path and the solution for the uniqueness anomaly that exists when performing snapshot restoration; According to the repair scheme, the uniqueness state is fixed up in the fixup callback function of snapshot recovery.
6. A detection device applied to the kernel of an operating system, wherein the kernel is configured with verification information corresponding to the software for verifying uniqueness status; the device comprises: The receiving unit receives the unique status call request initiated by the software; The response unit, in response to the call request, when returning the uniqueness status to the software, compares the process information corresponding to the uniqueness status with the verification information configured in the kernel to determine whether the process information is consistent with the verification information; The output unit, if applicable, outputs the user-mode stack of the software runtime; wherein the user-mode stack stores the function call relationships between various functions during the uniqueness state call process of the software, and the function call relationships are used to determine the code path in the source code of the software corresponding to the function that initially calls the uniqueness state.
7. The apparatus according to claim 6, wherein when the software operation depends on a third-party library and the third-party library involves a unique state, the receiving unit further comprises receiving a unique state call request initiated by the software and / or a third-party library running in the same process as the software; The user-mode stack stores the function call relationships between various functions during the invocation of the uniqueness state by the software. These function call relationships are used to determine the code path in the software's source code corresponding to the function that initially invokes the uniqueness state, including: The user-mode stack stores the function call relationships between various functions of the software and / or third-party libraries during the invocation of the uniqueness state. The function call relationships are used to determine the code path of the code corresponding to the function that initially invokes the uniqueness state in the source code of the software and / or third-party libraries.
8. A detection device, the device comprising: The acquisition unit acquires the user-mode stack output by the kernel based on the method described in claim 1; The determining unit determines the code path in the source code of the software that calls the unique state, based on the function call relationship in the user-mode stack.
9. An electronic device, comprising: processor; Memory used to store processor-executable instructions; The processor is configured to perform the method according to any one of claims 1-5.
10. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method as described in any one of claims 1-5.