A single-thread instruction center multi-thread control optimization processing method, device and terminal

By constructing a thread pool and a state dictionary, the multi-threaded control method of the single-threaded instruction center is optimized, which solves the problem that the single-threaded instruction center cannot support multi-threaded and concurrent operations, realizes efficient concurrent operations and timing management, and improves the user experience.

CN115509697BActive Publication Date: 2026-05-01OCEAN UNIV OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
OCEAN UNIV OF CHINA
Filing Date
2022-11-01
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing technologies, single-threaded instruction centers cannot support multi-threaded control and concurrent operations, resulting in low control system efficiency and poor user experience.

Method used

By constructing a thread pool and a thread state dictionary, the system receives concurrent operation commands, determines whether the device has other operation commands, executes the latest command, and clears invalid commands, thereby achieving multi-threaded control optimization processing in a single-threaded command center.

Benefits of technology

It ensures the normal operation of the single-threaded command center, supports concurrent operations, solves the timing problem of concurrent operations, and improves control efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115509697B_ABST
    Figure CN115509697B_ABST
Patent Text Reader

Abstract

The application relates to a single-thread instruction center multi-thread control optimization processing method and device, and belongs to the technical field of multi-thread control optimization processing. Whether the device operated by a current operation instruction is online is judged. Whether the device operated by the current operation instruction has other operation instructions for the device in a thread result dictionary and whether the device operated by the current operation instruction has other operation instructions for the device in a thread state dictionary. The normal operation of the single-thread instruction center control instruction can be guaranteed, the concurrent operation of a user can be supported, the concurrent operation timing problem can be solved, the latest effective operation instruction can be guaranteed to be executed, and if a subsequent instruction has been executed, the previous invalid instruction is emptied, the concurrent operation timing problem of the single-thread instruction center multi-thread control optimization processing is solved, and the single-thread instruction center multi-thread control optimization processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of multi-threaded control optimization processing technology, and in particular to a multi-threaded control optimization processing method, apparatus and terminal of a single-threaded instruction center. Background Technology

[0002] Currently, due to issues with the control center or chips in some devices, the command center used only supports single-threaded control commands and does not support multiple operation commands simultaneously. Although single-threaded operation of a single-threaded command center can ensure the normal operation of the command center, single-threaded operation will result in the user end not supporting concurrent operations, leading to a poor user experience and low efficiency. Therefore, there is an urgent need to propose a multi-threaded control efficiency improvement method for single-threaded control centers, which solves the problem of low control efficiency in control systems that only support single-threaded command operations, and also solves the problem that control systems that only support single-threaded command operations cannot support multi-threaded control and scheduling, as well as the problem of repeated screen flickering during concurrent operations. Summary of the Invention

[0003] This application provides a method, apparatus, and terminal for optimizing multi-threaded control in a single-threaded instruction center. This method ensures that the control instructions in the single-threaded instruction center operate normally without interfering with each other, supports concurrent user operations, and solves problems related to concurrent operation timing and screen flickering, thereby improving control efficiency and user experience.

[0004] The technical solution of this application is as follows:

[0005] According to a first aspect of the embodiments of this application, a multi-threaded control optimization processing method for a single-threaded instruction center is provided, comprising:

[0006] Receive concurrent operation instructions input by the user and distribute the concurrent operation instructions to each thread in the thread pool, wherein the concurrent operation instructions carry time information;

[0007] Determine whether the device operated by the current operation instruction has other operation instructions for the device in the thread result dictionary;

[0008] If there are no other operation instructions for the device in the thread result dictionary, then determine whether the device operated by the current operation instruction has other operation instructions for the device in the thread state dictionary.

[0009] If the device operated by the current operation instruction does not have other operation instructions for the device in the thread state dictionary, then the current operation instruction is executed and the current operation instruction information is written into the thread state dictionary.

[0010] Optionally, the concurrent operation instructions include username, operation time, and operation instructions. The concurrent operation instructions include different concurrent operations issued by the same user to multiple different devices and different concurrent operations issued by different users to one or more different devices.

[0011] Optionally, the step of determining whether the device operated by the current operation instruction has other operation instructions for the device in the thread result dictionary further includes:

