+

CN116248495A - Resource determination method, device and electronic device - Google Patents

Resource determination method, device and electronic device Download PDF

Info

Publication number
CN116248495A
CN116248495A CN202211542980.9A CN202211542980A CN116248495A CN 116248495 A CN116248495 A CN 116248495A CN 202211542980 A CN202211542980 A CN 202211542980A CN 116248495 A CN116248495 A CN 116248495A
Authority
CN
China
Prior art keywords
resource
message
configuration
cloud
order
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211542980.9A
Other languages
Chinese (zh)
Inventor
赵雅男
李良斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing SoundAI Technology Co Ltd
Original Assignee
Beijing SoundAI Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing SoundAI Technology Co Ltd filed Critical Beijing SoundAI Technology Co Ltd
Priority to CN202211542980.9A priority Critical patent/CN116248495A/en
Publication of CN116248495A publication Critical patent/CN116248495A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/082Configuration setting characterised by the conditions triggering a change of settings the condition being updates or upgrades of network functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明提供一种资源确定方法、装置和电子设备,涉及云计算技术领域。该资源确定方法包括:获取用户端的订单消息,所述订单消息中包括用户对云计算资源的配置需求;基于所述配置需求向云端发送资源配置指令;在接收到消息中间件发送的响应消息的情况下,基于所述响应消息,确定所述云计算资源的配置状态;其中,所述响应消息是所述云端响应所述资源配置指令而发出的消息。本发明通过消息中间件来接收云端的响应消息,进而更新资源的配置状态,无需主动向云端查询配置状态,能够减小查询压力,提高性能。

Figure 202211542980

The invention provides a resource determination method, device and electronic equipment, and relates to the technical field of cloud computing. The method for determining resources includes: obtaining an order message from a user terminal, the order message including the user's configuration requirements for cloud computing resources; sending a resource configuration instruction to the cloud based on the configuration requirements; receiving a response message sent by the message middleware In some cases, the configuration status of the cloud computing resource is determined based on the response message; wherein the response message is a message sent by the cloud in response to the resource configuration instruction. The present invention receives the response message from the cloud through the message middleware, and then updates the configuration status of the resource without actively querying the configuration status from the cloud, which can reduce query pressure and improve performance.

Figure 202211542980

Description

资源确定方法、装置和电子设备Resource determination method, device and electronic device

技术领域technical field

本发明涉及云计算技术领域,尤其涉及一种资源确定方法、装置和电子设备。The present invention relates to the technical field of cloud computing, in particular to a resource determination method, device and electronic equipment.

背景技术Background technique

云计算资源包括云主机、云存储、云网络等多种资源,在使用云计算资源的场景中,需要将多种资源进行整合。整合的流程可以分为两步:指令下发和资源绑定。其中,指令下发指的是创建资源的指令的调度,例如创建指令、开机指令、关闭指令等;而资源绑定指的是通过指令下发创建好资源后的绑定操作,例如将云主机跟云硬盘进行绑定。资源绑定是通过轮训查询的方式确定每种资源的状态。在这个过程中,必须轮训查询直到所有要绑定的资源的状态均为可用时,才能进行绑定,如果资源的状态不正确,无法完成绑定操作。在高并发的场景下,大量的接口轮训会导致查询压力过大,会造成不必要的资源浪费。Cloud computing resources include cloud hosts, cloud storage, cloud networks and other resources. In scenarios where cloud computing resources are used, multiple resources need to be integrated. The integration process can be divided into two steps: command issuance and resource binding. Among them, issuing instructions refers to the scheduling of instructions for creating resources, such as creating instructions, starting instructions, shutting down instructions, etc.; resource binding refers to the binding operation after resources are created through issuing instructions, such as linking cloud hosts with The cloud disk is bound. Resource binding is to determine the status of each resource through round-robin query. In this process, the binding must be performed until the status of all resources to be bound is available in round robin. If the status of the resources is incorrect, the binding operation cannot be completed. In a high-concurrency scenario, a large number of interface training rotations will cause excessive query pressure and cause unnecessary waste of resources.

发明内容Contents of the invention

本发明提供一种资源确定方法、装置和电子设备,用以解决现有技术中资源调度时资源状态查询压力过大的缺陷,实现系统性能的提升。The present invention provides a resource determination method, device and electronic equipment, which are used to solve the defect of excessive resource state query pressure during resource scheduling in the prior art, and to improve system performance.

本发明提供一种资源确定方法,包括:获取用户端的订单消息,所述订单消息中包括用户对云计算资源的配置需求;基于所述配置需求向云端发送资源配置指令;在接收到所述消息中间件发送的响应消息的情况下,基于所述响应消息,确定所述云计算资源的配置状态;其中,所述响应消息是所述云端响应所述资源配置指令而发出的消息。The present invention provides a method for determining resources, including: obtaining an order message from a user terminal, the order message including the user's configuration requirements for cloud computing resources; sending a resource configuration instruction to the cloud based on the configuration requirements; receiving the message In the case of a response message sent by the middleware, the configuration state of the cloud computing resource is determined based on the response message; wherein the response message is a message sent by the cloud in response to the resource configuration instruction.

根据本发明提供的一种实施方式,所述基于所述配置需求向云端发送资源配置指令,包括:基于所述配置需求,确定所述订单消息对应的资源编排配置文件,其中,所述资源编排配置文件用于指示处理所述订单消息的组件;调用所述资源编排配置文件中的组件,向所述云端发送资源配置指令。According to an embodiment provided by the present invention, the sending the resource configuration instruction to the cloud based on the configuration requirement includes: determining the resource arrangement configuration file corresponding to the order message based on the configuration requirement, wherein the resource arrangement The configuration file is used to indicate the components for processing the order message; the components in the resource arrangement configuration file are called to send resource configuration instructions to the cloud.

根据本发明提供的一种实施方式,所述资源编排配置文件中包括第一组件和第二组件;所述调用所述资源编排配置文件中的组件,向所述云端发送资源配置指令,包括:调用所述第一组件,对所述订单消息进行校验;在所述校验通过的情况下,调用所述第二组件,向所述云端发送资源配置指令。According to an implementation manner provided by the present invention, the resource orchestration configuration file includes a first component and a second component; the invoking the component in the resource orchestration configuration file and sending the resource configuration instruction to the cloud includes: The first component is called to verify the order message; if the verification is passed, the second component is called to send a resource configuration instruction to the cloud.

根据本发明提供的一种实施方式,所述基于所述配置需求向云端发送资源配置指令之后,还包括:获取所述云端返回的资源标识;将所述资源标识与所述订单消息进行关联,在接收到消息中间件发送的云端消息时,通过所述资源标识从所述云端消息中确定所述订单消息对应的响应消息。According to an embodiment provided by the present invention, after sending the resource configuration instruction to the cloud based on the configuration requirement, it further includes: acquiring the resource identifier returned by the cloud; associating the resource identifier with the order message, When the cloud message sent by the message middleware is received, the response message corresponding to the order message is determined from the cloud message through the resource identifier.

根据本发明提供的一种实施方式,所述确定所述云计算资源的配置状态之后,还包括:显示所述云计算资源的所述配置状态;再次接收到针对所述订单消息的响应消息时,更新显示的所述配置状态。According to an implementation manner provided by the present invention, after the determining the configuration state of the cloud computing resource, it further includes: displaying the configuration state of the cloud computing resource; when receiving a response message to the order message again , to update the displayed configuration status.

