Instruction sending method, instruction execution method and related device
By configuring target execution identifiers for instructions to be executed in service control requests in cloud computing environments, and controlling the order of instructions to be executed by controlling the controlled device based on these identifiers, the problem of low efficiency in executing service control instructions in network equipment when multiple services is issued is solved, and more efficient instruction execution is achieved.
Patent Information
- Application Number
- CN202311406649.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-26
- Publication Date
- 2025-04-29
AI Technical Summary
In a cloud computing environment, when multiple services are issued, network equipment is less efficient in executing business control instructions, mainly due to the excessively large and redundant system architecture, resulting in inefficient in issuing and execution of instructions.
By receiving a service control request from a service control device, a target execution identifier is configured for each type of instructions to be executed, and a first target instruction in the instructions to be executed is sent to the controlled device based on these identifiers to control the execution order of the instructions.
This method can control the order of commanded equipment execution instructions through the target execution identification of a single instruction under the situation of multiple services being issued concurrently. Compared with the method of adding a distributed lock for each request, it improves the efficiency of commanded equipment being executed by the commanded equipment being executed by service control instructions.
Smart Images

Figure CN119906738A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology. Specifically, the present application relates to an instruction sending method, an instruction execution method and related devices. Background Art
[0002] With the development of cloud computing, the network architecture of cloud service providers has become more complex. In order to support various forms of business scheduling, network control devices are usually deployed in the cloud to issue control instructions to different types of network devices in various computer rooms.
[0003] As cloud service providers provide more and more network services, there are more and more types of business control devices. Each business control device needs to connect to various devices and implement capabilities such as configuration distribution, version management, and consistency management. The system architecture becomes very large and redundant, resulting in low efficiency of network devices in executing business control instructions when multiple services are distributed. Summary of the invention
[0004] The embodiments of the present application provide an instruction sending method, an instruction execution method and related devices, which are used to solve the technical problem that when multiple services are issued, the efficiency of a device in executing service control instructions is low.
[0005] On the one hand, an embodiment of the present application provides a method for sending an instruction, including:
[0006] receiving at least one service control request from a service control device, and performing instruction sending processing on each received service control request, wherein each service control request includes at least one type of instructions to be executed;
[0007] For each service control request, the instruction sending process includes:
[0008] For each type of to-be-executed instruction in the service control request, a target execution identifier is configured for the to-be-executed instruction, wherein the target execution identifiers corresponding to the same type of to-be-executed instructions are used to indicate the order in which the same type of to-be-executed instructions are executed, and the same type of to-be-executed instructions have different corresponding target execution identifiers in different service control requests;
[0009] Based on the target execution identifier corresponding to the to-be-executed instruction, a first target instruction in the to-be-executed instruction is sent to the controlled device, so that the controlled device executes the first target instruction.
[0010] On the other hand, the embodiment of the present application further provides an instruction execution method, including:
[0011] Receive a first target instruction from an instruction control platform, where the first target instruction is obtained by the instruction control platform based on a method in any embodiment of the present application;
[0012] The first target instruction received is executed.
[0013] On the other hand, the embodiment of the present application further provides a command sending device, including:
[0014] An instruction sending module, used to receive at least one service control request from a service control device, and perform instruction sending processing on each received service control request, each service control request including at least one type of instructions to be executed;
[0015] Wherein, for each service control request, the instruction sending module is used to:
[0016] For each type of to-be-executed instruction in the service control request, a target execution identifier is configured for the to-be-executed instruction, wherein the target execution identifiers corresponding to the same type of to-be-executed instructions are used to indicate the order in which the same type of to-be-executed instructions are executed, and the same type of to-be-executed instructions have different corresponding target execution identifiers in different service control requests;
[0017] Based on the target execution identifier corresponding to the to-be-executed instruction, a first target instruction in the to-be-executed instruction is sent to the controlled device, so that the controlled device executes the first target instruction.
[0018] Optionally, when configuring the target execution identifier for the instruction to be executed, the instruction sending module may be used for at least one of the following:
[0019] Obtaining a current version number associated with the instruction to be executed, and determining a target version number of the instruction to be executed based on the current version number and a preset version number update step, and determining the target version number of the instruction to be executed as a target execution identifier of the instruction to be executed;
[0020] The cumulative count value of the instruction to be executed is obtained, and the target version number of the instruction to be executed is determined based on the cumulative count value and the initial version number corresponding to the instruction to be executed, and the target version number of the instruction to be executed is determined as the target execution identifier of the instruction to be executed.
[0021] Optionally, when the instruction sending module sends the first target instruction in the instructions to be executed to the controlled device based on the target execution identifier corresponding to the instructions to be executed, it can be used to:
[0022] Based on the target version number corresponding to the instruction to be executed, a first target instruction that meets a first preset condition is sent to the controlled device, where the first preset condition includes at least one of the following:
[0023] The difference between the target version number of the instruction to be executed and the base version number corresponding to the instruction to be executed is the version number update step;
[0024] The version number difference between the target version number of the instruction to be executed and the base version number corresponding to the instruction to be executed is the smallest, and the target version number is different from the base version number.
[0025] Optionally, if there are other to-be-executed instructions that belong to the same category as the first target instruction, after sending the first target instruction that meets the first preset condition to the controlled device, the instruction sending module is further used to:
[0026] The target version number of the first target instruction is configured as a new base version number corresponding to the first target instruction, so as to determine a new first target instruction from other instructions to be executed based on the new base version number.
[0027] Optionally, when the instruction sending module sends the first target instruction in the instructions to be executed to the controlled device based on the target execution identifier corresponding to the instructions to be executed, it can be used for at least one of the following:
[0028] For similar to-be-executed instructions in different service control requests, based on target execution identifiers corresponding to similar to-be-executed instructions in different service control requests, first target instructions in the similar to-be-executed instructions are sequentially sent to the controlled device;
[0029] For multiple to-be-executed instructions in the same service control request, based on the execution order of each to-be-executed instruction configured in the same service control request, the first target instruction in the multiple to-be-executed instructions is sent to the controlled device in sequence.
[0030] Optionally, a first instruction to be executed among the multiple instructions to be executed has a hierarchical association relationship with at least one second instruction to be executed among the multiple instructions to be executed, and the second instruction to be executed is an instruction other than the first instruction to be executed among the multiple instructions to be executed. When the instruction sending module sends the first target instruction among the multiple instructions to be executed to the controlled device in sequence based on the execution order of the instructions to be executed configured in the same service control request, it can be used to:
[0031] When the first instruction to be executed and each of the second instructions to be executed meet the first preset condition, based on the execution order of the first instruction to be executed and the second instruction to be executed configured in the same service control request, sending the first target instruction in the first instruction to be executed and the second instruction to be executed to the controlled device in sequence;
[0032] The target execution identifier includes a target version number, and the first preset condition includes at least one of the following:
[0033] The difference between the target version number of the instruction to be executed and the base version number corresponding to the instruction to be executed is the version number update step;
[0034] The version number difference between the target version number of the instruction to be executed and the base version number corresponding to the instruction to be executed is the smallest, and the target version number is different from the base version number.
[0035] Optionally, when configuring the target execution identifier for the instruction to be executed, the instruction sending module may be used to:
[0036] Obtaining identification configuration attributes associated with each to-be-executed instruction having a hierarchical association relationship;
[0037] If the identification configuration attribute associated with one of the to-be-executed instructions with a hierarchical association relationship is occupied, wait until the identification configuration attributes associated with each of the to-be-executed instructions with a hierarchical association relationship are not occupied, and then configure the target execution identification for each of the to-be-executed instructions with a hierarchical association relationship;
[0038] If the identification configuration attribute associated with any instruction to be executed with a hierarchical association relationship is not occupied, then the identification configuration attribute associated with any instruction to be executed with a hierarchical association relationship is occupied, and the target execution identification of each instruction to be executed with a hierarchical association relationship is configured, and when the configuration of the target execution identification of each instruction to be executed with a hierarchical association relationship is completed, the occupied identification configuration attribute associated with each instruction to be executed with a hierarchical association relationship is released;
[0039] Among them, the fact that the flag configuration attribute is occupied indicates that the execution flag is being configured.
[0040] On the other hand, the embodiment of the present application further provides an instruction execution device, including:
[0041] A receiving module, used to receive a first target instruction from an instruction control platform, where the first target instruction is obtained by the instruction control platform based on a method in any embodiment of the present application;
[0042] The instruction execution module is used to execute the received first target instruction.
[0043] Optionally, the instruction execution module may be used for any of the following when executing the received first target instruction:
[0044] Based on the order in which the first target instructions are received, the first target instructions are executed in sequence;
[0045] Based on the target execution identifiers corresponding to the first target instructions, the second target instructions are determined from the first target instructions in sequence, and the second target instructions are executed.
[0046] Optionally, when the instruction execution module determines the second target instructions from the first target instructions in sequence based on the target execution identifiers corresponding to the first target instructions, it can be used to:
[0047] Based on the target version numbers corresponding to the first target instructions, second target instructions that meet the second preset condition are determined from the first target instructions in sequence, where the second preset condition includes at least one of the following:
[0048] The difference between the target version number of the first target instruction and the reference version number corresponding to the first target instruction is a preset version number update step length;
[0049] The version number difference between the target version number of the first target instruction and the reference version number corresponding to the first target instruction is the smallest, and the target version number is different from the reference version number.
[0050] On the other hand, an embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement a method of any embodiment of the present application.
[0051] On the other hand, an embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, a method of any embodiment of the present application is implemented.
[0052] On the other hand, an embodiment of the present application further provides a computer program product, including a computer program, which implements any method of the embodiment of the present application when the computer program is executed by a processor.
[0053] The technical solution of this embodiment receives at least one business control request from a business control device, and performs instruction sending processing on each received business control request. For each type of to-be-executed instruction in the business control request, a target execution identifier is configured for the to-be-executed instruction, and based on the target execution identifier corresponding to the to-be-executed instruction, the first target instruction in the to-be-executed instruction is sent to the controlled device, so that the controlled device executes the first target instruction. Even if the configuration of a business may involve the issuance of dozens of consecutive instructions, multiple business control requests can be issued concurrently. Controlling the order in which the controlled device executes instructions through the target execution identifier of a single instruction is much more efficient than adding a distributed lock to each request, thereby improving the efficiency of the controlled device in executing business control instructions. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A schematic diagram of an implementation environment of a related technology provided in an embodiment of the present application;
[0055] Figure 2 A schematic diagram of an implementation of data center interconnection provided in an embodiment of the present application;
[0056] Figure 3 A schematic diagram of an implementation environment for instruction processing provided in an embodiment of the present application;
[0057] Figure 4 A flowchart of a method for sending instructions provided in an embodiment of the present application;
[0058] Figure 5 A schematic diagram of an online ordering process provided in an embodiment of the present application;
[0059] Figure 6 A schematic diagram of an execution identification of an instruction to be executed in a service control request provided in an embodiment of the present application;
[0060] Figure 7 A schematic diagram of a sequence of sequentially executing instructions provided in an embodiment of the present application;
[0061] Figure 8 A schematic diagram of comparing a baseline version number and a target version number provided in an embodiment of the present application;
[0062] Fig. 9 Another schematic diagram of comparing a baseline version number with a target version number provided in an embodiment of the present application;
[0063] Fig.10 A schematic diagram of an instruction execution sequence with a hierarchical association relationship provided in an embodiment of the present application;
[0064] Fig.11 A flowchart of an instruction execution method provided in an embodiment of the present application;
[0065] Fig.12 A flowchart of an instruction processing method provided in an embodiment of the present application;
[0066] Fig.13 A flowchart of another instruction processing method provided in an embodiment of the present application;
[0067] Fig.14 A schematic diagram of the structure of a command sending device provided in an embodiment of the present application;
[0068] Fig.15 A schematic diagram of the structure of an instruction execution device provided in an embodiment of the present application;
[0069] Fig.16 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0070] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.
[0071] Those skilled in the art will appreciate that, unless specifically stated, the singular forms "one", "an", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we call an element "connected" or "coupled" to another element, the one element may be directly connected or coupled to the other element, or it may refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, such as "A and / or B" indicates implementation as "A", or implementation as "A", or implementation as "A and B".
[0072] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0073] See also Figure 1 , Figure 1 A schematic diagram of an implementation environment of a related technology provided in an embodiment of the present application. Figure 1 The implementation environment diagram shown includes a configuration device, a cloud control device, and a controlled device.
[0074] Among them, the controlled device can be a network device. Various types of network devices are deployed in various computer rooms in different regions, and common ones are routers, gateways, switches, etc. These network devices support various services on the cloud, including services directly provided to users for external sales, as well as internal services used by operation and maintenance personnel. These services are provided with configuration pages through various modules of the front end (which may also be different front-end services). The specific services configured on the front-end page are sent to the back end and handed over to cloud control devices that provide different functions for further processing.
[0075] The cloud control device is responsible for allocating and scheduling the specific resources required for business implementation, generating a set of control instructions for each network device involved in the business scheduling, and sending them to the network devices to finally complete the business activation.
[0076] See also Figure 2 , Figure 2 The following is a schematic diagram of an implementation of data center interconnection provided in an embodiment of the present application. Figure 2As shown in the figure, when the business operation and maintenance personnel need to configure and accelerate the IP network segment of a certain business between two data centers, they send a business request to the control device on the cloud through the operation and maintenance front end. After the resource allocation, scheduling, and business arrangement of the business control device, configuration instructions are issued to the network devices in different regional parks. Finally, the business is officially connected after the instructions take effect.
[0077] However, as cloud service providers provide more and more network services, there are more and more types of business control devices. Each business control device needs to connect to various devices and implement configuration distribution, version management, consistency management and other capabilities. The system architecture becomes very large and redundant. This application proposes to build a unified management and control platform that can connect to various business control devices on the one hand, and different network devices on the other hand, to provide unified and universal services for various businesses. In this way, when expanding the business, you only need to focus on your own business characteristics for differentiated development, and you don’t need to worry about the underlying general capabilities.
[0078] See also Figure 3 , Figure 3 A schematic diagram of an implementation environment for instruction processing provided in an embodiment of the present application. Figure 3 The implementation environment shown includes configuration devices, cloud control devices, command control platform and controlled devices.
[0079] Among them, the configuration device can be used to provide a front-end configuration page for users or business operation and maintenance personnel to perform business-related configuration. The cloud control device can be used as a business control device to control the controlled device, and the business control device can be deployed in the cloud. The controlled device can refer to a device that requires business configuration, such as a network device. The network device can include but is not limited to at least one of a router, a switch, or a gateway. If the controlled device is a network device, the command control platform can also be understood as a network device control platform.
[0080] Specifically, the general network device management and control platform between the controller and the network devices mainly provides various control instructions issued by the cloud controller to various devices.
[0081] In this embodiment, when the service control device configures complex services, a large number of service control instructions will be issued in a period of time. Some of these instructions have strict sequence requirements, while others can be completely parallel. In order to reduce the large amount of interaction between the service control device and the instruction control platform when complex services are issued, the interface for configuring control instructions on the instruction control platform supports batches, and also supports multiple interface requests for concurrent calls.
[0082] Specifically, Figure 3As shown, the connection mode between the switch and the gateway, the connection mode between the gateways, the forwarding mode adopted by a certain gateway (such as low-speed forwarding, medium-speed forwarding or high-speed forwarding, etc.) and the forwarding path can be configured based on the business control request. The specific instructions that need to be configured and the order of the configuration instructions can be determined according to the actual situation, and are not limited here.
[0083] Optionally, an embodiment of the present application may involve cloud computing, for example, configuring the instruction control platform on a cloud server, and configuring the target execution identifier and screening the first target instruction through the cloud server using cloud computing.
[0084] Cloud computing is a computing model that distributes computing tasks on a resource pool composed of a large number of computers, allowing various application systems to obtain computing power, storage space and information services as needed. The network that provides resources is called a "cloud". From the user's perspective, the resources in the "cloud" are infinitely scalable and can be obtained at any time, used on demand, expanded at any time, and paid for by use.
[0085] As a provider of basic cloud computing capabilities, a cloud computing resource pool (referred to as a cloud platform, generally referred to as an IaaS (Infrastructure as a Service) platform) will be established, and various types of virtual resources will be deployed in the resource pool for external customers to choose to use. The cloud computing resource pool mainly includes: computing devices (virtualized machines, including operating systems), storage devices, and network devices.
[0086] According to the logical function division, the PaaS (Platform as a Service) layer can be deployed on the IaaS (Infrastructure as a Service) layer, and the SaaS (Software as a Service) layer can be deployed on the PaaS layer. SaaS can also be deployed directly on IaaS. PaaS is a platform for software operation, such as databases, web containers, etc. SaaS is a variety of business software, such as web portals, SMS mass senders, etc. Generally speaking, SaaS and PaaS are upper layers relative to IaaS.
[0087] In general, this application proposes to build a device management and control platform that provides the ability to manage the batch issuance of control instructions for a large number of network devices that are unrelated to type and can be grouped by business. By controlling the execution identification of batch instructions, it can not only ensure that the instructions are issued in a strict order, but also reduce the locking when the instructions are issued concurrently, thereby ensuring concurrent performance to the greatest extent. In addition, the solution also optimizes the instruction model tree of hierarchical associations in concurrent scenarios to reduce deadlocks.
[0088] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.
[0089] See also Figure 4 , Figure 4 The flowchart of a method for sending instructions provided in an embodiment of the present application is shown in FIG. The method of this embodiment can be executed by an instruction control platform, such as Figure 4 Methods may include:
[0090] S410: Receive at least one service control request from a service control device, and perform instruction sending processing on each received service control request.
[0091] Among them, the service control request may refer to a request for controlling the controlled device. Each service control request includes at least one type of instructions to be executed. Optionally, in a service control request, each type of execution instruction may be one or more. Multiple may refer to not less than two. Among them, the target execution identifier corresponding to the same type of instructions to be executed is used to indicate the order in which the same type of instructions to be executed are executed, and the target execution identifiers corresponding to the same type of instructions to be executed in different service control requests are different. The instructions to be executed may refer to instructions that need to be executed by the controlled device. Specifically, the classification of instructions to be executed may be that each instruction is regarded as a category, that is, different instructions are different types of instructions; in addition, it may also be classified according to the function or role of the instructions to be executed, such as the update or deletion operation of the configuration content; in addition, the instructions may also be classified according to the node where the instructions are located in the service request, which is not limited here.
[0092] It should be noted that, for different types of pending instructions in the same business control request, the execution order between different types of pending instructions can also be determined by the target execution identifier corresponding to the pending instructions; it can also be determined based on a pre-defined execution order between different types of pending instructions, that is, the execution order between different types of pending instructions may be independent of the target execution identifier of each pending instruction, and can be set as needed, and is not limited here.
[0093] For example, the classification of instructions is described by taking the online ordering scenario as an example. Figure 5 , Figure 5 A schematic diagram of an online ordering process provided in an embodiment of the present application.
[0094] like Figure 5As shown, for example, when placing an order online, there is an interface in the system for users to place an order, but before placing an order, users must check the inventory to ensure that there is enough inventory before placing an order. Since the system has a certain degree of concurrency, the inventory of the goods will be saved in redis (Remote Dictionary Server) in advance, and the inventory in redis will be updated when the user places an order. The instruction to check the inventory from redis can be one type of instruction, and the instruction to update the inventory in redis can be another type of instruction, which is not limited here.
[0095] Specifically, taking the online ordering scenario as an example, the business control request is an ordering request, and a business control request may include an instruction to check inventory and an instruction to update inventory, etc.
[0096] In this embodiment, at least one service control request is received from a service control device, and the following instruction sending process may be performed for each received service control request.
[0097] For each service control request, the instruction sending process includes:
[0098] S411: For each type of to-be-executed instruction in the service control request, configure a target execution identifier for the to-be-executed instruction.
[0099] The target execution identifiers corresponding to the same type of to-be-executed instructions are used to indicate the order in which the same type of to-be-executed instructions are executed. The target execution identifiers corresponding to the same type of to-be-executed instructions in different service control requests are different.
[0100] Exemplarily, taking the continuous receipt of the first business control request and the second business control request as an example, assuming that the first business control request includes new instructions of instruction model B, new instructions of instruction model A and new instructions of instruction model C, and the second business control request includes new instructions of instruction model A, new instructions of instruction model B and new instructions of execution model A, if the first business control request is earlier than the request time of the second business control request, or the first business control request arrives at the instruction management and control platform before the second business control request, then the target execution identifiers corresponding to the instructions of the first business control request and the second business control request can be as follows Figure 6 shown. Figure 6 A schematic diagram of the execution identification of a to-be-executed instruction in a service control request provided in an embodiment of the present application. Instruction model A is also referred to as instruction A in the following embodiments, instruction model B is also referred to as instruction B in the following embodiments, and instruction model C is also referred to as instruction C in the following embodiments. Optionally, the instruction model may be related to a specific service, and different services may use different instruction models. For example, service A corresponds to instruction model A, service B corresponds to instruction model B, and service C corresponds to instruction model C.
[0101] like Figure 6 As shown, for the first service control request, the target execution identifier of the new instruction of instruction model B included therein is configured as 4, the target execution identifier of the new instruction of instruction model A is 2, and the target execution identifier of the new instruction of instruction model C is 3. For the second service control request, the target execution identifier of one of the new instructions of instruction model A included therein is 3, the target execution identifier of the new instruction of instruction model B is 4, and the target execution identifier of another new instruction of instruction model A is 4.
[0102] In this example, the instruction model is used to indicate the category of the instruction. Instruction model A indicates that a new instruction has an instruction of category A. Instruction model B indicates that a new instruction has an instruction of category B. Instruction model C indicates that a new instruction has an instruction of category B.
[0103] S412: Send a first target instruction in the instructions to be executed to the controlled device based on the target execution identifier corresponding to the instructions to be executed, so that the controlled device executes the first target instruction.
[0104] In this embodiment, based on the target execution identifier corresponding to the to-be-executed instruction, the first target instruction in the to-be-executed instruction is sent to the controlled device. The first target instruction in the to-be-executed instruction can be sent to the controlled device in sequence based on the target execution identifier corresponding to the to-be-executed instruction. Then, the controlled device can directly execute the received first target instruction. Figure 6 As shown, the smaller the target execution identifier, the higher the priority of the execution order; or the larger the target execution identifier, the higher the priority of the execution order. This is related to the configuration rules of the target execution identifier and is not limited here. For example, if the target execution identifier is configured in an ascending manner, the smaller the target execution identifier, the higher the priority of the execution order; if the target execution identifier is configured in a descending manner, the larger the target execution identifier, the higher the priority of the execution order.
[0105] In addition, based on the target execution identifier corresponding to the instruction to be executed, the first target instruction in the instructions to be executed is sent to the controlled device. It can also be that all the instructions to be executed configured with the target execution identifier are sent to the controlled device as the first target instruction. In this case, the first target instructions received by the controlled device all correspond to the target execution identifier, and then the second target instructions in the first target instructions are executed in sequence based on the target execution identifier corresponding to each first target instruction. This is not limited here.
[0106] See also Figure 7 , Figure 7 A schematic diagram of a sequence of sequentially executing instructions provided in an embodiment of the present application. In this embodiment, the smaller the target execution identifier, the higher the priority of the execution sequence.
[0107] Combination Figure 6 and Figure 7 As shown, instruction B in the first service control request is executed first, then instruction A in the first service control request is executed, then instruction A in the second service control request is executed, then instruction B in the second service control request is executed, and then another instruction B in the second service control request is executed. As for instruction C in the first service control request, it can be executed in parallel with the instruction in the first service control request.
[0108] like Figure 7 The example shown above only lists a relatively simple request. In actual business scenarios, the configuration of a business may involve the issuance of dozens of consecutive instructions. At this time, if multiple business control requests are issued concurrently, the order in which the controlled device executes instructions can be controlled by the target execution identifier of a single instruction. This will be much more efficient than adding a distributed lock to each request.
[0109] The technical solution of this embodiment receives at least one business control request from a business control device, and performs instruction sending processing on each received business control request. For each type of to-be-executed instruction in the business control request, a target execution identifier is configured for the to-be-executed instruction, and based on the target execution identifier corresponding to the to-be-executed instruction, the first target instruction in the to-be-executed instruction is sent to the controlled device, so that the controlled device executes the first target instruction. Even if the configuration of a business may involve the issuance of dozens of consecutive instructions, multiple business control requests can be issued concurrently. Controlling the order in which the controlled device executes instructions through the target execution identifier of a single instruction is much more efficient than adding a distributed lock to each request, thereby improving the efficiency of the controlled device in executing business control instructions.
[0110] It should be noted that if there are multiple controlled devices and different instructions of the same business control request are sent to different controlled devices, the instruction in the business control request also corresponds to a controlled device identifier. When the instruction meets the first preset condition, the instruction management and control platform can send the instruction to the controlled device pointed to by the controlled device identifier based on the controlled device identifier.
[0111] The following embodiments, based on any of the above embodiments, illustrate how to configure a target execution identifier for an instruction to be executed.
[0112] In a possible implementation, configuring a target execution identifier for the instruction to be executed includes at least one of the following:
[0113] Obtaining a current version number associated with the instruction to be executed, and determining a target version number of the instruction to be executed based on the current version number and a preset version number update step, and determining the target version number of the instruction to be executed as a target execution identifier of the instruction to be executed;
[0114] The cumulative count value of the instruction to be executed is obtained, and the target version number of the instruction to be executed is determined based on the cumulative count value and the initial version number corresponding to the instruction to be executed, and the target version number of the instruction to be executed is determined as the target execution identifier of the instruction to be executed.
[0115] Specifically, in this embodiment, the target version number of the instruction to be executed is first determined, and then the target version number is determined as the target execution identifier.
[0116] In this embodiment, each instruction model (each type of instruction) is configured with a reference version number, which may be variable and may be determined based on the target version number of the first target instruction that was most recently sent. The current version number may be the latest version number currently configured. The reference version number may refer to the latest version number for evaluating whether the instruction to be executed can be sent. The initial version number may be a fixed version number that is defined at the beginning, and the target version number can be determined based on the accumulated count value and the initial version number.
[0117] Specifically, according to the business control requests that are continuously received, based on the instruction model to which the instructions to be executed in the business control requests belong, and the current version number of the instruction model or at least one of the cumulative count values, target version numbers are configured for the instructions to be executed in the business control requests, thereby enabling the target execution identifiers corresponding to the same type of instructions to be executed in different business control requests to be different.
[0118] Taking the determination of the target version number based on the current version number as an example, for each instruction model, the control platform will create a self-incrementing version number ID (unique number, Identity document) for it after creation. When the control platform receives each new instruction from the business control device, the control platform will update the version number ID ± the version number step to ensure the uniqueness of any instruction issued. Optionally, the version number update step can be 1, or other values, which are not limited here.
[0119] In another possible implementation, the version number update step may also be a value greater than 1. When one of the requests needs to be processed first, the request may carry a priority processing flag, and the corresponding version number update step is smaller for the request carrying the priority processing flag, so that the request can be processed first.
[0120] Taking the determination of the target version number based on the cumulative count value as an example, for each type of to-be-executed instruction, when a to-be-executed instruction is received, the cumulative count value may be +1, and the target version number of the to-be-executed instruction may be determined based on the cumulative count value and the initial version number corresponding to the to-be-executed instruction. The sum of the initial version number and the cumulative count value may be determined as the target version number.
[0121] The technical solution of this embodiment obtains the current version number or the cumulative count value associated with the instruction to be executed; and then determines the target version number. Since the target execution identifier is determined based on the version number of the instruction to be executed, the configuration convenience and efficiency of the target execution identifier can be improved.
[0122] In a possible implementation, based on the target execution identifier corresponding to the to-be-executed instruction, sending a first target instruction in the to-be-executed instruction to the controlled device includes:
[0123] Based on the target version number corresponding to the instruction to be executed, a first target instruction that meets a first preset condition is sent to the controlled device, where the first preset condition includes at least one of the following:
[0124] The difference between the target version number of the instruction to be executed and the base version number corresponding to the instruction to be executed is the version number update step;
[0125] The version number difference between the target version number of the instruction to be executed and the base version number corresponding to the instruction to be executed is the smallest, and the target version number is different from the base version number.
[0126] In this embodiment, if the difference between the target version number of the instruction to be executed and the baseline version number corresponding to the instruction to be executed is the version number update step, or the version number difference between the target version number of the instruction to be executed and the baseline version number corresponding to the instruction to be executed is the smallest and the target version number is different from the baseline version number, it means that the instruction to be executed can be executed, and the instruction to be executed is sent to the controlled device as the first target instruction.
[0127] The technical solution of this embodiment uses the instruction control platform to filter out the first target instruction and send it to the controlled device, so that the controlled device can directly execute the first target instruction, which can reduce the computing power resources required for the controlled device to filter out the second target instruction from the first target instruction and save time.
[0128] In a possible implementation manner, after sending the first target instruction that meets the first preset condition to the controlled device, the method further includes:
[0129] The target version number of the first target instruction is configured as a new base version number corresponding to the first target instruction, so as to determine a new first target instruction from other instructions to be executed based on the new base version number.
[0130] In this embodiment, after sending a first target instruction that meets the first preset condition to the controlled device, the target version number of the first target instruction can be directly configured as a new baseline version number corresponding to the first target instruction, so that when other to-be-executed instructions of the same type as the first target instruction are received, a new first target instruction can be determined from the other to-be-executed instructions based on the new baseline version number.
[0131] In another possible implementation, if there are other to-be-executed instructions that belong to the same category as the first target instruction, after sending the first target instruction that meets the first preset condition to the controlled device, the method further includes:
[0132] The target version number of the first target instruction is configured as a new base version number corresponding to the first target instruction, so as to determine a new first target instruction from other instructions to be executed based on the new base version number.
[0133] In this embodiment, the target version number of the first target instruction may be configured as a new base version number corresponding to the first target instruction only when there are other instructions to be executed that belong to the same category as the first target instruction.
[0134] See also Figure 8 and Fig. 9 , Figure 8 A schematic diagram for comparing a baseline version number and a target version number provided in an embodiment of the present application. Fig. 9 Another schematic diagram of comparing a baseline version number with a target version number provided in an embodiment of the present application.
[0135] like Figure 8 As shown, two requests from the business control device reach the management and control platform at the same time. The platform adds +1 to the current version ID of the instruction model according to the instructions it wants to issue, and each request and each instruction gets a new version ID (target version ID). After the version ID is generated, the requests of the business control device begin to execute concurrently, and there is no need to add a distributed lock to each request. Taking the version number update step of 1 and the self-increment of the version number as an example, when a specific instruction model is executed, the thread processing the request will determine whether the current target version ID of the instruction is +1 with the current baseline version ID in the database, or whether the difference between the target version number and the baseline version number is the smallest and the target version number is different from the baseline version number.
[0136] If so, it means that the current instruction can be executed immediately. After execution, the current baseline version ID of the instruction model in the database will be updated to the target version ID of the instruction; if not, it means that the previous instructions issued for the instruction model have not been executed and you need to wait here.
[0137] Then, after executing the new instruction of instruction model B, the new instruction of instruction model A and the new instruction of instruction model C in the first service control request, Fig. 9As shown, the base version ID of instruction model A is replaced with 2, the base version ID of instruction model B is replaced with 4, and the base version ID of instruction model C is replaced with 3. At this time, for the to-be-executed instruction in the second service control request, it satisfies the first preset condition, so the to-be-executed instruction in the second service control request can be executed. Therefore, the final instruction execution result can be as follows Figure 7 shown.
[0138] In a possible implementation, sending a first target instruction in the instructions to be executed to the controlled device based on the target execution identifier corresponding to the instructions to be executed includes at least one of the following:
[0139] For similar to-be-executed instructions in different service control requests, based on target execution identifiers corresponding to similar to-be-executed instructions in different service control requests, first target instructions in the similar to-be-executed instructions are sequentially sent to the controlled device;
[0140] For multiple to-be-executed instructions in the same service control request, based on the execution order of each to-be-executed instruction configured in the same service control request, the first target instruction in the multiple to-be-executed instructions is sent to the controlled device in sequence.
[0141] In this embodiment, for the same type of pending instructions in different business control requests, the first target instruction of the same type of pending instructions is sent to the controlled device in sequence based on the target execution identifier corresponding to the same type of pending instructions in different business control requests, and for multiple pending instructions in the same business control request, the first target instruction of the multiple pending instructions is sent to the controlled device in sequence based on the execution order of each pending instruction configured in the same business control request, that is, the pending instructions of the same business control request may not be affected by the target execution identifier.
[0142] In the above embodiments, it is introduced that the concurrent issuance of the same instruction is controlled by a unique incremental version number. In actual scenarios, the cloud controller of the business will also have hierarchical association requirements between different instructions. Specifically, instruction model A and instruction model B can exist as separate models and perform add, delete, modify and query operations, but in some business scenarios, instruction model A and instruction model B have a hierarchical association relationship. When model A is created, model B can be created at the same time, but the created B is still a separate instruction model, not just a property of model A. Specific operating rules include but are not limited to the following:
[0143] Rule 1: A command model can have one or more subordinate command models, but can only have one superior command model. The superior command model is called the parent model, and the subordinate command model is called the child model.
[0144] Rule 2: After a sub-model is created, it can be updated or deleted separately;
[0145] Rule 3: After a parent model is created, its child models cannot be operated at the same time when an update operation is performed, and its child models will be deleted at the same time when a deletion operation is performed.
[0146] With the hierarchical association, the operation of a simple sub-model is no different from before, but concurrent operation of the parent model cannot be solved by just one version number. Both the parent and child models have version numbers. When an operation of the parent model comes in, a new version number will be generated for the parent model itself and its child models at the same time. When the version numbers of all models reach the +1 requirement, the instructions of the parent model will be sent to the device.
[0147] In a possible implementation, a first instruction to be executed among multiple instructions to be executed has a hierarchical association relationship with at least one second instruction to be executed among the multiple instructions to be executed, the second instruction to be executed is an instruction other than the first instruction to be executed among the multiple instructions to be executed, and based on the execution order of each instruction to be executed configured in the same service control request, the first target instruction among the multiple instructions to be executed is sequentially sent to the controlled device, including:
[0148] When the first instruction to be executed and each of the second instructions to be executed meet the first preset condition, based on the execution order of the first instruction to be executed and the second instruction to be executed configured in the same service control request, sending the first target instruction in the first instruction to be executed and the second instruction to be executed to the controlled device in sequence;
[0149] The target execution identifier includes a target version number, and the first preset condition includes at least one of the following:
[0150] The difference between the target version number of the instruction to be executed and the base version number corresponding to the instruction to be executed is the version number update step;
[0151] The version number difference between the target version number of the instruction to be executed and the base version number corresponding to the instruction to be executed is the smallest, and the target version number is different from the base version number.
[0152] like Fig.10 As shown, Fig.10 A schematic diagram of an instruction execution sequence with a hierarchical association relationship provided in an embodiment of the present application. In this embodiment, Fig.10As shown, the instruction models are associated in a tree-like relationship. When two requests, one for operating instruction model A and the other for operating instruction model B, arrive at the platform at the same time, the platform will increment the version numbers of the two models and all their recursive sub-models by 1. The second business control request first obtains the version number of instruction B and increments it by 1 to get 4, and also increments the version number of instruction C by 1 to get 3. Then, when the first business control request operates instruction A, it finds that the version numbers of instructions B and C it obtains are not in the relationship of +1 with the current version number, so it needs to wait. After the second business control request is issued, the version numbers of instructions B and C can be operated only when they catch up.
[0153] The technical solution of this embodiment, by sending the first target instruction in the first to-be-executed instruction and the second to-be-executed instruction to the controlled device in sequence based on the execution order of the first to-be-executed instruction and the second to-be-executed instruction configured in the same business control request when the first to-be-executed instruction and each second to-be-executed instruction satisfy the first preset condition, can be applicable to the situation where there is a hierarchical association relationship between the to-be-executed instructions of the same business control request. On the basis of improving the efficiency of the controlled device in executing the business control instructions, the applicability of the controlled device in executing the business control instructions is also improved.
[0154] In some cases of the example, in an extreme concurrency scenario, request 2 may obtain version number 4 of instruction B, but request 1 may obtain version number 5 of instruction B and version number 3 of instruction C. When issuing, request 1 must wait for request 2 to complete issuing instruction B, and request 2 must wait for request 1 to issue instruction C, thus forming a deadlock.
[0155] Therefore, the following embodiments further illustrate how to reduce deadlock situations based on any of the above embodiments.
[0156] In a possible implementation, configuring a target execution identifier for the instruction to be executed includes:
[0157] Obtaining identification configuration attributes associated with each to-be-executed instruction having a hierarchical association relationship;
[0158] If the identification configuration attribute associated with one of the to-be-executed instructions with a hierarchical association relationship is occupied, wait until the identification configuration attributes associated with each of the to-be-executed instructions with a hierarchical association relationship are not occupied, and then configure the target execution identification for each of the to-be-executed instructions with a hierarchical association relationship;
[0159] If the identification configuration attribute associated with any instruction to be executed with a hierarchical association relationship is not occupied, then the identification configuration attribute associated with any instruction to be executed with a hierarchical association relationship is occupied, and the target execution identification of each instruction to be executed with a hierarchical association relationship is configured, and when the configuration of the target execution identification of each instruction to be executed with a hierarchical association relationship is completed, the occupied identification configuration attribute associated with each instruction to be executed with a hierarchical association relationship is released;
[0160] Among them, the fact that the flag configuration attribute (Increasing attribute) is occupied indicates that the execution flag is being configured.
[0161] In this embodiment, specifically, an additional attribute Increasing is added to each instruction model to indicate whether the attribute is currently acquiring a version number. When the platform interface receives a request, it is necessary to check whether the Increasing attributes of the instruction requested and all its recursive sub-instruction models are occupied. If they are occupied, it is necessary to wait. If not, they must all be set to occupied.
[0162] Continue with Fig.10 The following example illustrates this.
[0163] When request 2 arrives, before obtaining the version number of instruction B, it first checks the Increasing properties of instructions B and C. If they are not occupied, they are occupied. Then the new version numbers of instructions B and C are obtained respectively. Similarly, when request 1 arrives, before obtaining the version number of instruction A, it is found that the Increasing properties of instructions B and C are already occupied, so the version number cannot be obtained and it needs to wait. After request 2 completes the acquisition of the version numbers of instructions B and C, the Increasing property is released, and request 1 can start to obtain the version number. This ensures that the request to obtain the latest version number of the parent instruction model can also obtain the latest version number of the child instruction model at the same time, so that there will be no deadlock between multiple requests waiting for each other.
[0164] The technical solution of this embodiment can reduce the deadlock of requests with hierarchical associations in extreme concurrent scenarios and improve the success rate of instruction sending by occupying the identification configuration attributes associated with any instruction to be executed with a hierarchical association and configuring the target execution identification of each instruction to be executed with a hierarchical association only when the identification configuration attributes associated with any instruction to be executed with a hierarchical association are not occupied.
[0165] In a possible implementation, in the deletion scenario, the request that enters the waiting version number state needs to note that the child instruction model it is waiting for may have been deleted in other concurrent requests. Therefore, when the request enters the issuance process, the version numbers of all instruction models (parent instruction model and child instruction model) meet the +1 condition, or the child instruction model no longer exists. After the child instruction model is deleted, there is no need to consider the child's concurrent scenario when operating its parent instruction model. The parent instruction model can be issued as long as it meets the first condition.
[0166] In general, the embodiment of the present application designs a platform-based network equipment management and control solution, and builds a general instruction management and control platform for complex and diverse cloud network business scenarios. The platform provides instruction model configuration for various instructions. When multiple services are issued in parallel, it can perform concurrent control in a lock-free manner in the form of the smallest granularity instruction version ID to ensure high-efficiency execution when multiple services are issued. At the same time, it supports hierarchical associations between instruction models, and performs targeted optimization for concurrent operations between hierarchically associated model trees, ensuring efficiency while avoiding deadlock problems.
[0167] See also Fig.11 , Fig.11 The flowchart of a method for executing an instruction provided in an embodiment of the present application is shown in FIG. The method of this embodiment can be executed by a controlled device. Fig.11 The methods shown may include:
[0168] S1110. Receive a first target instruction from an instruction control platform.
[0169] In this embodiment, the instruction control platform may determine the target execution identifier of the instruction to be executed, and then directly send the instruction to be executed carrying the target execution identifier as the first target instruction to the controlled device; or the instruction control platform may filter out the instructions that the controlled device ultimately needs to execute and then send them to the controlled device in sequence.
[0170] Specifically, how the instruction control platform sends the first target instruction can refer to the description of any of the above embodiments, which will not be repeated here.
[0171] S1120. Execute the received first target instruction.
[0172] In this embodiment, the instruction control platform may determine the target execution identifier of the instruction to be executed, and directly send the instruction to be executed carrying the target execution identifier as the first target instruction to the controlled device, and the controlled device may select the second target instruction that needs to be executed in the end; or the instruction control platform may screen out the instructions that need to be executed in the end by the controlled device and send them to the controlled device in sequence, and the controlled device may execute the received first target instruction.
[0173] In a possible implementation, executing the received first target instruction includes any one of the following:
[0174] Based on the order in which the first target instructions are received, the first target instructions are executed in sequence;
[0175] Based on the target execution identifiers corresponding to the first target instructions, the second target instructions are determined from the first target instructions in sequence, and the second target instructions are executed.
[0176] The technical solution of this embodiment receives at least one business control request from a business control device, and performs instruction sending processing on each received business control request. For each type of to-be-executed instruction in the business control request, a target execution identifier is configured for the to-be-executed instruction, and based on the target execution identifier corresponding to the to-be-executed instruction, the first target instruction in the to-be-executed instruction is sent to the controlled device, so that the controlled device executes the first target instruction. Even if the configuration of a business may involve the issuance of dozens of consecutive instructions, multiple business control requests can be issued concurrently. Controlling the order in which the controlled device executes instructions through the target execution identifier of a single instruction is much more efficient than adding a distributed lock to each request, thereby improving the efficiency of the controlled device in executing business control instructions.
[0177] In a possible implementation, the target execution identifier includes a target version number, and based on the target execution identifiers corresponding to the first target instructions, the second target instructions are sequentially determined from the first target instructions, including:
[0178] Based on the target version numbers corresponding to the first target instructions, second target instructions that meet the second preset condition are determined from the first target instructions in sequence, where the second preset condition includes at least one of the following:
[0179] The difference between the target version number of the first target instruction and the reference version number corresponding to the first target instruction is a preset version number update step length;
[0180] The version number difference between the target version number of the first target instruction and the reference version number corresponding to the first target instruction is the smallest, and the target version number is different from the reference version number.
[0181] In this embodiment, if the difference between the target version number of the instruction to be executed and the baseline version number corresponding to the instruction to be executed is the version number update step, or the version number difference between the target version number of the instruction to be executed and the baseline version number corresponding to the instruction to be executed is the smallest and the target version number is different from the baseline version number, it means that the instruction to be executed can be executed, and the instruction to be executed is sent to the controlled device as the first target instruction.
[0182] The technical solution of this embodiment is to directly send a first target instruction carrying a target execution identifier through the instruction control platform, so that the controlled device can select a second target device from the first target device and then execute the second target device, thereby reducing the computing power resources required by the instruction control platform.
[0183] For ease of understanding, the following embodiments are based on any of the above embodiments and are illustrated by taking the method executed by a service control device, an instruction control platform, and a controlled device as an example.
[0184] See also Fig.12 , Fig.12 A flowchart of a method for processing instructions provided in an embodiment of the present application. The method of this embodiment may include:
[0185] S1210. The business control device continuously sends business control requests to the command management and control platform.
[0186] S1220: The instruction management and control platform configures a target execution identifier for each type of to-be-executed instruction in each received business control request, and sends the to-be-executed instruction configured with the target execution identifier as a first target instruction to the controlled device.
[0187] S1230: The controlled device determines second target instructions from the first target instructions in sequence based on the target execution identifiers corresponding to the first target instructions, and executes the second target instructions.
[0188] It can be understood that the detailed description of S1210-S1230 of this embodiment can refer to the description of any of the above embodiments and will not be repeated here.
[0189] The technical solution of this embodiment receives at least one business control request from a business control device through an instruction management and control platform, and performs instruction sending processing on each received business control request. For each type of to-be-executed instruction in the business control request, a target execution identifier is configured for the to-be-executed instruction, and based on the target execution identifier corresponding to the to-be-executed instruction, the first target instruction in the to-be-executed instruction is sent to the controlled device, so that the controlled device executes the first target instruction. Even if the configuration of a business may involve the issuance of dozens of consecutive instructions, multiple business control requests can be issued concurrently. Controlling the order in which the controlled device executes instructions through the target execution identifier of a single instruction is much more efficient than adding a distributed lock to each request, thereby improving the efficiency of the controlled device in executing business control instructions.
[0190] See also Fig.13 , Fig.13 A flowchart of another instruction processing method provided in an embodiment of the present application. The method of this embodiment may include:
[0191] S1310. The business control device continuously sends business control requests to the command management and control platform.
[0192] S1320. The instruction management and control platform configures a target execution identifier for each type of to-be-executed instruction in each received business control request, and sends the first target instruction in the to-be-executed instructions to the controlled device in sequence based on the target execution identifier corresponding to the to-be-executed instruction.
[0193] S1330: The controlled device executes the first target instructions in sequence based on the order in which the first target instructions are received.
[0194] It can be understood that the detailed description of S1310-S1330 of this embodiment can refer to the description of any of the above embodiments, and will not be repeated here.
[0195] The technical solution of this embodiment receives at least one business control request from a business control device through an instruction management and control platform, and performs instruction sending processing on each received business control request. For each type of to-be-executed instruction in the business control request, a target execution identifier is configured for the to-be-executed instruction, and based on the target execution identifier corresponding to the to-be-executed instruction, the first target instruction in the to-be-executed instruction is sent to the controlled device, so that the controlled device executes the first target instruction. Even if the configuration of a business may involve the issuance of dozens of consecutive instructions, multiple business control requests can be issued concurrently. Controlling the order in which the controlled device executes instructions through the target execution identifier of a single instruction is much more efficient than adding a distributed lock to each request, thereby improving the efficiency of the controlled device in executing business control instructions.
[0196] See also Fig.14 , Fig.14 This is a schematic diagram of the structure of a command sending device provided in an embodiment of the present application. Fig.14 The illustrated apparatus 1400 may include an instruction sending module 1410, wherein:
[0197] The instruction sending module 1410 is used to receive at least one service control request from the service control device and perform instruction sending processing on each received service control request, each service control request includes at least one type of instructions to be executed;
[0198] For each service control request, the instruction sending module 1410 is used to:
[0199] For each type of to-be-executed instruction in the service control request, a target execution identifier is configured for the to-be-executed instruction, wherein the target execution identifiers corresponding to the same type of to-be-executed instructions are used to indicate the order in which the same type of to-be-executed instructions are executed, and the same type of to-be-executed instructions have different corresponding target execution identifiers in different service control requests;
[0200] Based on the target execution identifier corresponding to the to-be-executed instruction, a first target instruction in the to-be-executed instruction is sent to the controlled device, so that the controlled device executes the first target instruction.
[0201] Optionally, when configuring the target execution identifier for the instruction to be executed, the instruction sending module 1410 may be used for at least one of the following:
[0202] Obtaining a current version number associated with the instruction to be executed, and determining a target version number of the instruction to be executed based on the current version number and a preset version number update step, and determining the target version number of the instruction to be executed as a target execution identifier of the instruction to be executed;
[0203] The cumulative count value of the instruction to be executed is obtained, and the target version number of the instruction to be executed is determined based on the cumulative count value and the initial version number corresponding to the instruction to be executed, and the target version number of the instruction to be executed is determined as the target execution identifier of the instruction to be executed.
[0204] Optionally, when the instruction sending module 1410 sends the first target instruction in the instructions to be executed to the controlled device based on the target execution identifier corresponding to the instructions to be executed, it can be used to:
[0205] Based on the target version number corresponding to the instruction to be executed, a first target instruction that meets a first preset condition is sent to the controlled device, where the first preset condition includes at least one of the following:
[0206] The difference between the target version number of the instruction to be executed and the base version number corresponding to the instruction to be executed is the version number update step;
[0207] The version number difference between the target version number of the instruction to be executed and the base version number corresponding to the instruction to be executed is the smallest, and the target version number is different from the base version number.
[0208] Optionally, if there are other to-be-executed instructions that belong to the same category as the first target instruction, after sending the first target instruction that meets the first preset condition to the controlled device, the instruction sending module 1410 is further configured to:
[0209] The target version number of the first target instruction is configured as a new base version number corresponding to the first target instruction, so as to determine a new first target instruction from other instructions to be executed based on the new base version number.
[0210] Optionally, when the instruction sending module 1410 sends the first target instruction in the instructions to be executed to the controlled device based on the target execution identifier corresponding to the instructions to be executed, it can be used for at least one of the following:
[0211] For similar to-be-executed instructions in different service control requests, based on target execution identifiers corresponding to similar to-be-executed instructions in different service control requests, first target instructions in the similar to-be-executed instructions are sequentially sent to the controlled device;
[0212] For multiple to-be-executed instructions in the same service control request, based on the execution order of each to-be-executed instruction configured in the same service control request, the first target instruction in the multiple to-be-executed instructions is sent to the controlled device in sequence.
[0213] Optionally, one of the first to-be-executed instructions among the multiple to-be-executed instructions has a hierarchical association relationship with at least one second to-be-executed instruction among the multiple to-be-executed instructions, and the second to-be-executed instruction is an instruction other than the first to-be-executed instruction among the multiple to-be-executed instructions. When the instruction sending module 1410 sends the first target instruction among the multiple to-be-executed instructions to the controlled device in sequence based on the execution order of each to-be-executed instruction configured in the same service control request, it can be used to:
[0214] When the first instruction to be executed and each of the second instructions to be executed meet the first preset condition, based on the execution order of the first instruction to be executed and the second instruction to be executed configured in the same service control request, sending the first target instruction in the first instruction to be executed and the second instruction to be executed to the controlled device in sequence;
[0215] The target execution identifier includes a target version number, and the first preset condition includes at least one of the following:
[0216] The difference between the target version number of the instruction to be executed and the base version number corresponding to the instruction to be executed is the version number update step;
[0217] The version number difference between the target version number of the instruction to be executed and the base version number corresponding to the instruction to be executed is the smallest, and the target version number is different from the base version number.
[0218] Optionally, when configuring a target execution identifier for the instruction to be executed, the instruction sending module 1410 may be used to:
[0219] Obtaining identification configuration attributes associated with each to-be-executed instruction having a hierarchical association relationship;
[0220] If the identification configuration attribute associated with one of the to-be-executed instructions with a hierarchical association relationship is occupied, wait until the identification configuration attributes associated with each of the to-be-executed instructions with a hierarchical association relationship are not occupied, and then configure the target execution identification for each of the to-be-executed instructions with a hierarchical association relationship;
[0221] If the identification configuration attribute associated with any instruction to be executed with a hierarchical association relationship is not occupied, then the identification configuration attribute associated with any instruction to be executed with a hierarchical association relationship is occupied, and the target execution identification of each instruction to be executed with a hierarchical association relationship is configured, and when the configuration of the target execution identification of each instruction to be executed with a hierarchical association relationship is completed, the occupied identification configuration attribute associated with each instruction to be executed with a hierarchical association relationship is released;
[0222] Among them, the fact that the flag configuration attribute is occupied indicates that the execution flag is being configured.
[0223] See also Fig.15 , Fig.15 This is a schematic diagram of the structure of an instruction execution device provided in an embodiment of the present application. Fig.15 The device 1500 shown may include a receiving module 1510 and an instruction execution module 1520, wherein:
[0224] Used to receive a first target instruction from an instruction control platform, where the first target instruction is obtained by the instruction control platform using the method of any of the above embodiments;
[0225] The instruction execution module 1520 is used to execute the received first target instruction.
[0226] Optionally, when executing the received first target instruction, the instruction execution module 1520 may be used for any of the following:
[0227] Based on the order in which the first target instructions are received, the first target instructions are executed in sequence;
[0228] Based on the target execution identifiers corresponding to the first target instructions, the second target instructions are determined from the first target instructions in sequence, and the second target instructions are executed.
[0229] Optionally, when the instruction execution module 1520 determines the second target instructions from the first target instructions in sequence based on the target execution identifiers corresponding to the first target instructions, it can be used to:
[0230] Based on the target version numbers corresponding to the first target instructions, second target instructions that meet the second preset condition are determined from the first target instructions in sequence, where the second preset condition includes at least one of the following:
[0231] The difference between the target version number of the first target instruction and the reference version number corresponding to the first target instruction is a preset version number update step length;
[0232] The version number difference between the target version number of the first target instruction and the reference version number corresponding to the first target instruction is the smallest, and the target version number is different from the reference version number.
[0233] The device of the embodiments of the present application can execute the method provided by the embodiments of the present application, and the implementation principles are similar. The actions performed by each module in the device of each embodiment of the present application correspond to the steps in the method of each embodiment of the present application. For the detailed functional description of each module of the device, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.
[0234] An embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory, and the processor executes the above computer program to implement the steps of the method of any embodiment of the present application.
[0235] In an alternative embodiment, an electronic device is provided, such as Fig.16 As shown, Fig.16 The electronic device 1600 shown includes: a processor 1601 and a memory 1603. The processor 1601 and the memory 1603 are connected, such as through a bus 1602. Optionally, the electronic device 1600 may also include a transceiver 1604, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 1604 is not limited to one, and the structure of the electronic device 1600 does not constitute a limitation on the embodiments of the present application.
[0236] Processor 1601 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 1601 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0237] The bus 1602 may include a path to transmit information between the above components. The bus 1602 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 1602 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.16 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0238] The memory 1603 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.
[0239] The memory 1603 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 1601. The processor 1601 is used to execute the computer program stored in the memory 1603 to implement the steps shown in the above method embodiment.
[0240] The electronic devices include but are not limited to: at least one of various personal computers, laptops, smart phones, tablet computers, Internet of Things devices or portable wearable devices. The Internet of Things devices may be at least one of smart speakers, smart TVs, smart air conditioners or smart car-mounted devices. The portable wearable device may be at least one of smart watches, smart bracelets or head-mounted devices.
[0241] The electronic device can also be a server, and the server can be implemented as an independent server or a server cluster composed of multiple servers. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application is not limited here.
[0242] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.
[0243] The embodiment of the present application also provides a computer program product, including a computer program, which can implement the steps and corresponding contents of the aforementioned method embodiment when executed by a processor.
[0244] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.
[0245] The above are only optional implementation methods for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the scheme of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.
Claims
1. A method for sending an instruction, characterized in that: include: receiving at least one service control request from a service control device, and performing instruction sending processing on each received service control request, wherein each service control request includes at least one type of instructions to be executed; Wherein, for each service control request, the instruction sending process includes: For each type of to-be-executed instruction in the service control request, configure a target execution identifier for the to-be-executed instruction, wherein the target execution identifiers corresponding to the to-be-executed instructions of the same type are used to indicate the order in which the to-be-executed instructions of the same type are executed, and the target execution identifiers corresponding to the to-be-executed instructions of the same type in different service control requests are different; Based on the target execution identifier corresponding to the to-be-executed instruction, a first target instruction in the to-be-executed instruction is sent to the controlled device, so that the controlled device executes the first target instruction.
2. The method according to claim 1, characterized in that The configuring a target execution identifier for the instruction to be executed includes at least one of the following: Obtaining a current version number associated with the instruction to be executed, and determining a target version number of the instruction to be executed based on the current version number and a preset version number update step, and determining the target version number of the instruction to be executed as a target execution identifier of the instruction to be executed; The cumulative count value of the instruction to be executed is obtained, and the target version number of the instruction to be executed is determined based on the cumulative count value and the initial version number corresponding to the instruction to be executed, and the target version number of the instruction to be executed is determined as the target execution identifier of the instruction to be executed.
3. The method according to claim 2, characterized in that The sending, based on the target execution identifier corresponding to the to-be-executed instruction, the first target instruction in the to-be-executed instruction to the controlled device, includes: Based on the target version number corresponding to the to-be-executed instruction, a first target instruction satisfying a first preset condition is sent to the controlled device, where the first preset condition includes at least one of the following: The difference between the target version number of the instruction to be executed and the reference version number corresponding to the instruction to be executed is the version number update step size; The version number difference between the target version number of the instruction to be executed and the reference version number corresponding to the instruction to be executed is the smallest, and the target version number is different from the reference version number.
4. The method according to claim 3, characterized in that If there are other to-be-executed instructions that belong to the same category as the first target instruction, after sending the first target instruction that meets the first preset condition to the controlled device, the method further includes: The target version number of the first target instruction is configured as the new reference version number corresponding to the first target instruction, so as to determine a new first target instruction from the other instructions to be executed based on the new reference version number.
5. The method according to any one of claims 1 to 3, characterized in that: The sending, based on the target execution identifier corresponding to the to-be-executed instruction, the first target instruction in the to-be-executed instruction to the controlled device, includes at least one of the following: For similar to-be-executed instructions in different service control requests, based on target execution identifiers corresponding to the similar to-be-executed instructions in different service control requests, sending first target instructions in the similar to-be-executed instructions to the controlled device in sequence; For multiple to-be-executed instructions in the same service control request, based on the execution order of each to-be-executed instruction configured in the same service control request, the first target instruction in the multiple to-be-executed instructions is sent to the controlled device in sequence.
6. The method according to claim 5, characterized in that A first instruction to be executed among the multiple instructions to be executed has a hierarchical association relationship with at least one second instruction to be executed among the multiple instructions to be executed, the second instruction to be executed is an instruction among the multiple instructions to be executed except the first instruction to be executed, and the sending of the first target instruction among the multiple instructions to be executed to the controlled device in sequence based on the execution order of the instructions to be executed configured in the same service control request includes: When the first instruction to be executed and each second instruction to be executed meet the first preset condition, based on the execution order of the first instruction to be executed and the second instruction to be executed configured in the same service control request, sending the first target instruction in the first instruction to be executed and the second instruction to be executed to the controlled device in sequence; The target execution identifier includes a target version number, and the first preset condition includes at least one of the following: The difference between the target version number of the instruction to be executed and the reference version number corresponding to the instruction to be executed is the version number update step size; The version number difference between the target version number of the instruction to be executed and the reference version number corresponding to the instruction to be executed is the smallest, and the target version number is different from the reference version number.
7. The method according to claim 6, characterized in that The configuring a target execution identifier for the instruction to be executed includes: Obtaining identification configuration attributes associated with each to-be-executed instruction having a hierarchical association relationship; If the identification configuration attribute associated with one of the to-be-executed instructions with a hierarchical association relationship is occupied, wait until the identification configuration attributes associated with each of the to-be-executed instructions with a hierarchical association relationship are not occupied, and then configure the target execution identification for each of the to-be-executed instructions with a hierarchical association relationship; If the identification configuration attribute associated with any instruction to be executed with a hierarchical association relationship is not occupied, then the identification configuration attribute associated with any instruction to be executed with a hierarchical association relationship is occupied, and the target execution identification of each instruction to be executed with a hierarchical association relationship is configured, and when the configuration of the target execution identification of each instruction to be executed with a hierarchical association relationship is completed, the occupied identification configuration attribute associated with each instruction to be executed with a hierarchical association relationship is released; The fact that the flag configuration attribute is occupied indicates that the execution flag is being configured.
8. A method for executing an instruction, characterized in that: include: Receiving a first target instruction from an instruction control platform, where the first target instruction is obtained by the instruction control platform based on the method according to any one of claims 1 to 7; The received first target instruction is executed.
9. The method according to claim 8, characterized in that The executing the received first target instruction includes any one of the following: Based on the order in which the first target instructions are received, executing the first target instructions in sequence; Based on the target execution identifiers corresponding to the first target instructions, second target instructions are determined from the first target instructions in sequence, and the second target instructions are executed.
10. The method according to claim 9, characterized in that The target execution identifier includes a target version number, and determining the second target instructions from the first target instructions in sequence based on the target execution identifiers corresponding to the first target instructions includes: Based on the target version numbers corresponding to the first target instructions, second target instructions satisfying a second preset condition are determined from the first target instructions in sequence, where the second preset condition includes at least one of the following: The difference between the target version number of the first target instruction and the reference version number corresponding to the first target instruction is a preset version number update step; The version number difference between the target version number of the first target instruction and the reference version number corresponding to the first target instruction is the smallest, and the target version number is different from the reference version number.
11. A command sending device, characterized in that: include: An instruction sending module, used to receive at least one service control request from a service control device, and perform instruction sending processing on each received service control request, each of the service control requests including at least one type of instructions to be executed; Wherein, for each service control request, the instruction sending module is used to: For each type of to-be-executed instruction in the service control request, configure a target execution identifier for the to-be-executed instruction, wherein the target execution identifiers corresponding to the to-be-executed instructions of the same type are used to indicate the order in which the to-be-executed instructions of the same type are executed, and the target execution identifiers corresponding to the to-be-executed instructions of the same type in different service control requests are different; Based on the target execution identifier corresponding to the to-be-executed instruction, a first target instruction in the to-be-executed instruction is sent to the controlled device, so that the controlled device executes the first target instruction.
12. An instruction execution device, characterized in that: include: A receiving module, configured to receive a first target instruction from an instruction control platform, wherein the first target instruction is obtained by the instruction control platform based on the method according to any one of claims 1 to 7; An instruction execution module is used to execute the received first target instruction.
13. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the method according to any one of claims 1 to 7 or claims 8 to 10.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 or claims 8 to 10 is implemented.