[0012] If there are other operation instructions for the device in the thread result dictionary, then determine whether the instruction time of the other operation instructions for the device in the thread result dictionary is later than the instruction time of the current operation instruction.

[0013] If the instruction time of other operation instructions for the device in the thread result dictionary is later than the instruction time of the current operation instruction, then determine whether the operation result of the other operation instructions for the device in the thread result dictionary is executed normally.

[0014] If the result of other operation instructions for the device in the thread result dictionary is normal execution, then return directly and end the execution of the current operation instruction;

[0015] If the result of other operation instructions for the device in the thread result dictionary is failure, then it is determined whether the device operated by the current operation instruction has other operation instructions for the device in the thread state dictionary.

[0016] Optionally, the step of determining whether the instruction times of other operation instructions for the device existing in the thread result dictionary are later than the instruction times of the current operation instruction further includes:

[0017] If the instruction time of any other operation instruction for the device existing in the thread result dictionary is not later than the instruction time of the current operation instruction, then the other operation instructions for the device existing in the thread result dictionary will be executed normally and the execution of the current operation instruction will end.

[0018] Optionally, the step of determining whether the device operated by the current operation instruction has other operation instructions for the device in the thread state dictionary further includes:

[0019] If the device operated by the current operation instruction has other operation instructions for the device in the thread state dictionary, then determine whether the operation time of the other operation instructions for the device in the thread state dictionary is later than the instruction time of the current operation instruction.

[0020] If the operation time of other operation instructions for the device operated by the current operation instruction is later than the instruction time of the current operation instruction, then wait for the execution result of the other operation instructions for the device that exist in the thread state dictionary;

[0021] If the execution result of other operation instructions for the device in the thread state dictionary is unsuccessful, or if the operation time of other operation instructions for the device operated by the current operation instruction is earlier than the instruction time of the current operation instruction, then the current operation instruction is executed and the current operation instruction information is written into the thread state dictionary.

[0022] If the execution result of other operation instructions for the device that exist in the thread state dictionary is successful, return directly and end the execution of the current operation instruction.

[0023] Optionally, the execution result of other operation instructions for the device existing in the thread state dictionary as "execution unsuccessful" means that the other operation instructions for the device existing in the thread state dictionary that are currently being executed were not completed within the valid time and were forcibly terminated.

[0024] Optionally, the instruction to execute the current operation includes:

[0025] The current operation instruction is split into multiple concurrent operation commands that can be executed only after multiple control requests are made;

[0026] Multiple concurrent operation commands are sent one by one to the corresponding request control party. If most concurrent operation commands are sent successfully, the status flag of the corresponding instruction sending module is set to "in use" and the module waits for the processing result returned by the device control center.

[0027] If the processing result of the concurrent operation command is received from the device control center, the remaining concurrent operation commands among the multiple concurrent operation commands are sent sequentially.

[0028] If all concurrent operation commands are completed or any of the concurrent operation commands fail to execute, the execution of the concurrent operation commands will end, the usage status flag of the instruction sending module will be set to unused, and the current operation instruction information will be removed from the thread status dictionary.

[0029] Optionally, if the current operation instruction is executed successfully, the thread execution result of the current operation instruction is added to the thread result dictionary; if the current operation instruction is executed abnormally, the thread execution result of the current operation instruction is removed from the thread result dictionary.

[0030] According to a second aspect of the embodiments of this application, a multi-threaded control optimization processing apparatus with a single-threaded instruction center is provided, comprising:

[0031] The receiving module is used to receive concurrent operation instructions input by the user and distribute the concurrent operation instructions to each thread in the thread pool, wherein the concurrent operation instructions carry time information;

[0032] The first judgment module is used to determine whether the device operated by the current operation instruction has other operation instructions for the device in the thread result dictionary;

[0033] The second judgment module is used to determine whether the device operated by the current operation instruction has other operation instructions for the device in the thread state dictionary if there are no other operation instructions for the device in the thread result dictionary.

[0034] The execution module is used to execute the current operation instruction and write the current operation instruction information into the thread state dictionary if there are no other operation instructions for the device operated by the current operation instruction in the thread state dictionary.

[0035] According to a third aspect of the embodiments of this application, a terminal is provided, comprising: a processor, and a memory communicatively connected to the processor;

[0036] The memory stores computer-executed instructions;