根据本发明提供的一种实施方式,所述订单消息中包括多个子订单;所述根据所述响应消息获取资源配置状态,包括:根据所述响应消息中的资源标识,确定所述响应消息对应的目标子订单,更新所述目标子订单的所述配置状态;在所述订单消息中所有的子订单的所述配置状态为第一状态的情况下,将每个所述子订单对应的资源进行绑定,获得所述订单消息对应的云计算资源。According to an embodiment of the present invention, the order message includes a plurality of sub-orders; the obtaining the resource configuration status according to the response message includes: determining the corresponding sub-order of the response message according to the resource identifier in the response message update the configuration status of the target sub-order; if the configuration status of all sub-orders in the order message is the first status, the resource corresponding to each sub-order Perform binding to obtain the cloud computing resource corresponding to the order message.

本发明还提供一种资源确定装置,包括:消息获取模块,用于获取用户端的订单消息,所述订单消息中包括用户对云计算资源的配置需求;指令下发模块,用于基于所述配置需求向云端发送资源配置指令;状态确定模块,用于在接收到所述消息中间件发送的响应消息的情况下,基于所述响应消息,确定所述云计算资源的配置状态;其中,所述响应消息是所述云端响应所述资源配置指令而发出的消息。The present invention also provides a device for determining resources, including: a message acquisition module, configured to acquire an order message from a user terminal, the order message including the user's configuration requirements for cloud computing resources; an instruction issuing module, configured to The resource configuration instruction is sent to the cloud as required; the state determination module is configured to determine the configuration state of the cloud computing resource based on the response message in the case of receiving the response message sent by the message middleware; wherein, the The response message is a message sent by the cloud in response to the resource configuration instruction.

根据本发明提供的一种实施方式,指令下发模块具体包括:资源编排模块,用于基于所述配置需求,确定所述订单消息对应的资源编排配置文件,其中,所述资源编排配置文件用于指示处理所述订单消息的组件;组件调用模块,用于调用所述资源编排配置文件中的组件,向所述云端发送资源配置指令。According to an embodiment provided by the present invention, the instruction sending module specifically includes: a resource orchestration module, configured to determine a resource orchestration configuration file corresponding to the order message based on the configuration requirement, wherein the resource orchestration configuration file uses Instructing the component to process the order message; the component calling module is used to call the component in the resource arrangement configuration file, and send the resource configuration instruction to the cloud.

根据本发明提供的一种实施方式,所述资源编排配置文件中包括第一组件和第二组件;所述组件调用模块,具体用于:调用所述第一组件,对所述订单消息进行校验;在所述校验通过的情况下,调用所述第二组件,向所述云端发送资源配置指令。According to an implementation manner provided by the present invention, the resource arrangement configuration file includes a first component and a second component; the component calling module is specifically configured to: call the first component, and verify the order message verification; if the verification is passed, the second component is invoked to send a resource configuration instruction to the cloud.

根据本发明提供的一种实施方式,该资源确定装置还可以包括:标识获取模块,用于获取所述云端返回的资源标识;资源关联模块,用于将所述资源标识与所述订单消息进行关联,在接收到消息中间件发送的云端消息时,通过所述资源标识从所述云端消息中确定所述订单消息对应的响应消息。According to an embodiment provided by the present invention, the resource determination device may further include: an identifier acquisition module, configured to acquire the resource identifier returned by the cloud; a resource association module, configured to associate the resource identifier with the order message Associating, when the cloud message sent by the message middleware is received, the response message corresponding to the order message is determined from the cloud message through the resource identifier.

根据本发明提供的一种实施方式,该资源确定装置还包括:状态显示模块,用于显示所述云计算资源的所述配置状态;显示更新模块,用于再次接收到针对所述订单消息的响应消息时,更新显示的所述配置状态。According to an embodiment of the present invention, the resource determination device further includes: a status display module, configured to display the configuration status of the cloud computing resource; a display update module, configured to receive the order message again In response to a message, update the displayed configuration status.

根据本发明提供的一种实施方式,所述订单消息中包括多个子订单;所述状态确定模块具体包括:状态更新模块,用于根据所述响应消息中的资源标识,确定所述响应消息对应的目标子订单,更新所述目标子订单的所述配置状态;资源绑定模块,用于在所述订单消息中所有的子订单的所述配置状态为第一状态的情况下,将每个所述子订单对应的资源进行绑定,获得所述订单消息对应的云计算资源。According to an embodiment provided by the present invention, the order message includes multiple sub-orders; the status determination module specifically includes: a status update module, configured to determine the response message corresponding update the configuration status of the target sub-order; the resource binding module is configured to, when the configuration status of all sub-orders in the order message is the first status, set each The resource corresponding to the sub-order is bound to obtain the cloud computing resource corresponding to the order message.

本发明还提供一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上述任一种所述资源确定方法。The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and operable on the processor. When the processor executes the program, it implements any one of the resource determination methods described above. .

本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述资源确定方法。The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any resource determination method described above can be implemented.

本发明还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上述任一种所述资源确定方法。The present invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, any resource determination method described above is implemented.

本发明提供的资源确定方法、装置和电子设备,通过消息中间件来接收云端返回的消息,云端的配置状态更新时,消息中间件会主动返回对应的响应消息。基于该响应消息可以及时更新云计算资源的配置状态,提高配置状态的时效性,便于用户及时了解配置状态。并且本方案无需查询向云端查询配置状态,能够降低查询压力,从而提高系统性能。The resource determination method, device and electronic equipment provided by the present invention receive the message returned by the cloud through the message middleware, and when the configuration state of the cloud is updated, the message middleware will actively return the corresponding response message. Based on the response message, the configuration state of the cloud computing resource can be updated in time, the timeliness of the configuration state can be improved, and it is convenient for the user to know the configuration state in time. Moreover, this solution does not need to query the configuration status from the cloud, which can reduce query pressure and improve system performance.

附图说明Description of drawings

为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the present invention or the technical solutions in the prior art, the accompanying drawings that need to be used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the accompanying drawings in the following description are the present invention. For some embodiments of the invention, those skilled in the art can also obtain other drawings based on these drawings without creative effort.

图1是本发明提供的资源确定方法的流程示意图;Fig. 1 is a schematic flowchart of a method for determining resources provided by the present invention;

图2是本发明提供的资源确定方法的应用场景示意图;FIG. 2 is a schematic diagram of an application scenario of a resource determination method provided by the present invention;

图3是本发明提供的资源确定装置的结构示意图;Fig. 3 is a schematic structural diagram of a device for determining resources provided by the present invention;

图4是本发明提供的电子设备的结构示意图。Fig. 4 is a schematic structural diagram of an electronic device provided by the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention , but not all examples. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

附图中所示的方框图仅仅是功能实体,不一定必须与物理上独立的实体相对应。即,可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。The block diagrams shown in the drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices entity.

附图中所示的流程图仅是示例性说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解,而有的操作/步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flow charts shown in the drawings are only exemplary illustrations, and do not necessarily include all contents and operations/steps, nor must they be performed in the order described. For example, some operations/steps can be decomposed, and some operations/steps can be combined or partly combined, so the actual order of execution may be changed according to the actual situation.

本说明书中,用语“第一”、“第二”、“第三”等仅作为标记使用,不是对其对象的数量或顺序限制。In this specification, terms such as "first", "second", and "third" are used only as signs, and do not limit the number or order of their objects.

下面结合附图描述本发明的资源确定方法、装置和电子设备。The resource determination method, device and electronic equipment of the present invention will be described below with reference to the accompanying drawings.

本发明实施例首先提供一种资源确定方法。示例性的,该资源确定方法可应用于手机、平板电脑、笔记本电脑、增强现实设备、虚拟现实设备、可穿戴智能设备等各种电子设备中,也可以应用于服务器、个人计算机等电子设备,本实施方式对此不作特殊限定。Embodiments of the present invention firstly provide a resource determination method. Exemplarily, the resource determination method can be applied to various electronic devices such as mobile phones, tablet computers, notebook computers, augmented reality devices, virtual reality devices, and wearable smart devices, and can also be applied to electronic devices such as servers and personal computers, There is no special limitation in this embodiment.

