CN115712468A - Time information processing method and device, computing equipment and storage medium - Google Patents

Time information processing method and device, computing equipment and storage medium Download PDF

Info

Publication number
CN115712468A
CN115712468A CN202211214468.1A CN202211214468A CN115712468A CN 115712468 A CN115712468 A CN 115712468A CN 202211214468 A CN202211214468 A CN 202211214468A CN 115712468 A CN115712468 A CN 115712468A
Authority
CN
China
Prior art keywords
time
conversion
task
operating system
dynamic link
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211214468.1A
Other languages
Chinese (zh)
Inventor
吕状
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
XFusion Digital Technologies Co Ltd
Original Assignee
XFusion Digital Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by XFusion Digital Technologies Co Ltd filed Critical XFusion Digital Technologies Co Ltd
Priority to CN202211214468.1A priority Critical patent/CN115712468A/en
Publication of CN115712468A publication Critical patent/CN115712468A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the application discloses a time information processing method, a time information processing device, computing equipment and a storage medium, wherein the method comprises the following steps: responding to a time query event generated aiming at the task object, generating a time acquisition request, and sending the time acquisition request in an operating system running the task object; receiving task time returned by responding to the time acquisition request; processing the task object according to the task time; wherein, if the time conversion object is enabled in the operating system, the task time comprises: a conversion time obtained by a time conversion object injected in the operating system; the conversion time is obtained by converting the reference time according to a conversion rule; if the time conversion object is not enabled in the operating system, the task time comprises: acquiring reference time acquired by an object through time; the reference time is different from the transition time. By adopting the method and the device, time can be flexibly provided for the software object, including providing converted time or reference time.

Description