[0037] The processor executes computer execution instructions stored in the memory to implement the method provided in the first aspect.

[0038] Beneficial effects:

[0039] This application discloses a multi-threaded control optimization method for a single-threaded instruction center. By determining whether the device operated by the current operation instruction has other operation instructions for that device in the thread result dictionary and whether the device operated by the current operation instruction has other operation instructions for that device in the thread state dictionary, it can ensure that the normal operation of the single-threaded instruction center control instructions does not affect each other, support concurrent user operations, solve concurrent operation timing problems, ensure the execution of the latest valid operation instructions, and clear and discard previous invalid instructions if subsequent instructions have been executed. This solves the concurrent operation timing problem in the multi-threaded control optimization processing of the single-threaded instruction center and improves the efficiency of multi-threaded control optimization processing of the single-threaded instruction center.

[0040] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0041] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application, and do not constitute an undue limitation of this application.

[0042] Figure 1 This is a flowchart illustrating a multi-threaded control optimization processing method for a single-threaded instruction center provided by this application, according to an exemplary embodiment.

[0043] Figure 2 This is an execution flowchart illustrating a multi-threaded control optimization processing method for a single-threaded instruction center according to an exemplary embodiment;

[0044] Figure 3 This is a schematic diagram illustrating the structure of a multi-threaded control optimization processing device with a single-threaded instruction center according to an exemplary embodiment. Detailed Implementation

[0045] To enable those skilled in the art to better understand the technical solutions of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0046] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0047] Currently, due to issues with some device control centers or chips, the instruction centers used only support single-threaded control instructions and do not support multiple operation instructions simultaneously. Although single-threaded operation of a single-threaded instruction center can ensure the normal operation of the instruction center, single-threaded operation will result in the user end not supporting concurrent operations, leading to a poor user experience and low efficiency. To solve this technical problem, this embodiment of the invention constructs a thread pool for concurrent user operations of a single-threaded instruction center. The thread pool sets the core thread count X and the maximum thread count Y. At the same time, a thread state dictionary and a thread result dictionary are constructed. The thread state dictionary (map dictionary) in the thread state holder ThreadStatusHolder is shown in Table 1 below. This map dictionary records the operating device that is processing the instruction, the thread in the thread pool that is processing the user instruction, and the time of the instruction.

[0048] Table 1: The map dictionary in the ThreadStatusHolder thread status dictionary

[0049] Operating equipment time Equipment A (Thread a, Time) Equipment B (Thread d, Time) Equipment C (Thread c, Time)

[0050] The thread result dictionary (resultMap dictionary) in the ThreadStatusHolder is shown in the table below. This thread result dictionary records the latest instruction completion time of each device, as well as the threads and results in the thread pool that processed the user instructions.

[0051] Table 2: Thread Result Dictionary in ThreadStatusHolder

[0052]

[0053]

[0054] Figure 1 This is a flowchart illustrating a multi-threaded control optimization processing method for a single-threaded instruction center, provided as an exemplary embodiment of this application. Figure 1 As shown, the specific steps of the multi-threaded control optimization method of this single-threaded instruction center are as follows:

[0055] Step 110: Receive concurrent operation instructions input by the user and distribute the concurrent operation instructions to each thread in the thread pool, wherein the concurrent operation instructions carry time information.

[0056] The concurrent operation commands input by the user include the username, operation time, and operation command. These concurrent operation commands include different concurrent operations issued by the same user on multiple different devices, and different concurrent operations issued by different users on one or more different devices. The concurrent operation commands input by the user enable one user to operate multiple devices simultaneously or multiple users to issue different operation commands to the same device. For example, this allows for concurrent operations by multiple users or the same user on three-screen or four-screen devices. Example concurrent operation commands input by the user are shown in Table 3 below:

[0057] Table 3: User-inputted concurrent operation commands

[0058]

[0059]

[0060] After receiving the concurrent operation command input by the user, the concurrent operation command is distributed to each thread in the thread pool (prepared in advance). The distributed concurrent operation command carries time information, and the format can be: (command, time). After the distribution is completed, wait for the system to return the corresponding concurrent operation command processing result.

[0061] Step 120: Determine whether the device operated by the current operation instruction has other operation instructions for the device in the thread result dictionary.