图1示出了该资源确定方法的流程图。参考图1所示,该方法可以包括如下步骤:Fig. 1 shows a flow chart of the resource determination method. Referring to Fig. 1, the method may include the following steps:

步骤10:获取用户端的订单消息,订单消息中包括用户对云计算资源的配置需求。Step 10: Obtain an order message from the user terminal, where the order message includes the user's configuration requirements for cloud computing resources.

在本实施方式中,用户端指的是需要使用云计算资源的系统、平台、应用等,本实施方式不限于此。云端指的是底层的提供云计算资源的系统。In this embodiment, the client refers to a system, platform, application, etc. that need to use cloud computing resources, and this embodiment is not limited thereto. The cloud refers to the underlying system that provides cloud computing resources.

图2示出了本实施例的资源确定方法的应用场景示意图。如图2所示,电子设备10用于执行本实施例中资源确定方法。该电子设备10通过网络与消息中间件11连接,消息中间件11可以通过网络与云端13连接。电子设备10可以将要发送给云端13的消息先发送给消息中间件11,然后由消息中间件11根据每个消息对应的接收端,将消息发送给对应的云端13。当云端13要向电子设备10发送消息时,同样由消息中间件11接收,再转发给电子设备10。FIG. 2 shows a schematic diagram of an application scenario of the method for determining resources in this embodiment. As shown in FIG. 2 , the electronic device 10 is configured to execute the resource determination method in this embodiment. The electronic device 10 is connected to the message middleware 11 through the network, and the message middleware 11 can be connected to the cloud 13 through the network. The electronic device 10 may first send the message to be sent to the cloud 13 to the message middleware 11, and then the message middleware 11 sends the message to the corresponding cloud 13 according to the receiving end corresponding to each message. When the cloud 13 wants to send a message to the electronic device 10 , it is also received by the message middleware 11 and forwarded to the electronic device 10 .

当电子设备10接收到用户端12发送的订单消息时,可以获取该订单消息中包含的用户端对云计算资源的配置需求。配置需求具体可以包括云计算资源的系统类型、资源大小、资源类型等等。When the electronic device 10 receives the order message sent by the user terminal 12, it may obtain the configuration requirements of the user terminal for cloud computing resources included in the order message. The configuration requirements may specifically include system types, resource sizes, resource types, and the like of cloud computing resources.

此外,订单消息中还可以包括用户端信息,例如用户端标识、用户端所属区域等,还可以包括订单消息的属性信息,例如订单标识、下单的接口信息、订单的类型等;或者也可以包括其他信息,例如下单的平台等,本实施方式对此不作特殊限定。In addition, the order message may also include client information, such as the client identifier, the area to which the client belongs, etc., and may also include attribute information of the order message, such as the order identifier, interface information for placing an order, and order type, etc.; or It includes other information, such as the platform where the order was placed, which is not specifically limited in this embodiment.

步骤20:基于配置需求向云端发送资源配置指令,并接收消息中间件发送的响应消息,该响应消息是云端响应资源配置指令而发出的消息。Step 20: Send a resource configuration command to the cloud based on the configuration requirement, and receive a response message sent by the message middleware. The response message is a message sent by the cloud in response to the resource configuration command.

消息中间件是基于队列与消息传递技术,在网络环境中为应用系统提供同步或异步、可靠的消息传输的软件系统。示例性的,常用的消息中间件包括:RabbitMQ、RocketMQ、Kafka等,本实施方式对消息中间件的具体类型不作特殊限定。Message middleware is a software system that provides synchronous or asynchronous and reliable message transmission for application systems in a network environment based on queuing and message passing technologies. Exemplarily, commonly used message middleware includes: RabbitMQ, RocketMQ, Kafka, etc., and this embodiment does not specifically limit the specific type of message middleware.

继续参考图2,发送者(电子设备10)将消息发送给消息中间件11,消息中间件11将消息存放在队列中,按照队列的读取规则再将消息转发给接收者(云端13)。消息中间件可以在不同平台之间通信,能够在客户端与服务器之间提供同步或异步的连接。Continuing to refer to FIG. 2, the sender (electronic device 10) sends the message to the message middleware 11, and the message middleware 11 stores the message in the queue, and then forwards the message to the receiver (cloud 13) according to the read rules of the queue. Message middleware can communicate between different platforms, and can provide synchronous or asynchronous connections between clients and servers.

示例性的,电子设备10可以通过消息中间件11与多个云端13进行连接。并且,电子设备10还可以通过消息中间件11与用户端12进行连接,通过消息中间件11来接收用户端12发送的消息,例如订单消息等。当消息中间11接收到用户端12发送的订单消息时,可以根据该订单消息对应的接收端,将该订单消息再转发给电子设备10。同理的,电子设备10要向用户端12或者云端13发送消息时,也可以通过消息中间11来进行转发。Exemplarily, the electronic device 10 can be connected with multiple clouds 13 through the message middleware 11 . Moreover, the electronic device 10 can also be connected with the client terminal 12 through the message middleware 11, and receive messages sent by the client terminal 12 through the message middleware 11, such as order messages. When the message center 11 receives the order message sent by the user terminal 12, it may forward the order message to the electronic device 10 according to the receiving end corresponding to the order message. Similarly, when the electronic device 10 wants to send a message to the client 12 or the cloud 13, it can also forward it through the message center 11.

在本实施方式中,电子设备10在接收到用户端的订单消息后,可以根据该订单消息中包含的配置需求,生成资源配置指令。该资源配置指令可以用于在云端创建与配置需求相匹配的云计算资源。例如,开通10G云主机、开通10G云硬盘等。同样的,电子设备10发送的资源配置指令由消息中间件11接收,并由该消息中间件11转发至对应的云端13。In this embodiment, after receiving the order message from the user terminal, the electronic device 10 may generate a resource configuration instruction according to the configuration requirement contained in the order message. The resource configuration instruction can be used to create cloud computing resources matching the configuration requirements on the cloud. For example, open 10G cloud host, open 10G cloud hard disk, etc. Similarly, the resource configuration instruction sent by the electronic device 10 is received by the message middleware 11 and forwarded to the corresponding cloud 13 by the message middleware 11 .

本实施方式中,电子设备10可以通过资源编排的方式实现资源配置指令的下发。资源编排是一个轻量、快速的组件式规则引擎框架,能够将复杂的任务按代码片段拆分成一个个组件,并定义组件之间的规则流程。具体的,根据不同任务的处理逻辑可以预先生成多种资源编排配置文件,该资源编排配置文件中包括了需要调用的多种组件,电子设备10可以根据该资源编排配置文件中的组件,以及组件的顺序依次调用各个组件,从而实现需要的功能。In this implementation manner, the electronic device 10 may realize the delivery of the resource configuration instruction by means of resource orchestration. Resource orchestration is a lightweight and fast component-based rule engine framework, which can split complex tasks into components by code fragments and define the rule flow between components. Specifically, various resource layout configuration files can be pre-generated according to the processing logic of different tasks, and the resource layout configuration file includes various components that need to be called, and the electronic device 10 can arrange components in the configuration file according to the resource, and the components The sequence calls each component in turn to achieve the required functions.

资源编排通过将任务进行拆分,通过多个组件来实现,灵活性更高,扩展性强。如果任务中有一个功能变更,只需要变更资源编排配置文件中一个组件,极大地减小了代码编写量,提高了可维护性和健壮性。并资源编排配置文件本身不需要额外的资源消耗,有利于提升系统的性能。Resource orchestration is realized by splitting tasks and using multiple components, which has higher flexibility and strong scalability. If there is a function change in the task, only one component in the resource orchestration configuration file needs to be changed, which greatly reduces the amount of code writing and improves maintainability and robustness. And the resource orchestration configuration file itself does not require additional resource consumption, which is conducive to improving system performance.