Time information processing method and device, computing equipment and storage medium
Technical Field
The present application relates to the technical field of computing devices, and in particular, to a time information processing method and apparatus, a computing device, and a storage medium.
Background
With the development of computer technology, various software applications can be programmed based on a plurality of programming languages, and the software applications can greatly facilitate the production and life of people. In these software applications, there are many time-based functions, such as data cycle dump, timing alarm, license failure detection, daylight savings time switch, password modification reminder, conversion calculation of different time zones, etc. in the device management software system. The software application triggers these functions by acquiring the system time provided by the operating system at which it resides.
The existing time acquisition mode is that a software application automatically reads the system time of an operating system where the software application is located through designed program codes, and the time acquisition mode is single and cannot cover some special scenes, for example, scenes needing to specify a time or acceleration time cannot be covered.
Disclosure of Invention
The embodiment of the application provides a time information processing method and device, computing equipment and a storage medium, which can flexibly provide time for a software object.
In a first aspect, an embodiment of the present application provides a time information processing method, which may be applied to a computing device capable of running a software application, where the method includes: responding to a time query event generated aiming at a task object, generating a time acquisition request, and sending the time acquisition request in an operating system running the task object; receiving the task time returned by responding to the time acquisition request; processing the task object according to the task time; wherein, if a time conversion object is enabled in the operating system, the task time comprises: a conversion time obtained by a time conversion object injected in the operating system; the conversion time is obtained by converting the reference time according to a conversion rule; if no time conversion object is enabled in the operating system, the task time comprises: acquiring reference time acquired by an object through time; the reference time is different from the transition time.
In the technical scheme, two objects for acquiring time, namely a time conversion object and a time acquisition object, are designed, for example, two time functions capable of acquiring different times are designed, when a certain task object in a software application needs to acquire time, different times can be acquired in a mode of enabling the time conversion object or not enabling the time conversion object, so that the time acquisition mode is more flexible, and finally, the reference time or the converted conversion time which is flexibly acquired can be used as the task time to respond to a time query event.
In a possible implementation manner, if a time conversion object is injected into the operating system, it is determined that the time conversion object is enabled in the operating system, a time acquisition request for calling the time acquisition object may be intercepted by the time conversion object, and the conversion time may be obtained by the time conversion object; wherein the time acquisition object is used for acquiring a reference time as a reference time.
In the technical scheme, the time conversion object is specially designed, so that once the time conversion object is injected into an operating system, the time conversion object can automatically intercept a time acquisition request and feed back and modify the converted time after time conversion, and under some time modification scenes, code modification is not required to be carried out on software application used or tested, and the software application is not immersed, so that the use or the test of the software application needing time modification or time acceleration is greatly facilitated.
In a possible implementation manner, the sending the time obtaining request in an operating system running the task object includes: determining a time control strategy of a task object corresponding to the time query event; if the policy is the first policy, determining that the time conversion object is not enabled in the operating system, and sending a time acquisition request to a time acquisition object in the operating system running the task object so as to acquire the reference time; if the policy is the second policy, it is determined that the time conversion object is enabled in the operating system, and a time acquisition request may be sent to the time conversion object injected in the operating system running the task object, so as to acquire the conversion time.
In the technical scheme, when a time acquisition request is initiated, whether a time conversion object capable of modifying and converting time is started or not can be dynamically judged by determining a time control strategy of a character object, and simply, the time control strategy mainly indicates whether time conversion modification or time conversion modification is needed or not, and can be realized in a way of dynamic specification and the like by a user through an application tool.
In one possible implementation, the reference time is determined according to a system time of an operating system running the task object, and the conversion time includes any one of the following times:
the method comprises the steps of obtaining specified time after converting system time of an operating system, wherein the conversion rule is a rule for converting the system time into the specified time;
and performing time acceleration calculation on the system time of the operating system to obtain acceleration time, wherein the conversion rule is a rule for performing conversion calculation according to time acceleration multiples.
In the technical scheme, the time conversion object can directly convert the system time into the time specified by a user, so that the requirements of some timer task objects can be met, for example, for an alarm clock task object, the time conversion object can directly reach the requirement that whether the alarm clock can normally work on time to test after the specified time is reached, and can also accelerate the system time, for example, some periodic task objects can directly accelerate the original period to 1 minute in one week by an accelerating mode, so that the period time requirement of one week can be met. The time conversion mode can cover more test requirements, the test can be completed quickly without waiting for specified time or an overlong time period during the test, the test efficiency is improved, and the possibility of system breakdown caused by the mode of modifying the system time to reach the specified time and the adverse effect on the normal work of other software applications are greatly reduced.
In one possible implementation, the specified time is configured through a user interface for configuring a time conversion object; or, the time acceleration multiple is obtained by configuring a user interface for configuring a time conversion object, and the conversion time is obtained by calculating according to the system time, the target time and the time acceleration multiple.
In the technical scheme, the setting of the designated time and the time acceleration multiple can be completed in a user interface mode, so that the software application test or the time acquisition requirement of a user can be greatly facilitated, and various different designated times or acceleration modes can be set to be suitable for the software application with different time acquisition requirements.
In one possible implementation, the method further includes: receiving a dynamic link library and an injection module object for loading the dynamic link library; and loading the dynamic link library into the address space of the process of the task object through the injection module object to obtain the time conversion object.
In the technical scheme, besides the corresponding dynamic link library, a special injection module object is designed, and the injection module object loads the dynamic link library into the corresponding address space. Therefore, the time conversion object can be better ensured to be correctly injected into the operating system, the time code intrusive modification on the software application is not needed, the dynamic link library and the injection module object can be multiplexed in different test software, and the related parameters can be adjusted through the user interface, so that the test requirements of different test software are realized.
In a possible implementation manner, the dynamic link library is selected from an object set according to an object type of the task object, the object set includes a plurality of dynamic link libraries, and conversion rules for time conversion of different dynamic link libraries are different.
In the technical scheme, the dynamic link library or the time conversion object can be injected into the operating system as required, different dynamic link libraries can be automatically loaded by different object types, for example, a task object of a timer only needs to be injected into the dynamic link library capable of converting the system time into the specified time of the timer, and a periodic task object needing time acceleration needs to start the dynamic link library capable of performing time acceleration conversion, so that the automation and intelligentization requirements of time acquisition of the task object with the time conversion requirement are met.
In one possible implementation, the dynamically linked library includes: the method comprises the steps that a hook function object constructed based on hook technology and a time function object used for converting reference time according to a conversion rule are constructed; the hook function object is used for intercepting a time acquisition request for calling the time acquisition object and converting the reference time according to a conversion rule through the time function object.
In the technical scheme, a special dynamic link library is designed, so that the interception and time conversion of the time acquisition request can be realized, the converted time can be conveniently provided for the task object needing time conversion, and the code of the software application where the task object is located does not need to be modified.
In a possible implementation manner, before processing the task object according to the task time, the method further includes: judging whether the task time meets the processing condition of the task object; if yes, executing the step of processing the task object according to the task time; if not, detecting a time query event generated aiming at the task object so as to execute the step of generating the time acquisition request responding to the time query event generated aiming at the task object.
In the technical scheme, the returned task time is judged to determine whether to process the task object, for example, whether the returned specified time is the specified time of an alarm clock timer, if so, alarm clock ringing is executed, and for example, whether the returned accelerated time reaches the cycle duration of cycle dumping, and if the accelerated time reaches the required cycle duration, data is dumped, so that intelligent processing of the task object is realized, and the method and the device are particularly suitable for time acceleration of different cycle lengths in a scene of time conversion into time acceleration.
In a second aspect, an embodiment of the present application further provides a time information processing method, which can be applied in a computing device, and implement processing of time information based on a management tool that manages a process of a software application, where the method includes: acquiring a dynamic link library and an injection module object for loading the dynamic link library; sending an injection request to an operating system for running a task object, wherein the injection request is used for triggering the operating system to execute the injection module object, and loading the dynamic link library into an address space of a process of the task object through the injection module object so as to obtain a time conversion object; and the time conversion object is used for converting the reference time according to a conversion rule to obtain conversion time.
In the technical scheme, besides the corresponding dynamic link library, a special injection module object is designed, and the injection module object loads the dynamic link library into the corresponding address space. Therefore, the time conversion object can be better ensured to be correctly injected into the operating system to realize the time conversion, the time code intrusive modification on the software application is not needed, and the dynamic link library and the injection module object can be multiplexed in different test software to realize the test requirements of different test software.
In one possible implementation, the method further includes: loading a dynamic link library and an injection module object for loading the dynamic link library into the operating system so as to load the dynamic link library into an address space of a process of a task object after the injection request is initiated; and when an unloading event of the loaded dynamic link library is detected, generating an unloading request, wherein the unloading request is used for triggering the operating system to execute the injection module object, and unloading the dynamic link library from the address space of the process of the task object through the injection module object.
In the technical scheme, the injection module object can transmit the dynamic link library and the injection module object to an operating system, so that the dynamic link library is loaded or unloaded through the injection module object, code modification does not need to be carried out on software application corresponding to the task object, and functions of time modification of function objects and the like such as injection and unloading are realized under the condition of no invasion.
In one possible implementation, the dynamically linked library includes: the method comprises the steps that a hook function object constructed based on hook technology and a time function object used for converting reference time according to a conversion rule are constructed; the hook function object is used for intercepting a time acquisition request for calling the time acquisition object and converting the reference time according to a conversion rule through the time function object.
In the technical scheme, a special dynamic link library is designed, so that the interception and time conversion of the time acquisition request can be realized, the converted time can be conveniently provided for the task object needing time conversion, and the code of the software application where the task object is located does not need to be modified.
In one possible implementation, the method further includes: displaying a user interface; the user interface comprises: any one or more of a display item for displaying the progress information of the task object, a configuration item for configuring the time designated for the time conversion object, and a configuration item for configuring the time acceleration multiple for the time conversion object, wherein the conversion time is obtained by calculating according to the system time, the target time and the time acceleration multiple.
Through the user interface, the management and monitoring of the process of the related software application are greatly facilitated, the time conversion can be configured, the configuration of different appointed time and time acceleration is facilitated, and the time conversion requirement of task objects in various software applications is met.
In a third aspect, an embodiment of the present application further provides a time information processing apparatus, where the apparatus has a capability of performing some or all of the steps in the method example described in the first aspect or the method example described in the second aspect, for example, the apparatus may have a function of performing relevant steps in some or all of the embodiments of the present application, or may have a function of separately performing the steps in any of the embodiments of the present application. In the apparatus, the relevant steps and functions may be implemented by hardware, or may be implemented by hardware executing corresponding software. The hardware or software includes one or more units or modules corresponding to the above functions.
In one implementation, the pair of time information processing apparatuses may include a processing unit and a communication unit in the structure, and the processing unit is configured to support the present apparatus to execute the corresponding steps of the above method. The communication unit is arranged to support communication requirements that may be involved. The time information processing apparatus may further comprise a storage unit for coupling with the processing unit and the communication unit, which stores necessary computer programs and data.
In a fourth aspect, an embodiment of the present application further provides a computing device, where the computing device includes a processor, and the apparatus has a capability to perform some or all of the steps in the method example described in the first aspect or the method example described in the second aspect, for example, with the processor, the computing device may have a function of performing relevant steps in some or all of the embodiments of the present application, or may have a function of separately performing steps in any of the embodiments of the present application. The related steps and functions can be realized by hardware, and the corresponding software can also be executed by hardware.
In one implementation, the computing device may also include a communication interface, such as a portal, in its structure for supporting communication needs that may be involved. The computing device may also include a memory for coupling with the processor and the communication interface that holds the necessary computer programs and data.
Drawings
FIG. 1 is a schematic diagram of an architecture of time information processing according to an embodiment of the present application;
FIG. 2 is a flow chart illustrating a method for processing time information according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of another time information processing method in the embodiment of the present application;
FIG. 4 is a schematic block diagram illustrating an embodiment of a system for performing usage or test management of a software application;
FIG. 5 is a flow chart illustrating a further method for processing time information according to an embodiment of the present application;
FIG. 6 is a schematic illustration of a user interface of an embodiment of the present application;
fig. 7 is a schematic structural diagram of a time information processing apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of another time information processing apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a computing device according to an embodiment of the present application.
Detailed Description
In order to better understand the technical solutions provided by the embodiments of the present application, the following describes the related embodiments of the present application.
During testing or use of a software application, the operating system will assign services/processes to the software application to facilitate execution of the software application, all described briefly below using processes. The embodiment of the application can provide more appropriate task time for the time-based functional application objects (or referred to as task objects) included in the software applications, so as to meet the use or test requirements of users on the task objects. In the embodiment of the application, different time requirements of a user using the software application or a test user can be met through two objects used for acquiring time.
The two mentioned objects for acquiring time may be referred to as a time acquisition object and a time conversion object, and the concrete representation thereof may be two time functions. The time acquisition object may be any one of all time API functions that can be provided by the operating system, for example, a getsystemtimeassfiletime function (a time acquisition function) of the operating system. The time conversion object can be a specially designed and loaded custom time API function, and the custom time API function can be named as a Hook _ GetSystemTimeAsFileTime function. In the embodiment of the present application, on one hand, the time conversion object may inject a corresponding dynamic link library into an address space of a process in which the task object is located through a dynamic link library injection technique, so as to be conveniently called by the process of the task object when needed, and on the other hand, the time conversion object may redirect to a Hook _ getsystemtimeafieldime function through all provided time API functions (including the aforementioned time acquisition object) of a Hook technology Hook operating system, thereby obtaining a modified conversion time. The hook technology is also called a hook technology, and before a system does not call a certain target function, a hook program captures a message sent to the target function, the hook function obtains a control right, and the hook function can process (change) an execution behavior aiming at the message to obtain a result different from a processing result of the target function.
For the conversion rule involved in the time conversion object, a specified time may be set or the time may be subjected to accelerated conversion, or some other conversion, as necessary. In this way, the reference time obtained from the system time of the operating system or other means may be converted to a specified time or an accelerated time according to the use or test requirements.
Through the two objects for acquiring the time, a user or a test user of the software application can flexibly acquire the time fed back by the two objects, and then flexibly respond to the time query event, so that the requirements of time designation or accelerated processing on task objects with time requirements in the software objects can be met, the system time of an operating system is not manually modified, and the use efficiency or the test efficiency of the software application is improved. Meanwhile, a special time conversion object is designed without adding a new code for time modification in the software application, so that the development cost of the software application with time requirement is saved, the universality of time modification is met to a certain extent by the special time conversion object, and the time modification conversion can be realized in different software applications.
In an embodiment, please refer to fig. 1, which is a schematic diagram of an architecture for processing time information according to an embodiment of the present application, where the architecture includes two parts, one part is a management tool 101 for managing use or testing of a software application, and the other part is a process 102 for running the software application. The management tool 101 can load the time conversion object into the address space corresponding to the process 102 at least when needed, the address space of the process is essentially a data structure, one process includes codes and data, and a related data structure maintained by the operating system, and the time conversion object becomes a part of the process by loading the time conversion object into the address space of the process, so that the time conversion object can be conveniently and quickly called to complete the time conversion and obtain the proper conversion time.
The management tool 101 and the process 102 may run in an operating system of a computing device, the operating system providing the process 102 for a software application comprising one or more task objects with time requirements, and the management tool 101 may be started according to the needs of a user or a test user and may communicate with the process 102. Of course, the management tool 101 and the process 102 may also run in operating systems on different computing devices, and the different computing devices establish data connection in a wired or wireless manner, so as to implement communication between the management tool 101 and the process 102.
After a software application including a time-demanding task object is launched using a user or a test user, the operating system allocates a process for the software application. In S101, the process runs the software application, and during the running of the software application, a task object in the software application that needs time conversion is executed. In S102, when the process detects a time query event generated for a target task object in the software application, a time acquisition request is generated, and in S103, the time acquisition request is sent in an operating system running the task object. In general, the time obtaining request generated at this time is used to call an operating system method to obtain system time, and may also be regarded as being used to call the aforementioned time obtaining object (as shown by a dotted line in fig. 1), so that the process responds to the time query event of the target task object according to the system time. At this time, if the custom dynamic link library (i.e., the time conversion object) of the embodiment of the present application is not injected, the process receives the reference time (as shown by the dotted line in fig. 1) acquired by the time acquisition object, and processes the task object according to the reference time. The reference time may refer to a system time of the operating system, or may be a time that can be provided by some other server or a time that can be provided by some time service device.
When a user using the software application or a test user wishes to perform conversion modification on the time required by a target task object in the software application, a customized dynamic link library, that is, the aforementioned time conversion object, may be injected into the address space of the process by the management tool in S104 based on an injection technique of the dynamic link library. The S104 may be performed at any time before the time acquisition request is transmitted, and then after the time acquisition request is generated and transmitted, the following S105 may be performed. If S104 is executed after the time acquisition request is sent, S105 described below is executed after the time inquiry event generated for the target task object in the software application is detected again and the time acquisition request is generated.
In S105, the time conversion object intercepts a time obtaining request for calling the time obtaining object based on a hook technology, obtains conversion time through the time conversion object, and feeds back the obtained conversion time to the process, so that the process responds to the time query event of the target task object according to the conversion time.
Under the condition that the custom dynamic link library of the embodiment of the application is injected, because the time acquisition request is intercepted, the task time finally returned to the process is the conversion time acquired by the time conversion object injected in the operating system; and the conversion time is obtained by converting the reference time according to the conversion rule. The process receives the conversion time obtained by the time conversion object and processes the task object according to the conversion time.
In one embodiment, in S106, the time transformation object may obtain the system time by calling an operating system method (for example, calling the time obtaining object), and perform transformation on the basis of the obtained system time to obtain the transformation time.
The custom dynamic link library or time conversion object can be written as required to implement different conversion rules. In some embodiments, the conversion rule is a rule for converting the system time into the specified time, so that the time conversion object can convert the system time of the operating system into the specified time; or, the conversion rule is a rule for performing conversion calculation according to a time acceleration multiple, and therefore, the time conversion object may perform time acceleration calculation on the system time of the operating system to obtain acceleration time.
In the embodiment of the application, a time modification function can be automatically provided for the task object after successful injection through the configured special time conversion object loaded based on the dynamic link library, so that time can be reprocessed according to a test scene, such as accelerating time lapse, appointing and modifying time, and the rapid construction of the test scene is realized. The dynamic link library injection is adopted to realize non-invasive time control on a single or a plurality of task objects, so that the time conversion efficiency can be improved, the problems of system crash or other software application errors caused by modes of manually modifying system time and the like can be effectively reduced, and meanwhile, the time conversion object can be independently processed by loading and unloading, so that the recovery of the time environment of an operating system is quickly realized. And for the time conversion object, the time conversion object is a universal cross-platform time control program and can provide the function of modifying the time required by the task object in a multi-platform manner.
Referring to fig. 2 again, it is a flowchart illustrating a method for processing time information according to an embodiment of the present application, where the method may be executed on a computing device for running a software application, and the computing device runs the software application by allocating a process through an operating system. The method of an embodiment of the present application includes the following steps.
S201: running a software application in which a time-based task object is launched; the task object may be, for example, a data cycle dump task that performs a data dump process, a timed alarm task for a timed alarm function, and so on.
S202: detecting a temporal query event generated for a task object; the task object may generate a time query event by initiating a time acquisition request, so as to request the time required for acquisition, and further determine whether to execute corresponding processing, such as a timing function and a periodic dump function.
S203: and determining the time control strategy of the task object corresponding to the time query event. In the embodiment of the present application, a time control policy for determining a task object corresponding to a time query event is first performed when a time query event is generated, for example, when a task object of some timers, a task object of periodic data processing, and the like need to acquire system time of an operating system, and after the time control policy is determined, task time is acquired according to the determined time control policy, and different time control policies may acquire different task times.
The time control strategy mentioned in the embodiments of the present application mainly includes: a policy that does not require temporal modification (may be simply referred to as a first policy), and a policy that requires temporal modification (may be simply referred to as a second policy). If the time control policy is the first policy, the following S204 is executed, that is, in the operating system running the task object, a time obtaining request is sent to the time obtaining object, and further the obtained task time is: the reference time is obtained by a time obtaining object, which may be a function object for obtaining the system time of the operating system where the task object is located. And the reference time may be a system time of the operating system.
If the time control policy is the second policy, S205 is executed, that is, in the operating system running the task object, sending a time obtaining request to the time conversion object injected in the operating system, and further obtaining the task time as follows: a conversion time obtained by a time conversion object; the reference time is different from the transition time.
In one embodiment, the conversion time is obtained by converting a reference time according to a conversion rule, where the reference time may refer to a system time or other standard time of an operating system where the task object is located. The reference time may also refer to the system time of the operating system where the task object is located or other standard time. Other standard times are, for example, the times obtained from other servers or devices capable of providing time.
In one embodiment, the specific determination process of S203 may determine the time control policy by determining whether a time translation object exists in the address space of the process, and if the time translation object exists, the time control policy is determined to be the second policy, otherwise, the time control policy is the first policy. Or in another embodiment, the user using the software application or the test user may actively send a notification message to the process through the aforementioned management tool, notify the process that the current time control policy of the task object is the second policy, and if the notification message sent by the management tool is not received or other forms of notification messages are received (for example, the notification time control policy adopts a first notification message for the second policy, and the notification time control policy adopts a second notification message for the first policy), the current time control policy of the task object is considered as the first policy.
S204: the receiving time obtains a reference time obtained by the object. The reference time may be a system time TA currently recorded by the operating system or a base time TA. The reference time is taken as the task time.
S205: and triggering the conversion time obtained by the time conversion object. The time conversion object obtains the conversion time in various ways, one of which is to first obtain the current reference time TA, and then directly convert the reference time TA into another specified time TB, where the specified time TB is the conversion time. The other is an acceleration time T obtained by performing time acceleration calculation on the system time of the operating system. In one embodiment, the rule for performing the conversion calculation according to the time acceleration factor may refer to the following formula.
T = TA + (TB-TA) x K, where T is the transition time, TA is the reference time, TB is the desired time, and K is the time acceleration multiple.
S206: the conversion time obtained by the time conversion object is received. In this case, the conversion time is taken as the task time.
In one embodiment, when the second policy is determined, the process may call a time conversion object in the address space, and the time conversion object intercepts a function of getsystemtimeafilteretime (acquisition time) in the operating system and redirects the getsystemtimetimeafilteretime into a Hook _ getsystemtimeafilteretime method by using a Hook technology, thereby acquiring the conversion time.
S207: judging whether the task time meets the processing condition of the task object; if so, S208 described below is performed. If not, the above step S202 is executed. S207 mainly determines whether the task time satisfies a timing processing condition or a period processing condition, for example, whether the task time reaches a time timed by the timer, and if so, executes a timing-related function, such as a function of a timing alarm clock.
S208: and processing the task object according to the task time.
The embodiment of the present application has the above-mentioned beneficial effects brought by converting objects based on time, and is different from the previous embodiment in that: in the embodiment of the application, the process can dynamically determine the time control strategy for the currently running task object by communicating with a management tool and the like, so that the convenient switching between the acquisition of the reference time or the reference time and the acquisition of the modified time is greatly facilitated.
Referring to fig. 3 again, the method is a flowchart of another time information processing method in the embodiment of the present application, and the method in the embodiment of the present application is described with an operating system allocation process in a computing device as an execution subject. The method specifically comprises the following steps.
S301: and responding to a time inquiry event generated aiming at the task object, generating a time acquisition request, and sending the time acquisition request in an operating system running the task object.
S302: and receiving the task time returned by responding to the time acquisition request. Wherein, if a time conversion object is enabled in the operating system, the task time comprises: a conversion time obtained by a time conversion object injected in the operating system; the conversion time is obtained by converting the reference time according to a conversion rule; if no time conversion object is enabled in the operating system, the task time comprises: acquiring reference time acquired by an object through time; the reference time is different from the transition time.
In one embodiment, if a time conversion object is injected into the operating system, it may be considered that the time conversion object is enabled in the operating system, and at this time, a time acquisition request for calling the time acquisition object is intercepted by the time conversion object, and the conversion time is obtained by the time conversion object. That is, if the time conversion object is injected into the operating system, the step S302 specifically includes: receiving a conversion time acquired by the time conversion object as a task time. If there is no time conversion object in the operating system, it may be considered that there is no time conversion object enabled in the operating system, and in this case, the step S302 specifically includes: a reference time acquired by the time acquisition object is received as a task time. That is, after the time conversion object is injected into the operating system (or the time conversion object is injected into the address space of the process corresponding to the task object, where the time conversion object may also be referred to as a custom time API function or a custom dynamic link library), since the time conversion object may be intercepted by using hook technology, only the conversion time acquired by the time conversion object may be received in S302. If the time translation object is not injected, the reference time returned by the system time function (which may also be referred to as a time acquisition object) may be acquired directly.
In another embodiment, after a time query event generated for a task object is detected or a time acquisition request is generated, the process may also actively determine a time control policy of the task object corresponding to the time query event, if the time control policy is a first policy, it may be considered that a time conversion object is not enabled in the operating system, and at this time, in the operating system running the task object, a time acquisition request is sent to the time acquisition object, so as to acquire reference time; if the policy is the second policy, it may be considered that the time conversion object is enabled in the operating system, and at this time, in the operating system running the task object, a time acquisition request is sent to the time conversion object injected in the operating system, so as to acquire the conversion time.
The time control policy for actively determining the task object corresponding to the time query event may include various manners, for example: the process may determine whether a notification message sent by a management tool for managing the process is received, and if the notification message is received, determine that the time control policy is the second policy, otherwise, determine that the time control policy is the first policy. For another example, the process may determine whether a time translation object exists in an address space of the process of the operating system, and if so, determine that the time control policy is the second policy, otherwise, determine that the time control policy is the first policy.
In one embodiment, the base time is determined according to a system time of an operating system running the task object, and the conversion time includes: the method comprises the steps of obtaining specified time after converting system time of an operating system, wherein the conversion rule is a rule for converting the system time into the specified time; and the conversion rule is any one of rules for performing conversion calculation according to time acceleration multiples. In other embodiments, the reference time may be other times, for example, a time provided by another application server, a time provided by a time service system, or the like.
In one embodiment, the specified time is configured through a user interface for configuring a time conversion object; or, the time acceleration multiple is obtained through a user interface configuration for configuring a time conversion object, and the conversion time is obtained by calculating according to the system time, the target time and the time acceleration multiple. The specific implementation of the user interface can refer to the description of the relevant contents in the following embodiments.
S303: and processing the task object according to the task time. In an embodiment, when the acquired task time meets the processing condition of the task object, subsequent processing may be performed, for example, the acquired time is 9 months and 01 days, and the condition for performing data dump processing by the data dump task is met, so that subsequent data dump processing may be performed. If the processing condition of the task object is not satisfied, the time inquiry event generated for the task object may be detected again so as to perform the S301 to S303 again.
It should be noted that the time conversion object is a dynamic link library, is in the form of a dll file under the windows platform, and is in the form of a so under the linux platform, and can provide time simulation functions such as time calculation, modification, reset, time lapse (e.g., 1 second (real) =1 minute (after acceleration)), daylight saving time/winter saving time, and the like. The dynamic link library may be injected into the address space of the process through a management tool, and in one embodiment, the injection process of the time translation object may include: receiving a dynamic link library and an injection module object for loading the dynamic link library; and loading the dynamic link library into the address space of the progress of the task object through the injection module object so as to obtain the time conversion object. The management tool communicates the dynamic link library and the injection module object with a process, the injection module object provides a function of loading and unloading the dynamic link library for a specified process, wherein the loading function can load the dynamic link library into an address space of the process, and the unloading function can unload the dynamic link library from the address space of the process.
In one embodiment, the dynamic link library is selected from an object set according to an object type of the task object, the object set may include a plurality of preset dynamic link libraries, and conversion rules for time conversion of different dynamic link libraries are different. The user or the test user of the software application can select the type of the task object currently needing time conversion in the software application on the user interface provided by the management tool, so that the management tool can automatically select a proper dynamic link library for the task object according to the type set by the user. Different object types correspond to different conversion rules, and the object types may include, for example: a timing type, a cycle type, and the like, the timing type may select a rule for converting the system time into a specified time, and the cycle type may select a conversion rule for performing time acceleration calculation on the system time by a time acceleration multiple.
In one embodiment, the dynamically linked library comprises: the method comprises the steps that a hook function object constructed based on hook technology and a time function object used for converting reference time according to a conversion rule are constructed; the hook function object is used for intercepting a time acquisition request for calling the time acquisition object and converting the reference time according to a conversion rule through the time function object. Therefore, the corresponding time conversion object can replace the time acquisition object such as the system time acquisition function and the like, and provides the modified and converted time for the process, thereby achieving the function of providing the designated time or the accelerated time for the task object.
In the embodiment of the application, a time modification function can be automatically provided for the task object after successful injection through the configured special time conversion object loaded based on the dynamic link library, so that reprocessing of time according to the test scene can be realized, such as acceleration of time lapse, designation and modification, and the rapid construction of the test scene is realized. The non-invasive time control of a single or a plurality of task objects is realized by adopting dynamic link library injection, so that the time conversion efficiency can be improved, the problem of system crash caused by manual modification of system time can be effectively reduced, and meanwhile, the time conversion object can be independently processed by loading and unloading, and the environment recovery is quickly realized. And for the time conversion object, the time conversion object is a universal cross-platform time control program and can provide the function of modifying the time required by the task object in a multi-platform manner.
Referring to fig. 4, a schematic structural diagram of performing software application use or test management according to an embodiment of the present application is shown. In fig. 4, the management tool 401 includes four modules, namely: a user interface module 4011, a remote control module 4012, a dynamic library management module 4013, a Test Stub module 4014, and an injection proxy module 403. And operating system 402 is used to allocate business processes to run software applications. The management tool 401 and the operating system 402 may run in the same computing device or in different computing devices, which is not limited in this application.
Wherein, the user interface module 4011: and providing a user interface which comprises the process information, the system time, the accelerated time information and the time acceleration multiple information of a task object in the checking operation system, and the functions of inquiring, modifying and recovering time.
Remote control module 4012: communication with the operating system 402, transmitting the corresponding TestStub module 4014 and injection proxy module 403 to the operating system, and launching the injection proxy module 403; meanwhile, the process, the time information and the like of the existing task object of the operating system can be obtained through communication with the operating system.
The dynamic library management module 4013: and completing the injection and unloading functions of the dynamic link library on the operating system.
Test pile Test Stub module 4014: the dynamic link library of the time-dependent API is realized by rewriting under different platforms, a dll file is in a form under a windows platform, a so file is in a form under a linux platform, and time calculation, modification, reset, time acceleration lapse (such as 1 second (reality) =1 minute (after acceleration)), and daylight saving time/winter time simulation functions are provided.
The injection agent module 403: the loading and unloading functions of the dynamic link library for the specified process are provided.
On the basis of fig. 4, please refer to fig. 5 again, which is a flowchart illustrating another time information processing method according to an embodiment of the present application, where the method according to the embodiment of the present application is described with a management tool running in a computing device as an execution subject. The method specifically comprises the following steps.
S501: acquiring a dynamic link library and an injection module object for loading the dynamic link library;
s502: sending an injection request to an operating system for running a task object, wherein the injection request is used for triggering the operating system to execute the injection module object, and loading the dynamic link library into an address space of a process of the task object through the injection module object so as to obtain a time conversion object; and the time conversion object is used for converting the reference time according to a conversion rule to obtain conversion time.
In one embodiment, the method may further comprise: loading a dynamic link library and an injection module object for loading the dynamic link library into the operating system so as to load the dynamic link library into an address space of a process of a task object after the injection request is initiated; and when an unloading event of the loaded dynamic link library is detected, generating an unloading request, wherein the unloading request is used for triggering the operating system to execute the injection module object, and unloading the dynamic link library from the address space of the process of the task object through the injection module object. In the technical scheme, the injection module object can transmit the dynamic link library and the injection module object to an operating system, so that the dynamic link library is loaded or unloaded through the injection module object, code modification does not need to be carried out on software application corresponding to the task object, and functions of time modification of function objects and the like such as injection and unloading are realized under the condition of no invasion.
In one embodiment, the dynamically linked library comprises: the method comprises the steps that a hook function object constructed based on hook technology and a time function object used for converting reference time according to a conversion rule are constructed; the hook function object is used for intercepting a time acquisition request for calling the time acquisition object and converting the reference time according to a conversion rule through the time function object.
In one embodiment, the method may further comprise: displaying a user interface; the user interface comprises: any one or more of a display item for displaying the process information of the task object, a configuration item for configuring the time designated for the time conversion object, and a configuration item for configuring the time acceleration multiple for the time conversion object, wherein the conversion time is obtained by calculating according to the system time, the target time and the time acceleration multiple.
In an embodiment, please refer to fig. 6, which is a schematic diagram of a user interface according to an embodiment of the present application, where different information may be displayed on the user interface according to a use or a test requirement of a software application, where the information includes, for example, the process information of a task object in the operating system, the system time, the time information after acceleration, and the time acceleration multiple information mentioned above, and further, the user interface may provide a function of querying, modifying, and recovering time.
In the user interface shown in fig. 6, a first display area 601 is included, a host IP entry for using or testing a software application is included in the first display area 601, and a user name entry and a password entry of a user currently logging in and operating a management tool are also included, and after the user enters a correct user name and password, processes of monitoring a process, injecting and uninstalling a dynamic link library, and the like can be performed on a host of an IP address entered in the host IP entry.
The user interface further includes a second display area 602, where a process list is displayed in the second display area 602, and the process list is used to record process information of one or more processes currently allocated and running in the host corresponding to the IP address input in the host IP entry, including information such as process ID, process name, control status, source time, transition time, and multiple. The information described in the control status item is used to indicate whether the relevant process executes the time control policy, if a valid value is shown, for example, 1, it is considered that a dynamic link library is injected into the relevant process or a time conversion object is injected into the relevant process, and time modification conversion processing needs to be performed through the time conversion object, and if a non-valid value is shown, for example, 0, it is considered that when the relevant process needs to acquire the task time, the reference time is acquired as the task time by calling the aforementioned time acquisition object.
The original time item is used to display the current system time or the acquired reference time, and the conversion time item is used to record the conversion time, where the conversion time is obtained by converting the system time or the reference time by the time conversion object after the relevant process is injected into the time conversion object, for example, the time displayed by the original time item is "16. The last multiple term then shows the time acceleration multiple, i.e. the value of K in the formula T = TA + (TB-TA) x K.
If a process has not injected a time transition object, i.e., has not injected any of the dynamically linked libraries displayed in the list of dynamically linked libraries, the control status item, the transition time item, and the multiplier item may not display any information or display some specified information that is specified to indicate meaningless, such as None (NULL).
Also included in the user interface is a third display area 603, where a dynamic library list is displayed in the third display area 603, where one or more dynamically linked libraries in the set of objects are recorded. The related information of the dynamic link libraries of different object types can be recorded in the dynamic library list for the user to select, for example, the related information of the dynamic link libraries of timing type and the related information of the dynamic link libraries of period type are included. Two controls are also displayed in the third display area 603, including "add" and "delete" controls, enabling the addition and deletion of available dynamically linked libraries displayed in the dynamic library list.
The information related to the dynamically linked library displayed in the displayed list includes: the name of the dynamically linked library, the control process ID, and the state of the dynamically linked library. The name of the dynamic link library can be named based on the object type of the dynamic link library, so that a user can select the dynamic link library which can be injected for a target process intuitively according to the name. The control process ID refers to the ID of the process that the target dynamic link library has been currently injected into and controlled, such as the ID of the target process, and if the target dynamic link library is not currently injected into any process, no information or information indicating meaningless information, such as None (NULL), is displayed in the control process ID item. The status of the dynamic link library is used for indicating whether the dynamic link library is available, and a user can make the injected dynamic link library available or unavailable through an on/off button. In one embodiment, the target process that injected the target dynamic link library may be notified to call or not call the injected target dynamic link library by sending a notification message to the target process, or the aforementioned injection proxy module may be notified to uninstall the target dynamic link library that has been injected in the target process. A user may control the control 606 in fig. 6, and when the control 606 is operated to be in an open state, send a first notification message to a target process selected in the process list, where the first notification message is used to notify the target process to obtain a transition time as a task time through an injected dynamic link library, or may be considered to notify the target process that a time control policy for a current task object is a second policy. If the operation control 606 is in the off state, a second notification message is sent to the target process selected in the process list, where the second notification message is used to notify the target process to acquire the reference time as the task-feeding time through the time acquisition object (or the time acquisition function of the system), or may be considered to notify the target process that the time control policy for the current task object is the first policy. If, however, the target process selected in the process list is not injected into any dynamically linked library, then control 606 is in a non-editable state, e.g., the color appears grey and does not respond to any operation.
As shown in FIG. 6, the user interface also includes "inject" and "unload" controls. The user may select a process corresponding to a process ID in the second display area 602 of the user interface as a target process, select a dynamic link library with a certain name in the third display area 603 as a target dynamic link library, and inject the selected target dynamic link library into the selected target process if an injection operation is detected. Certainly, the injection process includes communicating with an operating system where the target process is located, transmitting the target dynamic link library and an injection module object for loading the target dynamic link library to the target process under the operating system, and triggering the injection module object by the target process to load the target dynamic link library into an address space of the target process. After the loading injection is completed, if the target dynamic link library is expected to be unloaded from the target process, the target dynamic link library in the address space of the target process can be unloaded and deleted by clicking an unloading control. Meanwhile, the relevant information in the process list and the dynamic library list can be updated and displayed.
In addition, for the generated dynamic link library or the dynamic link library injected into the process, the user can set the acceleration multiple item and the self-defined time displayed in the user interface so as to achieve the control of the designated time or the time acceleration multiple in the dynamic link library. The specified time can be obtained by editing the time setting in the custom time entry 605. And by editing the acceleration factor item 604 and the custom time item 605, the value of K (acceleration factor) and TB (custom time) in T = TA + (TB-TA) × K can be modified.
In the log 607 portion of the user interface, a work log of the monitored process may be displayed. Based on the work log of the target process, the working condition of the related task object in the software application corresponding to the target process can be clearly known, and particularly when the task object is a test object, a test user can conveniently know the test result of the test object under the condition that the dynamic link library is injected into the test object.
In one embodiment, an entry may also be provided on the user interface shown in FIG. 6 to specify the type of dynamically linked library to inject to the target process currently selected in the process list. For example, the display areas occupied by the acceleration multiple item 604, the user-defined time item 605, and the control 606 may be planned, a new object type selection item is set behind the control 606, and in the object type selection item, the user may now select the object type (timing type, cycle type, etc.) of the dynamic link library required by the target process selected in the current process list, and further automatically select the dynamic link library of the appropriate object type for the target process and inject the dynamic link library into the address space of the target process.
Some of the injection operations associated with the present application are briefly described below in conjunction with fig. 6:
1. a user selects a process in a process list as a target process in a touch manner and other manners, the user selects a dynamic link library in a dynamic library list as a target dynamic link library, after an injection control is clicked, the management tool can execute the steps of S501 and S502, and the target dynamic link library is injected into the target process through an injection module object;
2. a user selects a process in a process list as a target process through touch control and other modes, if a target dynamic link library is injected into the target process, an unloading control is displayed to be in a controllable state, and if the unloading control is clicked by the user, an injection module object is triggered to unload and delete the target dynamic link library from the target process;
3. a user selects a process in the process list as a target process in a touch mode and the like, and the user selects a dynamic link library in the dynamic library list as a target dynamic link library. Meanwhile, after the corresponding designated time and/or the time acceleration multiple are edited by the acceleration multiple item and/or the custom time item, the target dynamic link library can be modified according to the edited designated time and/or acceleration multiple, and the modified target dynamic link library is injected into the target process;
4. a user selects a process in a process list as a target process through touch control and other modes, if a target dynamic link library is injected into the target process, the opening/closing control is displayed in a controllable state, and the user can send a notification message to the target process by operating the opening/closing control, so that the time control strategy of a task object on the target process is a first strategy (the opening/closing control is at a closing position) or a second strategy (the opening/closing control is at an opening position);
5. the user selects a process in the process list as a target process by touch and the like, if the user selects a desired object type on an object type selection item on a user interface, a dynamic link library matched with the object type selected by the user is displayed to the user in the dynamic library list, the user determines whether to inject the dynamic link library into the target process, for the dynamic link library matched with the object type selected by the user, the corresponding time parameter of the matched dynamic link library can be displayed in an acceleration multiple item and/or a self-defined time item, the user can decide whether to select the matched dynamic link library according to the displayed content of one or two items, or the user can set a new designated time value or a time acceleration multiple in one or two items to adjust the related parameter in the matched dynamic link library and finally inject the related parameter into the selected target process.
In the embodiment of the application, a certain task object included in the currently used or tested software application can be monitored through a special management tool, so that not only can the relevant process information of the process where the task object is located be visually displayed for a user, but also a time conversion object for providing a time conversion function for the task object can be edited, configured and modified, the requirements of monitoring the software application and intelligently and automatically modifying the time by the user needing to monitor the software application and having the time modification requirement are greatly met, and the monitoring efficiency and the time modification efficiency are improved.
Referring to fig. 7 again, the schematic structural diagram of a time information processing apparatus according to an embodiment of the present application is shown, where the apparatus according to the embodiment of the present application may be disposed in a computing device, and is used to implement operation and time-related processing of a task object of a software application, and the apparatus includes a communication unit 702 and a processing unit 701. The communication unit 702 is configured to communicate with other apparatuses of the computing device or other devices connected to the computing device when needed, and the processing unit 701 implements related functional steps related to time information processing in this embodiment, where the implemented functional steps are as follows.
The processing unit 701 is configured to generate a time obtaining request in response to a time query event generated for a task object, and send the time obtaining request in an operating system running the task object;
receiving task time returned by responding to the time acquisition request;
processing the task object according to the task time;
wherein, if a time conversion object is enabled in the operating system, the task time comprises: a conversion time obtained by a time conversion object injected in the operating system; the conversion time is obtained by converting the reference time according to a conversion rule; if no time conversion object is enabled in the operating system, the task time comprises: acquiring reference time acquired by an object through time; the reference time is different from the transition time.
In an embodiment, if a time conversion object is injected into the operating system, the processing unit 701 intercepts, by the time conversion object, a time obtaining request for calling the time obtaining object, and obtains the conversion time by the time conversion object; wherein the time acquisition object is used for acquiring a reference time as a reference time.
In an embodiment, the processing unit 701 is configured to determine a time control policy of a task object corresponding to the time query event in a process of sending the time obtaining request in an operating system running the task object; if the policy is the first policy, sending a time acquisition request to a time acquisition object in an operating system running the task object so as to acquire reference time; and if the policy is the second policy, sending a time acquisition request to a time conversion object injected in the operating system running the task object so as to acquire conversion time.
In one embodiment, the reference time is determined according to a system time of an operating system running the task object, and the conversion time includes any one of the following times:
the method comprises the steps of obtaining specified time after converting system time of an operating system, wherein the conversion rule is a rule for converting the system time into the specified time;
and performing time acceleration calculation on the system time of the operating system to obtain acceleration time, wherein the conversion rule is a rule for performing conversion calculation according to time acceleration multiples.
In one embodiment, the specified time is configured through a user interface for configuring a time conversion object; or, the time acceleration multiple is obtained through a user interface configuration for configuring a time conversion object, and the conversion time is obtained by calculating according to the system time, the target time and the time acceleration multiple.
In one embodiment, the processing unit 701 is further configured to receive a dynamic link library and an injection module object for loading the dynamic link library; and loading the dynamic link library into the address space of the process of the task object through the injection module object to obtain the time conversion object.
In one embodiment, the dynamic link library is selected from an object set according to an object type of the task object, the object set includes a plurality of dynamic link libraries, and conversion rules for time conversion of different dynamic link libraries are different.
In one embodiment, the dynamically linked library comprises: the method comprises the steps that a hook function object constructed based on hook technology and a time function object used for converting reference time according to a conversion rule are constructed; the hook function object is used for intercepting a time acquisition request for calling the time acquisition object and converting the reference time according to a conversion rule through the time function object.
In an embodiment, before the processing unit 701 is configured to process the task object according to the task time, the processing unit is further configured to determine whether the task time meets a processing condition of the task object; if yes, executing the step of processing the task object according to the task time; if not, detecting a time query event generated aiming at the task object so as to execute the step of generating the time acquisition request responding to the time query event generated aiming at the task object.
The apparatus in the embodiment of the present application corresponds to the embodiments of the methods mentioned in the foregoing embodiments, and the functional steps implemented by the processing unit 701 in the apparatus and other descriptions may specifically refer to the descriptions of the relevant contents in the foregoing embodiments, and beneficial effects that the apparatus can bring are also referred to the descriptions of the foregoing embodiments, which are not repeated herein.
Referring to fig. 8 again, the schematic diagram is a structural diagram of another time information processing apparatus according to an embodiment of the present application, where the apparatus according to the embodiment of the present application may be disposed in a computing device, and is used to implement time-related processing for a software application, and the apparatus includes a display unit 802 and a processing unit 801. The display unit 802 is configured to display required information to a user, and the processing unit 801 implements relevant functional steps related to time information processing in the embodiment of the present application, where the implemented functional steps are as follows.
The processing unit 801 is configured to obtain a dynamic link library and an injection module object for loading the dynamic link library; sending an injection request to an operating system for running a task object, wherein the injection request is used for triggering the operating system to execute the injection module object, and loading the dynamic link library into an address space of a process of the task object through the injection module object so as to obtain a time conversion object; and the time conversion object is used for converting the reference time according to a conversion rule to obtain conversion time.
In one embodiment, the processing unit 801 is further configured to load a dynamic link library and an injection module object for loading the dynamic link library into the operating system, so as to load the dynamic link library into an address space of a process of a task object after the injection request is initiated; and when an unloading event of the loaded dynamic link library is detected, generating an unloading request, wherein the unloading request is used for triggering the operating system to execute the injection module object, and unloading the dynamic link library from the address space of the process of the task object through the injection module object.
In one embodiment, the display unit 802 is configured to display a user interface; the user interface comprises: any one or more of a display item for displaying the progress information of the task object, a configuration item for configuring the time designated for the time conversion object, and a configuration item for configuring the time acceleration multiple for the time conversion object, wherein the conversion time is obtained by calculating according to the system time, the target time and the time acceleration multiple.
The apparatus in the embodiment of the present application corresponds to the embodiments of the methods mentioned in the foregoing embodiments, and the functional steps implemented by the processing unit 801 in the apparatus and other descriptions may specifically refer to the descriptions of the relevant contents in the foregoing embodiments, and the beneficial effects that the apparatus can bring are also referred to the descriptions of the foregoing embodiments, which are not repeated herein.
It should be noted that the time information processing apparatuses described in fig. 7 and fig. 8 may be the same apparatus, and the processing unit 801 and the processing unit 701 may execute corresponding functional steps for the same processing unit.
Referring to fig. 9 again, it is a schematic structural diagram of a computing device according to an embodiment of the present disclosure, and the computing device 90 according to the embodiment of the present disclosure includes a processor 901.
The processor 901 may have a memory function capable of storing necessary computer programs and data. Optionally, a separate memory 902 may also be provided in the computing device 90. The processor 901 may have a data transceiving function, and may be capable of communicating with other devices. Optionally, in the computing device, a separate data communication unit, such as the transceiver 903, may be provided for transmitting and receiving data. The processor 901, the memory 902 and the transceiver 903 may be connected by a bus, which may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 9, but this does not indicate only one bus or one type of bus.
The memory 902 has stored therein a computer program that the processor 901 calls to implement the method as described in some or all of the embodiments above.
In one embodiment, the processor 901 executes a computer program stored in the memory 902, and is configured to generate a time acquisition request in response to a time query event generated for a task object, and send the time acquisition request in an operating system running the task object; receiving task time returned by responding to the time acquisition request; processing the task object according to the task time; wherein, if a time conversion object is enabled in the operating system, the task time comprises: a conversion time obtained by a time conversion object injected in the operating system; the conversion time is obtained by converting the reference time according to a conversion rule; if no time translation object is enabled in the operating system, the task time includes: acquiring reference time acquired by an object through time; the reference time is different from the transition time.
In an embodiment, if a time conversion object is injected into the operating system, the processor 901 intercepts a time obtaining request for calling the time obtaining object through the time conversion object, and obtains the conversion time through the time conversion object; wherein the time acquisition object is used for acquiring a reference time as a reference time.
In an embodiment, the processor 901 is configured to determine a time control policy of a task object corresponding to the time query event in a process of sending the time obtaining request in an operating system running the task object; if the policy is the first policy, sending a time acquisition request to a time acquisition object in an operating system running the task object so as to acquire reference time; and if the policy is the second policy, sending a time acquisition request to a time conversion object injected in the operating system running the task object so as to acquire conversion time.
In one embodiment, the reference time is determined according to a system time of an operating system running the task object, and the conversion time includes any one of the following times:
the method comprises the steps of obtaining specified time after system time of an operating system is converted, wherein the conversion rule is a rule for converting the system time into the specified time;
and performing time acceleration calculation on the system time of the operating system to obtain acceleration time, wherein the conversion rule is a rule for performing conversion calculation according to time acceleration multiples.
In one embodiment, the specified time is configured through a user interface for configuring a time conversion object; or, the time acceleration multiple is obtained through a user interface configuration for configuring a time conversion object, and the conversion time is obtained by calculating according to the system time, the target time and the time acceleration multiple.
In one embodiment, the processor 901 is further configured to receive a dynamic link library and an injection module object for loading the dynamic link library; and loading the dynamic link library into the address space of the progress of the task object through the injection module object so as to obtain the time conversion object.
In one embodiment, the dynamic link library is selected from an object set according to the object type of the task object, the object set includes a plurality of dynamic link libraries, and the conversion rules for time conversion of different dynamic link libraries are different.
In one embodiment, the dynamically linked library comprises: the method comprises the steps that a hook function object constructed based on hook technology and a time function object used for converting reference time according to a conversion rule are constructed; the hook function object is used for intercepting a time acquisition request for calling the time acquisition object and converting the reference time according to a conversion rule through the time function object.
In an embodiment, before the processor 901 is configured to process the task object according to the task time, it is further configured to determine whether the task time meets a processing condition of the task object; if yes, executing the step of processing the task object according to the task time; if not, detecting a time query event generated aiming at the task object so as to execute the step of generating the time acquisition request responding to the time query event generated aiming at the task object.
In one embodiment, in addition to implementing the related functions related to the time information processing, the computing device can also implement functions such as loading, management, and process management of time conversion objects, i.e., dynamic link libraries, by the processor 901. Of course, this portion of the functionality may be implemented by processors on other computing devices. Specifically, the processor 901 may further be configured to obtain a dynamic link library and an injection module object for loading the dynamic link library; sending an injection request to an operating system for running a task object, wherein the injection request is used for triggering the operating system to execute the injection module object, and loading the dynamic link library into an address space of a process of the task object through the injection module object so as to obtain a time conversion object; and the time conversion object is used for converting the reference time according to a conversion rule to obtain conversion time.
In one embodiment, the processor 901 is further configured to load a dynamic link library and an injection module object for loading the dynamic link library into the operating system, so as to load the dynamic link library into an address space of a process of a task object after initiating the injection request; and when an unloading event of the loaded dynamic link library is detected, generating an unloading request, wherein the unloading request is used for triggering the operating system to execute the injection module object, and unloading the dynamic link library from the address space of the process of the task object through the injection module object.
The processor 901 is further configured to display a user interface; the user interface comprises: any one or more of a display item for displaying the progress information of the task object, a configuration item for configuring the time designated for the time conversion object, and a configuration item for configuring the time acceleration multiple for the time conversion object, wherein the conversion time is obtained by calculating according to the system time, the target time and the time acceleration multiple.
The computing device in the embodiment of the present application corresponds to the embodiments of the methods mentioned in the foregoing embodiments, and the functional steps implemented by the processor and the like in the computing device and other descriptions may specifically refer to the descriptions of the relevant contents in the foregoing embodiments, and the beneficial effects that the apparatus can bring are also referred to the descriptions of the foregoing embodiments, which are not repeated herein.
Those skilled in the art will also appreciate that the various illustrative logical blocks and steps (step) set forth in the embodiments of the present application may be implemented in electronic hardware, computer software, or combinations of both. Whether such functionality is implemented as hardware or software depends upon the particular application and design requirements of the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
The present application also provides a computer-readable storage medium having stored thereon a computer program comprising program instructions which, when executed by a computer, implement the functions of any of the above-described method embodiments.
The computer readable storage medium includes, but is not limited to, flash memory, hard disk, solid state disk.
The present application also provides a computer program product which, when executed by a computer, implements the functionality of any of the above-described method embodiments.
The solution described in the present application can be implemented in various ways. For example, these techniques may be implemented in hardware, software, or a combination of hardware and software. For a hardware implementation, the processing units used to perform these techniques at the relevant apparatus may be implemented in one or more general-purpose processors, digital Signal Processors (DSPs), digital signal processing devices, application Specific Integrated Circuits (ASICs), programmable logic devices, field Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or any combinations thereof. A general-purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a digital signal processor core, or any other similar configuration.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The apparatus or computing device to which embodiments of the application relate may be a general purpose computer, a special purpose computer, a network of computers, or other programmable apparatus. And computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium.
Reference in the present application to an element using the singular is intended to mean "one or more" rather than "one and only one" unless specifically stated otherwise. In the present application, unless otherwise specified, "at least one" is intended to mean "one or more" and "a plurality" is intended to mean "two or more".
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A can be singular or plural, and B can be singular or plural.
The preset (e.g. preset sequence) in this application may be understood as defining, predefining, storing, pre-negotiating, pre-configuring, curing, or pre-firing.
For convenience and simplicity of description, a person of ordinary skill in the art may refer to corresponding processes in the foregoing method embodiments for specific working processes of the above-described systems, apparatuses, and units, which are not described herein again.
The same or similar parts between the various embodiments in this application may be referred to each other. In the embodiments and the implementations/implementation methods in the embodiments in the present application, unless otherwise specified or conflicting in terms of logic, terms and/or descriptions between different embodiments and between the implementations/implementation methods in the embodiments have consistency and may be mutually cited, and technical features in different embodiments and implementations/implementation methods in the embodiments may be combined to form a new embodiment, implementation method, or implementation method according to the inherent logic relationship. The above-described embodiments of the present application do not limit the scope of the present application.