[0062] Step 130: If there are no other operation instructions for the device in the thread result dictionary, then determine whether the device operated by the current operation instruction has other operation instructions for the device in the thread state dictionary.

[0063] Step 140: If the device operated by the current operation instruction does not have other operation instructions for the device in the thread state dictionary, then execute the current operation instruction and write the current operation instruction information into the thread state dictionary.

[0064] This application discloses a multi-threaded control optimization method for a single-threaded instruction center. By determining whether the device operated by the current operation instruction has other operation instructions for that device in the thread result dictionary and whether the device operated by the current operation instruction has other operation instructions for that device in the thread state dictionary, it can ensure that the normal operation of the single-threaded instruction center control instructions does not affect each other, support concurrent user operations, solve concurrent operation timing problems, ensure the execution of the latest valid operation instructions, and clear and discard previous invalid instructions if subsequent instructions have been executed. This solves the concurrent operation timing problem in the multi-threaded control optimization processing of the single-threaded instruction center and improves the efficiency of multi-threaded control optimization processing of the single-threaded instruction center.

[0065] refer to Figure 2 As shown in the figure, the specific execution process of a multi-threaded control optimization processing method for a single-threaded instruction center provided by this embodiment of the invention is as follows:

[0066] Step 201: Receive concurrent operation instructions input by the user and distribute the concurrent operation instructions to each thread in the thread pool, wherein the concurrent operation instructions carry time information.

[0067] Step 202: Determine whether the device operated by the current operation instruction has other operation instructions for the device in the thread result dictionary;

[0068] Step 203: If there are no other operation instructions for the device in the thread result dictionary, then determine whether the device operated by the current operation instruction has other operation instructions for the device in the thread state dictionary.

[0069] Step 204: If there are other operation instructions for the device in the thread result dictionary, determine whether the instruction time of the other operation instructions for the device in the thread result dictionary is later than the instruction time of the current operation instruction.

[0070] Step 205: If the instruction time of other operation instructions for the device in the thread result dictionary is later than the instruction time of the current operation instruction, then determine whether the operation result of the other operation instructions for the device in the thread result dictionary is executed normally.

[0071] Step 206: If the operation result of other operation instructions for the device in the thread result dictionary is normal execution, then return directly and end the execution of the current operation instruction.

[0072] It should be noted that if the operation results of other operation instructions for the device in the thread result dictionary are executed normally, it indicates that other instructions after the current operation instruction have been executed successfully, and the process will return directly without performing any device operation.

[0073] Step 207: If the operation result of other operation instructions for the device in the thread result dictionary is failure, then determine whether the device operated by the current operation instruction has other operation instructions for the device in the thread state dictionary.

[0074] Step 208: If the instruction time of other operation instructions for the device existing in the thread result dictionary is not later than the instruction time of the current operation instruction, then the other operation instructions for the device existing in the thread result dictionary are executed normally and the execution of the current operation instruction ends.

[0075] Step 209: If the device operated by the current operation instruction has other operation instructions for the device in the thread state dictionary, then determine whether the operation time of the other operation instructions for the device operated by the current operation instruction in the thread state dictionary is later than the instruction time of the current operation instruction.

[0076] Step 210: If the operation time of other operation instructions for the device operated by the current operation instruction exists in the thread state dictionary and is later than the instruction time of the current operation instruction, then wait for the execution result of the other operation instructions for the device that exist in the thread state dictionary.

[0077] In other words, if the device operated by the current operation instruction has other operation instructions for that device in the thread state dictionary with operation times later than the current operation instruction, it means that the other instructions being executed are later than the current operation instruction. In this case, wait for the execution result of the other instructions being executed (with a limit on the number of times and time to wait). If the instructions being executed are successful within the valid time, return directly without performing the device operation of the current operation instruction. If the execution is unsuccessful, continue to wait. If the execution is not completed within the valid time, forcibly terminate the instructions being executed and report that the execution result of the other instructions being executed is abnormal.

[0078] Step 211: If the execution result of other operation instructions for the device in the thread state dictionary is unsuccessful, or if the operation time of other operation instructions for the device operated by the current operation instruction is earlier than the instruction time of the current operation instruction, then execute the current operation instruction and write the current operation instruction information into the thread state dictionary.