预先针对不同的任务可以创建不同的资源编排配置文件,每个任务中可以包括多个功能。当电子设备10接收到订单消息时,电子设备10可以确定订单消息对应的任务,例如该订单消息为创建云计算资源,从而根据该订单消息从预先生成的多个资源编排配置文件中,确定该订单消息对应的资源编排配置文件。然后按照该资源编排配置文件,调用该资源编排配置文件中的组件,实现向云端发送资源配置指令的任务。具体的,电子设备10在执行订单消息对应的资源编排配置文件,调用其中包括的组件时,可以执行如下操作:对订单消息进行校验,在校验通过的情况下,向云端发送资源配置指令。Different resource orchestration configuration files can be created in advance for different tasks, and each task can include multiple functions. When the electronic device 10 receives an order message, the electronic device 10 can determine the task corresponding to the order message, for example, the order message is to create a cloud computing resource, so as to determine the task from multiple pre-generated resource layout configuration files according to the order message. The resource orchestration configuration file corresponding to the order message. Then, according to the resource orchestration configuration file, the components in the resource orchestration configuration file are invoked to realize the task of sending resource configuration instructions to the cloud. Specifically, when the electronic device 10 executes the resource arrangement configuration file corresponding to the order message and calls the components included therein, it may perform the following operations: verify the order message, and send the resource configuration command to the cloud if the verification is passed .

对订单消息进行校验可以通过调用资源编排配置文件中的第一组件来实现。示例性的,电子设备10可以对订单消息进行多种校验,例如权限校验、镜像校验、资源配置套餐校验、资源预占结果校验等。第一组件可以包括多个,每个第一组件可以实现其中一种校验功能。根据资源编排配置文件中包括的第一组件,来对订单消息进行对应的校验。举例来说,权限校验可以指校验用户端是否存在资源开通权限,根据该用户端的用户端信息,电子设备可以查询存储的权限名单中是否包括该用户端,在权限名单中包括该用户端的情况下,则权限校验通过。镜像指的是用户端所需的云计算资源的系统类型。镜像校验则用于校验用户端是否具有对应的系统类型的权限。资源配置套餐包括CPU、内存、网络带宽、系统盘大小、数据盘大小、费用信息等。资源配置套餐校验则用于确定配置需求是否与用户端的资源配置套餐相匹配,例如配置需求中的网络带宽与资源配置套餐中的网络带宽是否一致,镜像是否与系统盘大小匹配等等。资源预占结果用于指示云端是否存在用户端所需的可用资源,通过向云端查询配置需求对应的可用资源,可以得到云端反馈的资源预占结果。如果该资源预占结果为资源预占成功,则资源预占结果校验通过。当资源预占成功时,资源预占结果中包括可用资源的资源标识。Verifying the order message can be implemented by calling the first component in the resource orchestration configuration file. Exemplarily, the electronic device 10 may perform multiple checks on the order message, such as permission check, image check, resource configuration package check, resource reservation result check, and the like. There may be multiple first components, and each first component may implement one of the verification functions. Corresponding verification is performed on the order message according to the first component included in the resource orchestration configuration file. For example, authority verification can refer to verifying whether the user terminal has resource activation authority. According to the user terminal information of the user terminal, the electronic device can query whether the user terminal is included in the stored authority list, and the user terminal is included in the authority list. In this case, the permission verification is passed. Mirroring refers to the system type of cloud computing resources required by the client. Mirror verification is used to verify whether the client has the corresponding system type of authority. The resource configuration package includes CPU, memory, network bandwidth, system disk size, data disk size, cost information, etc. The resource configuration package verification is used to determine whether the configuration requirement matches the resource configuration package on the client side, for example, whether the network bandwidth in the configuration requirement is consistent with the network bandwidth in the resource configuration package, whether the mirror image matches the system disk size, and so on. The resource reservation result is used to indicate whether there are available resources required by the client in the cloud, and the resource reservation result fed back by the cloud can be obtained by querying the cloud for the available resources corresponding to the configuration requirements. If the resource preemption result is that the resource preemption is successful, the verification of the resource preemption result is passed. When the resource preemption succeeds, the resource preemption result includes resource identifiers of available resources.

在每个第一组件对应的校验均通过的情况下,再调用第二组件,向云端发送资源配置指令。第二组件可以被编辑为通过发送指令的接口,向云端发送资源配置指令。When the checks corresponding to each first component pass, the second component is invoked to send a resource configuration command to the cloud. The second component can be edited to send resource configuration instructions to the cloud through the interface for sending instructions.

接下来,步骤30:在接收到消息中间件发送的响应消息的情况下,基于响应消息,确定云计算资源的配置状态。Next, step 30: in the case of receiving the response message sent by the message middleware, based on the response message, determine the configuration state of the cloud computing resource.

电子设备10发送出去的资源配置指令由消息中间件11转发给云端13。云端13可以根据该资源配置指令创建对应的云计算资源给用户端。云计算资源的创建过程是有状态的数据,例如,云计算资源的创建过程的状态可以包括:开始创建、创建中、已完成、待绑定、运行中等。上述状态可以作为配置状态。为了便于用户及时了解云计算资源的配置状态,云端13每更新一次配置状态向消息中间件11发送一次更新后的配置状态。具体的,在云端13收到资源配置指令后,向消息中间件11发送资源正在创建中的响应消息。该响应消息由消息中间件11接收后转发给电子设备10,电子设备10可以根据该响应消息来更新用户端的订单消息对应的配置状态。The resource configuration instruction sent by the electronic device 10 is forwarded to the cloud 13 by the message middleware 11 . The cloud 13 can create corresponding cloud computing resources for the client according to the resource configuration instruction. The creation process of the cloud computing resource is stateful data, for example, the status of the creation process of the cloud computing resource may include: creating, creating, completed, pending binding, running, etc. The above states can be regarded as configuration states. In order to facilitate the user to know the configuration status of cloud computing resources in a timely manner, the cloud 13 sends the updated configuration status to the message middleware 11 every time the configuration status is updated. Specifically, after receiving the resource configuration instruction, the cloud 13 sends a response message to the message middleware 11 indicating that the resource is being created. The response message is received by the message middleware 11 and forwarded to the electronic device 10, and the electronic device 10 can update the configuration status corresponding to the order message of the client according to the response message.

通常电子设备10要更新订单消息的配置状态时,需要按照一定的次数、间隔时长来进行查询,很容易造成与云端的配置状态不一致的情况。本实施方式中,电子设备10无需按照间隔时长和次数来查询资源的配置状态,而是由消息中间件11主动来反馈配置状态,可以避免轮训次数和间隔时长的限制,能够及时更新配置状态,提高状态更新的时效性,并且能保证与云端状态的一致性。Usually, when the electronic device 10 wants to update the configuration state of the order message, it needs to perform queries according to a certain number of times and at intervals, which may easily cause an inconsistency with the configuration state of the cloud. In this embodiment, the electronic device 10 does not need to query the configuration status of resources according to the interval time and number of times, but the message middleware 11 actively feeds back the configuration status, which can avoid the limitation of the number of rounds and the interval time, and can update the configuration status in time. Improve the timeliness of status updates and ensure consistency with cloud status.

示例性的,云端13可以同时为多个用户端分配多个云计算资源,因此电子设备10可以同步或异步接收到多个针对不同云计算资源的响应消息。这些响应消息可以是多个云计算资源的配置状态。电子设备10接收到响应消息时,可以根据该响应消息中资源ID确定该响应消息对应的订单消息。Exemplarily, the cloud 13 can allocate multiple cloud computing resources to multiple client terminals at the same time, so the electronic device 10 can receive multiple response messages for different cloud computing resources synchronously or asynchronously. These response messages may be the configuration status of multiple cloud computing resources. When the electronic device 10 receives the response message, it may determine the order message corresponding to the response message according to the resource ID in the response message.

