A method, apparatus, device, and medium for determining the execution date of a business operation.
By determining the time interval and adding the service to the queue upon receiving the service to be executed, and executing the service at the preset time, the problem of inconsistent execution dates caused by time deviations in different electronic device systems is solved, thus achieving accuracy in execution dates.
Patent Information
- Application Number
- CN202210142849.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-16
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-02-16
AI Technical Summary
Because there may be discrepancies between the system times of different electronic devices, transactions executed around the time of a date change may have different execution dates depending on the electronic device.
By receiving the business to be executed and determining the time interval between the current time and the preset date change time, if it is less than the preset offset interval, the business is added to the queue to be executed; when the current time is the preset time, the business in the queue is executed in sequence, and the execution date of each business is determined according to the date to which the execution time belongs.
This avoids the problem of inconsistent execution date timing due to system time deviations of different electronic devices, ensuring the accuracy of business execution dates.
Smart Images

Figure CN114489998B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data analysis technology, and in particular to a method, apparatus, device and medium for determining the execution date of a business. Background Technology
[0002] With the development of society, more and more users are conducting various businesses such as fund transactions online. Different types of transactions are executed using different electronic devices in the banking system. For example, one electronic device may be used to transfer funds out, while another electronic device may be used to transfer funds in. Due to possible discrepancies in the system times of different electronic devices, transactions executed around the time of a date change may result in different execution dates for the same transaction involving at least two electronic devices. For instance, if a user transfers funds to another user around 0:00 on a certain day, the execution dates recorded for the outgoing funds and the incoming funds may be different.
[0003] Since transactions involve at least two electronic devices, subsequent electronic devices typically execute subsequent transactions after the preceding electronic device has completed the corresponding business. Therefore, in order to solve this problem, in the prior art, when a transaction involves at least two electronic devices, the subsequent electronic device determines the execution date of the preceding electronic device as its own execution date when recording the execution date.
[0004] However, in this method, the system time of the preceding electronic device is later than that of the subsequent electronic device. When the subsequent electronic device completes the business corresponding to a transaction involving at least two electronic devices, the execution date determined by the subsequent electronic device is the execution date of the preceding electronic device. If the subsequent electronic device continues to execute other businesses, the execution date of those other businesses will be determined based on the system time of the electronic devices. Therefore, there may be a problem where the time sequence of the determined execution dates of different businesses differs from the time sequence in which the corresponding businesses are executed. Summary of the Invention
[0005] This application provides a method, apparatus, device, and medium for determining the execution date of a service, in order to solve the problem in the prior art where the timing of the execution dates of different services differs from the timing of the corresponding services being executed.
[0006] In a first aspect, embodiments of this application provide a method for determining a business execution date, the method comprising:
[0007] The system receives a service to be executed and determines whether the time interval between the current time and the preset date change time corresponding to the current time is less than a preset offset interval. If so, the service is added to the queue to be executed. The offset interval is not less than the maximum offset interval between the system times of each electronic device.
[0008] If the current time is the preset time of any date, each service in the queue to be executed is executed sequentially, and the execution date of each service is determined according to the first date to which the execution time belongs.
[0009] Furthermore, after sequentially executing each service in the queue to be executed, and before determining the execution date of each service based on the date to which the execution time belongs, the method further includes:
[0010] For each of the aforementioned services, determine whether the execution date has been received from other electronic devices involved in the transaction corresponding to that service;
[0011] If not, then for this business, the subsequent execution will be carried out, and the execution date steps for each business will be determined based on the first date to which the execution time belongs;
[0012] If so, the execution date determined by the other electronic devices shall be determined as the execution date of the service.
[0013] Furthermore, if the time interval between the current time and the preset date change time corresponding to the current time is not less than a preset offset interval, the method further includes:
[0014] The service is executed, and the execution date of the service is determined based on the second date to which the execution time of the service belongs.
[0015] Furthermore, after receiving the service to be executed, before determining whether the time interval between the current time and the preset date change time corresponding to the current time is less than a preset offset interval, the method further includes:
[0016] Determine whether the date change status corresponding to the current time is pending change;
[0017] If so, then proceed with the operation of determining whether the time interval between the current time and the preset date change time is less than the preset offset interval.
[0018] Furthermore, if the date change status corresponding to the current time is not a pending change status, the method further includes:
[0019] Execute the service, and determine the execution date of the service based on the third date to which the execution time of the service belongs.
[0020] Furthermore, the state to be changed is determined in the following way:
[0021] If the time interval between the current time and the preset date change time is less than the preset change time interval, the date change status is adjusted to the pending change status; the change time interval is greater than the offset interval.
[0022] Furthermore, the method also includes:
[0023] After executing each business in the pending queue in sequence, the date change status is adjusted to change completed.
[0024] Furthermore, the method also includes:
[0025] The identifier of the sending service and the determined execution date.
[0026] Secondly, embodiments of this application also provide a business execution date determination device, the device comprising:
[0027] The receiving and judging module is used to receive the service to be executed, and judge whether the time interval between the current time and the preset date change time corresponding to the current time is less than the preset offset interval; if so, the service is added to the queue to be executed; wherein, the offset interval is not less than the maximum offset interval between the system times of each electronic device.
[0028] The processing module is used to sequentially execute each service in the queue to be executed when the current time is a preset time of any date, and to determine the execution date of each service based on the first date to which the execution time belongs.
[0029] Furthermore, the processing module is also configured to determine, for each service, whether it has received the execution date determined by other electronic devices involved in the transaction corresponding to the service; if not, it will proceed with the subsequent steps of determining the execution date of each service based on the first date to which the execution time belongs; if yes, it will determine the execution date determined by the other electronic devices as the execution date of the service.
[0030] Furthermore, the processing module is also configured to execute the service if the time interval between the current time and the preset date change time corresponding to the current time is not less than a preset offset interval, and determine the execution date of the service based on the second date to which the execution time of the service belongs.
[0031] Furthermore, the receiving and judging module is also used to judge whether the date change status corresponding to the current time is a pending change status; if so, it performs the subsequent operation of judging whether the time interval between the current time and the preset date change time corresponding to the current time is less than the preset offset interval.
[0032] Furthermore, the processing module is also configured to execute the service if the date change status corresponding to the current time is not pending change, and determine the execution date of the service based on the third date to which the execution time of the service belongs.
[0033] Furthermore, the processing module is also configured to adjust the date change status to a pending change status if the time interval between the current time and the preset date change time corresponding to the current time is less than the preset change time interval; the change time interval is greater than the offset interval.
[0034] Furthermore, the processing module is also used to adjust the date change status to change complete status after executing each business in the queue in sequence.
[0035] Furthermore, the processing module is also used to send the service identifier and the determined execution date.
[0036] Thirdly, embodiments of this application also provide an electronic device, which includes at least a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the steps of the business execution date determination method as described in any of the preceding claims.
[0037] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the business execution date determination method as described in any of the preceding claims.
[0038] Fifthly, embodiments of this application also provide a computer program product, which includes: computer program code, and when the computer program code is run on a computer, causing the computer to perform the steps of the business execution date determination method as described in any of the above.
[0039] In this embodiment, upon receiving a service to be executed, if the time interval between the current time and the preset date change time corresponding to the current time is less than a preset offset interval, the service is executed when the current time is a preset time of any date, and the execution date of the service is determined based on the first date to which the execution time of the service belongs. In this embodiment, if each electronic device receives a service to be executed and its current time is a time that may not be the same as the system time of other electronic devices, the service is temporarily not processed until the current time is a preset time of any date, i.e., when the system time of the electronic device is the same as the system time of other electronic devices. This avoids the problem that the determined execution date sequence differs from the actual execution sequence of the service due to discrepancies in the system times of different electronic devices. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This application provides a schematic diagram of a process for determining a business execution date.
[0042] Figure 2 A schematic diagram of a transaction process involving only one electronic device, provided for an embodiment of this application;
[0043] Figure 3 A schematic diagram illustrating the execution process of a transaction involving at least two electronic devices, provided as an embodiment of this application;
[0044] Figure 4 This is a schematic diagram of a business execution date determination device provided in an embodiment of the present invention;
[0045] Figure 5 This is a schematic diagram of an electronic device structure provided by the present invention. Detailed Implementation
[0046] The present application will now be described in further detail with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present application.
[0047] In order to ensure that the timing of the execution dates of different services is the same as the timing of the execution of the corresponding services, embodiments of this application provide a method, apparatus, device and medium for determining the execution date of services.
[0048] Example 1:
[0049] Figure 1 A schematic diagram of a business execution date determination process provided in this application embodiment is included in the following steps:
[0050] S101: Receive the service to be executed, and determine whether the time interval between the current time and the preset date change time corresponding to the current time is less than the preset offset interval; if so, add the service to the queue to be executed; wherein the offset interval is not less than the maximum offset interval between the system times of each electronic device.
[0051] The business execution date determination method provided in this application embodiment is applied to an electronic device, which can be a smart device such as a PC or a server.
[0052] In this embodiment of the application, in order to avoid the problem that the timing of the execution date of different services is different from the timing of the corresponding services being executed due to the discrepancy between the system times of different electronic devices, the received services to be executed are not executed when the system times of different electronic devices may not belong to the same date.
[0053] Specifically, the electronic devices pre-store a preset offset interval, which is not less than the maximum offset interval between the system times of each electronic device. Upon receiving a service to be executed, the electronic device determines whether its system time at the time of receiving the service belongs to a different date than the system times of other electronic devices. Specifically, the electronic device obtains the date change time corresponding to the current time and the time interval between the current time and the date change time. It then determines whether this time interval is less than the preset offset interval. If the time interval is less than the preset offset interval, it indicates that the system time of this electronic device may not belong to the same date as other electronic devices, and the service is temporarily not processed and is added to the pending execution queue.
[0054] In this embodiment, to minimize the system time error between different electronic devices, the electronic devices can connect to a clock server and synchronize their time using Network Time Protocol (NTP). This ensures that the error between the electronic devices is only at the millisecond level. In practical applications, the system time error between electronic devices under NTP is within 10 milliseconds; therefore, the "offset interval" can be set to a time interval of not less than 10 milliseconds.
[0055] The date change time corresponding to the current time can be the closest date change time to the current time. If the current time is 23:15:57 on January 20, then the date change time corresponding to the current time is 00:00:00 on January 21. If the current time is 00:15:57 on January 20, then the date change time corresponding to the current time is 00:00:00 on January 20.
[0056] In this embodiment of the application, each date change time and offset interval can be stored in the database of the electronic device. After receiving the service to be executed, since there is a millisecond-level error between electronic devices under NTP, the received services to be executed within the range of the offset interval before and after the "each date change time" are added to the queue to be executed for a certain delay.
[0057] S102: If the current time is the preset time of any date, execute each service in the queue to be executed in sequence, and determine the execution date of each service according to the first date to which the execution time belongs.
[0058] In this embodiment, when the system times of different electronic devices belong to the same date, the electronic devices execute the received services. This avoids the problem that the determined execution date sequence of the services differs from the actual execution sequence due to different system times of different electronic devices. Therefore, when the current time is a preset time of any date, the electronic device executes each service in the queue to be executed. Specifically, to ensure the order in which services are executed, the electronic device executes each service in the queue to be executed sequentially. When executing each service in the queue to be executed sequentially, the electronic device determines the execution date of each service based on the first date to which the execution time of each service belongs.
[0059] For each date, the time interval between the preset time of that date and the date change time of that date is greater than the maximum offset interval between the system times of each electronic device. In other words, when the system time of an electronic device is the preset time of any date, the date corresponding to the system time of each electronic device is the same.
[0060] For each date, the time interval between the preset time of that date and the date change time of that date is the preset interval. If the preset interval is 1 minute, and the date change time is January 20th 00:00:00, then the preset time for that date is January 20th 00:01:00. At the preset time of that date, the execution time of each service in the pending queue is close to January 20th 00:01:00, therefore the first date to which the execution time belongs is January 20th, and the determined execution date can be January 20th.
[0061] In this embodiment of the application, if each electronic device receives a service to be executed and its current time is not the same as the system time of other electronic devices, it will temporarily not process the service. The service will only be executed when the current time is the preset time of any date, that is, when the system time of the electronic device is the same as the system time of other electronic devices. This avoids the problem that the time sequence of the determined execution date is different from the actual execution time sequence of the service due to the deviation between the system times of different electronic devices.
[0062] Example 2:
[0063] To ensure that the execution dates for transactions involving at least two electronic devices are identical, in this embodiment, based on the above embodiments, after sequentially executing each transaction in the queue to be executed and before determining the execution date of each transaction based on the date to which the execution time belongs, the method further includes:
[0064] For each of the aforementioned services, determine whether the execution date has been received from other electronic devices involved in the transaction corresponding to that service;
[0065] If not, then for this business, the subsequent execution will be carried out, and the execution date steps for each business will be determined based on the first date to which the execution time belongs;
[0066] If so, the execution date determined by the other electronic devices shall be determined as the execution date of the service.
[0067] To avoid the problem of different execution dates for transactions involving at least two electronic devices, in this embodiment, when an electronic device receives each service to be executed, if the service is a transaction involving at least two electronic devices and the electronic device is not the one processing the first service, then the electronic device will receive the execution date determined by the other electronic devices. If the electronic device receives the execution date determined by the other electronic devices, it will determine the execution date of the service based on the execution date determined by the other electronic devices.
[0068] Specifically, for each service, the electronic device determines whether it has received an execution date determined by other electronic devices. If the service involves a transaction between at least two electronic devices, and the electronic device is not the first to process the service, it receives an execution date determined by other electronic devices, and this execution date is the one determined by the first electronic device when executing the corresponding service. If no execution date is received from other electronic devices, it indicates that the service is not a service of a subsequent electronic device in a transaction involving at least two electronic devices. In this case, the electronic device determines the execution date of the service based on the first date to which the execution time of the service belongs. The electronic device may determine the first date to which the execution time belongs as the execution date of the service. If an execution date is received from other electronic devices, it indicates that the service is a service of a subsequent electronic device in a transaction involving at least two electronic devices. In this case, the execution date of the service is determined based on the execution date determined by the other electronic device. Alternatively, the execution date determined by the other electronic device may be used as the execution date of the service.
[0069] In other words, for transactions involving at least two electronic devices, the execution date determined for subsequent electronic devices shall be based on the execution date determined for the first electronic device.
[0070] In this embodiment of the application, after receiving a service, the transaction access device determines which electronic device to send the service to based on the type of the service. The electronic device can send the service identifier and the determined execution date to the transaction access device, and the transaction access device will then determine whether to send the execution date to other electronic devices.
[0071] Figure 2 A schematic diagram of a transaction process involving only one electronic device, provided for an embodiment of this application;
[0072] Depend on Figure 2 It can be seen that the transaction access device only needs to send the business to an electronic device.
[0073] Figure 3 This is a schematic diagram illustrating the execution process of a transaction involving at least two electronic devices, provided as an embodiment of this application.
[0074] Depend on Figure 3 It is understood that the transaction access device needs to send the business corresponding to the transaction to the corresponding electronic device, and when sending the corresponding business to the subsequent electronic device, the transaction access device needs to send the execution date determined by the previous electronic device to the subsequent electronic device.
[0075] Example 3:
[0076] To determine the execution date of each service, based on the above embodiments, in this embodiment, if the time interval between the current time and the preset date change time corresponding to the current time is not less than a preset offset interval, the method further includes:
[0077] The service is executed, and the execution date of the service is determined based on the second date to which the execution time of the service belongs.
[0078] In this embodiment, if the time interval between the current time and the preset date change time is not less than a preset offset interval, it indicates that the system time of each electronic device belongs to the same date. Therefore, the received pending service can be executed, and the execution date of the service can be determined based on the second date to which the execution time of the service belongs. Specifically, the second date can be determined as the execution date of the service.
[0079] If the execution time of this business is 15:28 on January 21, then the second date to which this execution time belongs is January 21. Therefore, the execution date of this business is January 21.
[0080] In other words, each electronic device can only obtain its own system time. Although this system time is automatically synchronized with the clock server via NTP, there is still a millisecond-level error. To avoid errors in the determined execution date caused by this error, delay compensation is required through "offset intervals".
[0081] The specific scenarios are as follows:
[0082] Scenario 1: If the time interval between the current time and the preset date change time is not less than the preset offset interval, it can be assumed that the system time of each electronic device belongs to the same date. In this case, the received service can be executed, and the execution date of the service can be determined according to the date to which the execution time belongs.
[0083] Scenario 2: If the time interval between the current time and the preset date change time is less than the preset offset interval, it can be assumed that the system time of each electronic device may belong to different dates. In this case, the business is added to the execution queue, and the business in the execution queue is executed when the system time of each electronic device is the same date.
[0084] Example 4:
[0085] To quickly and accurately determine the execution date of each service, based on the above embodiments, in this embodiment, after receiving the service to be executed and before determining whether the time interval between the current time and the preset date change time corresponding to the current time is less than a preset offset interval, the method further includes:
[0086] Determine whether the date change status corresponding to the current time is pending change;
[0087] If so, then proceed with the operation of determining whether the time interval between the current time and the preset date change time is less than the preset offset interval.
[0088] In this embodiment of the application, if after receiving each business to be executed, the time interval between the current time and the preset date change time corresponding to the current time is determined, and it is determined whether the time interval is less than the preset offset interval, it would be quite complicated and would affect the efficiency of business processing.
[0089] Since the time interval between the current time and the date change time corresponding to the preset current time is greater than the preset offset interval most of the time, a date change state can be set in this embodiment. The specific date change state includes a pending change state, which indicates that the current time is close to the time when the system time of different electronic devices belongs to different dates.
[0090] After receiving a service to be executed, the electronic device can first determine whether the date change status is pending. If the date change status is pending, it means that the current time is close to the time when different electronic devices' system times belong to different dates. Then, it will perform the subsequent operation of determining whether the time interval between the current time and the preset date change time corresponding to the current time is less than the preset offset interval. The pending change status can be represented by "1".
[0091] To quickly and accurately determine the execution date of each business operation, based on the above embodiments, in this embodiment, if the date change status corresponding to the current time is not a pending change status, the method further includes:
[0092] Execute the service, and determine the execution date of the service based on the third date to which the execution time of the service belongs.
[0093] In this embodiment of the application, upon receiving a service to be executed, if the date change status corresponding to the current time is not in a pending change state, it indicates that the system time of different electronic devices belongs to the same date. Therefore, the received service to be executed can be executed, and a third date to which the execution time of the service belongs is determined, which is then designated as the execution date of the service. The pending change state can be represented by "0".
[0094] In other words, when a pending service is received, if the date change status is "0", it means that the current time is the same for all electronic devices. In this case, the received pending service is executed, and the execution date is determined based on the third date to which the service's execution time belongs.
[0095] In this embodiment of the application, the business date can be recorded in the database of the electronic device. When performing business, the business date is the date to which the execution time belongs, so the business date can be directly determined as the execution date.
[0096] The execution date information that can be recorded in the database of electronic devices is shown in the table below:
[0097] The day before the business date The day before the date to which the current time belongs Business Dates The date to which the current time belongs The day after the business date The next day of the date to which the current time belongs Date change status indicator Identify date change status identifier
[0098] Table 1
[0099] In Table 1, the first column is the execution date, and the second column is the meaning of the data in the first column. The database can record "the day before the business date", "business date", "the day after the business date" and "date change status identifier". The day before the business date refers to the day before the date to which the current time belongs. The business date refers to the date to which the current time belongs. The business date plus 1 is the day after the date to which the current time belongs. The date change status identifier can be used to identify the date change status of the current time.
[0100] Example 5:
[0101] To quickly and accurately determine the execution date of each business operation, based on the above embodiments, in this application embodiment, the state to be changed is determined in the following way:
[0102] If the time interval between the current time and the preset date change time is less than the preset change time interval, the date change status is adjusted to the pending change status; the change time interval is greater than the offset interval.
[0103] In this embodiment, to determine the date change status, a change time interval is pre-stored. This change time interval is greater than the offset interval. If the time interval between the current time and the preset date change time corresponding to the current time is less than the preset change time interval, it indicates that the current time is close to the system time of different electronic devices and may belong to different dates. In this case, the date change status is adjusted to a pending change status. The change time interval can be any time greater than the offset interval.
[0104] In other words, in this embodiment of the application, if the time interval between the current time and the preset date change time corresponding to the current time is less than the preset change time interval, the date change status is adjusted to the pending change status. If a service to be executed is received, it is determined whether the time interval between the current time and the preset date change time corresponding to the current time is less than the preset offset interval. If it is less than the preset offset interval, the service is added to the pending execution queue. If it is greater than the preset offset interval, the service is executed.
[0105] To determine the date change status, based on the above embodiments, the method in this application embodiment further includes:
[0106] After executing each business in the pending queue in sequence, the date change status is adjusted to non-pending change status.
[0107] In this embodiment of the application, after executing each service in the queue to be executed in sequence, the electronic device adjusts the date change status to a non-pending change status. If a service is received subsequently, since the date change status is now a non-pending change status, the newly received service can be executed directly.
[0108] To accurately determine the execution time of each service, based on the above embodiments, the method in this application embodiment further includes:
[0109] The identifier of the sending service and the determined execution date.
[0110] In this embodiment of the application, after determining the execution date of each service, in order to determine the execution date of the service corresponding to a transaction involving at least two electronic devices, the electronic devices will send the identifier of each service and the determined execution date, so that subsequent electronic devices can determine the execution date of other services based on the execution date.
[0111] Example 6:
[0112] Figure 4 This invention provides a schematic diagram of a business execution date determination device, the device comprising:
[0113] The receiving and judging module 401 is used to receive the service to be executed, and judge whether the time interval between the current time and the preset date change time corresponding to the current time is less than the preset offset interval; if so, the service is added to the queue to be executed; wherein, the offset interval is not less than the maximum offset interval between the system times of each electronic device.
[0114] The processing module 402 is used to sequentially execute each service in the queue to be executed when the current time is a preset time of any date, and to determine the execution date of each service according to the first date to which the execution time belongs.
[0115] In one possible implementation, the processing module 402 is further configured to determine, for each service, whether the execution date determined by other electronic devices involved in the transaction corresponding to the service has been received; if not, then for the subsequent execution of the service, the execution date step of determining the execution date of each service is determined according to the first date to which the execution time belongs; if yes, then the execution date determined by the other electronic devices is determined as the execution date of the service.
[0116] In one possible implementation, the processing module 402 is further configured to execute the service if the time interval between the current time and the preset date change time corresponding to the current time is not less than a preset offset interval, and determine the execution date of the service based on the second date to which the execution time of the service belongs.
[0117] In one possible implementation, the receiving and judging module 401 is further configured to judge whether the date change status corresponding to the current time is a pending change status; if so, then perform the subsequent operation of judging whether the time interval between the current time and the preset date change time corresponding to the current time is less than the preset offset interval.
[0118] In one possible implementation, the processing module 402 is further configured to execute the service if the date change status corresponding to the current time is not pending change, and determine the execution date of the service based on the third date to which the execution time of the service belongs.
[0119] In one possible implementation, the processing module 402 is further configured to adjust the date change state to a pending change state if the time interval between the current time and the preset date change time corresponding to the current time is less than the preset change time interval; the change time interval is greater than the offset interval.
[0120] In one possible implementation, the processing module 402 is further configured to adjust the date change status to change complete status after executing each service in the queue to be executed in sequence.
[0121] In one possible implementation, the processing module 402 is further configured to send the service identifier and the determined execution date.
[0122] Example 7:
[0123] Figure 5 This is a schematic diagram of an electronic device structure provided by the present invention. Based on the above embodiments, the present invention also provides an electronic device, such as... Figure 5 As shown, it includes: processor 501, communication interface 502, memory 503 and communication bus 504, wherein processor 501, communication interface 502 and memory 503 communicate with each other through communication bus 504.
[0124] The memory 503 stores a computer program, which, when executed by the processor 501, causes the processor 501 to perform the following steps:
[0125] The system receives a service to be executed and determines whether the time interval between the current time and the preset date change time corresponding to the current time is less than a preset offset interval. If so, the service is added to the queue to be executed. The offset interval is not less than the maximum offset interval between the system times of each electronic device.
[0126] If the current time is the preset time of any date, each service in the queue to be executed is executed sequentially, and the execution date of each service is determined according to the first date to which the execution time belongs.
[0127] In one possible implementation, after sequentially executing each service in the queue to be executed, and before determining the execution date of each service based on the date to which the execution time belongs, the method further includes:
[0128] For each of the aforementioned services, determine whether the execution date has been received from other electronic devices involved in the transaction corresponding to that service;
[0129] If not, then for this business, the subsequent execution will be carried out, and the execution date steps for each business will be determined based on the first date to which the execution time belongs;
[0130] If so, the execution date determined by the other electronic devices shall be determined as the execution date of the service.
[0131] In one possible implementation, if the time interval between the current time and the preset date change time corresponding to the current time is not less than a preset offset interval, the method further includes:
[0132] The service is executed, and the execution date of the service is determined based on the second date to which the execution time of the service belongs.
[0133] In one possible implementation, after receiving the service to be executed, and before determining whether the time interval between the current time and the preset date change time corresponding to the current time is less than a preset offset interval, the method further includes:
[0134] Determine whether the date change status corresponding to the current time is pending change;
[0135] If so, then proceed with the operation of determining whether the time interval between the current time and the preset date change time is less than the preset offset interval.
[0136] In one possible implementation, if the date change status corresponding to the current time is not a pending change status, the method further includes:
[0137] Execute the service, and determine the execution date of the service based on the third date to which the execution time of the service belongs.
[0138] In one possible implementation, the state to be changed is determined in the following way:
[0139] If the time interval between the current time and the preset date change time is less than the preset change time interval, the date change status is adjusted to the pending change status; the change time interval is greater than the offset interval.
[0140] In one possible implementation, the method further includes:
[0141] After executing each business in the pending queue in sequence, the date change status is adjusted to change completed.
[0142] In one possible implementation, the method further includes:
[0143] The identifier of the sending service and the determined execution date.
[0144] The communication bus mentioned in the above server can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0145] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0146] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0147] The processors mentioned above can be general-purpose processors, including central processing units, network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits, field-programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0148] Example 8:
[0149] Based on the above embodiments, this invention also provides a computer-readable storage medium storing a computer program executable by an electronic device. When the program is run on the electronic device, the electronic device performs the following steps:
[0150] The memory stores a computer program that, when executed by the processor, causes the processor to perform the following steps:
[0151] The system receives a service to be executed and determines whether the time interval between the current time and the preset date change time corresponding to the current time is less than a preset offset interval. If so, the service is added to the queue to be executed. The offset interval is not less than the maximum offset interval between the system times of each electronic device.
[0152] If the current time is the preset time of any date, each service in the queue to be executed is executed sequentially, and the execution date of each service is determined according to the first date to which the execution time belongs.
[0153] In one possible implementation, after sequentially executing each service in the queue to be executed, and before determining the execution date of each service based on the date to which the execution time belongs, the method further includes:
[0154] For each of the aforementioned services, determine whether the execution date has been received from other electronic devices involved in the transaction corresponding to that service;
[0155] If not, then for this business, the subsequent execution will be carried out, and the execution date steps for each business will be determined based on the first date to which the execution time belongs;
[0156] If so, the execution date determined by the other electronic devices shall be determined as the execution date of the service.
[0157] In one possible implementation, if the time interval between the current time and the preset date change time corresponding to the current time is not less than a preset offset interval, the method further includes:
[0158] The service is executed, and the execution date of the service is determined based on the second date to which the execution time of the service belongs.
[0159] In one possible implementation, after receiving the service to be executed, and before determining whether the time interval between the current time and the preset date change time corresponding to the current time is less than a preset offset interval, the method further includes:
[0160] Determine whether the date change status corresponding to the current time is pending change;
[0161] If so, then proceed with the operation of determining whether the time interval between the current time and the preset date change time is less than the preset offset interval.
[0162] In one possible implementation, if the date change status corresponding to the current time is not a pending change status, the method further includes:
[0163] Execute the service, and determine the execution date of the service based on the third date to which the execution time of the service belongs.
[0164] In one possible implementation, the state to be changed is determined in the following way:
[0165] If the time interval between the current time and the preset date change time is less than the preset change time interval, the date change status is adjusted to the pending change status; the change time interval is greater than the offset interval.
[0166] In one possible implementation, the method further includes:
[0167] After executing each business in the pending queue in sequence, the date change status is adjusted to change completed.
[0168] In one possible implementation, the method further includes:
[0169] The identifier of the sending service and the determined execution date.
[0170] Example 9:
[0171] This application also provides a computer program product that, when executed by a computer, implements the business execution date determination method described in any of the above-described method embodiments applied to electronic devices.
[0172] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof, or in whole or in part, as a computer program product. The computer program product includes one or more computer instructions, which, when loaded and executed on a computer, generate, in whole or in part, the processes or functions described in the embodiments of this application.
[0173] In this embodiment of the application, if each electronic device receives a service to be executed and its current time is not the same as the system time of other electronic devices, it will temporarily not process the service. The service will only be executed when the current time is the preset time of any date, that is, when the system time of the electronic device is the same as the system time of other electronic devices. This avoids the problem that the time sequence of the determined execution date is different from the actual execution time sequence of the service due to the deviation between the system times of different electronic devices.
[0174] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0175] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0176] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0177] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0178] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for determining the execution date of a business transaction, characterized in that, Applied to electronic devices, the method includes: The system receives a service to be executed and determines whether the time interval between the current time and the preset date change time corresponding to the current time is less than a preset offset interval. If so, the service is added to the execution queue and the service is delayed. The offset interval is not less than the maximum offset interval between the system times of each electronic device. Each electronic device executes a different type of service. If the current time is a preset time for any date, each service in the queue to be executed is executed sequentially, and the execution date of each service is determined according to the first date to which the execution time belongs; so that when there is a discrepancy between the system times of different electronic devices, the execution sequence of different services determined by different electronic devices is the same as the execution sequence of the corresponding services; wherein, when the system time of an electronic device is a preset time for any date, the date corresponding to the system time of each electronic device is the same; the electronic device is connected to the clock server and uses the Network Time Protocol (NTP) to synchronize time with the clock server; The method further includes, after sequentially executing each service in the queue to be executed, and before determining the execution date of each service based on the date to which the execution time belongs: For each service, determine whether the execution date determined by other electronic devices involved in the transaction corresponding to the service has been received; wherein, if the service is a service corresponding to a transaction involving at least two electronic devices, and the electronic device is not the electronic device that processed the first service, the electronic device receives the execution date determined by other electronic devices, and the execution date is the execution date determined by the electronic device that processed the first service when executing the first service; If not, then it is determined that the business is not a business involving subsequent electronic devices in a transaction involving at least two electronic devices. For the business, the subsequent steps are performed, and the execution date of each business is determined according to the first date to which the execution time belongs. If so, the business is determined to be a business of a subsequent electronic device in a transaction involving at least two electronic devices, and the execution date determined by the other electronic devices is determined as the execution date of the business; The identifier of the sending service and the determined execution date are used to determine whether the transaction access device receiving the service identifier and the determined execution date should send the execution date to other electronic devices.
2. The method according to claim 1, characterized in that, If the time interval between the current time and the preset date change time is not less than the preset offset interval, the method further includes: The service is executed, and the execution date of the service is determined based on the second date to which the execution time of the service belongs.
3. The method according to claim 1, characterized in that, After receiving the service to be executed, before determining whether the time interval between the current time and the preset date change time corresponding to the current time is less than the preset offset interval, the method further includes: Determine whether the date change status corresponding to the current time is pending change; If so, then proceed with the operation of determining whether the time interval between the current time and the preset date change time is less than the preset offset interval.
4. The method according to claim 3, characterized in that, If the date change status corresponding to the current time is not pending change, the method further includes: Execute the service, and determine the execution date of the service based on the third date to which the execution time of the service belongs.
5. The method according to claim 3, characterized in that, The status to be changed is determined in the following way: If the time interval between the current time and the preset date change time is less than the preset change time interval, the date change status is adjusted to the pending change status; the change time interval is greater than the offset interval.
6. The method according to claim 3, characterized in that, The method further includes: After executing each business in the pending queue in sequence, the date change status is adjusted to change completed.
7. The method according to claim 1, characterized in that, The method further includes: The identifier of the sending service and the determined execution date.
8. A device for determining the execution date of a business transaction, characterized in that, The device includes: The receiving and judging module is used to receive the service to be executed, and judge whether the time interval between the current time and the preset date change time corresponding to the current time is less than the preset offset interval; if so, the service is added to the queue to be executed and the service is delayed; wherein, the offset interval is not less than the maximum offset interval between the system times of each electronic device; each electronic device executes different types of services; The processing module is used to sequentially execute each service in the queue to be executed when the current time is a preset time of any date, and to determine the execution date of each service according to the first date to which the execution time belongs; so that when there is a discrepancy between the system times of different electronic devices, the timing of the execution dates of different services determined by different electronic devices is the same as the timing of the execution of the corresponding services; wherein, when the system time of the electronic device is a preset time of any date, the date corresponding to the system time of each electronic device is the same; the electronic device is connected to the clock server and uses the Network Time Protocol (NTP) to synchronize time with the clock server; The processing module is further configured to, for each service, determine whether it has received an execution date determined by other electronic devices involved in the transaction corresponding to that service; wherein, if the service is a service corresponding to a transaction involving at least two electronic devices, and the electronic device is not the one processing the first service, the electronic device receives an execution date determined by other electronic devices, and this execution date is the execution date determined by the electronic device processing the first service when executing the first service; if not, it is determined that the service is not a service of subsequent electronic devices in a transaction involving at least two electronic devices, and the execution date of each service is determined according to the first date to which the execution time belongs; if yes, it is determined that the service is a service of subsequent electronic devices in a transaction involving at least two electronic devices, and the execution date determined by the other electronic devices is determined as the execution date of the service; the service identifier and the determined execution date are sent; so that the transaction access device receiving the service identifier and the determined execution date determines whether to send the execution date to other electronic devices.
9. The apparatus according to claim 8, characterized in that, The processing module is further configured to execute the service if the time interval between the current time and the preset date change time corresponding to the current time is not less than a preset offset interval, and to determine the execution date of the service based on the second date to which the execution time of the service belongs.
10. The apparatus according to claim 8, characterized in that, The receiving and judging module is also used to judge whether the date change status corresponding to the current time is a pending change status; if so, it performs the subsequent operation of judging whether the time interval between the current time and the preset date change time corresponding to the current time is less than the preset offset interval.
11. The apparatus according to claim 10, characterized in that, The processing module is further configured to execute the service if the date change status corresponding to the current time is not pending change, and determine the execution date of the service based on the third date to which the execution time of the service belongs.
12. The apparatus according to claim 10, characterized in that, The processing module is further configured to adjust the date change status to a pending change status if the time interval between the current time and the preset date change time corresponding to the current time is less than the preset change time interval; the change time interval is greater than the offset interval.
13. The apparatus according to claim 10, characterized in that, The processing module is also used to adjust the date change status to change complete status after executing each business in the queue in sequence.
14. An electronic device, characterized in that, The electronic device includes at least a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the steps of the business execution date determination method as described in any one of claims 1-7.
15. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the steps of the business execution date determination method as described in any one of claims 1-7.
16. A computer program product, characterized in that, Its computer program product includes: computer program code, which, when the computer program code is run on a computer, causes the computer to perform the steps of the business execution date determination method as described in any one of claims 1-7.
Citation Information
Patent Citations
Characteristic date data node configuration method and device
CN105654269A
Bank multi-platform accounting data processing method and device
CN110020941A