[0079] Among them, the execution result of other operation instructions for the device that exist in the thread state dictionary is "execution unsuccessful" means that the execution of other operation instructions for the device that exist in the thread state dictionary that are currently being executed is not completed within the valid time and is forcibly terminated.

[0080] Step 212: If the execution result of other operation instructions for the device that exist in the thread state dictionary is successful, return directly and end the execution of the current operation instruction.

[0081] Step 213: If the device operated by the current operation instruction does not have other operation instructions for the device in the thread state dictionary, then execute the current operation instruction and write the current operation instruction information into the thread state dictionary.

[0082] The execution of the current operation instruction includes: splitting the current operation instruction into multiple concurrent operation commands that can be executed by multiple control requesters; sending each of the multiple concurrent operation commands to the corresponding requesting control party one by one; if most of the concurrent operation commands are sent successfully, setting the usage status flag of the corresponding instruction sending module to "in use" and waiting for the processing result returned by the device control center; if the processing result of the concurrent operation command returned by the device control center is received, then the remaining concurrent operation commands among the multiple concurrent operation commands are sent sequentially; if all concurrent operation commands are executed or any of the concurrent operation commands are executed abnormally, then the execution of the concurrent operation commands is terminated, the usage status flag of the instruction sending module is set to "unused," and the current operation instruction information is removed from the thread status dictionary.

[0083] This embodiment of the invention ensures single-threaded instruction sending by setting a usage status flag for the instruction sending module, while also maximizing the utilization rate of the single-threaded instruction sending.

[0084] If the device operated by the current operation instruction does not have other operation instructions for the device in the thread state dictionary, then the current operation instruction is executed. The same current operation instruction needs to be split into multiple control requests to execute concurrent operation commands. For example, a four-screen split needs to be split into four screens, the creation of four screen windows, and the corresponding signal source address of each screen window, etc., which are nearly ten instruction requests.

[0085] If the current operation instruction is executed successfully, the thread execution result of the current operation instruction is added to the thread result dictionary; if the current operation instruction is executed abnormally, the thread execution result of the current operation instruction is removed from the thread result dictionary. After the abnormal or normal concurrent operation command set ends, the information of that device and that thread at that time is removed from the thread state dictionary, and the thread result related to that device is forcibly removed from the thread result dictionary, and the thread result is added to the thread result dictionary to ensure that the thread result dictionary always contains the latest processing result for a certain device.

[0086] This application discloses a multi-threaded control optimization method for a single-threaded instruction center. By determining whether the device operated by the current operation instruction has other operation instructions for that device in the thread result dictionary and whether the device operated by the current operation instruction has other operation instructions for that device in the thread state dictionary, it can ensure that the normal operation of the single-threaded instruction center control instructions does not affect each other, support concurrent user operations, solve concurrent operation timing problems, ensure the execution of the latest valid operation instructions, and clear and discard previous invalid instructions if subsequent instructions have been executed. This solves the concurrent operation timing problem in the multi-threaded control optimization processing of the single-threaded instruction center and improves the efficiency of multi-threaded control optimization processing of the single-threaded instruction center.

[0087] Figure 3 This is a schematic diagram of a multi-threaded control optimization processing apparatus for a single-threaded instruction center, provided as an exemplary embodiment of this application. The multi-threaded control optimization processing apparatus for a single-threaded instruction center provided in this embodiment can execute the processing flow provided in an embodiment of a multi-threaded control optimization processing method for a single-threaded instruction center. For example... Figure 3 As shown, the multi-threaded control optimization processing device 30 of the single-threaded instruction center provided in this application includes:

[0088] The receiving module 301 is used to receive concurrent operation instructions input by the user and distribute the concurrent operation instructions to each thread in the thread pool, wherein the concurrent operation instructions carry time information;

[0089] The first judgment module 302 is used to determine whether the device operated by the current operation instruction has other operation instructions for the device in the thread result dictionary;

[0090] The second judgment module 303 is used to determine whether the device operated by the current operation instruction has other operation instructions for the device in the thread state dictionary if there are no other operation instructions for the device in the thread result dictionary.

[0091] The execution module 304 is configured to execute the current operation instruction and write the current operation instruction information into the thread state dictionary if there are no other operation instructions for the device operated by the current operation instruction in the thread state dictionary.