具体的,在下发资源配置指令之前,电子设备10要先校验云端13是否存在与配置需求相匹配的可用资源。当电子设备10向云端13发送查询可用资源的消息后,如果云端13存在可用资源,则会返回可用资源的资源标识。当电子设备10获取到云端13返回的可用资源的资源标识时,可以将该资源标识与订单消息相关联。Specifically, before issuing the resource configuration command, the electronic device 10 first checks whether there is an available resource matching the configuration requirement in the cloud 13 . After the electronic device 10 sends a message of querying available resources to the cloud 13, if there are available resources in the cloud 13, the resource identification of the available resources will be returned. When the electronic device 10 acquires the resource identifier of the available resource returned by the cloud 13, the resource identifier can be associated with the order message.

在接收到消息中间件11发送的云端消息时,可以通过云端消息中的资源标识确定订单消息对应的响应消息。如果云端消息中包含的资源标识与订单消息的订单标识存在关联关系,则该云端消息为该订单消息的响应消息。进而根据该响应消息确定订单消息对应的云计算资源的配置状态。When the cloud message sent by the message middleware 11 is received, the response message corresponding to the order message can be determined through the resource identifier in the cloud message. If the resource identifier included in the cloud message is associated with the order identifier of the order message, the cloud message is a response message to the order message. Further, according to the response message, the configuration state of the cloud computing resource corresponding to the order message is determined.

确定用户端所需的云计算资源的配置状态之后,电子设备10可以将该配置状态进行显示,便于用户端的用户了解云计算资源的配置进度。然后,电子设备10可以在再次接收到针对上述订单消息的响应时,根据该再次接收到的响应消息更新显示的配置状态。例如,将配置状态从“创建中”更新为“已完成”等。After determining the configuration state of the cloud computing resource required by the user end, the electronic device 10 may display the configuration state, so that the user at the user end can know the configuration progress of the cloud computing resource. Then, when the electronic device 10 receives a response to the order message again, it may update the displayed configuration status according to the response message received again. For example, updating configuration status from "creating" to "completed", etc.

如果用户端需要多种类型的云计算资源,例如云主机和云网络,则订单消息中可以包括多个子订单,每个子订单对应一种资源类型。电子设备10接收到包括多个子订单的订单消息时,可以分别校验每个子订单对应的资源类型是否有可用资源,从而获取每个资源类型对应的可用资源的资源标识。然后,在电子设备10接收到消息中间件11发送来的响应消息时,可以确定每个响应消息对应的目标子订单,然后获取该响应消息中的配置状态,更新给该目标子订单。在订单消息包括的所有子订单的配置状态均为已完成的状态(即第一状态)的情况下,将每个子订单对应的资源进行绑定,得到该订单消息对应的云计算资源。If the client needs multiple types of cloud computing resources, such as cloud hosts and cloud networks, the order message may include multiple sub-orders, and each sub-order corresponds to a resource type. When the electronic device 10 receives an order message including multiple sub-orders, it may respectively check whether there are available resources in the resource type corresponding to each sub-order, so as to obtain the resource identifier of the available resource corresponding to each resource type. Then, when the electronic device 10 receives the response message sent by the message middleware 11, it can determine the target sub-order corresponding to each response message, then obtain the configuration status in the response message, and update it to the target sub-order. When the configuration states of all sub-orders included in the order message are completed (ie, the first state), the resources corresponding to each sub-order are bound to obtain the cloud computing resources corresponding to the order message.

举例来说,假设订单消息M中包括云主机的子订单m1和云硬盘的子订单m2。配置需求可以包括云主机的大小、系统类型,以及云硬盘的大小、类型等信息。当电子设备10接收到该订单消息M时,通过对应的资源编排配置文件来下发开通云主机的资源配置指令A1,以及开通云硬盘的资源配置指令A2。上述资源配置指令A1和资源配置指令A2通过消息中间件11转发给云端13。云端13收到资源配置指令A1和资源配置指令A2时,开始开通对应的资源,并返回资源正在开通中的响应消息B。电子设备10从消息中间件11中收到响应消息B时,可以根据该响应消息B的资源标识确定该响应消息B关联的订单标识,从而将该订单标识对应的子订单,如子订单m1的配置状态更新为“开通中”。同理的,电子设备10可以根据接收到的其他响应消息再对子订单m1与子订单m2的配置状态进行更新。例如,电子设备10从消息中间11中收到资源已开通完毕的响应消息C时,可以根据响应消息C关联的订单标识,确定该响应消息C对应的子订单,如子订单m2,将该子订单m2的配置状态更新为“已开通”。For example, assume that the order message M includes the sub-order m1 of the cloud host and the sub-order m2 of the cloud hard disk. The configuration requirements can include information such as the size and system type of the cloud host, and the size and type of the cloud hard disk. When the electronic device 10 receives the order message M, it issues the resource configuration instruction A1 for activating the cloud host and the resource configuration instruction A2 for activating the cloud hard disk through the corresponding resource arrangement configuration file. The above-mentioned resource configuration instruction A1 and resource configuration instruction A2 are forwarded to the cloud 13 through the message middleware 11 . When the cloud 13 receives the resource configuration command A1 and the resource configuration command A2, it starts to activate the corresponding resource, and returns a response message B indicating that the resource is being activated. When the electronic device 10 receives the response message B from the message middleware 11, it can determine the order identifier associated with the response message B according to the resource identifier of the response message B, so as to identify the sub-order corresponding to the order, such as the sub-order m1 The configuration status is updated to "Activating". Similarly, the electronic device 10 may update the configuration status of the sub-order m1 and the sub-order m2 according to other received response messages. For example, when the electronic device 10 receives a response message C from the message center 11 that the resource has been opened, it can determine the sub-order corresponding to the response message C according to the order identifier associated with the response message C, such as sub-order m2, and the sub-order The configuration status of order m2 is updated to "Activated".

在电子设备10确定订单消息M的所有子订单,即子订单m1与子订单m2的配置状态均为“已开通”时,电子设备10可以将子订单m1对应的资源与子订单m2对应的资源进行绑定。绑定完成后,云主机和云硬盘的状态为可用,用户端可以使用云主机和云硬盘。When the electronic device 10 determines that all sub-orders of the order message M, that is, the configuration states of the sub-order m1 and the sub-order m2 are both "opened", the electronic device 10 can assign the resource corresponding to the sub-order m1 to the resource corresponding to the sub-order m2 to bind. After the binding is completed, the status of the cloud host and cloud disk is available, and the client can use the cloud host and cloud disk.

电子设备10确定了每个子订单的配置状态后,可以将每个子订单的配置状态进行显示,便于用户端12进行查看。After the electronic device 10 determines the configuration status of each sub-order, it can display the configuration status of each sub-order, which is convenient for the user terminal 12 to view.

示例性地,通过资源编排的方式也可以对接收到的响应消息进行处理。预先通过资源编排定义用于处于响应消息的组件,以及各组件之间的顺序,保存为资源编排配置文件等。当接收到响应消息时,执行该资源编排配置文件,依次调用其中的各个组件,实现对响应消息的处理。Exemplarily, the received response message can also be processed through resource orchestration. The components used to respond to messages and the order among the components are defined in advance through resource orchestration, and saved as resource orchestration configuration files, etc. When a response message is received, the resource arrangement configuration file is executed, and each component therein is called in turn to realize the processing of the response message.