Claims (13)

1. A time information processing method, characterized by comprising:
responding to a time query event generated aiming at a task object, generating a time acquisition request, and sending the time acquisition request in an operating system running the task object;
receiving task time returned by responding to the time acquisition request;
processing the task object according to the task time;
wherein, if a time conversion object is enabled in the operating system, the task time comprises: a conversion time obtained by a time conversion object injected in the operating system; the conversion time is obtained by converting the reference time according to a conversion rule; if no time conversion object is enabled in the operating system, the task time comprises: acquiring reference time acquired by an object through time; the reference time is different from the transition time.
2. The method of claim 1, wherein if a time conversion object is injected in the operating system, a time acquisition request for calling the time acquisition object is intercepted by the time conversion object, and the conversion time is obtained by the time conversion object; wherein the time acquisition object is used for acquiring a reference time as a reference time.
3. The method of claim 1, wherein sending the time acquisition request in an operating system running the task object comprises:
determining a time control strategy of a task object corresponding to the time query event;
if the policy is the first policy, sending a time acquisition request to a time acquisition object in an operating system running the task object so as to acquire reference time;
and if the policy is the second policy, sending a time acquisition request to a time conversion object injected in the operating system running the task object so as to acquire conversion time.
4. The method of any of claims 1-3, wherein the base time is determined from a system time of an operating system running the task object, and the transition time comprises any of:
the method comprises the steps of obtaining specified time after converting system time of an operating system, wherein the conversion rule is a rule for converting the system time into the specified time;
and performing time acceleration calculation on the system time of the operating system to obtain acceleration time, wherein the conversion rule is a rule for performing conversion calculation according to time acceleration multiples.
5. The method of claim 4,
the specified time is obtained through the configuration of a user interface for configuring the time conversion object;
or, the time acceleration multiple is obtained by configuring a user interface for configuring a time conversion object, and the conversion time is obtained by calculating according to the system time, the target time and the time acceleration multiple.
6. The method of claim 1, further comprising:
receiving a dynamic link library and an injection module object for loading the dynamic link library;
and loading the dynamic link library into the address space of the process of the task object through the injection module object to obtain the time conversion object.
7. The method of claim 6, wherein the dynamically linked library is selected from a set of objects according to the object type of the task object, the set of objects includes a plurality of dynamically linked libraries, and the conversion rules for time conversion of different dynamically linked libraries are different.
8. The method of claim 1, wherein prior to processing the task object according to the task time, further comprising:
judging whether the task time meets the processing condition of the task object;
if yes, executing the step of processing the task object according to the task time;
if not, detecting a time query event generated aiming at the task object so as to execute the step of generating the time acquisition request responding to the time query event generated aiming at the task object.
9. A time information processing method, characterized by comprising:
acquiring a dynamic link library and an injection module object for loading the dynamic link library;
sending an injection request to an operating system for running a task object, wherein the injection request is used for triggering the operating system to execute the injection module object, and loading the dynamic link library into an address space of a process of the task object through the injection module object so as to obtain a time conversion object;
and the time conversion object is used for converting the reference time according to a conversion rule to obtain conversion time.
10. The method of claim 9, wherein the method further comprises:
loading a dynamic link library and an injection module object for loading the dynamic link library into the operating system so as to load the dynamic link library into an address space of a process of a task object after the injection request is initiated;
and when an unloading event of the loaded dynamic link library is detected, generating an unloading request, wherein the unloading request is used for triggering the operating system to execute the injection module object, and unloading the dynamic link library from the address space of the process of the task object through the injection module object.
11. The method of claim 9 or 10, further comprising:
displaying a user interface;
the user interface comprises: any one or more of a display item for displaying the progress information of the task object, a configuration item for configuring the time designated for the time conversion object, and a configuration item for configuring the time acceleration multiple for the time conversion object, wherein the conversion time is obtained by calculating according to the system time, the target time and the time acceleration multiple.
12. A computing device, characterized in that the computing device comprises a processor for performing the method of any of claims 1-11.
13. A computer-readable storage medium, characterized in that a program is stored in the computer-readable storage medium, which program, when executed, carries out the method according to any one of claims 1-11.
CN202211214468.1A 2022-09-30 2022-09-30 Time information processing method and device, computing equipment and storage medium Pending CN115712468A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211214468.1A CN115712468A (en) 2022-09-30 2022-09-30 Time information processing method and device, computing equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211214468.1A CN115712468A (en) 2022-09-30 2022-09-30 Time information processing method and device, computing equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115712468A true CN115712468A (en) 2023-02-24