[0092] The apparatus provided in this application embodiment can be specifically used to perform the above-described... Figure 1 and Figure 2 The specific functions and technical effects of the solutions provided in the corresponding method embodiments will not be elaborated here.

[0093] This invention also provides a terminal comprising: a processor, and a memory communicatively connected to the processor;

[0094] The memory stores instructions that the computer executes;

[0095] The processor executes computer execution instructions stored in the memory to implement the solution provided in any of the above method embodiments; the specific functions and technical effects achieved are not elaborated here. The electronic device can be the server mentioned above.

[0096] This application also provides a computer-readable storage medium storing computer-executable instructions. When executed by a processor, the computer-executable instructions are used to implement the solution provided in any of the above method embodiments. The specific functions and technical effects to be achieved are not described here.

[0097] This application also provides a computer program product, which includes a computer program stored in a readable storage medium. At least one processor of the electronic device can read the computer program from the readable storage medium. The at least one processor executes the computer program to cause the electronic device to perform the solution provided in any of the above method embodiments. The specific functions and technical effects that can be achieved are not described here.

[0098] The application scenarios described in this application are for the purpose of more clearly illustrating the technical solutions of this application, and do not constitute a limitation on the technical solutions provided in this application. As those skilled in the art will know, with the emergence of new application scenarios, the technical solutions provided in this application are also applicable to similar technical problems.

[0099] Those skilled in the art will understand that various aspects of this application can be implemented as a system, method, or program product. Therefore, various aspects of this application can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, collectively referred to herein as a "circuit," "module," or "system."

[0100] In some possible implementations, the electronic device according to this application may include at least one processor and at least one memory. The memory stores program code that, when executed by the processor, causes the processor to perform the operational data management methods according to the various exemplary embodiments of this application described above. For example, the processor may perform steps such as those in the operational data management method.

[0101] It should be noted that although several units or sub-units of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.

[0102] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0103] 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.

[0104] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will 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 image scaling device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable image scaling device, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0105] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable image scaling device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0106] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0107] 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 multi-threaded control optimization method for a single-threaded instruction center, characterized in that, The multi-threaded control optimization method includes: Receive concurrent operation instructions input by the user and distribute the concurrent operation instructions to each thread in the thread pool, wherein the concurrent operation instructions carry time information; Determine whether the device operated by the current operation instruction has other operation instructions for the device in the thread result dictionary; If there are no other operation instructions for the device in the thread result dictionary, then it is determined whether the device operated by the current operation instruction has other operation instructions for the device in the thread state dictionary. The thread state dictionary records the operating device that is processing the instruction, the thread in the thread pool that processes its user instruction, and the time of the instruction. The thread result dictionary records the latest instruction time of each device, the thread in the thread pool that processes its user instruction, and the result. If the device operated by the current operation instruction does not have other operation instructions for the device in the thread state dictionary, then the current operation instruction is executed and the current operation instruction information is written into the thread state dictionary; The step of determining whether the device operated on by the current operation instruction has other operation instructions for that device in the thread result dictionary, further includes: If there are other operation instructions for the device in the thread result dictionary, then determine whether the instruction time of the other operation instructions for the device in the thread result dictionary is later than the instruction time of the current operation instruction. If the instruction time of other operation instructions for the device in the thread result dictionary is later than the instruction time of the current operation instruction, then determine whether the operation result of the other operation instructions for the device in the thread result dictionary is executed normally. If the result of other operation instructions for the device in the thread result dictionary is normal execution, then return directly and end the execution of the current operation instruction; If the result of other operation instructions for the device in the thread result dictionary is failure, then it is determined whether the device operated by the current operation instruction has other operation instructions for the device in the thread state dictionary.

2. The multi-threaded control optimization processing method according to claim 1, characterized in that, The concurrent operation instructions include username, operation time, and operation instructions. The concurrent operation instructions include different concurrent operations issued by the same user to multiple different devices and different concurrent operations issued by different users to one or more different devices.

3. The multi-threaded control optimization processing method according to claim 2, characterized in that, The step of determining whether the instruction times of other operation instructions for the device existing in the thread result dictionary are later than the instruction times of the current operation instruction, further includes: If the instruction time of other operation instructions for the device existing in the thread result dictionary is not later than the instruction time of the current operation instruction, then the other operation instructions for the device existing in the thread result dictionary will be executed normally and the execution of the current operation instruction will end.