在云端13创建云计算资源的过程中,可能存在单个资源的配置状态并发的情况,例如,云主机创建的很快,“创建中”和“已完成”两条响应消息几乎同时发送到消息中间件11。电子设备10接收到这两条响应消息的时间很接近,可能存在并发的情况。为了保证消息并发时状态更新的准确性,电子设备10可以先对接收到的多个响应消息进行排序,然后按照排序的顺序依次处理每个响应消息,实现配置状态的更新。In the process of creating cloud computing resources on Cloud 13, there may be concurrent configuration status of a single resource. For example, the cloud host is created very quickly, and two response messages of "creating" and "completed" are sent to the middle of the message almost at the same time piece 11. The time at which the electronic device 10 receives the two response messages is very close, and there may be concurrency. In order to ensure the accuracy of state update when messages are concurrent, the electronic device 10 may first sort the multiple received response messages, and then process each response message sequentially according to the sorted order, so as to update the configuration state.

具体的,在电子设备10每接收到一个响应消息时,先确定该响应消息是否为开始消息。如果响应消息包括开始标签,则响应消息为开始消息;如果响应消息不包含开始标签,则响应消息不为开始消息。如果响应消息为开始消息,则电子设备10可以对该响应消息进行处理,即根据该响应消息对订单消息的配置状态进行更新。处理之后,在对该响应消息添加处理标记。Specifically, each time the electronic device 10 receives a response message, it first determines whether the response message is a start message. If the response message includes a start tag, the response message is a start message; if the response message does not contain a start tag, the response message is not a start message. If the response message is a start message, the electronic device 10 may process the response message, that is, update the configuration status of the order message according to the response message. After processing, a processing mark is added to the response message.

在响应消息不为开始消息的情况下,电子设备10再确定响应消息是否存在前序消息。前序消息指的是在响应消息之前相邻的消息。在响应消息的消息头中包含有前序消息的信息,例如消息标识等。如果电子设备10确定响应消息的消息头中不包含前序消息的信息,则可以确定该响应消息不存在前序消息,则电子设备10可以对该响应消息进行处理。If the response message is not a start message, the electronic device 10 then determines whether there is a preamble message in the response message. A preamble message refers to a message that precedes a response message. The message header of the response message contains the information of the previous message, such as message identifier and so on. If the electronic device 10 determines that the message header of the response message does not contain the information of the preceding message, it may determine that the response message does not contain the preceding message, and the electronic device 10 may process the response message.

如果电子设备10确定该响应消息的消息头中包括前序消息的信息,则再确定前序消息是否包括处理标记。如果响应消息中不包括处理标记,则将该响应消息放入队列中,进行排序。等待预设时间再从该队列中依次取出未处理的响应消息进行处理。如果前序消息包括处理标记,则说明该前序消息已经被处理,电子设备可以对该响应消息进行处理,保证在响应消息前的消息已被处理完,再处理响应消息,避免因多个消息并发而导致状态更新错误的问题,提高状态更新的准确性。If the electronic device 10 determines that the message header of the response message includes the information of the previous message, it then determines whether the previous message includes the processing flag. If the processing flag is not included in the response message, the response message is put into a queue for sorting. Wait for the preset time and then sequentially take out unprocessed response messages from the queue for processing. If the pre-order message includes a processing flag, it means that the pre-order message has been processed, and the electronic device can process the response message to ensure that the messages before the response message have been processed, and then process the response message to avoid multiple messages. The problem of status update errors caused by concurrency improves the accuracy of status updates.

进一步的,本实施例还提供一种资源确定装置,可用于执行上述资源确定方法。下面对本发明提供的资源确定装置进行描述,下文描述的资源确定装置与上文描述的资源确定方法可相互对应参照。Further, this embodiment also provides a device for determining resources, which can be used to execute the above method for determining resources. The resource determining device provided by the present invention is described below, and the resource determining device described below and the resource determining method described above can be referred to in correspondence.

图3示出了本实施例中资源确定装置的结构示意图。如图3所示,该资源确定装置30可以包括:消息获取模块31,用于获取用户端的订单消息,所述订单消息中包括用户对云计算资源的配置需求;指令下发模块32,用于基于所述配置需求向云端发送资源配置指令;状态确定模块33,用于在接收到所述消息中间件发送的响应消息的情况下,基于所述响应消息,确定所述云计算资源的配置状态;其中,所述响应消息是所述云端响应所述资源配置指令而发出的消息。Fig. 3 shows a schematic structural diagram of the resource determining device in this embodiment. As shown in FIG. 3 , the resource determination device 30 may include: a message obtaining module 31, configured to obtain an order message from the user end, the order message including the user's configuration requirements for cloud computing resources; an instruction issuing module 32, configured to Send resource configuration instructions to the cloud based on the configuration requirements; the state determination module 33 is configured to determine the configuration state of the cloud computing resources based on the response message in the case of receiving the response message sent by the message middleware ; Wherein, the response message is a message sent by the cloud in response to the resource configuration instruction.

示例性地,指令下发模块32具体包括:资源编排模块,用于基于所述配置需求,确定所述订单消息对应的资源编排配置文件,其中,所述资源编排配置文件用于指示处理所述订单消息的组件;组件调用模块,用于调用所述资源编排配置文件中的组件,向所述云端发送资源配置指令。Exemplarily, the instruction delivery module 32 specifically includes: a resource orchestration module, configured to determine a resource orchestration configuration file corresponding to the order message based on the configuration requirements, wherein the resource orchestration configuration file is used to instruct to process the A component of the order message; a component calling module, used to call the components in the resource arrangement configuration file, and send a resource configuration instruction to the cloud.

示例性地,所述资源编排配置文件中包括第一组件和第二组件;所述组件调用模块,具体用于:调用所述第一组件,对所述订单消息进行校验;在所述校验通过的情况下,调用所述第二组件,向所述云端发送资源配置指令。Exemplarily, the resource orchestration configuration file includes a first component and a second component; the component calling module is specifically configured to: call the first component, and verify the order message; If the verification is passed, the second component is invoked to send a resource configuration instruction to the cloud.

示例性地,该资源确定装置30还可以包括:标识获取模块,用于获取所述云端返回的资源标识;资源关联模块,用于将所述资源标识与所述订单消息进行关联,在接收到消息中间件发送的云端消息时,通过所述资源标识从所述云端消息中确定所述订单消息对应的响应消息。Exemplarily, the resource determination device 30 may further include: an identifier acquisition module, configured to acquire the resource identifier returned by the cloud; a resource association module, configured to associate the resource identifier with the order message, and upon receiving When the cloud message is sent by the message middleware, the response message corresponding to the order message is determined from the cloud message through the resource identifier.

示例性地,该资源确定装置30还包括:状态显示模块,用于显示所述云计算资源的所述配置状态;显示更新模块,用于再次接收到针对所述订单消息的响应消息时,更新显示的所述配置状态。Exemplarily, the resource determining device 30 further includes: a status display module, configured to display the configuration status of the cloud computing resource; a display update module, configured to update the status when a response message to the order message is received again Displays the status of the configuration.

示例性地,所述订单消息中包括多个子订单;所述状态确定模块33具体包括:状态更新模块,用于根据所述响应消息中的资源标识,确定所述响应消息对应的目标子订单,更新所述目标子订单的所述配置状态;资源绑定模块,用于在所述订单消息中所有的子订单的所述配置状态为第一状态的情况下,将每个所述子订单对应的资源进行绑定,获得所述订单消息对应的云计算资源。Exemplarily, the order message includes multiple sub-orders; the status determination module 33 specifically includes: a status update module, configured to determine the target sub-order corresponding to the response message according to the resource identifier in the response message, Updating the configuration state of the target sub-order; a resource binding module, configured to map each of the sub-orders to Bind the resources of the order message to obtain the cloud computing resources corresponding to the order message.

