Overseas holding valuation process control method, device, computer equipment and storage medium
Through multi-threaded concurrent execution and task priority mechanism, the problem of poor user experience in the overseas holding valuation accounting process is solved, and rapid response and accurate valuation information display are achieved.
Patent Information
- Application Number
- CN201811518626.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-12-12
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2038-12-12
AI Technical Summary
In the existing technology, the valuation and accounting process of overseas holdings is complicated, resulting in the front-end being unable to accurately know the time point when the valuation and accounting process is completed, resulting in poor user experience.
By obtaining the preset target thread tasks and executing them concurrently according to the multi-thread concurrency rules, multiple multi-thread tasks to be executed are generated and executed sequentially until all are completed. The CPU resource ratio threshold and task priority mechanism are used to optimize task execution. Combined with the heartbeat detection mechanism to provide feedback information.
It achieves rapid response to front-end operations, improves user experience, and ensures the smooth execution of the valuation accounting process and the timely display of user information.
Smart Images

Figure CN109783242B
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of financial information technology, and in particular to a method, device, computer equipment and storage medium for controlling an overseas holding valuation process. Background Art
[0002] With the development of the world economy, more and more enterprises or companies are registering companies overseas. Overseas holdings include overseas registered companies holding mainland Chinese companies and mainland companies holding overseas companies. In the valuation process of overseas holdings, the valuation and accounting process consists of four steps: equity reset, position calculation, liquidation and business certification. These four steps need to be carried out in sequence.
[0003] In the prior art, the overseas holding valuation and accounting process is complicated. For users, the users obtain the execution progress information of the overseas holding valuation and accounting process through the front end. However, due to the asynchronous response of the front end, the front end cannot accurately know the time node when the valuation and accounting process is completed, resulting in the front end being unable to display the valuation and accounting information to the user during the valuation and accounting process on the server side, resulting in a poor user experience. Summary of the invention
[0004] The embodiments of the present invention provide a method, device, computer equipment and storage medium for controlling an overseas holding valuation process by concurrently executing an overseas holding valuation accounting process through multiple threads.
[0005] In order to solve the above technical problems, a technical solution adopted by an embodiment of the present invention is to provide a method for controlling an overseas holding valuation process, comprising the following steps:
[0006] Obtaining a preset target thread task, wherein the target thread task is used to execute an overseas holding valuation and accounting process;
[0007] Concurrently executing the target thread task according to a preset multi-thread concurrency rule to generate at least two multi-thread tasks to be executed;
[0008] The at least two multi-threaded tasks to be executed are executed in sequence until all the multi-threaded tasks to be executed are completed.
[0009] Optionally, before the step of sequentially executing the at least two to-be-executed multi-threaded tasks until all the to-be-executed multi-threaded tasks are executed, the step further includes:
[0010] Get the ratio of used CPU resources to total CPU resources;
[0011] Comparing the ratio with a preset percentage threshold;
[0012] When the ratio is less than the proportion threshold, the at least two multi-threaded tasks to be executed are executed.
[0013] Optionally, the step of sequentially executing the at least two multi-threaded tasks to be executed until all the multi-threaded tasks to be executed are completed comprises the following steps:
[0014] Establishing a task to be executed by a thread to execute the at least two multi-threaded tasks to be executed;
[0015] The tasks to be executed are executed preferentially according to the preset task execution rules.
[0016] Optionally, the step of preferentially executing the tasks to be executed according to a preset task execution rule comprises the following steps:
[0017] Detect whether there is an operation task with a higher priority than the task to be executed in the task queue after the task to be executed;
[0018] When there is an operation task with a higher priority than the task to be executed in the task queue, the priority of the task to be executed is set higher than the priority of the operation task, so that the task to be executed is executed first and then the operation task is called back to execute after the task to be executed is completed.
[0019] Optionally, after the step of sequentially executing the at least two multi-threaded tasks to be executed until all the multi-threaded tasks to be executed are completed, the following steps are further included:
[0020] Get the polling detection data packet sent by the front end according to the preset heartbeat detection mechanism;
[0021] The execution status of the at least two to-be-executed multi-threaded tasks is detected according to the polling detection data packet, and feedback information is generated and sent to the front end.
[0022] In order to solve the above technical problems, an embodiment of the present invention further provides an overseas holding valuation process control device, comprising:
[0023] A first acquisition module is used to acquire a preset target thread task, wherein the target thread task is used to execute an overseas holding valuation and accounting process;
[0024] A first processing module, configured to concurrently execute the target thread task according to a preset multi-thread concurrent rule to generate at least two multi-thread tasks to be executed;
[0025] The first execution module is used to execute the at least two multi-threaded tasks to be executed in sequence until all the multi-threaded tasks to be executed are completed.
[0026] Optionally, it also includes:
[0027] The second acquisition module is used to obtain the ratio of the used CPU resources to the total CPU resources;
[0028] A comparison module, used for comparing the ratio with a preset proportion threshold;
[0029] The second execution module is used to execute the at least two multi-threaded tasks to be executed when the ratio is less than the proportion threshold.
[0030] Optionally, it also includes:
[0031] A thread creation submodule, used for establishing a to-be-executed task for executing the at least two to-be-executed multi-threaded tasks through a thread;
[0032] The first execution submodule is used to preferentially execute the tasks to be executed according to preset task execution rules.
[0033] Optionally, it also includes:
[0034] A detection submodule, used for detecting whether there is an operation task with a higher priority than the task to be executed in the task queue after the task to be executed;
[0035] The second execution submodule is used to set the priority of the task to be executed to be higher than the priority of the operation task when there is an operation task with a higher priority than the task to be executed in the task queue, so that the task to be executed is executed first and then the operation task is called back to execute after the task to be executed is completed.
[0036] Optionally, it also includes:
[0037] The third acquisition module is used to obtain the polling detection data packet sent by the front end according to the preset heartbeat detection mechanism;
[0038] The third execution module is used to detect the execution status of the at least two to-be-executed multi-threaded tasks according to the polling detection data packet, generate feedback information, and then send it to the front end.
[0039] In order to solve the above technical problems, an embodiment of the present invention further provides a computer device, including a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the above overseas holding valuation process control method.
[0040] In order to solve the above technical problems, an embodiment of the present invention further provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the above overseas holding valuation process control method.
[0041] The beneficial effects of the embodiments of the present invention are as follows: by obtaining a target thread task, the target thread task is used to execute the overseas holding valuation and accounting process, and then the target thread task is multi-threaded and concurrently executed according to the multi-threaded concurrency rules to generate multiple multi-threaded tasks to be executed, and the multi-threaded tasks to be executed are executed in sequence until all the multi-threaded tasks to be executed are completed. This embodiment quickly responds to front-end operations by executing the overseas holding valuation and accounting process in multi-threaded concurrent manner, and provides a friendly user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 A basic flow chart of a method for controlling an overseas holding valuation process according to an embodiment of the present invention;
[0044] Figure 2 A schematic diagram of a flow chart of a CPU executing a multi-threaded task to be executed when idle in an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of a process of asynchronously executing multi-threaded tasks to be executed by multi-threads according to an embodiment of the present invention;
[0046] Figure 4 A schematic diagram of a flow chart for preferentially executing multi-threaded tasks to be executed according to an embodiment of the present invention;
[0047] Figure 5 A schematic diagram of a process flow of detecting a valuation calculation process according to an embodiment of the present invention;
[0048] Figure 6 A schematic diagram showing the flow of multi-threaded task execution time according to an embodiment of the present invention;
[0049] Figure 7 This is a basic structural diagram of an overseas holding valuation process control device according to an embodiment of the present invention;
[0050] Figure 8 The figure is a basic structural block diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0052] In some of the processes described in the specification and claims of the present invention and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.
[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0054] Example 1
[0055] Please refer to Figure 1 , Figure 1 Schematic diagram of the basic process of the overseas holding valuation process control method of this embodiment.
[0056] like Figure 1 As shown, a method for controlling the process of overseas holding valuation includes the following steps:
[0057] S1100, obtaining a preset target thread task, wherein the target thread task is used to execute an overseas holding valuation and accounting process;
[0058] The target thread task is a task to be executed by the system preset. The target thread task is used to execute the overseas holding valuation and accounting process. The overseas holding valuation and accounting process is a business activity such as accounting, valuation and related information disclosure of overseas holding funds. During implementation, different overseas holding valuation and accounting processes correspond to different thread tasks. For example: Class A overseas holding valuation and accounting process corresponds to the first thread task, and Class B overseas holding valuation and accounting process corresponds to the second thread task. When it is necessary to execute Class A overseas holding valuation and accounting process, the system automatically confirms the first thread task as the target thread task.
[0059] In one embodiment, taking the overseas holding valuation process control method of the present invention applied to a PC (personal computer) side as an example, the system displays information related to the overseas holding valuation and accounting process to the user through the display of the PC side and monitors the user's operation. For example, the system monitors that the user wants to view information related to the Class B overseas holding valuation and accounting process. The system obtains the second thread task corresponding to the Class B overseas holding valuation and accounting process as the target thread task according to the user's operation, thereby executing the Class B overseas holding valuation and accounting process and displaying it through the display for the user to view.
[0060] S1200, executing the target thread task concurrently according to a preset multi-thread concurrency rule to generate at least two multi-thread tasks to be executed;
[0061] After obtaining the target thread task, the system executes the target thread task concurrently according to the multi-thread concurrency rules, thereby generating multiple (for example, 2, 3 or 5) multi-thread tasks to be executed. During implementation, Python can be used to establish multiple multi-thread tasks to be executed concurrently for executing the target thread task.
[0062] S1300, executing the at least two to-be-executed multi-threaded tasks in sequence until all the to-be-executed multi-threaded tasks are completed.
[0063] After generating multiple multi-threaded tasks to be executed for concurrently executing the target thread task, the system executes at least two (for example, 3, 5 or 8) multi-threaded tasks to be executed in sequence until all the multi-threaded tasks to be executed are completed. During implementation, the overseas holding valuation and accounting process is executed concurrently by multiple threads, and the multi-threaded tasks to be executed can be controlled by CountDownLatch to complete the corresponding overseas holding valuation and accounting process, wherein CountDownLatch is a synchronization tool class that allows one or more threads to wait until other threads are executed before executing. Specifically, CountDownLatch is implemented by a counter, and the initialization value of the counter is the number of threads. Whenever a thread completes its task, the value of the counter is reduced by 1 accordingly. When the counter reaches 0, it means that all threads have completed their tasks, and then the threads waiting on the latch can resume executing their tasks.
[0064] In one embodiment, taking viewing the valuation and accounting process of Class B overseas holdings as an example, the system obtains the second thread task corresponding to the valuation and accounting process of Class B overseas holdings as the target thread task, and then concurrently executes the target thread task according to the multi-threaded concurrency rules to generate at least two (for example, 5) multi-threaded tasks to be executed, including the first multi-threaded task to be executed, the second multi-threaded task to be executed, the third multi-threaded task to be executed, the third multi-threaded task to be executed and the fifth multi-threaded task to be executed. The system controls the first multi-threaded task to be executed, the second multi-threaded task to be executed, the third multi-threaded task to be executed, the third multi-threaded task to be executed and the fifth multi-threaded task to be executed through CountDownLatch to realize the multi-threaded concurrent execution of the target thread task and complete the corresponding valuation and accounting process. The multi-threaded concurrent execution of the overseas holding valuation and accounting process can quickly realize the front-end response, avoid the user waiting for a long time, and improve the user experience.
[0065] This embodiment obtains a target thread task, which is used to execute the overseas holding valuation and accounting process, and then performs multi-threaded concurrent execution of the target thread task according to the multi-threaded concurrency rule to generate multiple multi-threaded tasks to be executed, and executes the multi-threaded tasks to be executed in sequence until all the multi-threaded tasks to be executed are completed. This embodiment quickly responds to front-end operations by performing multi-threaded concurrent execution of the overseas holding valuation and accounting process, and provides a friendly user experience.
[0066] In an optional embodiment, for users, the user views the overseas holding valuation and accounting process through the front end. When the front end displays data information and draws the display interface, the system invests a large amount of CPU resources to execute the interface drawing operation, and can execute other operation tasks when the CPU is idle, so as to avoid the display interface being stuck due to the allocation of CPU resources to execute other tasks, and the user experience is good. Please refer to Figure 2 , Figure 2 It is a flowchart of executing multi-threaded tasks to be executed when the CPU is idle in an embodiment of the present invention.
[0067] like Figure 2 As shown, before step 1300, the following steps are also included:
[0068] S1210, obtaining a ratio of used CPU resources to total CPU resources;
[0069] Taking the overseas holding valuation process control method of the present invention applied to smart devices as an example, smart devices include but are not limited to: smart phones, computers, tablets and other smart electronic devices. During the use of smart devices, it is necessary to perform reading, storage and event processing operations on files, and these operations will consume a large amount of CPU resources. For example, when using a smart device to watch a film or TV work, the smart device will use more CPU resources for interface drawing operations. If the CPU resources are allocated to perform other operations at this time, part of the CPU resources will be occupied, causing the interface to freeze or drop frames, thereby reducing the user experience.
[0070] S1220, comparing the ratio with a preset proportion threshold;
[0071] After obtaining the ratio of used CPU resources to total CPU resources, the system compares the ratio with a percentage threshold. The percentage threshold is a preset comparison value. The system determines whether the CPU is idle based on the percentage threshold. During implementation, the percentage threshold can also be set by the user. For example, the system displays a percentage threshold setting interface to the user through a display and listens to the user's operation, and then specifically sets a specific value of the percentage threshold according to the user's operation in the percentage threshold setting interface.
[0072] S1230: When the ratio is less than the proportion threshold, execute the at least two multi-threaded tasks to be executed.
[0073] The ratio threshold is a comparison value pre-set by the system. By comparing the ratio of the used CPU resources to the total CPU resources with the ratio threshold, when the ratio is less than the ratio threshold, it means that the CPU is in an idle period and the CPU resource occupancy rate is not high. At this time, the multi-threaded tasks to be executed can be executed to achieve multi-threaded concurrent execution of the target thread tasks, complete the corresponding valuation and accounting process, and avoid the phenomenon of front-end jamming caused by occupying a large amount of CPU resources when executing the multi-threaded tasks to be executed. During implementation, before executing the multi-threaded tasks to be executed, the multi-threaded tasks to be executed can also be placed in the operation pool. The system waits for CPU resources. When the CPU resources are in the idle period of the time slice, the multi-threaded tasks to be executed are taken out of the operation pool. When each multi-threaded task to be executed is completed, the next multi-threaded task to be executed is performed in turn until all the multi-threaded tasks to be executed are completed, thereby achieving multi-threaded concurrent execution of the target thread tasks without affecting other operations (such as interface drawing operations), thereby ensuring the smoothness of the front-end interface.
[0074] In another optional embodiment, the multi-threaded tasks to be executed can also be executed by multi-threading priority, so as to achieve the function of quickly completing the corresponding valuation calculation process to respond to the front-end operation, see Figure 3 , Figure 3It is a basic flow chart of multi-threaded asynchronous execution of multi-threaded tasks to be executed according to an embodiment of the present invention.
[0075] like Figure 3 As shown, step 1300 includes the following steps:
[0076] S1310, establishing a to-be-executed task for executing the at least two to-be-executed multi-threaded tasks through a thread;
[0077] A thread is a single sequential control flow in an application. There is a relatively independent and schedulable execution unit in a process, which is the basic unit for the system to independently schedule and dispatch CPU instructions. Running multiple threads simultaneously in a single program to complete different tasks is called multithreading. By establishing a pending task to execute the pending multithreaded task, the overseas holding valuation accounting process and other task operations can be asynchronously performed simultaneously.
[0078] S1320: Prioritize executing the tasks to be executed according to preset task execution rules.
[0079] Task execution rules are preset by the system to give priority to pending tasks. When the system executes pending multi-threaded tasks, it can establish pending tasks through threads to give priority to the pending multi-threaded tasks, so as to give priority to completing the corresponding valuation and accounting processes. During implementation, CountDownLatch can be used to control the pending multi-threaded tasks, so as to complete the corresponding overseas holding valuation and accounting processes.
[0080] In an alternative embodiment, see Figure 4 , Figure 4 It is a basic flow chart of an embodiment of the present invention for preferentially executing multi-threaded tasks to be executed.
[0081] like Figure 4 As shown, step 1320 includes the following steps:
[0082] S1321, detecting whether there is an operation task with a higher priority than the task to be executed in the task queue after the task to be executed;
[0083] The task queue is a collection of all pending operation tasks in the system. Multiple (for example, 3, 5 or 8) operation tasks are stored in the task queue. These operation tasks are all set with corresponding priorities. Priority is a parameter that determines the priority level of each operation program receiving system resources when the computer time-sharing operating system processes multiple operation programs. Among them, the high priority is done first, and the low priority is done later. The system automatically detects the priority of each operation task in the task queue, and compares the priority of the operation task with the priority of the task to be executed to determine whether the priority of the operation task is higher than the priority of the task to be executed.
[0084] S1322. When there is an operation task in the task queue whose priority is higher than that of the task to be executed, the priority of the task to be executed is set to be higher than that of the operation task, so that the task to be executed is executed first and then the operation task is called back to execute after the task to be executed is completed.
[0085] When the priority of an operation task is higher than that of the task to be executed, the system will reset the priority of the task to be executed, so that the priority of the task to be executed is higher than that of the operation task. The system will execute in descending order after the priority is reset, so as to give priority to the task to be executed until the task to be executed is completed, and then execute other operation tasks, so as to give priority to completing the corresponding valuation and accounting process.
[0086] In an optional embodiment, the valuation and accounting process can also be polled periodically to automatically detect the progress of the valuation and accounting process. Figure 5 , Figure 5 It is a basic flow chart of the process of detecting the valuation calculation process according to an embodiment of the present invention.
[0087] like Figure 5 As shown, after step S1300, the following steps are also included:
[0088] S1400, obtaining a polling detection data packet sent by the front end according to a preset heartbeat detection mechanism;
[0089] During the overseas holding valuation and accounting process, the system also performs polling detection of the accounting process of the overseas holding valuation and accounting process through the polling detection data packet sent by the front end, wherein the front end refers to the application corresponding to the server to display the display interface to the user and provide local services to the user; the heartbeat detection mechanism is a mechanism that sends a custom structure (heartbeat packet) at a regular interval to let the other party know that it is still alive to ensure the validity of the connection. For example: if the user sets the heartbeat, the number of heartbeats set by the user (for example, 2 times) will be sent within a certain period of time (for example, 3 seconds), and this information will not affect the protocol defined between the front end and the server. For example, the front end sends a custom structure (heartbeat packet or heartbeat frame) at a regular interval to let the server know that the front end is online to ensure the validity of the link between the front end and the server; taking the overseas holding valuation process control method of the present invention applied to the server as an example, the polling detection data packet is the detection instruction data sent by the front end to the server for detecting the execution progress of the multi-threaded task to be executed by the server.
[0090] S1500, detecting the execution status of the at least two to-be-executed multi-threaded tasks according to the polling detection data packet, generating feedback information, and sending the feedback information to the front end.
[0091] After the system receives the polling detection data packet sent by the front end, it detects the execution status of multiple multi-threaded tasks to be executed according to the polling detection data packet, and then generates feedback information and sends the feedback information to the front end, so that the front end and the user can obtain the progress of the valuation and accounting process and the time node of completion. In one embodiment, taking the application of the overseas holding valuation process control method of the present invention to the server side as an example, after receiving the polling detection data packet sent by the front end according to the heartbeat mechanism, the server side automatically detects the execution progress of the valuation and accounting process on the server side, and then generates feedback information after the valuation and accounting process is completed and sends it to the front end, automatically detecting the execution progress of the valuation and accounting process and improving the user experience.
[0092] In an optional embodiment, when executing multi-threaded tasks, the time required for the overseas holding valuation process to be completed can also be displayed in the front end, so that users can intuitively understand the valuation time. Please refer to Figure 6 , Figure 6 It is a basic flow chart showing the execution time of multi-threaded tasks according to an embodiment of the present invention.
[0093] like Figure 6 As shown, step S1300 also includes the following steps:
[0094] S1330, obtaining computing power information of the computer device executing the corresponding computing power operation;
[0095] Computer equipment refers to electronic equipment that executes the overseas holding valuation process. In one embodiment, taking the computer equipment as a background server as an example, the system obtains the CPU resource occupancy value, memory resource occupancy value and GPU resource occupancy value of the background server, and calculates the computing power of the computer equipment based on the CPU resource occupancy value, memory resource occupancy value and GPU resource occupancy value to generate computing power information.
[0096] S1340. Calculate the time information required to execute the at least two multi-threaded tasks to be executed according to the computing power information.
[0097] After obtaining the computing power information of the computer device, the system can calculate the time information required for the computer device to complete the execution of at least two multi-threaded tasks to be executed according to the computing power information, and display the time information to the user through the front end. During implementation, the execution status of the at least two multi-threaded tasks to be executed can be obtained, and integrated with the time information to generate a valuation process progress bar for display to the user, so that the user can directly obtain the progress of the completion of the multi-threaded tasks to be executed, so as to know the completion status of the overseas holding valuation process. During implementation, it is also possible to collect the operation data of multiple (for example, 3, 5 or 9) devices in a preset area, and then use the preset strategy to determine whether there is one or more devices with available idle computing power among the multiple devices. When there is one or more devices with available idle computing power, the available idle computing power of the one or more devices is integrated to form a computing power reserve pool, and the computing power reserve pool is connected to the system to perform the corresponding computing power operation of the overseas holding valuation process, thereby improving the accounting efficiency of the overseas holding valuation process.
[0098] In order to solve the above technical problems, an embodiment of the present invention further provides an overseas holding valuation process control device.
[0099] Please refer to Figure 7 , Figure 7 Schematic diagram of the basic structure of the overseas holding valuation process control device of this embodiment.
[0100] like Figure 7 As shown, a device for controlling an overseas holding valuation process includes: a first acquisition module 2100, a first processing module 2200 and a first execution module 2300, wherein the first acquisition module 2100 is used to acquire a preset target thread task, wherein the target thread task is used to execute the overseas holding valuation accounting process; the first processing module 2200 is used to concurrently execute the target thread task according to a preset multi-thread concurrency rule to generate at least two multi-thread tasks to be executed; the first execution module 2300 is used to sequentially execute the at least two multi-thread tasks to be executed until all the multi-thread tasks to be executed are executed.
[0101] This embodiment obtains a target thread task, which is used to execute the overseas holding valuation and accounting process, and then performs multi-threaded concurrent execution of the target thread task according to the multi-threaded concurrency rule to generate multiple multi-threaded tasks to be executed, and executes the multi-threaded tasks to be executed in sequence until all the multi-threaded tasks to be executed are completed. This embodiment quickly responds to front-end operations by performing multi-threaded concurrent execution of the overseas holding valuation and accounting process, and provides a friendly user experience.
[0102] In some embodiments, the overseas holding valuation process control device also includes: a second acquisition module, a comparison module and a second execution module, wherein the second acquisition module is used to obtain the ratio of used CPU resources to total CPU resources; the comparison module is used to compare the ratio with a preset proportion threshold; the second execution module is used to execute the at least two multi-threaded tasks to be executed when the ratio is less than the proportion threshold.
[0103] In some embodiments, the overseas holding valuation process control device also includes: a thread creation submodule and a first execution submodule, wherein the thread creation module is used to establish a to-be-executed task for executing the at least two to-be-executed multi-threaded tasks through a thread; and the first execution submodule is used to prioritize the execution of the to-be-executed tasks according to preset task execution rules.
[0104] In some embodiments, the overseas holding valuation process control device also includes: a detection submodule and a second execution submodule, wherein the detection submodule is used to detect whether there is an operation task with a higher priority than the task to be executed in the task queue after the task to be executed; the second execution submodule is used to set the priority of the task to be executed to be higher than the priority of the operation task when there is an operation task with a higher priority than the task to be executed in the task queue, so that the task to be executed is executed first until the operation task is called back to execute after the task to be executed is completed.
[0105] In some embodiments, the overseas holding valuation process control device also includes: a third acquisition module and a third execution module, wherein the third execution module is used to obtain a polling detection data packet sent by the front end according to a preset heartbeat detection mechanism; the third execution module is used to detect the execution status of the at least two multi-threaded tasks to be executed according to the polling detection data packet and generate feedback information and send it to the front end.
[0106] In some embodiments, the overseas holding valuation process control device also includes: a first acquisition submodule and a third execution submodule, wherein the first acquisition submodule is used to obtain computing power information of the computer device performing corresponding computing power operations; the second execution submodule is used to calculate the time information required to execute the at least two multi-threaded tasks to be executed based on the computing power information.
[0107] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0108] To solve the above technical problems, the embodiment of the present invention also provides a computer device. Figure 8 , Figure 8 This is a basic structural block diagram of the computer device in this embodiment.
[0109] like Figure 8 As shown in Figure 1, the internal structure diagram of a computer device. Figure 8 As shown, the computer device includes a processor, a non-volatile storage medium, a memory, and a network interface connected through a system bus. Among them, the non-volatile storage medium of the computer device stores an operating system, a database, and a computer-readable instruction. The database may store a control information sequence. When the computer-readable instruction is executed by the processor, the processor can implement a method for controlling an overseas holding valuation process. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instruction is executed by the processor, the processor can execute a method for controlling an overseas holding valuation process. The network interface of the computer device is used to connect and communicate with the terminal. It can be understood by those skilled in the art that the structure shown in the figure is only a block diagram of a partial structure related to the present application scheme, and does not constitute a limitation on the computer device to which the present application scheme is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0110] In this embodiment, the processor is used to execute Figure 7 The first acquisition module 2100, the first processing module 2200 and the first execution module 2300 are stored in the memory, and the program code and various data required to execute the above modules are stored. The network interface is used to transmit data between the user terminal or the server. The memory in this embodiment stores the program code and data required to execute all sub-modules in the overseas holding valuation process control device, and the server can call the program code and data of the server to execute the functions of all sub-modules.
[0111] The computer obtains a target thread task, which is used to execute the overseas holding valuation and accounting process, and then performs multi-threaded concurrent execution of the target thread task according to the multi-threaded concurrency rule to generate multiple multi-threaded tasks to be executed, and executes the multi-threaded tasks to be executed in sequence until all the multi-threaded tasks to be executed are completed. This embodiment quickly responds to front-end operations by executing the overseas holding valuation and accounting process in multi-threaded concurrent execution, and provides a friendly user experience.
[0112] The present invention also provides a storage medium storing computer-readable instructions, which, when executed by one or more processors, enables the one or more processors to execute the steps of the overseas holding valuation process control method described in any of the above embodiments.
[0113] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0114] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0115] The above descriptions are only some embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for controlling the process of overseas holding valuation, characterized in that: The steps include: Obtaining a preset target thread task, wherein the target thread task is used to execute an overseas holding valuation and accounting process; Concurrently executing the target thread task according to a preset multi-thread concurrency rule to generate at least two multi-thread tasks to be executed, where the multi-thread tasks to be executed are used to perform computing operations of the overseas holding valuation process; The at least two multi-threaded tasks to be executed are executed in sequence until all the multi-threaded tasks to be executed are completed, wherein during the execution of the at least two multi-threaded tasks to be executed, the following steps are performed: Obtain computing power information for executing corresponding computing power operations and execution status of the at least two multi-threaded tasks to be executed; Calculate the time information required to execute the at least two multi-threaded tasks to be executed according to the computing power information; The execution status and the time information are integrated to generate a valuation process progress bar for display to the user, wherein the computing power operation for realizing multi-threaded concurrent execution of target thread tasks has no effect on the operation of the display interface.
2. The overseas holding valuation process control method according to claim 1, characterized in that: Before the step of sequentially executing the at least two multi-threaded tasks to be executed until all the multi-threaded tasks to be executed are completed, the following steps are also included: Get the ratio of used CPU resources to total CPU resources; Comparing the ratio with a preset percentage threshold; When the ratio is less than the proportion threshold, the at least two multi-threaded tasks to be executed are executed.
3. The overseas holding valuation process control method according to claim 1 is characterized in that: The step of sequentially executing the at least two multi-threaded tasks to be executed until all the multi-threaded tasks to be executed are completed comprises the following steps: Establishing a task to be executed by a thread to execute the at least two multi-threaded tasks to be executed; The tasks to be executed are executed preferentially according to the preset task execution rules.
4. The overseas holding valuation process control method according to claim 3 is characterized in that: The step of preferentially executing the tasks to be executed according to the preset task execution rules comprises the following steps: Detect whether there is an operation task with a higher priority than the task to be executed in the task queue after the task to be executed; When there is an operation task with a higher priority than the task to be executed in the task queue, the priority of the task to be executed is set higher than the priority of the operation task, so that the task to be executed is executed first and then the operation task is called back to execute after the task to be executed is completed.
5. The overseas holding valuation process control method according to claim 1, characterized in that: After the step of sequentially executing the at least two multi-threaded tasks to be executed until all the multi-threaded tasks to be executed are completed, the following steps are also included: Get the polling detection data packet sent by the front end according to the preset heartbeat detection mechanism; The execution status of the at least two to-be-executed multi-threaded tasks is detected according to the polling detection data packet, and feedback information is generated and sent to the front end.
6. An overseas holding valuation process control device, characterized in that: include: A first acquisition module is used to acquire a preset target thread task, wherein the target thread task is used to execute an overseas holding valuation and accounting process; A first processing module, configured to concurrently execute the target thread task according to a preset multi-thread concurrent rule to generate at least two multi-thread tasks to be executed, wherein the multi-thread tasks to be executed are used to perform computing operations of an overseas holding valuation process; The first execution module is used to execute the at least two multi-threaded tasks to be executed in sequence until all the multi-threaded tasks to be executed are completed, wherein the first execution module performs the following steps during the execution of the at least two multi-threaded tasks to be executed: Obtain computing power information for executing corresponding computing power operations and execution status of the at least two multi-threaded tasks to be executed; Calculate the time information required to execute the at least two multi-threaded tasks to be executed according to the computing power information; The execution status and the time information are integrated to generate a valuation process progress bar for display to the user, wherein the computing power operation for realizing multi-threaded concurrent execution of target thread tasks has no influence on the displayed interface.
7. The overseas holding valuation process control device according to claim 6, characterized in that: Also includes: The second acquisition module is used to obtain the ratio of the used CPU resources to the total CPU resources; A comparison module, used for comparing the ratio with a preset proportion threshold; The second execution module is used to execute the at least two multi-threaded tasks to be executed when the ratio is less than the proportion threshold.
8. The overseas holding valuation process control device according to claim 6, characterized in that: Also includes: A thread creation submodule, used for establishing a to-be-executed task for executing the at least two to-be-executed multi-threaded tasks through a thread; The first execution submodule is used to preferentially execute the tasks to be executed according to preset task execution rules.
9. A computer device comprising a memory and a processor, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the processor executes the steps of the overseas holding valuation process control method as claimed in any one of claims 1 to 5.
10. A storage medium storing computer-readable instructions, wherein when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the overseas holding valuation process control method as claimed in any one of claims 1 to 5.
Citation Information
Patent Citations
Multi-thread concurrent system
CN106325980A
Resource application method and apparatus based on idle computing power in region, and computing device
CN108595266A
Memory access method for parallel computing
US20130061018A1