4. The multi-threaded control optimization processing method according to claim 3, characterized in that, The step of determining whether the device operated by the current operation instruction has other operation instructions for the device in the thread state dictionary, further includes: If the device operated by the current operation instruction has other operation instructions for the device in the thread state dictionary, then determine whether the operation time of the other operation instructions for the device in the thread state dictionary is later than the instruction time of the current operation instruction. If the operation time of other operation instructions for the device operated by the current operation instruction is later than the instruction time of the current operation instruction, then wait for the execution result of the other operation instructions for the device that exist in the thread state dictionary; If the execution result of other operation instructions for the device in the thread state dictionary is unsuccessful, or if the operation time of other operation instructions for the device operated by the current operation instruction is earlier than the instruction time of the current operation instruction, then the current operation instruction is executed and the current operation instruction information is written into the thread state dictionary. If the execution result of other operation instructions for the device that exist in the thread state dictionary is successful, return directly and end the execution of the current operation instruction.

5. The multi-threaded control optimization processing method according to claim 4, characterized in that, The execution result of other operation instructions for the device that exist in the thread state dictionary is "execution unsuccessful" means that the execution was not completed within the valid time and other operation instructions for the device that exist in the thread state dictionary that are currently being executed were forcibly terminated.

6. The multi-threaded control optimization processing method according to claim 1, characterized in that, The instruction to execute the current operation includes: The current operation instruction is split into multiple concurrent operation commands that can be executed only after multiple control requests are made; Multiple concurrent operation commands are sent one by one to the corresponding request control party. If most concurrent operation commands are sent successfully, the status flag of the corresponding instruction sending module is set to "in use" and the module waits for the processing result returned by the device control center. If the processing result of the concurrent operation command is received from the device control center, the remaining concurrent operation commands among the multiple concurrent operation commands are sent sequentially. If all concurrent operation commands are completed or any of the concurrent operation commands fail to execute, the execution of the concurrent operation commands will end, the usage status flag of the instruction sending module will be set to unused, and the current operation instruction information will be removed from the thread status dictionary.

7. The multi-threaded control optimization processing method according to claim 6, characterized in that, If the current operation instruction is executed successfully, the thread execution result of the current operation instruction is added to the thread result dictionary; if the current operation instruction is executed abnormally, the thread execution result of the current operation instruction is removed from the thread result dictionary.

8. A multi-threaded control optimization processing device with a single-threaded instruction center, characterized in that, The multi-threaded control optimization processing device includes: The receiving module is used to receive concurrent operation instructions input by the user and distribute the concurrent operation instructions to each thread in the thread pool, wherein the concurrent operation instructions carry time information; The first judgment module is used to determine whether the device operated by the current operation instruction has other operation instructions for the device in the thread result dictionary. The thread state dictionary records the operating device that is processing the instruction, the thread in the thread pool that processes the user instruction, and the time of the instruction. The thread result dictionary records the latest instruction time of each device, the thread in the thread pool that processes the user instruction, and the result. The second judgment module is used to determine whether the device operated by the current operation instruction has other operation instructions for the device in the thread state dictionary if there are no other operation instructions for the device in the thread result dictionary. The execution module is used to execute the current operation instruction and write the current operation instruction information into the thread state dictionary if there are no other operation instructions for the device operated by the current operation instruction in the thread state dictionary. The first judgment module is specifically used for: If there are other operation instructions for the device in the thread result dictionary, then determine whether the instruction time of the other operation instructions for the device in the thread result dictionary is later than the instruction time of the current operation instruction. If the instruction time of other operation instructions for the device in the thread result dictionary is later than the instruction time of the current operation instruction, then determine whether the operation result of the other operation instructions for the device in the thread result dictionary is executed normally. If the result of other operation instructions for the device in the thread result dictionary is normal execution, then return directly and end the execution of the current operation instruction; If the result of other operation instructions for the device in the thread result dictionary is failure, then it is determined whether the device operated by the current operation instruction has other operation instructions for the device in the thread state dictionary.

9. A terminal, characterized in that, The terminal includes: a processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Database access method and apparatus

    CN106528293A

  • Database handle processing method and device and computer equipment

    CN107220275A