在本实施方式中,通过消息中间件来向用户端和云端发送消息,并接收用户端和云端返回的消息。云端的配置状态更新时,消息中间件会主动返回对应的响应消息,基于该响应消息可以及时更新云计算资源的配置状态,提高响应的时效性,并且无需查询云端的云计算资源的配置状态,能够降低查询压力。In this embodiment, messages are sent to the client and the cloud through message middleware, and messages returned by the client and the cloud are received. When the configuration status of the cloud is updated, the message middleware will actively return the corresponding response message. Based on the response message, the configuration status of the cloud computing resources can be updated in time to improve the timeliness of the response, and there is no need to query the configuration status of the cloud computing resources in the cloud. Can reduce query pressure.

图4示例了一种电子设备的实体结构示意图,如图4所示,该电子设备可以包括:处理器(processor)410、通信接口(Communications Interface)420、存储器(memory)430和通信总线440,其中,处理器410,通信接口420,存储器430通过通信总线440完成相互间的通信。处理器410可以调用存储器430中的逻辑指令,以执行资源确定方法,该方法包括:获取用户端的订单消息,所述订单消息中包括用户对云计算资源的配置需求;基于所述配置需求向云端发送资源配置指令;在接收到所述消息中间件发送的响应消息的情况下,基于所述响应消息,确定所述云计算资源的配置状态;其中,所述响应消息是所述云端响应所述资源配置指令而发出的消息。FIG. 4 illustrates a schematic diagram of the physical structure of an electronic device. As shown in FIG. 4, the electronic device may include: a processor (processor) 410, a communication interface (Communications Interface) 420, a memory (memory) 430 and a communication bus 440, Wherein, the processor 410 , the communication interface 420 , and the memory 430 communicate with each other through the communication bus 440 . The processor 410 can call the logic instructions in the memory 430 to execute the resource determination method. The method includes: obtaining an order message from the user end, the order message including the user's configuration requirements for cloud computing resources; sending a resource configuration instruction; in the case of receiving a response message sent by the message middleware, based on the response message, determine the configuration state of the cloud computing resource; wherein, the response message is the cloud response to the Messages sent for resource configuration instructions.

示例性的,处理器410还可以调用存储器430中的逻辑指令,以执行:基于所述配置需求,确定所述订单消息对应的资源编排配置文件,其中,所述资源编排配置文件用于指示处理所述订单消息的组件;调用所述资源编排配置文件中的组件,向所述云端发送资源配置指令。Exemplarily, the processor 410 may also call the logic instruction in the memory 430 to execute: based on the configuration requirements, determine the resource orchestration configuration file corresponding to the order message, where the resource orchestration configuration file is used to instruct processing A component of the order message; calling a component in the resource arrangement configuration file to send a resource configuration instruction to the cloud.

示例性的,所述资源编排配置文件中还可以包括第一组件和第二组件。基于此,处理器410还可以调用存储器430中的逻辑指令,以执行:调用所述第一组件,对所述订单消息进行校验;在所述校验通过的情况下,调用所述第二组件,向所述云端发送资源配置指令。Exemplarily, the resource orchestration configuration file may further include a first component and a second component. Based on this, the processor 410 can also call the logic instructions in the memory 430 to execute: calling the first component to verify the order message; if the verification is passed, calling the second component A component that sends a resource configuration instruction to the cloud.

示例性的,处理器410还可以调用存储器430中的逻辑指令,以执行:获取所述云端返回的资源标识;将所述资源标识与所述订单消息进行关联,在接收到消息中间件发送的云端消息时,通过所述资源标识从所述云端消息中确定所述订单消息对应的响应消息。Exemplarily, the processor 410 may also call the logic instructions in the memory 430 to perform: obtaining the resource identifier returned by the cloud; associating the resource identifier with the order message, and receiving the In the case of a cloud message, the response message corresponding to the order message is determined from the cloud message through the resource identifier.

示例性的,处理器410还可以调用存储器430中的逻辑指令,以执行:显示所述云计算资源的所述配置状态;再次接收到针对所述订单消息的响应消息时,更新显示的所述配置状态。Exemplarily, the processor 410 may also call the logic instructions in the memory 430 to perform: displaying the configuration state of the cloud computing resource; when receiving a response message to the order message again, updating the displayed configuration status.

示例性的,所述订单消息中包括多个子订单,基于此,处理器410还可以调用存储器430中的逻辑指令,以执行:根据所述响应消息中的资源标识,确定所述响应消息对应的目标子订单,更新所述目标子订单的所述配置状态;在所述订单消息中所有的子订单的所述配置状态为第一状态的情况下,将每个所述子订单对应的资源进行绑定,获得所述订单消息对应的云计算资源。Exemplarily, the order message includes a plurality of sub-orders, based on which, the processor 410 may also invoke logic instructions in the memory 430 to perform: according to the resource identifier in the response message, determine the sub-orders corresponding to the response message Target sub-orders, updating the configuration status of the target sub-orders; in the case that the configuration status of all sub-orders in the order message is the first status, perform resource corresponding to each sub-order Binding to obtain the cloud computing resource corresponding to the order message.

此外,上述的存储器430中的逻辑指令可以通过软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, the above logic instructions in the memory 430 may be implemented in the form of software function units and be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes. .

另一方面,本发明还提供一种计算机程序产品,所述计算机程序产品包括计算机程序,计算机程序可存储在非暂态计算机可读存储介质上,所述计算机程序被处理器执行时,计算机能够执行上述各方法所提供的资源确定方法,该方法包括:获取用户端的订单消息,所述订单消息中包括用户对云计算资源的配置需求;基于所述配置需求向云端发送资源配置指令;在接收到所述消息中间件发送的响应消息的情况下,基于所述响应消息,确定所述云计算资源的配置状态;其中,所述响应消息是所述云端响应所述资源配置指令而发出的消息。On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can Executing the resource determination method provided by the above methods, the method includes: obtaining an order message from the client, the order message including the user's configuration requirements for cloud computing resources; sending resource configuration instructions to the cloud based on the configuration requirements; receiving In the case of a response message sent by the message middleware, determine the configuration state of the cloud computing resource based on the response message; wherein the response message is a message sent by the cloud in response to the resource configuration instruction .

又一方面,本发明还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现以执行上述各方法提供的资源确定方法,该方法包括:获取用户端的订单消息,所述订单消息中包括用户对云计算资源的配置需求;基于所述配置需求向云端发送资源配置指令;在接收到所述消息中间件发送的响应消息的情况下,基于所述响应消息,确定所述云计算资源的配置状态;其中,所述响应消息是所述云端响应所述资源配置指令而发出的消息。In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for determining resources provided by the above-mentioned methods is implemented, and the method includes: Obtaining an order message from the client, the order message including the user's configuration requirements for cloud computing resources; sending resource configuration instructions to the cloud based on the configuration requirements; receiving the response message sent by the message middleware, based on The response message determines the configuration state of the cloud computing resource; wherein, the response message is a message sent by the cloud in response to the resource configuration instruction.

以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without any creative efforts.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the implementations, those skilled in the art can clearly understand that each implementation can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in computer-readable storage media, such as ROM/RAM, magnetic discs, optical discs, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments.

最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent replacements are made to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims (10)