Family

ID=85231036

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211214468.1A Pending CN115712468A (en) 2022-09-30 2022-09-30 Time information processing method and device, computing equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115712468A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116055569A (en) * 2023-03-31 2023-05-02 浙江华东工程数字技术有限公司 Method, system, computer device and storage medium for custom switching time zone

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116055569A (en) * 2023-03-31 2023-05-02 浙江华东工程数字技术有限公司 Method, system, computer device and storage medium for custom switching time zone

Similar Documents

Publication Publication Date Title
CN106775965B (en) Processing method and device for timing task
CN106951335B (en) Process daemon method and mobile terminal
EP3509270B1 (en) Data backup method and device, storage medium and electronic apparatus
CN110442426B (en) Password resetting method, device and storage medium
CN106066803B (en) application program operation control method and device
CN109117153B (en) Application processing method, device, terminal and storage medium
CN115712468A (en) Time information processing method and device, computing equipment and storage medium
CN105117272A (en) Operating system manager, virtual machine and switching method between operating systems
CN111061448A (en) Log information display method and device, electronic equipment and storage medium
CN111488163B (en) Firmware updating method and device, electronic equipment and storage medium
CN109901849B (en) Application program installation method and device, electronic equipment and storage medium
CN111240998A (en) Test case processing method and device
CN112905209A (en) Application program updating method and device
CN110321241A (en) A kind of method for restarting and terminal device of application program
CN111176708B (en) SDK file processing method and device, electronic equipment and storage medium
CN115220861A (en) Virtual client management method, apparatus, medium, and device
CN113515299A (en) Software development kit SDK hot upgrading method, device, equipment and storage medium
US10165074B2 (en) Asynchronous custom exit points
CN111176746A (en) Data configuration method, device and system, electronic equipment and storage medium thereof
CN110928630A (en) Activation control method, device and equipment for application program window and storage medium
CN114266037B (en) Sample detection method and device, electronic equipment and storage medium
CN109445964B (en) Method and device for data transmission with SAP system in external system
KR100600992B1 (en) Apparatus and method for logging history of mobile communication terminal
CN113176913B (en) Processing method and device of JAVA agent, terminal equipment and storage medium
CN113641524B (en) Reset method, device and equipment for single board starting overtime and readable storage medium

Legal Events

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