1.一种资源确定方法,其特征在于,包括:1. A resource determination method, characterized in that, comprising: 获取用户端的订单消息,所述订单消息中包括用户对云计算资源的配置需求;Obtaining an order message from the client, where the order message includes the user's configuration requirements for cloud computing resources; 基于所述配置需求向云端发送资源配置指令;Sending resource configuration instructions to the cloud based on the configuration requirements; 在接收到消息中间件发送的响应消息的情况下,基于所述响应消息,确定所述云计算资源的配置状态;In the case of receiving the response message sent by the message middleware, based on the response message, determine the configuration state of the cloud computing resource; 其中,所述响应消息是所述云端响应所述资源配置指令而发出的消息。Wherein, the response message is a message sent by the cloud in response to the resource configuration instruction. 2.根据权利要求1所述的资源确定方法,其特征在于,所述基于所述配置需求向云端发送资源配置指令,包括:2. The resource determination method according to claim 1, wherein the sending a resource configuration instruction to the cloud based on the configuration requirement comprises: 基于所述配置需求,确定所述订单消息对应的资源编排配置文件,其中,所述资源编排配置文件用于指示处理所述订单消息的组件;Based on the configuration requirements, determine a resource orchestration configuration file corresponding to the order message, where the resource orchestration configuration file is used to indicate a component that processes the order message; 调用所述资源编排配置文件中的组件,向所述云端发送资源配置指令。Invoking components in the resource orchestration configuration file, and sending resource configuration instructions to the cloud. 3.根据权利要求2所述的资源确定方法,其特征在于,所述资源编排配置文件中包括第一组件和第二组件;所述调用所述资源编排配置文件中的组件,向所述云端发送资源配置指令,包括:3. The resource determination method according to claim 2, characterized in that, the resource arrangement configuration file includes a first component and a second component; the calling of the components in the resource arrangement configuration file sends to the cloud Send resource configuration instructions, including: 调用所述第一组件,对所述订单消息进行校验;calling the first component to verify the order message; 在所述校验通过的情况下,调用所述第二组件,向所述云端发送资源配置指令。If the verification is passed, the second component is invoked to send a resource configuration instruction to the cloud. 4.根据权利要求1所述的资源确定方法,其特征在于,所述基于所述配置需求向云端发送资源配置指令之后,还包括:4. The resource determination method according to claim 1, characterized in that, after sending the resource configuration instruction to the cloud based on the configuration requirement, further comprising: 获取所述云端返回的资源标识;Obtain the resource identifier returned by the cloud; 将所述资源标识与所述订单消息进行关联,在接收到消息中间件发送的云端消息时,通过所述资源标识从所述云端消息中确定所述订单消息对应的响应消息。Associating the resource identifier with the order message, and determining the response message corresponding to the order message from the cloud message through the resource identifier when receiving the cloud message sent by the messaging middleware. 5.根据权利要求1所述的资源确定方法,其特征在于,所述确定所述云计算资源的配置状态之后,还包括:5. The method for determining resources according to claim 1, further comprising: 显示所述云计算资源的所述配置状态;displaying the configuration status of the cloud computing resources; 再次接收到针对所述订单消息的响应消息时,更新显示的所述配置状态。When a response message to the order message is received again, the displayed configuration status is updated. 6.根据权利要求1所述的资源确定方法,其特征在于,所述订单消息中包括多个子订单;所述根据所述响应消息获取资源配置状态,包括:6. The resource determination method according to claim 1, wherein the order message includes a plurality of sub-orders; and obtaining the resource configuration status according to the response message comprises: 根据所述响应消息中的资源标识,确定所述响应消息对应的目标子订单,更新所述目标子订单的所述配置状态;Determine the target sub-order corresponding to the response message according to the resource identifier in the response message, and update the configuration status of the target sub-order; 在所述订单消息中所有的子订单的所述配置状态为第一状态的情况下,将每个所述子订单对应的资源进行绑定,获得所述订单消息对应的云计算资源。When the configuration status of all sub-orders in the order message is the first status, bind resources corresponding to each sub-order to obtain cloud computing resources corresponding to the order message. 7.一种资源确定装置,其特征在于,包括:7. A resource determination device, characterized in that it comprises: 消息获取模块,用于获取用户端的订单消息,所述订单消息中包括用户对云计算资源的配置需求;A message acquisition module, configured to acquire an order message from the client, where the order message includes the user's configuration requirements for cloud computing resources; 指令下发模块,用于基于所述配置需求向云端发送资源配置指令;An instruction issuing module, configured to send a resource configuration instruction to the cloud based on the configuration requirements; 状态确定模块,用于在接收到所述消息中间件发送的响应消息的情况下,基于所述响应消息,确定所述云计算资源的配置状态;A state determining module, configured to determine the configuration state of the cloud computing resource based on the response message when receiving the response message sent by the messaging middleware; 其中,所述响应消息是所述云端响应所述资源配置指令而发出的消息。Wherein, the response message is a message sent by the cloud in response to the resource configuration instruction. 8.一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现如权利要求1至6任一项所述的资源确定方法。8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and operable on the processor, wherein the processor according to claim 1 is implemented when executing the program. The resource determination method described in any one of to 6. 9.一种非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至6任一项所述的资源确定方法。9. A non-transitory computer-readable storage medium, on which a computer program is stored, wherein, when the computer program is executed by a processor, the resource determination method according to any one of claims 1 to 6 is implemented. 10.一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至6任一项所述的资源确定方法。10. A computer program product, comprising a computer program, characterized in that, when the computer program is executed by a processor, the resource determination method according to any one of claims 1 to 6 is implemented.
CN202211542980.9A 2022-12-02 2022-12-02 Resource determination method, device and electronic device Pending CN116248495A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211542980.9A CN116248495A (en) 2022-12-02 2022-12-02 Resource determination method, device and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211542980.9A CN116248495A (en) 2022-12-02 2022-12-02 Resource determination method, device and electronic device

Publications (1)

Publication Number Publication Date
CN116248495A true CN116248495A (en) 2023-06-09

Family

ID=86624897

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211542980.9A Pending CN116248495A (en) 2022-12-02 2022-12-02 Resource determination method, device and electronic device

Country Status (1)

Country Link
CN (1) CN116248495A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105184501A (en) * 2015-09-22 2015-12-23 浪潮集团有限公司 Efficient asynchronous order processing method
CN108304236A (en) * 2017-12-28 2018-07-20 天津麒麟信息技术有限公司 User interface method for refreshing based on message subscribing under a kind of cloud platform

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105184501A (en) * 2015-09-22 2015-12-23 浪潮集团有限公司 Efficient asynchronous order processing method
CN108304236A (en) * 2017-12-28 2018-07-20 天津麒麟信息技术有限公司 User interface method for refreshing based on message subscribing under a kind of cloud platform

Similar Documents

Publication Publication Date Title
CN109491801B (en) Micro-service access scheduling method, micro-service access scheduling device, medium and electronic equipment
CN112753019A (en) Efficient state maintenance of execution environments in on-demand code execution systems
CN108287708B (en) Data processing method and device, server and computer readable storage medium
CN107798108A (en) A kind of asynchronous task querying method and equipment
CN113946425A (en) Service processing method and device, electronic equipment and computer readable storage medium
US20210176333A1 (en) Controlling transaction requests between applications and servers
CN110019873B (en) Face data processing method, device and equipment
CN113626512A (en) Data processing method, device, equipment and readable storage medium
CN111475388A (en) Data push test method and device, computer equipment and storage medium
CN113541987A (en) A method and apparatus for updating configuration data
CN111538672A (en) Test case layered test method, computer device and computer-readable storage medium
CN112015534A (en) Configurated platform scheduling method, system and storage medium
CN106021566A (en) Method, device and system for improving concurrent processing capacity of single database
CN114564249A (en) Recommendation scheduling engine, recommendation scheduling method, and computer-readable storage medium
CN114006927A (en) Service message processing method and processing device thereof, electronic equipment and storage medium
CN113434469A (en) Asynchronous file importing method based on thread pool
CN109298956A (en) File transfer method, device and terminal device
CN109062929A (en) A kind of query task communication means and system
CN116248495A (en) Resource determination method, device and electronic device
CN114036180B (en) Report generation method, device, equipment and storage medium
CN116935395A (en) Text recognition method, device, electronic equipment and storage medium
CN112487218B (en) Content processing method, system, device, computing device and storage medium
CN115982160A (en) Data processing method, server, electronic device, and computer storage medium
CN115309491A (en) Logic algorithm of platform system
CN112035226A (en) Data transmission method, electronic device and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载